Home > functions > job > job_view_leadfield_dir > job_view_lf_push_rotate_button.m

job_view_lf_push_rotate_button

PURPOSE ^

Change rotation mode

SYNOPSIS ^

function job_view_lf_push_rotate_button(inst_id)

DESCRIPTION ^

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

 --- History
 2008-01-27 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_view_lf_push_rotate_button(inst_id)
0002 % Change rotation mode
0003 %
0004 % --- Syntax
0005 % function job_view_lf_push_rotate_button(inst_id)
0006 %
0007 % --- History
0008 % 2008-01-27 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.viewlf{inst_id}.V), return; end
0015 
0016 %
0017 % Global variables
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 h_fig = vbmeg_inst.viewlf{inst_id}.h_fig;
0021 h_cortex = vbmeg_inst.viewlf{inst_id}.h_cortex;
0022 h_rotate = vbmeg_inst.viewlf{inst_id}.pb5;
0023 
0024 %
0025 % Change rotation mode and set callback function
0026 %
0027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0028 rot_flag = get(h_rotate, 'Value');
0029 if rot_flag, 
0030   on_off = 'on';
0031 else
0032   on_off = 'off';
0033 end
0034 [a,b] = vb_matlab_version;
0035 if (a+b*0.1)>=7.3, % MATLAB 7.3 or later
0036   h = rotate3d;
0037   set(h, 'Enable', on_off);
0038   set(h,'ActionPostCallback',@after_rotate_callback);
0039 else
0040   rotate3d(h_space, on_off);
0041 end
0042 
0043 %
0044 % Callback function after rotating the plot
0045 %
0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0047 function after_rotate_callback(obj,event_obj)
0048 
0049 child1 = get(obj,'Children');
0050 
0051 for i=1:length(child1)
0052   if strcmp(get(child1(i),'Type'),'axes'), 
0053     child2 = get(child1(i),'Children');
0054     for j=1:length(child2)
0055       if strcmp(get(child2(j),'Type'),'light'),
0056         camlight(child2(j),'headlight');
0057         return;
0058       end
0059     end
0060   end
0061 end
0062

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