jan: thuban/Thuban/UI renderer.py,1.49,1.50
cvs@intevation.de
cvs at intevation.de
Wed Nov 17 23:02:31 CET 2004
Author: jan
Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv9105
Modified Files:
renderer.py
Log Message:
(ScreenRenderer.draw_selection_incrementally):
Added consideration of the specific size of point symbols.
The property for each point symbol is retrieved and the size applied
for the rendering method.
Added doc-string.
Index: renderer.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- renderer.py 11 Nov 2003 18:16:42 -0000 1.49
+++ renderer.py 17 Nov 2004 22:02:29 -0000 1.50
@@ -1,8 +1,9 @@
-# Copyright (c) 2001, 2002, 2003 by Intevation GmbH
+# Copyright (c) 2001-2004 by Intevation GmbH
# Authors:
-# Bernhard Herzog <bh at intevation.de>
-# Jonathan Coles <jonathan at intevation.de>
-# Frank Koormann <frank.koormann at intevation.de>
+# Bernhard Herzog <bh at intevation.de> (2001-2003)
+# Jonathan Coles <jonathan at intevation.de> (2003)
+# Frank Koormann <frank.koormann at intevation.de> (2003)
+# Jan-Oliver Wagner <jan at intevation.de> (2003, 2004)
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with Thuban for details.
@@ -129,16 +130,44 @@
return self.render_map_incrementally()
def draw_selection_incrementally(self, layer, selected_shapes):
+ """Draw the selected shapes in a emphasized way (i.e.
+ with a special pen and brush.
+ The drawing is performed incrementally, that means every
+ n shapes, the user can have interactions with the map.
+ n is currently fixed to 500.
+
+ layer -- the layer where the shapes belong to.
+ selected_shapes -- a list of the shape-ids representing the
+ selected shapes for the given layer.
+ """
pen = wxPen(wxBLACK, 3, wxSOLID)
brush = wxBrush(wxBLACK, wxCROSS_HATCH)
shapetype = layer.ShapeType()
useraw, func, param = self.low_level_renderer(layer)
args = (pen, brush)
+
+ # for point shapes we need to find out the properties
+ # to determine the size. Based on table and field,
+ # we can find out the properties for object - see below.
+ if shapetype == SHAPETYPE_POINT:
+ lc = layer.GetClassification()
+ field = layer.GetClassificationColumn()
+ table = layer.ShapeStore().Table()
+
count = 0
for index in selected_shapes:
count += 1
shape = layer.Shape(index)
+
+ # Get the size of the specific property for this
+ # point
+ if shapetype == SHAPETYPE_POINT:
+ value = table.ReadValue(shape.ShapeID(), field)
+ group = lc.FindGroup(value)
+ size = group.GetProperties().GetSize()
+ args = (pen, brush, size)
+
if useraw:
data = shape.RawData()
else:
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)