[8] | 1 | %'update_obj': update the object graph representation and its projection field, record it in the uvmat interface
|
---|
| 2 | %-------------------------------------------------------------------
|
---|
[302] | 3 | %Object_out=update_obj(UvData,IndexObj_1,IndexObj_2);
|
---|
[156] | 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
|
---|
[302] | 14 | %IndexObj_1: index of the object whose projection is plotted in the GUI uvmat
|
---|
| 15 | %IndexObj_2: index of the object whose projection is plotted in te GUI view_field
|
---|
[8] | 16 | %-------------------------------------
|
---|
| 17 |
|
---|
[156] | 18 | function Object_out=update_obj(UvData,IndexObj_1,IndexObj_2)
|
---|
[8] | 19 |
|
---|
[156] | 20 | %% default input and output
|
---|
| 21 | Object_out=UvData.Object;
|
---|
[8] | 22 |
|
---|
[82] | 23 |
|
---|
[156] | 24 | %% representation of the different objects in the plots uvmat and view_field
|
---|
[159] | 25 | %plot uvmat
|
---|
[183] | 26 | for 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
|
---|
[82] | 30 | end
|
---|
[183] | 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}
|
---|
[302] | 32 | Object_out{iobj}.DisplayHandle_uvmat
|
---|
[183] | 33 | end
|
---|
[159] | 34 | % plot view_field
|
---|
| 35 | if ~isempty(IndexObj_2)
|
---|
[183] | 36 | for iobj=1:length(Object_out) %change the view of all existing objects on the updated object #IndexObj_2
|
---|
[156] | 37 | hobject=[];
|
---|
| 38 | if isfield(Object_out{iobj},'DisplayHandle_view_field') && ~isempty(Object_out{iobj}.DisplayHandle_view_field) && ishandle(Object_out{iobj}.DisplayHandle_view_field)
|
---|
[179] | 39 | hobject=Object_out{iobj}.DisplayHandle_view_field;%graphic handle of object #iobj in the view_field plot
|
---|
[156] | 40 | end
|
---|
| 41 | Object_out{iobj}.DisplayHandle_view_field=plot_object(Object_out{iobj},Object_out{IndexObj_2},hobject,'m');%update the object representation
|
---|
| 42 | end
|
---|
[159] | 43 | end
|
---|
[8] | 44 |
|
---|
| 45 |
|
---|
[82] | 46 |
|
---|
[156] | 47 |
|
---|
| 48 |
|
---|