1 |
# Copyright (c) 2001, 2002, 2003 by Intevation GmbH |
# Copyright (c) 2001-2004 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> (2001-2003) |
4 |
# Jonathan Coles <[email protected]> |
# Jonathan Coles <[email protected]> (2003) |
5 |
# Frank Koormann <[email protected]> |
# Frank Koormann <[email protected]> (2003) |
6 |
|
# Jan-Oliver Wagner <[email protected]> (2003, 2004) |
7 |
# |
# |
8 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
9 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
130 |
return self.render_map_incrementally() |
return self.render_map_incrementally() |
131 |
|
|
132 |
def draw_selection_incrementally(self, layer, selected_shapes): |
def draw_selection_incrementally(self, layer, selected_shapes): |
133 |
|
"""Draw the selected shapes in a emphasized way (i.e. |
134 |
|
with a special pen and brush. |
135 |
|
The drawing is performed incrementally, that means every |
136 |
|
n shapes, the user can have interactions with the map. |
137 |
|
n is currently fixed to 500. |
138 |
|
|
139 |
|
layer -- the layer where the shapes belong to. |
140 |
|
selected_shapes -- a list of the shape-ids representing the |
141 |
|
selected shapes for the given layer. |
142 |
|
""" |
143 |
pen = wxPen(wxBLACK, 3, wxSOLID) |
pen = wxPen(wxBLACK, 3, wxSOLID) |
144 |
brush = wxBrush(wxBLACK, wxCROSS_HATCH) |
brush = wxBrush(wxBLACK, wxCROSS_HATCH) |
145 |
|
|
146 |
shapetype = layer.ShapeType() |
shapetype = layer.ShapeType() |
147 |
useraw, func, param = self.low_level_renderer(layer) |
useraw, func, param = self.low_level_renderer(layer) |
148 |
args = (pen, brush) |
args = (pen, brush) |
149 |
|
|
150 |
|
# for point shapes we need to find out the properties |
151 |
|
# to determine the size. Based on table and field, |
152 |
|
# we can find out the properties for object - see below. |
153 |
|
if shapetype == SHAPETYPE_POINT: |
154 |
|
lc = layer.GetClassification() |
155 |
|
field = layer.GetClassificationColumn() |
156 |
|
table = layer.ShapeStore().Table() |
157 |
|
|
158 |
count = 0 |
count = 0 |
159 |
for index in selected_shapes: |
for index in selected_shapes: |
160 |
count += 1 |
count += 1 |
161 |
shape = layer.Shape(index) |
shape = layer.Shape(index) |
162 |
|
|
163 |
|
# Get the size of the specific property for this |
164 |
|
# point |
165 |
|
if shapetype == SHAPETYPE_POINT: |
166 |
|
value = table.ReadValue(shape.ShapeID(), field) |
167 |
|
group = lc.FindGroup(value) |
168 |
|
size = group.GetProperties().GetSize() |
169 |
|
args = (pen, brush, size) |
170 |
|
|
171 |
if useraw: |
if useraw: |
172 |
data = shape.RawData() |
data = shape.RawData() |
173 |
else: |
else: |