75 |
self.map = map |
self.map = map |
76 |
seenRaster = True |
seenRaster = True |
77 |
|
|
78 |
if self.scale == 0: |
self.dc.BeginDrawing() |
|
return |
|
79 |
|
|
80 |
# |
# |
81 |
# This is only a good optimization if there is only one |
# This is only a good optimization if there is only one |
103 |
|
|
104 |
self.draw_label_layer(map.LabelLayer()) |
self.draw_label_layer(map.LabelLayer()) |
105 |
|
|
106 |
|
self.dc.EndDrawing() |
107 |
|
|
108 |
def draw_shape_layer(self, layer): |
def draw_shape_layer(self, layer): |
109 |
scale = self.scale |
scale = self.scale |
110 |
offx, offy = self.offset |
offx, offy = self.offset |
124 |
defaultGroup = lc.GetDefaultGroup() |
defaultGroup = lc.GetDefaultGroup() |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
if shapetype == SHAPETYPE_POINT: |
if shapetype == SHAPETYPE_POINT: |
129 |
draw_func = self.draw_point_shape |
draw_func = self.draw_point_shape |
130 |
draw_func_param = layer |
draw_func_param = layer |
216 |
stream = cStringIO.StringIO(data) |
stream = cStringIO.StringIO(data) |
217 |
image = wxImageFromStream(stream, wxBITMAP_TYPE_BMP) |
image = wxImageFromStream(stream, wxBITMAP_TYPE_BMP) |
218 |
bitmap = wxBitmapFromImage(image) |
bitmap = wxBitmapFromImage(image) |
|
self.dc.BeginDrawing() |
|
219 |
self.dc.DrawBitmap(bitmap, 0, 0) |
self.dc.DrawBitmap(bitmap, 0, 0) |
|
self.dc.EndDrawing() |
|
220 |
|
|
221 |
def layer_ids(self, layer): |
def layer_ids(self, layer): |
222 |
"""Return the shape ids of the given layer that have to be drawn. |
"""Return the shape ids of the given layer that have to be drawn. |
355 |
self.dc.SetBrush(brush) |
self.dc.SetBrush(brush) |
356 |
self.dc.SetPen(pen) |
self.dc.SetPen(pen) |
357 |
func = self.draw_point_shape |
func = self.draw_point_shape |
358 |
args = () |
args = (pen, brush) |
359 |
else: |
else: |
360 |
raise TypeError(_("Unhandled shape type %s") % shapetype) |
raise TypeError(_("Unhandled shape type %s") % shapetype) |
361 |
|
|
362 |
for index in self.selected_shapes: |
for index in self.selected_shapes: |
363 |
func(renderparam, index, *args) |
func(renderparam, index, *args) |
364 |
|
|
|
|
|
365 |
def layer_ids(self, layer): |
def layer_ids(self, layer): |
366 |
"""Return the shapeids covered by the region that has to be redrawn |
"""Return the shapeids covered by the region that has to be redrawn |
367 |
|
|