Changeset 61 for trunk/src/mouse_up.m


Ignore:
Timestamp:
Mar 24, 2010, 12:51:51 AM (11 years ago)
Author:
sommeria
Message:

gestion of projection objects improved. Implementation of view_field.fig
introduction of a circle to mark vectors with the mouse
various cleaning and debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_up.m

    r60 r61  
    133133                write_plot_param(PlotHandles,UvData.Object{IndexObj}.PlotParam); %update the display of plotting parameters for the current object
    134134            end             
    135             set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation
    136             set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green
     135%             set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation
     136%             set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green
    137137            set(hhuvmat.edit,'BackgroundColor',[1 1 0]);% paint the edit text in yellow
    138138            set(hhuvmat.edit,'Value',1);%
     
    166166                    delete(AxeData.CurrentVec)
    167167                end
    168                 %update the axes UvData.Plane2 if it exists, else create it
    169 %                 if isfield (UvData,'Plane2') & ishandle(UvData.Plane2.Fig)%if the second plan plotting axis already exists
    170 %                     hfig2=UvData.Plane2.Fig;
    171 %                     if isequal(gcf,hfig2)%if we are already on the secondary figure
    172 %                         test_replot=1;
    173 %                     else
    174 %                         figure(hfig2)%set hfig2 as the current figure
    175 %                         clf; %erase axes
    176 %                     end
    177 %                 else
    178                     hfig2=figure;%create new figure
    179                     set(hfig2,'name','zoom')
    180                     set(hfig2,'Units','normalized')
    181                     set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
    182 %                     UvData.Plane2.Fig=hfig2;
    183                     map=colormap(currentaxes);
    184                     colormap(map);%transmit the current colormap to the zoom fig
    185                     get(handles.RootFile,'String')
    186 %                 end
     168                hfig2=figure;%create new figure
     169                set(hfig2,'name','zoom')
     170                set(hfig2,'Units','normalized')
     171                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
     172                map=colormap(currentaxes);
     173                colormap(map);%transmit the current colormap to the zoom fig
     174                get(handles.RootFile,'String')
    187175                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
    188176                if test_replot==0
     
    219207                        ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axes
    220208                        set(AxeData.ZoomAxes,'UserData',ChildAxeData);%update the AxeData of the new axes
    221                        % UvData.TopFig=hfig2;%put the new fig to the top of the stack for uvmat
    222         %                 set(huvmat,'UserData',UvData)
    223209                        set(AxeData.ZoomAxes,'Xlim',[PosRect(1) PosRect(1)+PosRect(3)])
    224210                        set(AxeData.ZoomAxes,'Ylim',[PosRect(2) PosRect(2)+PosRect(4)])
     
    277263if isequal(MouseAction,'ruler')
    278264    UvData.MouseAction='none';
    279     UvData=rmfield(UvData,'RulerHandle')
     265    UvData=rmfield(UvData,'RulerHandle');
    280266     xy=get(currentaxes,'CurrentPoint');
    281     RulerCoord=[UvData.RulerCoord ;xy(1,1:2)]
     267    RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];
    282268    set(huvmat,'UserData',UvData)
    283     RulerCoord=diff(RulerCoord,1)
     269    RulerCoord=diff(RulerCoord,1);
    284270    RulerCoord=RulerCoord(1)+i*RulerCoord(2);
    285     distance=abs(RulerCoord)
    286     azimuth=(180/pi)*angle(RulerCoord)
     271    distance=abs(RulerCoord);
     272    azimuth=(180/pi)*angle(RulerCoord);
    287273    msgbox_uvmat('RULER','',['length: ' num2str(distance,3) ',  angle(degrees): ' num2str(azimuth,3)])
     274    hruler=findobj(currentaxes,'Tag','ruler');
     275    delete(hruler)
    288276end
    289277
Note: See TracChangeset for help on using the changeset viewer.