/[thuban]/trunk/thuban/Thuban/Model/layer.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/Model/layer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 258 by bh, Thu Aug 15 12:48:03 2002 UTC revision 276 by bh, Fri Aug 23 15:25:07 2002 UTC
# Line 7  Line 7 
7    
8  __version__ = "$Revision$"  __version__ = "$Revision$"
9    
10    import os
11  from math import log, ceil  from math import log, ceil
12    
13  import shapelib, shptree  import shapelib, shptree
# Line 83  class BaseLayer(TitledObject, Modifiable Line 84  class BaseLayer(TitledObject, Modifiable
84          """Set the layer's visibility."""          """Set the layer's visibility."""
85          self.visible = visible          self.visible = visible
86          self.issue(LAYER_VISIBILITY_CHANGED, self)          self.issue(LAYER_VISIBILITY_CHANGED, self)
87            
88            
89  class Layer(BaseLayer):  class Layer(BaseLayer):
90    
91      """Represent the information of one geodata file (currently a shapefile)      """Represent the information of one geodata file (currently a shapefile)
# Line 119  class Layer(BaseLayer): Line 120  class Layer(BaseLayer):
120          colors are expected to be instances of Color class          colors are expected to be instances of Color class
121          """          """
122          BaseLayer.__init__(self, title, visible = visible)          BaseLayer.__init__(self, title, visible = visible)
123          self.filename = filename  
124            # Make the filename absolute. The filename will be
125            # interpreted relative to that anyway, but when saving a
126            # session we need to compare absolute paths and it's usually
127            # safer to always work with absolute paths.
128            self.filename = os.path.abspath(filename)
129    
130          self.projection = projection          self.projection = projection
131          self.fill = fill          self.fill = fill
132          self.stroke = stroke          self.stroke = stroke
# Line 160  class Layer(BaseLayer): Line 167  class Layer(BaseLayer):
167                                               maxdepth)                                               maxdepth)
168    
169      def Destroy(self):      def Destroy(self):
170          BaseLayer.Destroy()          BaseLayer.Destroy(self)
171          if self.shapefile is not None:          if self.shapefile is not None:
172              self.shapefile.close()              self.shapefile.close()
173              self.shapefile = None              self.shapefile = None

Legend:
Removed from v.258  
changed lines
  Added in v.276

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26