Home > functions > job > job_plot_currentmap_dir > job_plot_cmap_push_rotate_button.m

job_plot_cmap_push_rotate_button

PURPOSE ^

Change rotation mode

SYNOPSIS ^

function job_plot_cmap_push_rotate_button(inst_id)

DESCRIPTION ^

 Change rotation mode
 
 --- Syntax
 function job_plot_cmap_push_rotate_button(inst_id)

 --- History
 2008-09-29 Taku Yoshioka

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function job_plot_cmap_push_rotate_button(inst_id)
0002 % Change rotation mode
0003 %
0004 % --- Syntax
0005 % function job_plot_cmap_push_rotate_button(inst_id)
0006 %
0007 % --- History
0008 % 2008-09-29 Taku Yoshioka
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 global vbmeg_inst; 
0014 if isempty(vbmeg_inst.plotcmap{inst_id}.V), return; end
0015 
0016 %
0017 % Global variables
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 h_fig = vbmeg_inst.plotcmap{inst_id}.h_fig;
0021 h_space = vbmeg_inst.plotcmap{inst_id}.h_space;
0022 h_time = vbmeg_inst.plotcmap{inst_id}.h_time;
0023 h_rotate = vbmeg_inst.plotcmap{inst_id}.pb3;
0024 
0025 %
0026 % Change rotation mode and set callback function
0027 %
0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0029 rot_flag = get(h_rotate, 'Value');
0030 if rot_flag, 
0031     on_off = 'on';
0032 else
0033     on_off = 'off';
0034 end
0035 [a,b] = vb_matlab_version;
0036 if (a+b*0.1)>=7.3, % MATLAB 7.3 or later
0037   h = rotate3d;
0038   set(h, 'Enable', on_off);
0039   set(h,'ActionPostCallback',@after_rotate_callback);
0040 else
0041   rotate3d(h_space, on_off);
0042 end
0043 
0044 %
0045 % Callback function after rotating the plot
0046 %
0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 function after_rotate_callback(obj,event_obj)
0049 
0050 child1 = get(obj,'Children');
0051 
0052 for i=1:length(child1)
0053   if strcmp(get(child1(i),'Type'),'axes'), 
0054     child2 = get(child1(i),'Children');
0055     for j=1:length(child2)
0056       if strcmp(get(child2(j),'Type'),'light'),
0057         camlight(child2(j),'headlight');
0058         return;
0059       end
0060     end
0061   end
0062 end
0063

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005