[8] | 1 | %'update_obj': update the object graph representation and its projection field, record it in the uvmat interface
|
---|
| 2 | %-------------------------------------------------------------------
|
---|
[156] | 3 | %Object_out=update_obj(UvData,IndexObj,ObjectData,PlotHandles);
|
---|
| 4 |
|
---|
[8] | 5 | %OUTPUT:
|
---|
[156] | 6 | % Object_out= cell array of structures containing the properties of the existing objects .
|
---|
[8] | 7 | %
|
---|
| 8 | %INPUT:
|
---|
[156] | 9 | %UvData: structure stored as 'Userdata' on the uvmat interface, it contains:
|
---|
[71] | 10 | % .Object{1},{2}... description of all the projection objects
|
---|
[156] | 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: object index of UvData.Object correspopnding to the updated object
|
---|
| 15 | %ObjectData: structure containing the input object properties to be attributed to the object #IndexObj
|
---|
[71] | 16 | % .Style: style of the object: 'line', 'rectangle'...
|
---|
| 17 | %PlotHandles: structure containing the handles of the plotting parameter buttons on the uvmat or view_field interface
|
---|
[8] | 18 | %-------------------------------------
|
---|
| 19 |
|
---|
[156] | 20 | function Object_out=update_obj(UvData,IndexObj_1,IndexObj_2)
|
---|
[8] | 21 |
|
---|
[156] | 22 | %% default input and output
|
---|
| 23 | Object_out=UvData.Object;
|
---|
[8] | 24 |
|
---|
[82] | 25 |
|
---|
[156] | 26 | %% representation of the different objects in the plots uvmat and view_field
|
---|
[159] | 27 | %plot uvmat
|
---|
[156] | 28 | for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_1
|
---|
| 29 | hobject=[];
|
---|
| 30 | if isfield(Object_out{iobj},'DisplayHandle_uvmat') && ~isempty(Object_out{iobj}.DisplayHandle_uvmat) && ishandle(Object_out{iobj}.DisplayHandle_uvmat)
|
---|
[179] | 31 | hobject=Object_out{iobj}.DisplayHandle_uvmat;%graphic handle of object #iobj in the uvmat plot
|
---|
[156] | 32 | end
|
---|
| 33 | Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation
|
---|
[82] | 34 | end
|
---|
[159] | 35 | % plot view_field
|
---|
| 36 | if ~isempty(IndexObj_2)
|
---|
[156] | 37 | for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_2
|
---|
| 38 | hobject=[];
|
---|
| 39 | if isfield(Object_out{iobj},'DisplayHandle_view_field') && ~isempty(Object_out{iobj}.DisplayHandle_view_field) && ishandle(Object_out{iobj}.DisplayHandle_view_field)
|
---|
[179] | 40 | hobject=Object_out{iobj}.DisplayHandle_view_field;%graphic handle of object #iobj in the view_field plot
|
---|
[156] | 41 | end
|
---|
| 42 | Object_out{iobj}.DisplayHandle_view_field=plot_object(Object_out{iobj},Object_out{IndexObj_2},hobject,'m');%update the object representation
|
---|
| 43 | end
|
---|
[159] | 44 | end
|
---|
[8] | 45 |
|
---|
| 46 |
|
---|
[82] | 47 |
|
---|
[156] | 48 |
|
---|
| 49 |
|
---|