%ROTATE Adding a rotation tool
%
%
% crude attempt at changing the viewing angles. Run this script after plotbot
% and it pops up a couple of sliders to allow changing the viewpoint. Should
% be an integral part of plotbot, along with rewind button...
%
fig = gcf;
%clf

sli_azm = uicontrol(fig, 'Style', 'slider', ...
'Position', [50 50 120 20], ...
'Min', -90, 'Max', 90, 'Value', 30, ...
'Callback', [ ...
'set(azm_cur,''String'',',...
'num2str(get(sli_azm,''Val''))),',...
'set(gca,''View'',',...
'[get(sli_elv,''Val''),get(sli_azm,''Val'')])']);
sli_elv = uicontrol(fig, 'Style', 'slider', ...
'Position', [240 50 120 20], ...
'Min', -90, 'Max', 90, 'Value', 30, ...
'Callback', [ ...
'set(elv_cur,''String'',',...
'num2str(get(sli_elv,''Val''))),',...
'set(gca,''View'',',...
'[get(sli_azm,''Val''),get(sli_elv,''Val'')])']);
azm_min = uicontrol(fig,...
'Style', 'text', ...
'Pos', [210 50 30 20], ...
'String', num2str(get(sli_elv, 'Min')));
elv_min = uicontrol(fig,...
'Style', 'text', ...
'Pos', [210 50 30 20], ...
'String', num2str(get(sli_elv, 'Min')));
azm_max = uicontrol(fig,...
'Style', 'text', ...
'Pos', [170 50 30 20], ...
'String', num2str(get(sli_elv, 'Max')));
elv_max = uicontrol(fig,...
'Style', 'text', ...
'Pos', [360 50 30 20], ...
'String', num2str(get(sli_elv, 'Max')));

azm_label = uicontrol(fig, ...
'Style', 'text', ...
'Pos', [50 80 65 20], ...
'String', 'Azimuth');
elv_label = uicontrol(fig, ...
'Style', 'text', ...
'Pos', [240 80 65 20], ...
'String', 'Elevation');

azm_cur = uicontrol(fig, ...
'Style', 'text', ...
'Pos', [120 80 50 20], ...
'String', num2str(get(sli_azm, 'Value')));

elv_cur = uicontrol(fig, ...
'Style', 'text', ...
'Pos', [310 80 50 20], ...
'String', num2str(get(sli_elv, 'Value')));