/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/renderer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/renderer.py

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

revision 1552 by bh, Wed Aug 6 17:21:32 2003 UTC revision 1562 by bh, Thu Aug 7 17:53:37 2003 UTC
# Line 24  from Thuban.UI.common import Color2wxCol Line 24  from Thuban.UI.common import Color2wxCol
24  from Thuban.UI.classifier import ClassDataPreviewer  from Thuban.UI.classifier import ClassDataPreviewer
25  from Thuban.UI.scalebar import ScaleBar  from Thuban.UI.scalebar import ScaleBar
26    
27  from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, SHAPETYPE_POINT  from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, \
28         SHAPETYPE_POINT, RAW_SHAPEFILE
29    
30  from Thuban.Model.color import Transparent  from Thuban.Model.color import Transparent
31  import Thuban.Model.resource  import Thuban.Model.resource
# Line 57  class MapRenderer(BaseRenderer): Line 58  class MapRenderer(BaseRenderer):
58      def low_level_renderer(self, layer):      def low_level_renderer(self, layer):
59          """Override inherited method to provide more efficient renderers          """Override inherited method to provide more efficient renderers
60    
61          For point shapes, return self.draw_point_shape and layer just as          If the underlying data format is not a shapefile or the layer
62          the base class method. For arc and polygon use the more          contains points shapes, simply use what the inherited method
63          efficient wxproj.draw_polygon_shape and its corresponding          returns.
64          parameter created with wxproj.draw_polygon_init.  
65            Otherwise, i.e. for arc and polygon use the more efficient
66            wxproj.draw_polygon_shape and its corresponding parameter
67            created with wxproj.draw_polygon_init.
68          """          """
69          shapetype = layer.ShapeType()          if (layer.ShapeStore().RawShapeFormat() == RAW_SHAPEFILE
70          if shapetype == SHAPETYPE_POINT:              and layer.ShapeType() in (SHAPETYPE_ARC, SHAPETYPE_POLYGON)):
             func = self.draw_point_shape  
             param = layer  
         else:  
71              offx, offy = self.offset              offx, offy = self.offset
72              param = draw_polygon_init(layer.ShapeStore().Shapefile(), self.dc,              return (draw_polygon_shape,
73                                        self.map.projection,                      draw_polygon_init(layer.ShapeStore().Shapefile(),
74                                          self.dc, self.map.projection,
75                                        layer.projection,                                        layer.projection,
76                                        self.scale, -self.scale,                                        self.scale, -self.scale, offx, offy))
77                                        offx, offy)          else:
78              func = draw_polygon_shape              return BaseRenderer.low_level_renderer(self, layer)
         return func, param  
79    
80      def label_font(self):      def label_font(self):
81          return wxFont(self.resolution * 10, wxSWISS, wxNORMAL, wxNORMAL)          return wxFont(self.resolution * 10, wxSWISS, wxNORMAL, wxNORMAL)

Legend:
Removed from v.1552  
changed lines
  Added in v.1562

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26