/[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 362 by jonathan, Mon Jan 27 11:39:03 2003 UTC revision 394 by jonathan, Mon Feb 10 15:27:13 2003 UTC
# Line 13  from wxPython.wx import wxPoint, wxColou Line 13  from wxPython.wx import wxPoint, wxColou
13    
14  from wxproj import draw_polygon_shape  from wxproj import draw_polygon_shape
15    
16    from Thuban import _
17    
18  from Thuban.Model.layer import SHAPETYPE_POLYGON, SHAPETYPE_ARC, \  from Thuban.Model.layer import SHAPETYPE_POLYGON, SHAPETYPE_ARC, \
19       SHAPETYPE_POINT       SHAPETYPE_POINT
20  from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \  from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \
21       ALIGN_LEFT, ALIGN_RIGHT, ALIGN_BASELINE       ALIGN_LEFT, ALIGN_RIGHT, ALIGN_BASELINE
22    
23    from Thuban.Model.classification import Classification
24    
25    
26  class MapRenderer:  class MapRenderer:
27    
# Line 75  class MapRenderer: Line 79  class MapRenderer:
79          for i in self.layer_ids(layer):          for i in self.layer_ids(layer):
80              value = None              value = None
81              shape = layer.Shape(i)              shape = layer.Shape(i)
82              field = layer.classification.field              lc = layer.classification
83                field = lc.field
84    
85              if field is not None:              if field is not None:
86                  record = layer.table.read_record(i)                  record = layer.table.read_record(i)
# Line 87  class MapRenderer: Line 92  class MapRenderer:
92              # be null, at which point this call will              # be null, at which point this call will
93              # at least retreive the NullData              # at least retreive the NullData
94              #              #
95              prop = layer.classification.getProperties(value)              prop = lc.GetProperties(value)
96    
97              if prop != old_prop:              if prop != old_prop:
98                  old_prop = prop                  old_prop = prop
# Line 95  class MapRenderer: Line 100  class MapRenderer:
100                  if shapetype == SHAPETYPE_ARC:                  if shapetype == SHAPETYPE_ARC:
101                      fill = None                      fill = None
102                  else:                  else:
103                      fill = prop['fill']                      fill = prop.GetFill()
104            
105                  if fill is None:                  if fill is None:
106                      brush = wxTRANSPARENT_BRUSH                      brush = wxTRANSPARENT_BRUSH
# Line 105  class MapRenderer: Line 110  class MapRenderer:
110                                       fill.blue * 255)                                       fill.blue * 255)
111                      brush = wxBrush(color, wxSOLID)                      brush = wxBrush(color, wxSOLID)
112            
113                  stroke = prop['stroke']                  stroke = prop.GetStroke()
114                  stroke_width = prop['stroke_width']                  stroke_width = prop.GetStrokeWidth()
115                  if stroke is None:                  if stroke is None:
116                      pen = wxTRANSPARENT_PEN                      pen = wxTRANSPARENT_PEN
117                  else:                  else:
# Line 244  class ScreenRenderer(MapRenderer): Line 249  class ScreenRenderer(MapRenderer):
249                  if shapetype == SHAPETYPE_POINT:                  if shapetype == SHAPETYPE_POINT:
250                      self.draw_point_shape(layer, index)                      self.draw_point_shape(layer, index)
251                  else:                  else:
252                      raise TypeError("Unhandled shape type %s" % shapetype)                      raise TypeError(_("Unhandled shape type %s") % shapetype)
253    
254      def layer_ids(self, layer):      def layer_ids(self, layer):
255          """Return the shapeids covered by the region that has to be redrawn          """Return the shapeids covered by the region that has to be redrawn

Legend:
Removed from v.362  
changed lines
  Added in v.394

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26