changeset 17511:cd98a50bfa63

hidden.m: Fix hidden so that it also works for trimesh objects. * scripts/plot/trimesh.m: Set "Tag" property of patch object to "trimesh". * scripts/plot/hidden.m: Search for surface objects or objects with Tag "trimesh".
author Rik <rik@octave.org>
date Wed, 25 Sep 2013 16:00:09 -0700
parents 89ffc9c786e5
children db92cd6117a9
files scripts/plot/hidden.m scripts/plot/trimesh.m
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/hidden.m
+++ b/scripts/plot/hidden.m
@@ -52,7 +52,8 @@
 
   for h = (get (gca (), "children")).';
     htype = get (h, "type");
-    if (strcmp (htype, "surface"))
+    htag = get (h, "tag");
+    if (strcmp (htype, "surface") || strcmp (htag, "trimesh"))
       fc = get (h, "facecolor");
       if ((! ischar (fc) && is_white (fc))
           || (ischar (fc) && strcmp (fc, "none")))
--- a/scripts/plot/trimesh.m
+++ b/scripts/plot/trimesh.m
@@ -79,9 +79,10 @@
 
     hax = newplot ();
 
+    ## Tag object as "trimesh" so that hidden() can find it.
     htmp = patch ("Vertices", [x(:), y(:), z(:)], "Faces", tri,
                   "FaceVertexCdata", c, "EdgeColor", "flat", "FaceColor", "w",
-                  varargin{:});
+                  "Tag", "trimesh", varargin{:});
     if (! ishold ())
       set (hax, "view", [-37.5, 30], "box", "off",
                 "xgrid", "on", "ygrid", "on", "zgrid", "on");