Changeset 625 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 2, 2013, 7:51:42 PM (8 years ago)
Author:
sommeria
Message:

system of object creation by mouse ilmproved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r623 r625  
    25512551        UvData.ProjObject{1}.Type='plane';%main plotting plane
    25522552        UvData.ProjObject{1}.ProjMode='projection';%main plotting plane
     2553        UvData.ProjObject{1}.Coord=[0 0 0];
    25532554        UvData.ProjObject{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat
    25542555        UvData.ProjObject{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat
     
    41684169list_str=get(handles.ListObject,'String');
    41694170IndexObj=get(handles.ListObject,'Value');%present object selection
    4170 
    4171 %% The object  is displayed in set_object if this GUI is already opened
    41724171UvData=get(handles.uvmat,'UserData');
    41734172ObjectData=UvData.ProjObject{IndexObj};
    4174 hset_object=findobj(allchild(0),'tag','set_object');
    4175 if ~isempty(hset_object)
    41764173    ZBounds=0; % default
    41774174    if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
     
    41794176        ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    41804177    end
    4181     ObjectData.Name=list_str{IndexObj};
     4178
     4179%% show object features if view_object isselected
     4180if get(handles.ViewObject,'value')
    41824181    set_object(ObjectData,[],ZBounds);
    4183     set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised
    4184 end
    4185 
    4186 %%  desactivate the edit object mode
     4182end
     4183
     4184%% The object  is displayed in set_object if this GUI is already opened
     4185%
     4186% hset_object=findobj(allchild(0),'tag','set_object');
     4187% if ~isempty(hset_object)
     4188%
     4189%     ObjectData.Name=list_str{IndexObj};
     4190%     set_object(ObjectData,[],ZBounds);
     4191%     set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised
     4192% end
     4193
     4194%%  desactivate the edit object mode for security
    41874195set(handles.edit_object,'Value',0)
     4196
    41884197% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
    41894198
     
    42744283%-------------------------------------------------------------------
    42754284hset_object=findobj(allchild(0),'Tag','set_object');
    4276 if get(handles.edit_object,'Value')
    4277 %     set(handles.edit_object,'BackgroundColor',[1,1,0]) 
     4285if get(handles.edit_object,'Value')
    42784286    %suppress the other options
    42794287    set(handles.CheckZoom,'Value',0)
     
    42834291        hhgeometry_calib=guidata(hgeometry_calib);
    42844292        set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
    4285         set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7])
    42864293    end
    42874294    set(handles.ViewObject,'value',1)
    42884295    ViewObject_Callback(hObject, eventdata, handles)
    4289 else % desctivate object edit mode
    4290 %     set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
     4296else % desactivate object edit mode
    42914297    if ~isempty(hset_object)% open the
    4292         hhset_object=guidata(hset_object);
    4293         set(hhset_object.PLOT,'enable','off');
    4294         set(get(hset_object,'children'),'enable','inactive')
     4298        set(get(hset_object,'children'),'Enable','off')
     4299        hSAVE=findobj(hset_object,'Tag','SAVE');
     4300        set(hSAVE,'Enable','on')
    42954301    end
    42964302end
     
    43174323        ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    43184324    end
    4319 %     set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion
    43204325    data=UvData.ProjObject{IndexObj};
    43214326    if ~isfield(data,'Type')% default plane
    43224327        data.Type='plane';
    43234328    end
    4324 %     if isfield(UvData,'Field')
    4325 %         Field=UvData.Field;
    4326 %         if isfield(UvData.Field,'Mesh')&&~isempty(UvData.Field.Mesh)
    4327 %             data.RangeX=[UvData.Field.XMin UvData.Field.XMax];
    4328 %             if strcmp(data.Type,'line')||strcmp(data.Type,'polyline')
    4329 %                 data.RangeY=UvData.Field.Mesh;
    4330 %             else
    4331 %                 data.RangeY=[UvData.Field.YMin UvData.Field.YMax];
    4332 %             end
    4333 %             data.DX=UvData.Field.Mesh;
    4334 %             data.DY=UvData.Field.Mesh;
    4335 %         end
    4336 %         if isfield(Field,'NbDim')&& isequal(Field.NbDim,3)
    4337 %             data.Coord=[0 0 0]; %default
    4338 %         end
    4339 %         if isfield(Field,'CoordUnit')
    4340 %             data.CoordUnit=Field.CoordUnit;
    4341 %         end
    4342 %     end
    43434329    hset_object=set_object(data,[],ZBounds);
    43444330    hhset_object=guidata(hset_object);
    43454331    if get(handles.edit_object,'Value')% edit mode
    4346         set(hhset_object.PLOT,'Enable','on')
    4347         set(get(hset_object,'children'),'enable','on')
     4332        set(get(hset_object,'children'),'Enable','on')
    43484333    else
    4349         set(hhset_object.PLOT,'Enable','off')
    4350         set(get(hset_object,'children'),'enable','inactive')% deactivate the GUI except SAVE
     4334        set(get(hset_object,'children'),'Enable','off')% deactivate the GUI except SAVE
    43514335        set(hhset_object.SAVE,'Enable','on')
    43524336    end
     
    47714755end
    47724756set(handles.edit_object,'Value',0)  %desactivate the object edit mode
     4757edit_object_Callback([],[],handles)
     4758set(handles.ViewObject,'Value',0) % desactivate view_object (new object created)
    47734759set(handles.CheckZoomFig,'Value',0) %desactivate zoom sub fig
    47744760set(handles.CheckZoom,'Value',0)    %desactivate the zoom action
     
    47774763end
    47784764
    4779 %% append a new line to the list of projection objects
    4780 ListObject=get(handles.ListObject,'String');
    4781 if isempty(ListObject)
    4782     ListObject={''};
    4783 end
    4784 if ~strcmp(ListObject{end},'')
    4785     ListObject=[ListObject;{''}]; %append a blank to the list (if nort already done) to indicate the creation of a new object
    4786     set(handles.ListObject,'String',ListObject)
    4787 end
    4788 IndexObj=length(ListObject);
    4789 set(handles.ListObject,'Value',IndexObj)
     4765%% append a new line to the list of projection objects A METTRE PLUS TARD
     4766% ListObject=get(handles.ListObject,'String');
     4767% if isempty(ListObject)
     4768%     ListObject={''};
     4769% end
     4770% if ~strcmp(ListObject{end},'')
     4771%     ListObject=[ListObject;{''}]; %append a blank to the list (if nort already done) to indicate the creation of a new object
     4772%     set(handles.ListObject,'String',ListObject)
     4773% end
     4774% IndexObj=length(ListObject);
     4775% set(handles.ListObject,'Value',IndexObj)
    47904776UvData=get(handles.uvmat,'UserData');
    4791 UvData.ProjObject{IndexObj}=[]; %create a new empty object
    4792 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=handles.PlotAxes; % axes for plot_object
    4793 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
    4794 set(handles.uvmat,'UserData',UvData)
     4777% UvData.ProjObject{IndexObj}=[]; %create a new empty object
     4778% UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=handles.PlotAxes; % axes for plot_object
     4779% UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
     4780% set(handles.uvmat,'UserData',UvData)
    47954781
    47964782%% initiate the new projection object
     
    48624848set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object
    48634849set(handles.edit_object,'Value',0); %suppress the object edit mode
     4850edit_object_Callback([],[],handles)
    48644851% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    48654852set(handles.delete_object,'Visible','on')
Note: See TracChangeset for help on using the changeset viewer.