Changeset 410 for trunk/src/mouse_down.m


Ignore:
Timestamp:
May 6, 2012, 4:06:22 PM (12 years ago)
Author:
sommeria
Message:

projection on object improved: two menus for object projection dispalyed in uvmat and in view_field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r402 r410  
    245245                    %indicate on the list of the GUI uvmat which object has been selected
    246246            if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field
    247                 IndexObj_old=get(hhuvmat.ListObject,'Value');
    248                 if IndexObj>IndexObj_old(1)
    249                     IndexObj=[IndexObj_old(1) IndexObj];
    250                 else
    251                     IndexObj=[1 IndexObj];
    252                 end
     247%                 IndexObj=get(hhuvmat.ListObject,'Value');
     248%                 if IndexObj>IndexObj_old(1)
     249%                     IndexObj=[IndexObj_old(1) IndexObj];
     250%                 else
     251%                     IndexObj=[1 IndexObj];
     252%                 end
    253253                set(hhuvmat.ListObject,'Value',IndexObj);
    254                 set(hhuvmat.ListObject,'UserData',IndexObj);
     254%                 set(hhuvmat.ListObject,'UserData',IndexObj);
    255255            else
    256                 set(hhuvmat.ListObject,'Value',IndexObj);
    257                 list_str=get(hhuvmat.ListObject,'String');
     256                set(hhuvmat.ListObject_1,'Value',IndexObj);
     257                list_str=get(hhuvmat.ListObject_1,'String');
    258258                UvData.Object{IndexObj}.Name=list_str{IndexObj};
    259259            end
     
    290290if  test_create && ~isempty(xy) && ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create'))
    291291    hset_object=findobj(allchild(0),'tag','set_object');
     292    % activate this option if the GUI set_object is opened
    292293    if ~isempty(hset_object)
    293         sethandles=guidata(hset_object);
    294         ObjectData=read_GUI(hset_object); %read object features in the GUI set_object
     294        sethandles=guidata(hset_object);% handles of the elements in set_object
     295        ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object
    295296        ObjectData.Coord=[]; %reset previous object coordinates
    296         ObjectData.Coord(1,1)=xy(1,1);
     297        ObjectData.Coord(1,1)=xy(1,1); % the object first coordinate is set by the mouse position
    297298        ObjectData.Coord(1,2)=xy(1,2);
    298         if isfield(AxeData,'ObjectCoord') & size(AxeData.ObjectCoord,2)==3
     299        if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
    299300            ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle
    300301        end
     
    303304            IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface
    304305        else
    305             IndexObj=2;
     306            IndexObj=2;% the first object is used for uvmat display or blank
    306307        end
    307308        UvData.Object{IndexObj}=ObjectData;
    308         ListObject=get(hhuvmat.ListObject,'String');
    309         IndexObj_old=get(hhuvmat.ListObject,'Value');
     309        ListObject=get(hhuvmat.ListObject_1,'String');
    310310        UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject;
    311311        ObjectNameNew=ObjectData.Name;
     
    313313             ObjectNameNew=ObjectData.Type;
    314314        end
     315        % add an index to the object name if the proposed name already exists
    315316        vers=0;% index of the name
    316317        detectname=1;
     
    330331        ObjectName=ObjectNameNew;
    331332        set(sethandles.Name,'String',ObjectName)% display the default name in set_object
    332         IndexObj=numel(ListObject)+1;% append an object to the list in uvmat
     333%         IndexObj=numel(ListObject)+1;% append an object to the list in uvmat
    333334        set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list
    334         set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj])
     335        set(hhuvmat.ListObject_1,'String',[ListObject;{ObjectName}]);%complement the object list
     336        %set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj])
     337        set(hhuvmat.ListObject,'Value',IndexObj)
    335338        %             if isempty(object_name)
    336339        %                 list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Type];
     
    344347        PlotData=get(AxeData.CurrentObject,'UserData');
    345348        PlotData.IndexObj=IndexObj;
    346         set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph
    347         AxeData.Drawing='create';
     349        set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion)
     350        AxeData.Drawing='create';% flag for mouse motion
    348351    end
    349352end
Note: See TracChangeset for help on using the changeset viewer.