Revision: 3892
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3892&view=rev
Author:   mdboom
Date:     2007-09-25 12:53:56 -0700 (Tue, 25 Sep 2007)

Log Message:
-----------
Important bugfixes.

Modified Paths:
--------------
    branches/transforms/lib/matplotlib/lines.py
    branches/transforms/lib/matplotlib/path.py
    branches/transforms/lib/matplotlib/transforms.py

Modified: branches/transforms/lib/matplotlib/lines.py
===================================================================
--- branches/transforms/lib/matplotlib/lines.py 2007-09-25 19:08:51 UTC (rev 
3891)
+++ branches/transforms/lib/matplotlib/lines.py 2007-09-25 19:53:56 UTC (rev 
3892)
@@ -499,7 +499,7 @@
         lineFunc(renderer, gc, *self._transformed_path.get_path_and_affine())
            
        # MGDTODO: Deal with markers
-        if self._marker is not None and False:
+        if self._marker is not None:
             gc = renderer.new_gc()
             self._set_gc_clip(gc)
             gc.set_foreground(self.get_markeredgecolor())
@@ -507,7 +507,7 @@
             gc.set_alpha(self._alpha)
             funcname = self._markers.get(self._marker, '_draw_nothing')
             markerFunc = getattr(self, funcname)
-            markerFunc(renderer, gc, self._path)
+            markerFunc(renderer, gc, 
*self._transformed_path.get_path_and_affine())
 
         #renderer.close_group('line2d')
 

Modified: branches/transforms/lib/matplotlib/path.py
===================================================================
--- branches/transforms/lib/matplotlib/path.py  2007-09-25 19:08:51 UTC (rev 
3891)
+++ branches/transforms/lib/matplotlib/path.py  2007-09-25 19:53:56 UTC (rev 
3892)
@@ -65,7 +65,10 @@
 
     def __repr__(self):
        return "Path(%s, %s)" % (self.vertices, self.codes)
-           
+
+    def __len__(self):
+        return len(self._vertices)
+    
     def _get_codes(self):
        return self._codes
     codes = property(_get_codes)
@@ -108,7 +111,7 @@
            # This initial rotation is to make sure the polygon always
             # "points-up"
            theta += npy.pi / 2.0
-           verts = npy.concatenate((npy.cos(theta), npy.sin(theta)))
+           verts = npy.concatenate((npy.cos(theta), npy.sin(theta)), 1)
            path = Path(verts)
            cls._unit_regular_polygons[numVertices] = path
        return path

Modified: branches/transforms/lib/matplotlib/transforms.py
===================================================================
--- branches/transforms/lib/matplotlib/transforms.py    2007-09-25 19:08:51 UTC 
(rev 3891)
+++ branches/transforms/lib/matplotlib/transforms.py    2007-09-25 19:53:56 UTC 
(rev 3892)
@@ -24,7 +24,10 @@
     _gid = 0
     
     def __init__(self):
-        self._parents = WeakKeyDictionary()
+        # MGDTODO: I'd like to use a WeakKeyDictionary here, but it makes
+        # these instances uncopyable.  As it stands, _parents grows
+        # unboundedly...  Not a good idea.
+        self._parents = Set()
         self._children = Set()
         self._id = TransformNode._gid
         
@@ -34,7 +37,7 @@
         if not self._do_invalidation(affine_only):
             self._id = TransformNode._gid
             TransformNode._gid += 1
-            for parent in self._parents.iterkeys():
+            for parent in self._parents:
                 parent.invalidate(affine_only)
 
     def _do_invalidation(self, affine_only):
@@ -42,7 +45,7 @@
         
     def set_children(self, children):
         for child in children:
-            getattr(self, child)._parents[self] = None
+            getattr(self, child)._parents.add(self)
         self._children = children
 
     def make_graphviz(self, fobj):
@@ -1034,8 +1037,8 @@
 
     
 def composite_transform_factory(a, b):
-    if isinstance(a, BboxTransform) and isinstance(b, BboxTransform):
-        return BboxTransform(a._boxin, b._boxout)
+#     if isinstance(a, BboxTransform) and isinstance(b, BboxTransform):
+#         return BboxTransform(a._boxin, b._boxout)
     if isinstance(a, AffineBase) and isinstance(b, AffineBase):
         return CompositeAffine2D(a, b)
     return CompositeGenericTransform(a, b)
@@ -1162,19 +1165,23 @@
         
         self._path = path
         self._transform = transform
+        self.set_children(['_transform'])
         self._transformed_path = None
-        self._last_id = transform.get_id()
+
+    def _do_invalidation(self, affine_only):
+        if not affine_only:
+            self._transformed_path = None
+        return True
         
     def get_path_and_affine(self):
-        if (self._transformed_path is None or
-            self._last_id != self._transform.get_id()):
+        if self._transformed_path is None:
             vertices = 
self._transform.transform_non_affine(self._path.vertices)
             self._transformed_path = Path(vertices, self._path.codes)
+
         return self._transformed_path, self._transform.get_affine()
 
     def get_path(self):
-        if (self._transformed_path is None or
-            self._last_id != self._transform.get_id()):
+        if self._transformed_path is None:
             vertices = self._tranform.transform_non_affine(self._path.vertices)
             self._transformed_path = Path(vertices, self._path.codes)
         vertices = 
self._transform.transform_affine(self._transformed_path.vertices)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to