bernhard: thuban/Extensions/svgexport __init__.py, 1.4, 1.5 svgmapwriter.py, 1.7, 1.8

cvs@intevation.de cvs at intevation.de
Tue Dec 7 12:19:40 CET 2004


Author: bernhard

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

Modified Files:
	__init__.py svgmapwriter.py 
Log Message:
svgexport 0.9.1, implemented DrawSpline:
	* Extensions/svgexport/test/test_svgmapwriter.py:
	Added test_drawbezier() to test DrawSpline().

	* Extensions/svgexport/svgmapwriter.py(DrawSpline):
	Really implemented bezier drawing.

	* Extensions/svgexport/__init__.py: Bumped version of svgexport
	to 0.9.1 because now the legend examples lines styles 
	will be drawing with beziers.


Index: __init__.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- __init__.py	27 Nov 2004 20:22:38 -0000	1.4
+++ __init__.py	7 Dec 2004 11:19:38 -0000	1.5
@@ -24,7 +24,7 @@
 
 ext_registry.add(ExtensionDesc(
     name = 'SVGexport',
-    version = '0.9.0',
+    version = '0.9.1',
     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.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- svgmapwriter.py	22 Nov 2004 11:17:47 -0000	1.7
+++ svgmapwriter.py	7 Dec 2004 11:19:38 -0000	1.8
@@ -699,19 +699,24 @@
         # Put everything together and write it to the file
         self.file.write('%s %s d="%s"/>\n' % (self.make_id(), 
             self.make_meta(), join(data, '') ) )
-    
+
     def DrawSpline(self, points, closed=0):
         """Draw a spline object.
         """
-        self.DrawPolygon(points, 0)
-        print "TODO: DrawSpline(..)"
-        return # TODO: Implement
+        self.write_indent('<path %s ' % (self.make_style(1,1,0)))
+        datastr = ""
+        # we have four points: start, control, control, end
+        datastr+=('M %s %s C' % (points[0].x, points[0].y))
+        for i in (1,2,3):
+            datastr+=(' %s %s' %  (points[i].x,points[i].y))
+        self.file.write('%s %s d="%s"/>\n' % (self.make_id(), 
+            self.make_meta(), datastr ) )
 
     def BeginClipPath(self, id):
         """Build a clipping region to draw in."""
         self.write_indent('<clipPath id="%s">\n' % id)
         self.indent_level += 1
-    
+
     def EndClipPath(self):
         """End a clip path."""
         self.indent_level -= 1





More information about the Thuban-devel mailing list

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