Ignore:
Timestamp:
Apr 14, 2014, 11:41:21 AM (10 years ago)
Author:
sommeria
Message:

various bug resolutions and improvements in particular with geometry_calib. Introduction of a tool set_slices in uvmat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r714 r738  
    403403        if isnumeric(data.Coord)&&~isempty(data.Coord)
    404404            if test_transform
    405                             XCoord=(data.Coord(:,1));
    406             YCoord=(data.Coord(:,2));
     405                XCoord=(data.Coord(:,1));
     406                YCoord=(data.Coord(:,2));
    407407            else
    408             XCoord=(data.Coord(:,4));
    409             YCoord=(data.Coord(:,5));
     408                XCoord=(data.Coord(:,4));
     409                YCoord=(data.Coord(:,5));
    410410            end
    411411            xy=get(CurrentAxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    412412            if ~isempty(xy)
    413413                xlim=get(CurrentAxes,'XLim');
    414                 ind_range_x=abs((xlim(2)-xlim(1))/50);
     414%                 ind_range_x=abs((xlim(2)-xlim(1))/50);
    415415                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
    420421                if ~isempty(index_point)
    421                     pointershape='arrow';% default pointer is an arrow 
     422                    pointershape='arrow';% default pointer is an arrow
    422423                end
    423424                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)
    426427                    index_point=get(hh,'UserData');
    427428                    XCoord(index_point)=xy(1,1);
     
    429430                    set(hh,'XData',XCoord)
    430431                    set(hh,'YData',YCoord)
    431                end
     432                end
    432433                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);
    437439                    hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle)
    438440                    if ~isempty(hhh)
    439441                        set(hhh,'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range])
    440442                    else
    441                                     rectangle('Curvature',[1 1],...
    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');
    444446                    end
    445447                end
Note: See TracChangeset for help on using the changeset viewer.