Changeset 738 for trunk/src/mouse_motion.m
- Timestamp:
- Apr 14, 2014, 11:41:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r714 r738 403 403 if isnumeric(data.Coord)&&~isempty(data.Coord) 404 404 if test_transform 405 406 YCoord=(data.Coord(:,2));405 XCoord=(data.Coord(:,1)); 406 YCoord=(data.Coord(:,2)); 407 407 else 408 XCoord=(data.Coord(:,4));409 YCoord=(data.Coord(:,5));408 XCoord=(data.Coord(:,4)); 409 YCoord=(data.Coord(:,5)); 410 410 end 411 411 xy=get(CurrentAxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 412 412 if ~isempty(xy) 413 413 xlim=get(CurrentAxes,'XLim'); 414 ind_range_x=abs((xlim(2)-xlim(1))/50);414 % ind_range_x=abs((xlim(2)-xlim(1))/50); 415 415 ylim=get(CurrentAxes,'YLim'); 416 ind_range_y=abs((ylim(2)-ylim(1))/50); 417 ind_range=sqrt(ind_range_x*ind_range_y); 418 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 419 (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse 416 ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/25;%defines the size of the circle marker 417 % ind_range_y=abs((ylim(2)-ylim(1))/50); 418 % ind_range=sqrt(ind_range_x*ind_range_y); 419 index_point=find((XCoord<xy(1,1)+ind_range/2) & (XCoord>xy(1,1)-ind_range/2) & ...%flagx=1 for the vectors with x position selected by the mouse 420 (YCoord<xy(1,2)+ind_range/2) & (YCoord>xy(1,2)-ind_range/2),1);%find the first calibration point in the neighborhood of the mouse 420 421 if ~isempty(index_point) 421 pointershape='arrow';% default pointer is an arrow 422 pointershape='arrow';% default pointer is an arrow 422 423 end 423 424 hh=findobj('Tag','calib_points');%look for handle of calibration points 424 if ~isempty(hh) && ~isempty(get(hh,'UserData')) %&& get(hh_geometry_calib.CheckEnableMouse,'Value')425 %set(hh,'UserData',index_point)425 if ~isempty(hh) && ~isempty(get(hh,'UserData')) %&& get(hh_geometry_calib.CheckEnableMouse,'Value') 426 %set(hh,'UserData',index_point) 426 427 index_point=get(hh,'UserData'); 427 428 XCoord(index_point)=xy(1,1); … … 429 430 set(hh,'XData',XCoord) 430 431 set(hh,'YData',YCoord) 431 end432 end 432 433 if ~isempty(index_point) 433 Data=get(h_ListCoord,'Data'); 434 Data(:,6)=zeros(size(Data,1),1); 435 Data(index_point,6)=-1;%mrk the point on the GUI geometry_calib 436 set(h_ListCoord,'Data',Data); 434 set(hh_geometry_calib.CoordLine,'String',num2str(index_point)) 435 % Data=get(h_ListCoord,'Data'); 436 % Data(:,6)=zeros(size(Data,1),1); 437 % Data(index_point,6)=-1;%mrk the point on the GUI geometry_calib 438 % set(h_ListCoord,'Data',Data); 437 439 hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle) 438 440 if ~isempty(hhh) 439 441 set(hhh,'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range]) 440 442 else 441 442 'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',...443 'LineStyle','-','Tag','calib_marker');443 rectangle('Curvature',[1 1],... 444 'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range],'EdgeColor','m',... 445 'LineStyle','-','Tag','calib_marker'); 444 446 end 445 447 end
Note: See TracChangeset
for help on using the changeset viewer.