source: trunk/src/update_obj.m @ 295

Last change on this file since 295 was 183, checked in by sommeria, 10 years ago

small bug repair: reading movies in read_fields, plotting rectangles and ellipes

File size: 2.4 KB
Line 
1%'update_obj': update the object graph representation and its projection field, record it in the uvmat interface
2%-------------------------------------------------------------------
3%Object_out=update_obj(UvData,IndexObj,ObjectData,PlotHandles);
4
5%OUTPUT:
6% Object_out= cell array of structures containing the properties of the existing objects     .
7%
8%INPUT:
9%UvData: structure stored as 'Userdata' on the uvmat interface, it contains:
10%    .Object{1},{2}... description of all the projection objects
11%    .Field , the current input field to be projected on the object
12%    .Object{IndexObj}.DisplayHandle_uvmat: handles of the object plot on uvmat, =[] if it does not exist
13%    .Object{IndexObj}.DisplayHandle_view_field: handles of the object plot on view_field, =[] if it does not exist
14%IndexObj_1: index of  the object used for the uvmat plot
15%IndexObj_2: index of  the object used for the view_field plot
16%-------------------------------------
17
18function Object_out=update_obj(UvData,IndexObj_1,IndexObj_2)
19
20%% default input and output
21Object_out=UvData.Object;
22
23
24%%  representation of the different objects in the plots uvmat and view_field
25%plot uvmat
26for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_1
27     hobject=[];
28    if isfield(Object_out{iobj},'DisplayHandle_uvmat') && ~isempty(Object_out{iobj}.DisplayHandle_uvmat) && ishandle(Object_out{iobj}.DisplayHandle_uvmat)
29        hobject=Object_out{iobj}.DisplayHandle_uvmat;%graphic handle of object #iobj in the uvmat plot
30    end
31    Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation of Object_out{iobj} on Object_out{IndexObj_1}
32end
33% plot view_field
34if ~isempty(IndexObj_2)
35    for iobj=1:length(Object_out) %change the view of all existing objects on the updated  object #IndexObj_2
36        hobject=[];
37        if isfield(Object_out{iobj},'DisplayHandle_view_field') &&  ~isempty(Object_out{iobj}.DisplayHandle_view_field) && ishandle(Object_out{iobj}.DisplayHandle_view_field)
38            hobject=Object_out{iobj}.DisplayHandle_view_field;%graphic handle of object #iobj in the view_field plot
39        end
40        Object_out{iobj}.DisplayHandle_view_field=plot_object(Object_out{iobj},Object_out{IndexObj_2},hobject,'m');%update the object representation
41    end
42end
43
44
45
46
47
Note: See TracBrowser for help on using the repository browser.