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

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

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

revision 2224 by bh, Fri May 28 17:29:30 2004 UTC revision 2413 by bernhard, Mon Nov 22 11:16:35 2004 UTC
# Line 198  class BaseRenderer: Line 198  class BaseRenderer:
198              # if honor_visibility is true, only draw visible layers,              # if honor_visibility is true, only draw visible layers,
199              # otherwise draw all layers              # otherwise draw all layers
200              if not self.honor_visibility or layer.Visible():              if not self.honor_visibility or layer.Visible():
201                  if isinstance(layer, Layer) and seenRaster:                  if isinstance(layer, Layer):
202                      for i in self.draw_shape_layer_incrementally(layer):                      if seenRaster:
203                          yield True                          for i in self.draw_shape_layer_incrementally(layer):
204                                yield True
205                  elif isinstance(layer, RasterLayer) \                  elif isinstance(layer, RasterLayer) \
206                      and Thuban.Model.resource.has_gdal_support():                      and Thuban.Model.resource.has_gdal_support():
207                      self.draw_raster_layer(layer)                      self.draw_raster_layer(layer)
# Line 288  class BaseRenderer: Line 289  class BaseRenderer:
289                  data = shape.RawData()                  data = shape.RawData()
290              else:              else:
291                  data = shape.Points()                  data = shape.Points()
292              draw_func(draw_func_param, data, pen, brush)              if draw_func == self.draw_point_shape:
293                     draw_func(draw_func_param, data, pen, brush,
294                               size = group.GetProperties().GetSize())
295                else:
296                     draw_func(draw_func_param, data, pen, brush)
297              if count % 500 == 0:              if count % 500 == 0:
298                  yield True                  yield True
299    
# Line 383  class BaseRenderer: Line 388  class BaseRenderer:
388          value of the shape's Points() method. The coordinates in the          value of the shape's Points() method. The coordinates in the
389          DC's coordinate system are determined with          DC's coordinate system are determined with
390          self.projected_points.          self.projected_points.
391    
392            For a description of the algorithm look in wxproj.cpp.
393          """          """
394          points = self.projected_points(layer, points)          points = self.projected_points(layer, points)
395    
# Line 391  class BaseRenderer: Line 398  class BaseRenderer:
398              for part in points:              for part in points:
399                  polygon.extend(part)                  polygon.extend(part)
400    
401                # missing back vertices for correct filling.
402              insert_index = len(polygon)              insert_index = len(polygon)
403              for part in points[:-1]:              for part in points[:-1]:
404                  polygon.insert(insert_index, part[0])                  polygon.insert(insert_index, part[0])
# Line 420  class BaseRenderer: Line 428  class BaseRenderer:
428          for part in points:          for part in points:
429              self.dc.DrawLines(part)              self.dc.DrawLines(part)
430    
431      def draw_point_shape(self, layer, points, pen, brush):      def draw_point_shape(self, layer, points, pen, brush, size = 5):
432          """Draw a point shape from layer with the given brush and pen          """Draw a point shape from layer with the given brush and pen
433    
434          The shape is given by points argument which is a the return          The shape is given by points argument which is a the return
# Line 434  class BaseRenderer: Line 442  class BaseRenderer:
442          if not points:          if not points:
443              return              return
444    
445          radius = int(round(self.resolution * 5))          radius = int(round(self.resolution * size))
446          self.dc.SetBrush(brush)          self.dc.SetBrush(brush)
447          self.dc.SetPen(pen)          self.dc.SetPen(pen)
448          for part in points:          for part in points:

Legend:
Removed from v.2224  
changed lines
  Added in v.2413

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26