/[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 610 by jonathan, Fri Apr 4 13:56:59 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 109  class MapRenderer: Line 112  class MapRenderer:
112                  old_prop = prop                  old_prop = prop
113    
114                  if shapetype == SHAPETYPE_ARC:                  if shapetype == SHAPETYPE_ARC:
115                      fill = Color.None                      fill = Color.Transparent
116                  else:                  else:
117                      fill = prop.GetFill()                      fill = prop.GetFill()
118            
119                  if fill is Color.None:                  if fill is Color.Transparent:
120                      brush = wxTRANSPARENT_BRUSH                      brush = wxTRANSPARENT_BRUSH
121                  else:                  else:
122                      color = Color2wxColour(fill)                      color = Color2wxColour(fill)
# Line 121  class MapRenderer: Line 124  class MapRenderer:
124            
125                  stroke = prop.GetLineColor()                  stroke = prop.GetLineColor()
126                  stroke_width = prop.GetLineWidth()                  stroke_width = prop.GetLineWidth()
127                  if stroke is Color.None:                  if stroke is Color.Transparent:
128                      pen = wxTRANSPARENT_PEN                      pen = wxTRANSPARENT_PEN
129                  else:                  else:
130                      color = Color2wxColour(stroke)                      color = Color2wxColour(stroke)
# Line 178  class MapRenderer: Line 181  class MapRenderer:
181          self.dc.DrawLines(points)          self.dc.DrawLines(points)
182    
183      def draw_point_shape(self, layer, index):      def draw_point_shape(self, layer, index):
184          p = self.projected_points(layer, index)[0]          pp = self.projected_points(layer, index)
185    
186            if len(pp) == 0: return # ignore Null Shapes which have no points
187    
188            p = pp[0]
189          radius = self.resolution * 5          radius = self.resolution * 5
190          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)
191    

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26