Ignore:
Timestamp:
Dec 19, 2010, 10:11:04 PM (13 years ago)
Author:
sommeria
Message:

many bug repairs and corrections for mouse action
create_grid: option for black marjkers for grid detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r153 r156  
    3333test_draw=0;%test for mouse drawing of object, =0 by default
    3434test_object=0; %test for object editing or creation
    35 test_edit=isfield(handles,'edit') && get(handles.edit,'Value');% edit test for mouse shap: an arrow
     35test_edit_object=0;% edit test for mouse shap: an arrow
    3636test_zoom_draw=0; % test for zoom drawing
    3737test_ruler=0;%test for active ruler
     
    4040if ~isempty(huvmat)
    4141    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');
     44end
     45hciv=findobj(allchild(0),'tag','civ');%find the civ interface handle
    4846if ~isempty(hciv) && strcmp(get(currentfig,'tag'),'view_field')
    4947    hhciv=guidata(hciv);
     
    8583            test_zoom_draw=test_draw && isequal(AxeData.Drawing,'zoom')&& isfield(AxeData,'CurrentOrigin') && isequal(get(gcf,'SelectionType'),'normal');
    8684            test_object=test_draw && isfield(AxeData,'CurrentObject') && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject);
    87             if ~test_edit && ~test_zoom_draw && ~test_ruler
     85            if ~test_edit_object && ~test_zoom_draw && ~test_ruler
    8886                pointershape='crosshair';%set pointer with cross shape (default when mouse is over an axis)
    8987            end
     
    110108                                    if ~isempty(ivec)
    111109                                        % mark the vectors with a circle in the absence of other operations
    112                                         if ~test_object && ~test_edit && ~test_ruler
     110                                        if ~test_object && ~test_edit_object && ~test_ruler
    113111                                            pointershape='arrow'; %mouse indicates  the detection of a vector
    114112                                            if isempty(hhh)
     
    291289%%%%%%%%%%%%%%%%%
    292290%% create or modify an object
    293 
    294291if ~isempty(huvmat) && test_object
    295292    PlotData=get(AxeData.CurrentObject,'UserData');
     
    347344    pointershape='crosshair';%default for geometry_calib: ready to create new points
    348345    hh_geometry_calib=guidata(h_geometry_calib);
    349     if  ~isempty(xy)
     346    if  ~isempty(xy) && isfield(hh_geometry_calib,'ListCoord')
    350347        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
    351348        Coord=get(h_ListCoord,'String');
     
    368365                hh=findobj('Tag','calib_points');%look for handle of calibration points
    369366               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')
    371368                    XCoord(index_point)=xy(1,1);
    372369                    YCoord(index_point)=xy(1,2);
     
    387384
    388385%% draw ruler
    389 if test_ruler && isequal(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            end
     386if 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
    396393end
    397394
Note: See TracChangeset for help on using the changeset viewer.