-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathptrPlotTools.m
47 lines (38 loc) · 1 KB
/
ptrPlotTools.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function ptrPlotTools (hObject, eventdata, action, varargin)
fcn = str2func(action);
releaseBtn(hObject);
fcn(hObject, varargin{:});
end
function enable(hObject, varargin)
hs = findobj(hObject,'Tag','Toolbar.ImageTool');
for i=1:numel(hs), set (hs(i), 'Visible', varargin{1}); end
end
function releaseBtn(hBtn)
hPn = get(hBtn, 'Parent');
hs = findobj(hPn,'State','on','Tag','Toolbar.ImageTool');
hs = setdiff(hs, hBtn);
for i=1:numel(hs)
set (hs(i), 'State','off');
end
end
function zoomIn(hObject)
h = zoom;
set(h,'Direction','in');
set(h,'Enable',get(hObject,'State'));
end
function zoomReset(hObject)
zoom out
set(zoom,'Enable','off');
pan ('off');
end
function zoomOut(hObject)
h = zoom;
set(h,'Direction','out');
set(h,'Enable',get(hObject,'State'));
end
function hand(hObject)
pan(get(hObject,'State'));
end
function rotate(hObject)
rotate3d(get(hObject,'State'));
end