/[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 535 by bh, Fri Mar 14 20:42:18 2003 UTC revision 642 by jonathan, Thu Apr 10 14:41:50 2003 UTC
# Line 48  class MapRenderer: Line 48  class MapRenderer:
48                  the renderer's default.                  the renderer's default.
49          """          """
50          # resolution in pixel/inch          # resolution in pixel/inch
51    
52            assert scale > 0
53    
54          self.dc = dc          self.dc = dc
55          self.scale = scale          self.scale = scale
56          self.offset = offset          self.offset = offset
# Line 82  class MapRenderer: Line 85  class MapRenderer:
85          lc = layer.GetClassification()          lc = layer.GetClassification()
86          field = lc.GetField()          field = lc.GetField()
87    
         defaultProps = lc.GetDefaultGroup().GetProperties()  
   
88          for i in self.layer_ids(layer):          for i in self.layer_ids(layer):
89              value = None              value = None
90    
# Line 100  class MapRenderer: Line 101  class MapRenderer:
101                  # be null, at which point this call will                  # be null, at which point this call will
102                  # at least retreive the NullData                  # at least retreive the NullData
103                  #                  #
104                  prop = lc.GetProperties(value)  
105                    group = lc.FindGroup(value)
106    
107                    #prop = lc.GetProperties(value)
108              else:              else:
109                  prop = defaultProps                  group = lc.GetDefaultGroup()
110    
111                prop = group.GetProperties()
112    
113                if not group.IsVisible():
114                    continue
115    
116              # don't recreate new objects if they are the same as before              # don't recreate new objects if they are the same as before
117              if prop != old_prop:              if prop != old_prop:
118                  old_prop = prop                  old_prop = prop
119    
120                  if shapetype == SHAPETYPE_ARC:                  if shapetype == SHAPETYPE_ARC:
121                      fill = Color.None                      fill = Color.Transparent
122                  else:                  else:
123                      fill = prop.GetFill()                      fill = prop.GetFill()
124            
125                  if fill is Color.None:                  if fill is Color.Transparent:
126                      brush = wxTRANSPARENT_BRUSH                      brush = wxTRANSPARENT_BRUSH
127                  else:                  else:
128                      color = Color2wxColour(fill)                      color = Color2wxColour(fill)
# Line 121  class MapRenderer: Line 130  class MapRenderer:
130            
131                  stroke = prop.GetLineColor()                  stroke = prop.GetLineColor()
132                  stroke_width = prop.GetLineWidth()                  stroke_width = prop.GetLineWidth()
133                  if stroke is Color.None:                  if stroke is Color.Transparent:
134                      pen = wxTRANSPARENT_PEN                      pen = wxTRANSPARENT_PEN
135                  else:                  else:
136                      color = Color2wxColour(stroke)                      color = Color2wxColour(stroke)
# Line 178  class MapRenderer: Line 187  class MapRenderer:
187          self.dc.DrawLines(points)          self.dc.DrawLines(points)
188    
189      def draw_point_shape(self, layer, index):      def draw_point_shape(self, layer, index):
190          p = self.projected_points(layer, index)[0]          pp = self.projected_points(layer, index)
191    
192            if len(pp) == 0: return # ignore Null Shapes which have no points
193    
194            p = pp[0]
195          radius = self.resolution * 5          radius = self.resolution * 5
196          self.dc.DrawEllipse(p.x - radius, p.y - radius, 2*radius, 2*radius)          self.dc.DrawEllipse(p.x - radius, p.y - radius, 2*radius, 2*radius)
197    

Legend:
Removed from v.535  
changed lines
  Added in v.642

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26