0001 function job_plot_cmap_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.plotcmap{inst_id}.V), return; end
0015
0016
0017
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
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,
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
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