Changeset 156 for trunk/src/mouse_motion.m
- Timestamp:
- Dec 19, 2010, 10:11:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r153 r156 33 33 test_draw=0;%test for mouse drawing of object, =0 by default 34 34 test_object=0; %test for object editing or creation 35 test_edit =isfield(handles,'edit') && get(handles.edit,'Value');% edit test for mouse shap: an arrow35 test_edit_object=0;% edit test for mouse shap: an arrow 36 36 test_zoom_draw=0; % test for zoom drawing 37 37 test_ruler=0;%test for active ruler … … 40 40 if ~isempty(huvmat) 41 41 hhuvmat=guidata(huvmat); 42 end 43 if ~isempty(huvmat) 44 UvData=get(huvmat,'UserData'); 45 test_ruler=isfield(UvData,'MouseAction') && isequal(UvData.MouseAction,'ruler'); 46 end 47 hciv=findobj(allchild(0),'tag','civ');%find the uvmat interface handle 42 test_edit_object=get(hhuvmat.edit_object,'Value'); 43 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on'); 44 end 45 hciv=findobj(allchild(0),'tag','civ');%find the civ interface handle 48 46 if ~isempty(hciv) && strcmp(get(currentfig,'tag'),'view_field') 49 47 hhciv=guidata(hciv); … … 85 83 test_zoom_draw=test_draw && isequal(AxeData.Drawing,'zoom')&& isfield(AxeData,'CurrentOrigin') && isequal(get(gcf,'SelectionType'),'normal'); 86 84 test_object=test_draw && isfield(AxeData,'CurrentObject') && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject); 87 if ~test_edit && ~test_zoom_draw && ~test_ruler85 if ~test_edit_object && ~test_zoom_draw && ~test_ruler 88 86 pointershape='crosshair';%set pointer with cross shape (default when mouse is over an axis) 89 87 end … … 110 108 if ~isempty(ivec) 111 109 % mark the vectors with a circle in the absence of other operations 112 if ~test_object && ~test_edit && ~test_ruler110 if ~test_object && ~test_edit_object && ~test_ruler 113 111 pointershape='arrow'; %mouse indicates the detection of a vector 114 112 if isempty(hhh) … … 291 289 %%%%%%%%%%%%%%%%% 292 290 %% create or modify an object 293 294 291 if ~isempty(huvmat) && test_object 295 292 PlotData=get(AxeData.CurrentObject,'UserData'); … … 347 344 pointershape='crosshair';%default for geometry_calib: ready to create new points 348 345 hh_geometry_calib=guidata(h_geometry_calib); 349 if ~isempty(xy) 346 if ~isempty(xy) && isfield(hh_geometry_calib,'ListCoord') 350 347 h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord'); 351 348 Coord=get(h_ListCoord,'String'); … … 368 365 hh=findobj('Tag','calib_points');%look for handle of calibration points 369 366 if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.edit_append,'Value') 370 index_point=get(hh,'UserData') ;367 index_point=get(hh,'UserData') 371 368 XCoord(index_point)=xy(1,1); 372 369 YCoord(index_point)=xy(1,2); … … 387 384 388 385 %% draw ruler 389 if test_ruler && is equal(AxeData.Drawing,'ruler')390 if isfield(UvData,'RulerHandle')391 pointershape='crosshair';392 RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];393 set(UvData.RulerHandle,'XData',RulerCoord(:,1));394 set(UvData.RulerHandle,'YData',RulerCoord(:,2));395 386 if test_ruler && isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'ruler') 387 if isfield(AxeData,'RulerHandle') 388 pointershape='crosshair'; %give the mouse pointer a cross shape 389 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)]; %coordinates defining the ruler segment 390 set(AxeData.RulerHandle,'XData',RulerCoord(:,1));% updtate the x coordinates for the ruler graphic object 391 set(AxeData.RulerHandle,'YData',RulerCoord(:,2));% updtate the y coordinates for the ruler graphic object 392 end 396 393 end 397 394
Note: See TracChangeset
for help on using the changeset viewer.