Changeset 432 for trunk/src/uvmat.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/uvmat.m

    r429 r432  
    237237
    238238%% refresh projection plane
    239 UvData.Object{1}.ProjMode='projection';%main plotting plane
     239% UvData.Object{1}.ProjMode='projection';%main plotting plane
     240% UvData.Object{1}.DisplayHandle.uvmat=handles.axes3;
     241% UvData.Object{1}.DisplayHandle.view_field=[];
    240242set(handles.ListObject,'Value',1)% default: empty projection objectproj_field
    241243set(handles.ListObject,'String',{'plane'})
     
    25102512    UvData.Field.Mesh=ord;
    25112513end
    2512 
     2514        UvData.Object{1}.Type='plane';%main plotting plane
     2515        UvData.Object{1}.ProjMode='projection';%main plotting plane
     2516        UvData.Object{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat
     2517        UvData.Object{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat
    25132518
    25142519%% 3D case (menuvolume)
     
    25232528    if test_set_object% reinitiate the GUI set_object
    25242529        delete_object(1);% delete the current projection object in the list UvData.Object, delete its graphic representations and update the list displayed in handles.ListObject and 2
    2525         UvData.Object{1}.Type='plane';%main plotting plane
    2526         UvData.Object{1}.ProjMode='projection';%main plotting plane
    2527         UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
     2530%         UvData.Object{1}.Type='plane';%main plotting plane
     2531%         UvData.Object{1}.ProjMode='projection';%main plotting plane
     2532%         UvData.Object{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat
     2533%         UvData.Object{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat
    25282534        UvData.Object{1}.NbDim=NbDim;%test for 3D objects
    25292535        UvData.Object{1}.RangeZ=UvData.Field.Mesh;%main plotting plane
     
    39853991% --- Executes on selection change in ListObject_1.
    39863992function ListObject_1_Callback(hObject, eventdata, handles)
    3987 list_str=get(handles.ListObject_1,'String');
     3993list_str=get(handles.ListObject,'String');
    39883994UvData=get(handles.uvmat,'UserData');
    39893995ObjectData=UvData.Object{get(handles.ListObject_1,'Value')};
    39903996
    39913997%% update the projection plot on uvmat
    3992 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on UvData.Object{IndexObj(1)}
    3993 plot_field(ProjData,handles.axes3,read_GUI(handles.uvmat));%read plotting parameters on the uvmat interfacPlotHandles);
    3994 Object_out=update_obj(UvData,get(handles.ListObject_1,'Value'),[]);
     3998ProjData= proj_field(UvData.Field,ObjectData);%project the current input field on object ObjectData
     3999plot_field(ProjData,handles.axes3,read_GUI(handles.uvmat));% plot the projected field;
     4000%replot all the objects within the new projected field
     4001for IndexObj=1:numel(list_str)
     4002    IndexObj
     4003        hobject=UvData.Object{IndexObj}.DisplayHandle.uvmat
     4004        if isempty(hobject) || ~ishandle(hobject)
     4005            hobject=handles.axes3
     4006        end
     4007        if isequal(IndexObj,get(handles.ListObject,'Value'))
     4008            objectcolor='m'; %paint in magenta the currently selected object in ListObject
     4009        else
     4010            objectcolor='b';
     4011        end
     4012        UvData.Object{IndexObj}.DisplayHandle.uvmat=plot_object(UvData.Object{IndexObj},ObjectData,hobject,objectcolor);%draw the object in uvmat     
     4013end
     4014set(handles.uvmat,'UserData',UvData)
    39954015
    39964016%% display the object parameters if the GUI set_object is already opened
     
    40054025    set(handles.ViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised
    40064026end
     4027
    40074028%  desactivate the edit object mode
    40084029set(handles.edit_object,'Value',0)
     
    40594080
    40604081%% update the color of the graphic object representation: the selected object in magenta, others in blue
    4061 update_object_color(handles.axes3,hhview_field.axes3,UvData.Object{IndexObj(end)}.DisplayHandle_uvmat)
    4062 hview_field=findobj(allchild(0),'tag','view_field');
     4082update_object_color(handles.axes3,hhview_field.axes3,UvData.Object{IndexObj}.DisplayHandle.uvmat)
    40634083
    40644084%------------------------------------------------------------------------
     
    40874107    set(hother(iobj),'Selected','off')
    40884108end
    4089 if ~isempty(DisplayHandle)
     4109if ishandle(DisplayHandle)
    40904110    linetype=get(DisplayHandle,'Type');
    40914111    if isequal(linetype,'line')
     
    42574277    else
    42584278        Data=get(hview_field,'UserData');
    4259         set(hview_field,'Position',Data.GUISize)
     4279        set(hview_field,'Position',Data.GUISize)% restore the size of view_field for plots
    42604280    end
    42614281else
     
    45134533UvData=get(handles.uvmat,'UserData');
    45144534UvData.Object{IndexObj}=[]; %create a new empty object
     4535UvData.Object{IndexObj}.DisplayHandle.uvmat=handles.axes3; % axes for plot_object
     4536UvData.Object{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
    45154537data.Name=data.Type;% default name=type
    45164538data.Coord=[0 0]; %default
     
    45684590    set(handles.ListObject,'String',ListObject)
    45694591end
     4592UvData=get(handles.uvmat,'UserData');
     4593UvData.Object{IndexObj}=[]; %create a new empty object
     4594UvData.Object{IndexObj}.DisplayHandle.uvmat=[]; %no plot handle before plot_field operation
     4595UvData.Object{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
     4596set(handles.uvmat,'UserData',UvData)
    45704597set(handles.ListObject,'Value',length(ListObject))
    45714598hset_object=set_object(data);% call the set_object interface
     
    45744601set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    45754602set(handles.delete_object,'Visible','on')
     4603
    45764604
    45774605%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.