0001 function job_view_lf_push_rotate_button(inst_id)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 global vbmeg_inst;
0014 if isempty(vbmeg_inst.viewlf{inst_id}.V), return; end
0015
0016
0017
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
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,
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
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