[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mesh handles not working?
From: |
Daniel J Sebald |
Subject: |
mesh handles not working? |
Date: |
Tue, 06 Mar 2007 21:22:53 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 |
John,
I think that mesh() in CVS isn't working correctly in terms of the handles. It
appears the handle from __uiobject_get_handle__.m is returning a handle value
which is one too high so that every time mesh() is called the old surface
remains.
There may also be another problem inside __uiobject_draw_axes__.m with surfaces
but I can't get that far to isolate things.
Anyway, I think the problem is near lines 106 to 111, but these globals with
lock and unlock is too much for me to follow at the moment. Plus I probably
wouldn't come up with a good fix. The attached patch is simply to show where
the problem lies. Try the following code:
figure(1);
x = ones(3,1) * [0:2];
y = x';
z = x.*y;
mesh(x,y,z);
x = ones(21,1) * [0:20];
y = x';
z = x.*y;
mesh(x,y,z);
figure(2);
plot([0:30],-[0:30]);
plot([0:30],[0:30]);
Notice how the first lines add another number to the kids list. The second
doesn't.
Dan
--- /usr/local/share/octave/2.9.9+/m/plot/__uiobject_make_handle__.m
2007-03-04 16:14:49.000000000 -0600
+++ ./__uiobject_make_handle__.m 2007-03-06 21:02:26.861920328 -0600
@@ -105,7 +105,7 @@
if (nargin == 1)
idx = __uiobject_alloc__ ();
- h = __uiobject_get_handle__ ();
+ h = __uiobject_get_handle__ ()
__uiobject_list__(idx).handle = h;
__uiobject_list__(idx).object = s;
__request_drawnow__ ();
--- /usr/local/share/octave/2.9.9+/m/plot/__uiobject_adopt__.m 2007-03-04
16:14:47.000000000 -0600
+++ ./__uiobject_adopt__.m 2007-03-06 21:18:46.048061408 -0600
@@ -33,7 +33,7 @@
## Put this child at the end of the list. If it is already in
## the list, move it.
kids(kids == child) = [];
- kids = [kids, child];
+ kids = [kids, child]
set (parent, "children", kids);
else
error ("__uiobject_adopt__: expecting parent to be a handle");
- mesh handles not working?,
Daniel J Sebald <=