Changeset 78 for trunk/src/mouse_motion.m
- Timestamp:
- Apr 2, 2010, 9:01:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r71 r78 24 24 25 25 function mouse_motion(hObject,eventdata,handles) 26 26 27 if ~exist('handles','var') 27 28 return … … 34 35 test_ruler=0; 35 36 huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle 37 hhuvmat=guidata(huvmat); 38 test_zoom=get(hhuvmat.zoom,'Value'); 36 39 if ~isempty(huvmat) 37 40 UvData=get(huvmat,'UserData'); … … 207 210 set(handles.text_display_3,'String',text_displ_3); 208 211 set(handles.text_display_4,'String',text_displ_4); 209 if ~test_draw210 return211 end212 % if ~test_draw 213 % return 214 % end 212 215 % At this stage if no drawing operation is done 213 216 … … 289 292 % detect calibration points if the GUI geometry_calib is opened 290 293 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI 291 if ~test_zoom _draw&& ~isempty(h_geometry_calib)294 if ~test_zoom && ~isempty(h_geometry_calib) 292 295 pointershape='crosshair';%default for geometry_calib: ready to create new points 293 296 hh_geometry_calib=guidata(h_geometry_calib); 294 if get(hh_geometry_calib.edit_append,'Value') &&~isempty(xy)297 if ~isempty(xy) 295 298 h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord'); 296 299 Coord=get(h_ListCoord,'String'); … … 301 304 xy=get(haxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 302 305 if ~isempty(xy) 303 ind_range=10; 306 xlim=get(haxes,'XLim'); 307 ind_range_x=abs((xlim(2)-xlim(1))/50); 308 ylim=get(haxes,'YLim'); 309 ind_range_y=abs((ylim(2)-ylim(1))/50); 310 ind_range=sqrt(ind_range_x*ind_range_y); 304 311 index_point=find((XCoord<xy(1,1)+ind_range) & (XCoord>xy(1,1)-ind_range) & ...%flagx=1 for the vectors with x position selected by the mouse 305 312 (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse 306 313 if ~isempty(index_point) 307 314 pointershape='arrow';% default pointer is an arrow 308 set(h_ListCoord,'Value',index_point)%mrk the point on the GUI geometry_calib 309 hh=findobj('Tag','calib_points');%look for handle of calibration points 310 if ~isempty(hh) && strcmp(get(hh,'UserData'),'edit_mode') 311 XCoord(index_point)=xy(1,1); 312 YCoord(index_point)=xy(1,2); 313 set(hh,'XData',XCoord) 314 set(hh,'YData',YCoord) 315 end 315 end 316 hh=findobj('Tag','calib_points');%look for handle of calibration points 317 if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.edit_append,'Value') 318 index_point=get(hh,'UserData'); 319 XCoord(index_point)=xy(1,1); 320 YCoord(index_point)=xy(1,2); 321 set(hh,'XData',XCoord) 322 set(hh,'YData',YCoord) 323 end 324 if ~isempty(index_point) 325 set(h_ListCoord,'Value',index_point)%mrk the point on the GUI geometry_calib 316 326 hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle) 317 327 if ~isempty(hhh) 318 328 set(hhh,'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range]) 319 % set(hhh,'XData',XCoord(index_point)) 320 % set(hhh,'YData',YCoord(index_point)) 321 end 322 end 329 end 330 end 323 331 end 324 332 end
Note: See TracChangeset
for help on using the changeset viewer.