Issues with zooming using ActionPreCallback ActionPostCallback

2 visualizaciones (últimos 30 días)
Octavian
Octavian el 29 de En. de 2015
Dear All,
Zooming and rotating 3D a large object (cortex hull) by mouse click leads to a very and slow and choppy object movements in a multiobject figure, despite updated OpenGL drivers and a good 2GB Nvdia card. I tried several things, including trying to switch object visibility to off just during the respective operations. Here is the relevant code snippet:
function demome
Handle=tripatch(cortex,gcf,[.7 .7 .7]);
set(gcf,'Renderer','OpenGL');
zoomHandle = zoom;
set(zoomHandle,'ActionPreCallback',@zoomStarted)
set(zoomHandle,'ActionPostCallback',@zoomEnded)
zoomHandle.Enable='on';
function zoomStarted(Handle,b)
disp('A zoom is about to occur.');
set(Handle,'visible','off');
function zoomEnded(Handle,b)
disp('Zoom ended.');
set(Handle,'visible','on');
hold on % for other objects in the figure
I do not get an error, but the figure disappears, and with subsequent demome calls, no figure is displayed. I have to close matlab and restart it to be able to display (briefly) the cortex. I tried the demo in the zoom help to be clear about the obj, evd inputs; here is the demo code and error.
function demo
% Listen to zoom events
plot(1:10);
h = zoom;
h.ActionPreCallback = @myprecallback;
h.ActionPostCallback = @mypostcallback;
h.Enable = 'on';
%
function myprecallback(obj,evd)
disp('A zoom is about to occur.');
%
function mypostcallback(obj,evd)
newLim = evd.Axes.XLim;
msgbox(sprintf('The new X-Limits are [%.2f %.2f].',newLim));
and error:
demo
A zoom is about to occur.
Warning: An error occurred during the mode callback.
> In uitools.uimode.fireActionPostCallback at 14
In C:\Program Files\MATLAB\R2013b\toolbox\matlab\graph2d\zoom.p>local2DButtonUpFcn at 1358
In hgfeval at 63
In uitools.uimode.modeWindowButtonUpFcn at 53
In uitools.uimode.setCallbackFcn>localModeWindowButtonUpFcn at 54
I am lost. I use Matlab 2013b. Thank you for assist, Octavian.

Respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by