/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/layer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/layer.py

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

revision 179 by bh, Wed May 15 14:02:49 2002 UTC revision 260 by bh, Thu Aug 15 17:43:59 2002 UTC
# Line 159  class Layer(BaseLayer): Line 159  class Layer(BaseLayer):
159              self.shapetree = shptree.SHPTree(self.shapefile.cobject(), 2,              self.shapetree = shptree.SHPTree(self.shapefile.cobject(), 2,
160                                               maxdepth)                                               maxdepth)
161    
162        def Destroy(self):
163            BaseLayer.Destroy(self)
164            if self.shapefile is not None:
165                self.shapefile.close()
166                self.shapefile = None
167                self.shapetree = None
168            self.table.Destroy()
169    
170      def BoundingBox(self):      def BoundingBox(self):
171          """Return the layer's bounding box in the intrinsic coordinate system.          """Return the layer's bounding box in the intrinsic coordinate system.
172    
# Line 239  class Layer(BaseLayer): Line 247  class Layer(BaseLayer):
247          """Set the layer's stroke width."""          """Set the layer's stroke width."""
248          self.stroke_width = width          self.stroke_width = width
249          self.changed(LAYER_LEGEND_CHANGED, self)          self.changed(LAYER_LEGEND_CHANGED, self)
250    
251        def TreeInfo(self):
252            items = []
253    
254            if self.Visible():
255                items.append("Shown")
256            else:
257                items.append("Hidden")
258            items.append("Shapes: %d" % self.NumShapes())
259    
260            bbox = self.LatLongBoundingBox()
261            if bbox is not None:
262                items.append("Extent (lat-lon): (%g, %g, %g, %g)" % bbox)
263            else:
264                items.append("Extent (lat-lon):")
265            items.append("Shapetype: %s" % shapetype_names[self.ShapeType()])
266    
267            def color_string(color):
268                if color is None:
269                    return "None"
270                return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue)
271            items.append("Fill: " + color_string(self.fill))
272            items.append("Outline: " + color_string(self.stroke))
273    
274            return ("Layer '%s'" % self.Title(), items)

Legend:
Removed from v.179  
changed lines
  Added in v.260

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26