bernhard: thuban/Extensions/svgexport __init__.py, 1.5, 1.6 svgmapwriter.py, 1.10, 1.11

cvs@intevation.de cvs at intevation.de
Sat Dec 11 04:24:38 CET 2004


Author: bernhard

Update of /thubanrepository/thuban/Extensions/svgexport
In directory doto:/tmp/cvs-serv30649/Extensions/svgexport

Modified Files:
	__init__.py svgmapwriter.py 
Log Message:
	 svgexport 0.9.2: Point size supports for maps.

	* Extensions/svgexport/svgmapwriter.py: Added import of SHAPETYPE_POINT
	(def draw_point_shape): new parameter size defaults to 2 as before.
	(draw_shape_layer_incrementally): Moved draw_func log line higher.
	Added draw_func call with size when dealing with a point layer.

	* Extensions/svgexport/__init__.py: bumped version to 0.9.2.


Index: __init__.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- __init__.py	7 Dec 2004 11:19:38 -0000	1.5
+++ __init__.py	11 Dec 2004 03:24:36 -0000	1.6
@@ -24,7 +24,7 @@
 
 ext_registry.add(ExtensionDesc(
     name = 'SVGexport',
-    version = '0.9.1',
+    version = '0.9.2',
     authors= [ 'Markus Rechtien', 'Bernhard Reiter' ],
     copyright = '2004 Intevation GmbH',
     desc = _("Export the current map and legend in Thuban-map-SVG format.")))

Index: svgmapwriter.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- svgmapwriter.py	11 Dec 2004 02:25:36 -0000	1.10
+++ svgmapwriter.py	11 Dec 2004 03:24:36 -0000	1.11
@@ -35,6 +35,7 @@
 import binascii 
 
 from Thuban import _
+from Thuban.Model.data import SHAPETYPE_POINT
 # VirtualDC extends XMLWriter
 from Thuban.Model.xmlwriter import XMLWriter, escape
 # Color related classes from the model of thuban
@@ -225,7 +226,7 @@
         for parts in points:
             self.dc.DrawPolygon(parts,closed=1)
     
-    def draw_point_shape(self, layer, points, pen, brush):
+    def draw_point_shape(self, layer, points, pen, brush, size=2):
         """Draw a point shape from layer with the given brush and pen
 
         The shape is given by points argument which is a the return
@@ -239,7 +240,7 @@
         if not points:
             return
         
-        radius = self.factor * 2.0
+        radius = self.factor * size
         self.dc.SetBrush(brush)
         self.dc.SetPen(pen)
         for part in points:
@@ -273,6 +274,8 @@
         # Determine which render function to use.
         useraw, draw_func, draw_func_param = \
                 self.low_level_renderer(layer)
+        if verbose > 0 : log("Using draw_func %s\n"%(repr(draw_func)))
+
         tool_cache = {}
         
         new_baseid=dc.SetBaseID(layer.title)
@@ -316,8 +319,12 @@
                 data = shape.RawData()
             else:
                 data = shape.Points()
-            if verbose > 0 : log("Using draw_func %s\n"%(repr(draw_func)))
-            draw_func(draw_func_param, data, pen, brush)
+
+            if shapeType==SHAPETYPE_POINT:
+                 draw_func(draw_func_param, data, pen, brush,
+                           size = group.GetProperties().GetSize())
+            else:
+                 draw_func(draw_func_param, data, pen, brush)
             # compatibility
             if 0:
                 yield True





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)