119 |
old_prop = None |
old_prop = None |
120 |
old_group = None |
old_group = None |
121 |
lc = layer.GetClassification() |
lc = layer.GetClassification() |
122 |
field = lc.GetField() |
field = layer.GetClassificationColumn() |
123 |
defaultGroup = lc.GetDefaultGroup() |
defaultGroup = lc.GetDefaultGroup() |
124 |
|
|
125 |
|
|
|
if shapetype != SHAPETYPE_POINT: |
|
|
polygon_render_param = self.polygon_render_param(layer) |
|
|
|
|
126 |
if shapetype == SHAPETYPE_POINT: |
if shapetype == SHAPETYPE_POINT: |
127 |
draw_func = lambda i: \ |
draw_func = self.draw_point_shape |
128 |
self.draw_point_shape(layer, i) |
draw_func_param = layer |
129 |
else: |
else: |
130 |
draw_func = lambda i: \ |
draw_func = draw_polygon_shape |
131 |
self.draw_polygon_shape(polygon_render_param, i, pen, brush) |
draw_func_param = self.polygon_render_param(layer) |
132 |
|
|
133 |
table = layer.ShapeStore().Table() |
table = layer.ShapeStore().Table() |
134 |
for i in self.layer_ids(layer): |
for i in self.layer_ids(layer): |
174 |
color = Color2wxColour(stroke) |
color = Color2wxColour(stroke) |
175 |
pen = wxPen(color, stroke_width, wxSOLID) |
pen = wxPen(color, stroke_width, wxSOLID) |
176 |
|
|
177 |
if shapetype == SHAPETYPE_POINT: |
draw_func(draw_func_param, i, pen, brush) |
|
self.dc.SetBrush(brush) |
|
|
self.dc.SetPen(pen) |
|
|
|
|
|
draw_func(i) |
|
178 |
|
|
179 |
def draw_raster_layer(self, layer): |
def draw_raster_layer(self, layer): |
180 |
data = None |
data = None |
266 |
points = self.projected_points(layer, index) |
points = self.projected_points(layer, index) |
267 |
self.dc.DrawLines(points) |
self.dc.DrawLines(points) |
268 |
|
|
269 |
def draw_point_shape(self, layer, index): |
def draw_point_shape(self, layer, index, pen, brush): |
270 |
pp = self.projected_points(layer, index) |
pp = self.projected_points(layer, index) |
271 |
|
|
272 |
if len(pp) == 0: return # ignore Null Shapes which have no points |
if len(pp) == 0: return # ignore Null Shapes which have no points |
273 |
|
|
274 |
p = pp[0] |
p = pp[0] |
275 |
radius = self.resolution * 5 |
radius = self.resolution * 5 |
276 |
|
self.dc.SetBrush(brush) |
277 |
|
self.dc.SetPen(pen) |
278 |
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) |
279 |
|
|
280 |
def draw_label_layer(self, layer): |
def draw_label_layer(self, layer): |