Changeset 179 for trunk/src/update_obj.m


Ignore:
Timestamp:
Jan 9, 2011, 12:56:28 PM (13 years ago)
Author:
sommeria
Message:

various bug repairs, in particular for 3D fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/update_obj.m

    r159 r179  
    2121
    2222%% default input and output
    23 % Object_out{IndexObj}=ObjectData;%default
    24 % if  isfield(UvData,'Object')
    25 %     Object_set=UvData.Object;
    26 % else
    27 %     Object_set={};%create the object
    28 % end
    2923Object_out=UvData.Object;
    3024
    31 %% plot the field projected on the object
    32 % ProjData= proj_field(UvData.Field,ObjectData,IndexObj);%project the current interface field on ObjectData
    33 % if ~isempty(ProjData)   
    34 %     plotaxes=[];%default
    35 %     if length(Object_set)>= IndexObj && isfield(Object_set{IndexObj},'plotaxes')
    36 %         plotaxes=Object_set{IndexObj}.plotaxes;
    37 %         [PlotType,Object_out{IndexObj}.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotHandles);%update an existing field plot
    38 %         plotfig=get(plotaxes,'parent');
    39 %         ViewData=get(plotfig,'UserData');
    40 %         eval(
    41 %     else
    42 %         hview_field=view_field(ProjData);%create a new field plot with view_field
    43 %         hhview_field=guidata(hview_field);
    44 %         plotaxes=hhview_field.axes3;
    45 %     end
    46 %     Object_out{IndexObj}.plotaxes=plotaxes;
    47 % end
    4825
    4926%%  representation of the different objects in the plots uvmat and view_field
    50 
    5127%plot uvmat
    5228    for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_1
    5329         hobject=[];
    5430        if isfield(Object_out{iobj},'DisplayHandle_uvmat') && ~isempty(Object_out{iobj}.DisplayHandle_uvmat) && ishandle(Object_out{iobj}.DisplayHandle_uvmat)
    55             hobject=Object_out{iobj}.DisplayHandle_uvmat;
     31            hobject=Object_out{iobj}.DisplayHandle_uvmat;%graphic handle of object #iobj in the uvmat plot
    5632        end
    5733        Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation
     
    6238        hobject=[];
    6339        if isfield(Object_out{iobj},'DisplayHandle_view_field') &&  ~isempty(Object_out{iobj}.DisplayHandle_view_field) && ishandle(Object_out{iobj}.DisplayHandle_view_field)
    64             hobject=Object_out{iobj}.DisplayHandle_view_field;
    65 %         else
    66 %             hobject=plotaxes;
     40            hobject=Object_out{iobj}.DisplayHandle_view_field;%graphic handle of object #iobj in the view_field plot
    6741        end
    6842        Object_out{iobj}.DisplayHandle_view_field=plot_object(Object_out{iobj},Object_out{IndexObj_2},hobject,'m');%update the object representation
    6943    end
    7044end
    71 %  end
    72 
    73 %     if isfield(Object_set{iobj},'plotaxes')
    74 %         haxes=Object_set{iobj}.plotaxes;% axes for the field plot
    75 %         if ishandle(haxes) && isequal(get(haxes,'Type'),'axes')% update the representation of the object IndexObj on this axes if it exists
    76 %             testupdate=0;
    77 %             HandlesDisplay=[];%default
    78 %             if length(Object_set)>= IndexObj && isfield(Object_set{IndexObj},'HandlesDisplay')
    79 %                 HandlesDisplay=Object_set{IndexObj}.HandlesDisplay;%list of handles of object representations
    80 %             end
    81 %             hplot_list=findobj(haxes,'Tag','proj_object');%list of projection objects on the axes
    82 %             for ih=1:length(HandlesDisplay)
    83 %                 plot_detect=find(hplot_list==HandlesDisplay(ih));
    84 %                 if ~isempty(plot_detect)
    85 %                     Object_out.HandlesDisplay(ih)=plot_object(ObjectData,Object_set{iobj},HandlesDisplay(ih),'m');%update the the object representation
    86 %                     testupdate=1;
    87 %                     break
    88 %                 end
    89 %             end
    90 %             if ~testupdate% draw new object plot
    91 %                 hh=plot_object(ObjectData,Object_set{iobj},haxes,'m');%draw the object with the new object data
    92 %                 if isfield(Object_out,'HandlesDisplay')
    93 %                     Object_out.HandlesDisplay=[Object_out.HandlesDisplay hh];
    94 %                 else
    95 %                     Object_out.HandlesDisplay=hh;
    96 %                 end
    97 %                 PlotData=get(hh,'UserData');
    98 %                 PlotData.IndexObj=IndexObj;
    99 %                 set(hh,'UserData',PlotData); %record the object index in the graph
    100 %             end
    101 %         end
    102 %     end
    103 % end
    10445
    10546
    10647
    10748
     49
Note: See TracChangeset for help on using the changeset viewer.