Changeset 432 for trunk/src/plot_object.m
- Timestamp:
- May 25, 2012, 8:59:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_object.m
r397 r432 1 1 %'plot_object': draws a projection object (points, line, plane...) 2 2 %------------------------------------------------------------------- 3 % function [ObjectData_out,hh]=plot_object(ObjectData,hplot,col)3 % function hh=plot_object(ObjectData,ProjObject,hplot,col) 4 4 % 5 5 %OUTPUT … … 8 8 %INPUT: 9 9 % 10 % ObjectData In: structure representing the object properties:10 % ObjectData: structure representing the object properties: 11 11 % .Type : style of projection object 12 12 % .Coord: set of coordinates defining the object position; … … 36 36 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 37 37 38 function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col) 38 function [hh]=plot_object(ObjectData,ProjObject,hplot,col) 39 39 40 %% default output 40 41 hh=[];%default output 41 if ~isfield(ObjectDataIn,'Type')|| isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot 42 return 43 end 44 if ~isfield(ProjObject,'Type') 45 ObjectData=ObjectDataIn; 46 elseif isequal(ProjObject.Type,'plane') 47 ObjectData=ObjectDataIn;% TODO: modify take into account rotation of axis 48 else 49 return % object representation only available in a plane 50 end 51 if ~isfield(ObjectData,'Type')||isempty(ObjectData.Type)||~ischar(ObjectData.Type) 52 msgbox_uvmat('ERROR','undefined ObjectData.Type in plot_object.m') 53 return 54 end 55 if ~isfield(ObjectData,'Type')||isempty(ObjectData.Type)||~ischar(ObjectData.Type) 56 msgbox_uvmat('ERROR','undefined ObjectData.Type in plot_object.m') 57 return 42 % object representation is canceled if the field is not projected on a plane or is the same as the represented object 43 if ~isfield(ObjectData,'Type')|| isequal(ProjObject,ObjectData)|| ~strcmp(ProjObject.Type,'plane') 44 if ~isempty(hplot) && ishandle(hplot) && ~strcmp(get(hplot,'Type'),'axes') 45 ObjectPlotData=get(hplot,'UserData'); 46 if isfield(ObjectPlotData,'SubObject') & ishandle(ObjectPlotData.SubObject) 47 delete(ObjectPlotData.SubObject); 48 end 49 if isfield(ObjectPlotData,'DeformPoint') & ishandle(ObjectPlotData.DeformPoint) 50 delete(ObjectPlotData.DeformPoint); 51 end 52 delete(hplot) 53 end 54 return 58 55 end 59 56 XMin=0;%default … … 74 71 haxes=hplot; 75 72 currentfig=get(hplot,'parent'); 76 % set(0,'CurrentFigure',currentfig)77 78 % set(currentfig,'CurrentAxes',haxes);79 73 elseif isequal(get(hplot,'Type'),'figure')% hplot is the handle of a figure 80 74 set(0,'CurrentFigure',hplot);%set the input figure as the current one … … 82 76 haxes=haxes(1); 83 77 currentfig=hplot; 84 % set(hplot,'CurrentAxes',haxes);%set the first found axis as the current one85 78 else 86 79 currentfig=figure; %create new figure … … 103 96 ObjectData.Coord=[0 0 0];%default 104 97 end 105 % if ~isfield(ObjectData,'Phi')||isempty(ObjectData.Phi)106 % ObjectData.Phi=0;%default107 % end108 % if ~isfield(ObjectData,'Range')109 % ObjectData.Range(1,1)=0; %edfault110 % end111 % if size(ObjectData.Range,2)>=2112 % YMax=ObjectData.Range(1,2);%default113 % end114 % if size(ObjectData.Range,2)>=2 & size(ObjectData.Range,1)>=2115 % YMin=ObjectData.Range(2,2);116 % else117 % YMin=0;118 % end119 98 if isfield(ObjectData,'RangeX') && ~isempty(ObjectData.RangeX) 120 99 XMax=max(ObjectData.RangeX);
Note: See TracChangeset
for help on using the changeset viewer.