Changeset 102 for trunk/src/mouse_up.m


Ignore:
Timestamp:
Jun 13, 2010, 11:32:05 PM (14 years ago)
Author:
sommeria
Message:

bugs corrected for projection objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_up.m

    r89 r102  
    2828   handles=get(gcbo,'UserData');
    2929end
    30 huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle
     30huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle
    3131if ~isempty(huvmat)
    3232    hhuvmat=guidata(huvmat);
     
    6262        ObjectData.Coord(ind_move,2)=xy(1,2);
    6363    else   %creating object
    64         if isequal(ObjectData.Style,'line')||isequal(ObjectData.Style,'polyline')||...
    65                 isequal(ObjectData.Style,'polygon')||isequal(ObjectData.Style,'points')
     64        if strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||...
     65                strcmp(ObjectData.Style,'polygon')||strcmp(ObjectData.Style,'points')
    6666            if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
    6767              xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ...
     
    9191    end
    9292    %set(AxeData.CurrentObject,'UserData',ObjectData); %update the object properties
    93     if isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')
     93    if strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse')
    9494        NbDefPoint=1; 
    95     elseif isequal(ObjectData.Style,'line')|| isequal(ObjectData.Style,'plane');
     95    elseif strcmp(ObjectData.Style,'line')|| strcmp(ObjectData.Style,'plane');
    9696        NbDefPoint=2;
    9797    else
     
    100100   
    101101    %show object coordinates in the GUI set_object
    102     h_set_object=findobj(allchild(0),'Name','set_object');
    103     h_XObject=findobj(h_set_object,'Tag','XObject');
    104     h_YObject=findobj(h_set_object,'Tag','YObject');
    105     h_ZObject=findobj(h_set_object,'Tag','ZObject');
    106     set(h_XObject,'String',num2str(ObjectData.Coord(:,1),4));
    107     set(h_YObject,'String',num2str(ObjectData.Coord(:,2),4));
    108     set(h_ZObject,'String',num2str(ObjectData.Coord(:,3),4));
     102    h_set_object=findobj(allchild(0),'Tag','set_object');
     103    hh_set_object=guidata(h_set_object);
     104    set(hh_set_object.XObject,'String',num2str(ObjectData.Coord(:,1),4));
     105    set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4));
     106    set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4));
    109107    if NbDefPoint<=2 || isequal(get(currentfig,'SelectionType'),'alt') ||...
    110               isequal(AxeData.Drawing,'translate') || isequal(AxeData.Drawing,'deform');%stop drawing
     108              strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing
    111109        AxeData.CurrentOrigin=[]; %suppress the current origin
    112110       if isequal(ObjectData.Style,'line') && size(ObjectData.Coord,1)<=1
     
    126124                 PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters
    127125             end
    128             AxeData.hset_object=set_object(ObjectData,PlotHandles);% call the set_object interface ,*
    129126            UvData.Object{IndexObj}=update_obj(UvData,IndexObj,ObjectData,PlotHandles);
    130             %ObjectData=update_obj(UvData,IndexObj,ObjectData,PlotHandles);
    131127            if  isfield(UvData.Object{IndexObj},'PlotParam')
    132128                write_plot_param(PlotHandles,UvData.Object{IndexObj}.PlotParam); %update the display of plotting parameters for the current object
    133             end             
    134 %             set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation
    135 %             set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green
     129            end   
    136130            set(hhuvmat.edit,'BackgroundColor',[1 1 0]);% paint the edit text in yellow
    137131            set(hhuvmat.edit,'Value',1);%
     
    139133            set(hhuvmat.MenuEditObject,'Enable','on');%
    140134            set(hhuvmat.MenuEdit,'Enable','on');%
    141 %             set(hhuvmat.MenuObject,'Enable','on');%
    142135            UvData.MouseAction='edit_object'; % set the edit button to 'on'
    143136        end
     
    152145    test_drawing=0;
    153146end
    154 
    155147%creation of a new zoom plot
    156148test_replot=0;
     
    235227     %zoom out by a factor of 2 out when the right mouse button has been used
    236228     elseif isequal(get(currentfig,'SelectionType'),'alt'); %if right button has been pressed
    237             alpha=2; %zoom factor (zoom out by a factor 2)
     229%             alpha=2; %zoom factor (zoom out by a factor 2)
    238230            xlim=get(currentaxes,'XLim');
    239231            xlim_new(1)=2*xlim(1)-xy(1,1);
     
    344336    end
    345337    if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat)
    346         global Data_uvmat
    347         Data_uvmat=get(currentobj,'UserData');
    348         %plot_text(CurData)
    349         %get_field([],CurData);
    350         evalin('base','global Data_uvmat')%make CurData global in the workspace
     338        currentfig=get(currentobj,'parent');
     339        figname=get(currentfig,'name');
     340        eval(['global Data_' figname])
     341        eval(['Data_' figname '=get(currentobj,''UserData'')']);
     342        evalin('base',['global Data_' figname])%make CurData global in the workspace
    351343        objtype=get(currentobj,'Type');
    352344        display(['UserData of ' objtype ':'])
    353         evalin('base','Data_uvmat') %display CurData in the workspace
     345        evalin('base',['Data_' figname]) %display CurData in the workspace
    354346        commandwindow %brings the Matlab command window to the front
    355347    end
Note: See TracChangeset for help on using the changeset viewer.