Changeset 432 for trunk/src/mouse_down.m


Ignore:
Timestamp:
May 25, 2012, 8:59:59 AM (12 years ago)
Author:
sommeria
Message:

system of projection object manipulation with uvmat improved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r429 r432  
    311311        ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object
    312312        IndexObj=length(UvData.Object);
    313         %initiate a new object
    314         if isempty(UvData.Object{IndexObj});
     313        %initiate a new object (no data .Coord yet recorded)
     314        if ~isfield(UvData.Object{IndexObj},'Coord');
    315315            ObjectData.Coord=[];
    316316            ObjectNameNew=ObjectData.Name;
     
    318318                ObjectNameNew=ObjectData.Type;
    319319            end
    320             % add an index to the object name if the proposed name already exists
    321            
    322            
     320            % add an index to the object name if the proposed name already exists         
    323321            vers=0;% index of the name
    324322            ListObject=get(hhuvmat.ListObject,'String');
     
    345343            set(hhuvmat.ViewObject,'Value',1)
    346344        end
    347         % ObjectData.Coord=[]; %reset previous object coordinates
    348         %         ObjectData.Coord(1,1)=xy(1,1); % the object first coordinate is set by the mouse position
    349         %         ObjectData.Coord(1,2)=xy(1,2);
    350         %         if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
    351         %             ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle
    352         %         end
    353345        ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
    354         %                 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
    355         %                     xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ...
    356         %                 else
    357         %                     xy(1,3)=0; % z coordinate set to 0 by default
    358         %                 end
    359         %                 if ~isequal(ObjectData.Coord,xy(1,:))
    360         %                     ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
    361         %                 end
    362        
    363         AxeData.CurrentObject=plot_object(ObjectData,[],haxes,'m');%draw the object and its handle becomes AxeData.CurrentObject
    364         %         if isfield(UvData,'Object')
    365         %             IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface
    366         %         else
    367         %             IndexObj=2;% the first object is used for uvmat display or blank
    368         %         end
     346        hobject=UvData.Object{IndexObj}.DisplayHandle.(fig_tag);
     347        if isempty(hobject)
     348            hobject=haxes;
     349        end
     350        ProjObject=UvData.Object{get(hhuvmat.ListObject_1,'Value')};
     351        AxeData.CurrentObject=plot_object(ObjectData,ProjObject,hobject,'m');%draw the object and its handle becomes AxeData.CurrentObject
    369352        UvData.Object{IndexObj}=ObjectData;     
    370         UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject;     
    371         UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;
     353        UvData.Object{IndexObj}.DisplayHandle.(fig_tag)=AxeData.CurrentObject;% attribute the current plot object handle to the Object     
     354        %UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;
    372355        set(huvmat,'UserData',UvData)
    373356        PlotData=get(AxeData.CurrentObject,'UserData');
Note: See TracChangeset for help on using the changeset viewer.