Changeset 156 for trunk/src/plot_object.m
- Timestamp:
- Dec 19, 2010, 10:11:04 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_object.m
r38 r156 37 37 38 38 function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col) 39 %% default output 39 40 hh=[];%default output 40 41 if isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot … … 48 49 return % no object representation yet available 49 50 end 50 if ~isfield(ObjectData,'Style')| isempty(ObjectData.Style)|~ischar(ObjectData.Style)51 if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style) 51 52 msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m') 52 53 return 53 54 end 54 if ~isfield(ObjectData,'Style')| isempty(ObjectData.Style)|~ischar(ObjectData.Style)55 if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style) 55 56 msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m') 56 57 return … … 63 64 ZMax=0; 64 65 65 % determine the plotting axes (with handle 'haxes')66 %% determine the plotting axes (with handle 'haxes') 66 67 test_newobj=1; 67 68 if ishandle(hplot) 68 if isequal(get(hplot,'Tag'),'proj_object') 69 if isequal(get(hplot,'Tag'),'proj_object')% hplot is the handle of an object representation 69 70 test_newobj=0; 70 71 haxes=get(hplot,'parent'); 71 elseif isequal(get(hplot,'Type'),'axes') 72 axes(hplot) 72 elseif isequal(get(hplot,'Type'),'axes')% hplot is the handle of an axis 73 currentfig=get(hplot,'parent'); 74 set(0,'CurrentFigure',currentfig) 73 75 haxes=hplot; 74 elseif isequal(get(hplot,'Type'),'figure') 75 figure(hplot);%set the input figure as the current one 76 set(currentfig,'CurrentAxes',haxes); 77 elseif isequal(get(hplot,'Type'),'figure')% hplot is the handle of a figure 78 set(0,'CurrentFigure',hplot);%set the input figure as the current one 76 79 haxes=findobj(hplot,'Type','axes');%look for axes in the figure 77 80 haxes=haxes(1); 78 axes(haxes);%set the first found axis as the current one81 set(hplot,'CurrentAxes',haxes);%set the first found axis as the current one 79 82 else 80 83 figure; %create new figure … … 88 91 end 89 92 90 % default input parameters93 %% default input parameters 91 94 if ~isfield(ObjectData,'ProjMode')|isempty(ObjectData.ProjMode) 92 95 ObjectData.ProjMode='projection';%default … … 148 151 sizcoord=size(ObjectData.Coord); 149 152 150 % determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot153 %% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot 151 154 test_line= isequal(ObjectData.Style,'points')|isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|... 152 155 isequal(ObjectData.Style,'polygon')| isequal(ObjectData.Style,'plane')| isequal(ObjectData.Style,'volume'); … … 206 209 end 207 210 208 % shading image211 %% shading image 209 212 if test_patch 210 213 npMx=512; … … 267 270 268 271 PlotData=[];%default 269 % MODIFY AN EXISTING OBJECT PLOT272 %% MODIFY AN EXISTING OBJECT PLOT 270 273 if test_newobj==0; 271 274 hh=hplot; … … 326 329 end 327 330 328 % create the object331 %% create the object 329 332 if test_newobj 330 333 axes(haxes)
Note: See TracChangeset
for help on using the changeset viewer.