- Timestamp:
- May 22, 2012, 1:07:40 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r427 r429 23 23 24 24 function xy=mouse_down(hObject,eventdata) 25 26 25 AxeData=[];%default 27 26 FigData=get(hObject,'UserData'); … … 57 56 test_create=0; 58 57 hset_object=findobj(allchild(0),'tag','set_object'); 58 59 59 if ~isempty(hset_object) 60 60 hPLOT=findobj(hset_object,'tag','PLOT'); 61 test_create=strcmp(get(hPLOT,'enable'),'on') &&~test_edit; 62 end 63 % test_create=~isempty(hset_object)&&~test_edit; 61 test_create=strcmp(get(hPLOT,'enable'),'on') &&~test_edit;% create new object if set_object is in mode enable and uvmat not in mode 'edit_object' 62 end 64 63 65 64 test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration … … 304 303 end 305 304 306 %% create newprojection object307 if test_create && ~isempty(xy) && ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create'))305 %% create projection object 306 if test_create && ~isempty(xy) %&& ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create')) 308 307 hset_object=findobj(allchild(0),'tag','set_object'); 309 308 % activate this option if the GUI set_object is opened 310 309 if ~isempty(hset_object) 311 sethandles=guidata(hset_object);% handles of the elements in set_object310 sethandles=guidata(hset_object);% handles of the elements in the GUI set_object 312 311 ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object 313 ObjectData.Coord=[]; %reset previous object coordinates 314 ObjectData.Coord(1,1)=xy(1,1); % the object first coordinate is set by the mouse position 315 ObjectData.Coord(1,2)=xy(1,2); 316 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 317 ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle 318 end 312 IndexObj=length(UvData.Object); 313 %initiate a new object 314 if isempty(UvData.Object{IndexObj}); 315 ObjectData.Coord=[]; 316 ObjectNameNew=ObjectData.Name; 317 if isempty(ObjectNameNew) 318 ObjectNameNew=ObjectData.Type; 319 end 320 % add an index to the object name if the proposed name already exists 321 322 323 vers=0;% index of the name 324 ListObject=get(hhuvmat.ListObject,'String'); 325 detectname=1; 326 while ~isempty(detectname) 327 detectname=find(strcmp(ObjectNameNew,ListObject),1);%test the existence of the proposed name in the list 328 if detectname% if the object name already exists 329 indstr=regexp(ObjectNameNew,'\D'); 330 if indstr(end)<length(ObjectNameNew) %object name ends by a number 331 vers=str2double(ObjectNameNew(indstr(end)+1:end))+1; 332 ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)]; 333 else 334 vers=vers+1; 335 ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)]; 336 end 337 end 338 end 339 ObjectName=ObjectNameNew; 340 set(sethandles.Name,'String',ObjectName)% display the default name in set_object 341 ListObject{end}=ObjectName; 342 set(hhuvmat.ListObject,'String',ListObject);%complement the object list 343 set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list 344 set(hhuvmat.ListObject,'Value',IndexObj) 345 set(hhuvmat.ViewObject,'Value',1) 346 end 347 % ObjectData.Coord=[]; %reset previous object coordinates 348 % ObjectData.Coord(1,1)=xy(1,1); % the object first coordinate is set by the mouse position 349 % ObjectData.Coord(1,2)=xy(1,2); 350 % if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 351 % ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle 352 % end 353 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object 354 % if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 355 % xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ... 356 % else 357 % xy(1,3)=0; % z coordinate set to 0 by default 358 % end 359 % if ~isequal(ObjectData.Coord,xy(1,:)) 360 % ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object 361 % end 362 319 363 AxeData.CurrentObject=plot_object(ObjectData,[],haxes,'m');%draw the object and its handle becomes AxeData.CurrentObject 320 if isfield(UvData,'Object') 321 IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface 322 else 323 IndexObj=2;% the first object is used for uvmat display or blank 324 end 325 UvData.Object{IndexObj}=ObjectData; 326 ListObject=get(hhuvmat.ListObject,'String'); 327 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 328 ObjectNameNew=ObjectData.Name; 329 if isempty(ObjectNameNew) 330 ObjectNameNew=ObjectData.Type; 331 end 332 % add an index to the object name if the proposed name already exists 333 vers=0;% index of the name 334 detectname=1; 335 while ~isempty(detectname) 336 detectname=find(strcmp(ObjectNameNew,ListObject),1);%test the existence of the proposed name in the list 337 if detectname% if the object name already exists 338 indstr=regexp(ObjectNameNew,'\D'); 339 if indstr(end)<length(ObjectNameNew) %object name ends by a number 340 vers=str2double(ObjectNameNew(indstr(end)+1:end))+1; 341 ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)]; 342 else 343 vers=vers+1; 344 ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)]; 345 end 346 end 347 end 348 ObjectName=ObjectNameNew; 349 set(sethandles.Name,'String',ObjectName)% display the default name in set_object 350 set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list 351 set(hhuvmat.ListObject_1,'String',[ListObject;{ObjectName}]);%complement the object list 352 set(hhuvmat.ListObject,'Value',IndexObj) 353 set(hhuvmat.ViewObject,'Value',1) 364 % if isfield(UvData,'Object') 365 % IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface 366 % else 367 % IndexObj=2;% the first object is used for uvmat display or blank 368 % end 369 UvData.Object{IndexObj}=ObjectData; 370 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 354 371 UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject; 355 372 set(huvmat,'UserData',UvData) … … 358 375 set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion) 359 376 AxeData.Drawing='create';% flag for mouse motion 360 end 361 end 362 363 % create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected 377 %show object coordinates in the GUI set_object 378 h_set_object=findobj(allchild(0),'Tag','set_object'); 379 hh_set_object=guidata(h_set_object); 380 set(hh_set_object.Coord,'Data',ObjectData.Coord); 381 end 382 end 383 384 %% create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected 364 385 if ~test_zoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3') 365 386 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI … … 426 447 end 427 448 428 % edit vectors449 %% edit vectors 429 450 if test_edit_vect && ~isempty(ivec) 430 451 %create the error flag FF if it does not exist … … 445 466 eval(['FigData.' tagaxes '=Field;'])%record the modified field in FigData 446 467 set(hcurrentfig,'UserData',FigData); 447 end 468 end 448 469 set(haxes,'UserData',AxeData); 449 470 -
trunk/src/mouse_up.m
r425 r429 60 60 IndexObj=PlotData.IndexObj; 61 61 ObjectData=UvData.Object{IndexObj}; 62 ObjectData.enable_plot=1; 63 62 % ObjectData.enable_plot=1; 63 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 64 NbDefPoint=1; 65 elseif strcmp(ObjectData.Type,'line')|| strcmp(ObjectData.Type,'plane'); 66 NbDefPoint=2; 67 else 68 NbDefPoint=3; 69 end 64 70 % ending translation 65 71 if isequal(AxeData.Drawing,'translate') … … 78 84 %creating object 79 85 else 80 if strcmp(ObjectData.Type,'line')||strcmp(ObjectData.Type,'polyline')||... 81 strcmp(ObjectData.Type,'polygon')||strcmp(ObjectData.Type,'points') 82 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 83 xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ... 84 else 85 xy(1,3)=0; % z coordinate set to 0 by default 86 end 87 if ~isequal(ObjectData.Coord,xy(1,:)) 88 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordiantes marked by the mouse to the eobject 89 end 90 elseif isequal(ObjectData.Type,'rectangle')||isequal(ObjectData.Type,'ellipse')||isequal(ObjectData.Type,'volume') 91 XYData=AxeData.CurrentOrigin; 92 ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate 93 ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2; 94 ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width 95 ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height 96 elseif isequal(ObjectData.Type,'plane') %case of 'plane' 97 DX=(xy(1,1)-ObjectData.Coord(1,1)); 98 DY=(xy(1,2)-ObjectData.Coord(1,2)); 99 ObjectData.Phi=(angle(DX+i*DY))*180/pi;%rectangle width 100 if isfield(ObjectData,'RangeX') 101 XMax=sqrt(DX*DX+DY*DY); 102 if XMax>max(ObjectData.RangeX) 103 ObjectData.RangeX=[min(ObjectData.RangeX) XMax]; 104 end 105 end 106 end 107 end 108 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 109 NbDefPoint=1; 110 elseif strcmp(ObjectData.Type,'line')|| strcmp(ObjectData.Type,'plane'); 111 NbDefPoint=2; 112 else 113 NbDefPoint=3; 86 switch ObjectData.Type 87 case {'line'} 88 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 89 xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ... 90 else 91 xy(1,3)=0; % z coordinate set to 0 by default 92 end 93 % if ~isequal(ObjectData.Coord,xy(1,:)) 94 if ~isequal(ObjectData.Coord(end,1:2),xy(1,1:2)) 95 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the second point of the line if different from the first one 96 end 97 % end 98 case {'rectangle','ellipse','volume'} 99 XYData=AxeData.CurrentOrigin; 100 ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate 101 ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2; 102 ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width 103 ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height 104 case 'plane' %case of 'plane' 105 DX=(xy(1,1)-ObjectData.Coord(1,1)); 106 DY=(xy(1,2)-ObjectData.Coord(1,2)); 107 ObjectData.Phi=(angle(DX+i*DY))*180/pi;%rectangle width 108 if isfield(ObjectData,'RangeX') 109 XMax=sqrt(DX*DX+DY*DY); 110 if XMax>max(ObjectData.RangeX) 111 ObjectData.RangeX=[min(ObjectData.RangeX) XMax]; 112 end 113 end 114 end 114 115 end 115 116 … … 118 119 hh_set_object=guidata(h_set_object); 119 120 set(hh_set_object.Coord,'Data',ObjectData.Coord); 120 % set(hh_set_object.XObject,'String',num2str(ObjectData.Coord(:,1),4));121 % set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4));122 % set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4));123 121 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 124 122 set(hh_set_object.num_RangeX_2,'String',num2str(ObjectData.RangeX,4)); … … 128 126 strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing 129 127 AxeData.CurrentOrigin=[]; %suppress the current origin 130 if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1) <=1128 if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)>=2 131 129 AxeData.Drawing='off'; 132 130 set(currentaxes,'UserData',AxeData); 133 return % line needs at leqst two points131 % return % line needs at leqst two points 134 132 end 135 133 if ~isempty(ObjectData) … … 153 151 if ~isempty(ProjData) 154 152 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen in view_field 155 hview_field=findobj(allchild(0),'tag','view_field');153 hview_field=findobj(allchild(0),'tag','view_field'); 156 154 if isempty(hview_field) 157 hview_field=view_field(ProjData); 155 hview_field=view_field(ProjData); %open the view_field GUI for plot 158 156 else 159 hhview_field=guidata(hview_field);160 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot157 hhview_field=guidata(hview_field); 158 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing plot in view_field 161 159 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 162 160 end 163 161 ViewFieldData=get(hview_field,'UserData'); 164 ViewFieldData.axes3=ProjData; 165 set(hview_field,'UserData',ViewFieldData) 166 162 % ViewFieldData.axes3=ProjData; 163 haxes=findobj(hview_field,'tag','axes3'); 164 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 165 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 166 pos_table=get(h_TableDisplay,'Position'); 167 pos=get(hview_field,'Position'); 168 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 169 drawnow 170 set(hview_field,'UserData',ViewFieldData);% restore the previously stored GUI position after GUI resizing 171 else 172 set(hview_field,'Position',ViewFieldData.GUISize) 173 end 174 175 % Data=get(hview_field,'UserData'); 176 % if isempty(hview_field) 177 % hview_field=view_field(ProjData); 178 % else 179 % hhview_field=guidata(hview_field); 180 % [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot 181 % write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 182 % end 183 % ViewFieldData=get(hview_field,'UserData'); 184 % ViewFieldData.axes3=ProjData; 185 % set(hview_field,'UserData',ViewFieldData) 167 186 else 168 187 UvData.axes3=ProjData; -
trunk/src/plot_field.m
r428 r429 48 48 % .CheckFixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits 49 49 % .Coordinates.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales. 50 % .Coordinates.AspectRatio: imposed aspect ratio y/x of axis unit plots 50 51 % --scalars-- 51 52 % .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default … … 143 144 end 144 145 145 %% pure text display 146 if isempty(index_2D) && isempty(index_1D)% no plot 147 hfig=findobj(allchild(0),'Tag','fig_text_display'); 148 if isempty(hfig) 149 hfig=figure('name','text_display','Tag','fig_text_display'); 150 end 146 %% test axes and figure 147 testnewfig=1;%test to create a new figure (default) 148 testzoomaxes=0;%test for the existence of a zoom secondary figure attached to the plotting axes 149 if exist('haxes','var') 150 if ishandle(haxes) 151 if isequal(get(haxes,'Type'),'axes') 152 testnewfig=0; 153 AxeData=get(haxes,'UserData'); 154 if isfield(AxeData,'ZoomAxes')&& ishandle(AxeData.ZoomAxes) 155 if isequal(get(AxeData.ZoomAxes,'Type'),'axes') 156 testzoomaxes=1; 157 zoomaxes=AxeData.ZoomAxes; 158 end 159 end 160 end 161 end 162 end 163 164 %% create a new figure and axes if the plotting axes does not exist 165 if testnewfig 166 hfig=figure; 167 set(hfig,'Units','normalized') 168 haxes=axes; 169 set(haxes,'position',[0.13,0.2,0.775,0.73]) 170 PlotParam.NextPlot='add'; %parameter for plot_profile and plot_his 171 else 172 hfig=get(haxes,'parent'); 173 set(0,'CurrentFigure',hfig)% the parent of haxes becomes the current figure 174 set(hfig,'CurrentAxes',haxes)% haxes becomes the current axes of the parent figure 175 end 176 177 %% set axes properties 178 if isfield(PlotParam.Coordinates,'CheckFixLimits') && isequal(PlotParam.Coordinates.CheckFixLimits,1) %adjust the graph limits 179 set(haxes,'XLimMode', 'manual') 180 set(haxes,'YLimMode', 'manual') 181 else 182 set(haxes,'XLimMode', 'auto') 183 set(haxes,'YLimMode', 'auto') 184 end 185 % if ~isfield(PlotParam.Coordinates,'CheckFixAspectRatio')&& isfield(Data,'CoordUnit') 186 % PlotParam.Coordinates.CheckFixAspectRatio=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default 187 % end 188 errormsg=''; 189 PlotParamOut.Coordinates=[]; %default output 190 AxeData=get(haxes,'UserData'); 191 192 %% 2D plots 193 if isempty(index_2D) 194 plot_plane([],[],[],haxes);%removes images or vector plots in the absence of 2D field plot 195 else %plot 2D field 196 [tild,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex(index_2D),VarType(index_2D),haxes,PlotParam,PosColorbar); 197 AxeData.NbDim=2; 198 if testzoomaxes && isempty(errormsg) 199 [zoomaxes,PlotParamOut,tild,errormsg]=plot_plane(Data,CellVarIndex(index_2D),VarType(index_2D),zoomaxes,PlotParam,PosColorbar); 200 AxeData.ZoomAxes=zoomaxes; 201 end 202 end 203 204 %% 1D plot (usual graph y vs x) 205 if isempty(index_1D) 206 if ~isempty(haxes) 207 plot_profile([],[],[],haxes);%removes usual praphs y vs x in the absence of 1D field plot 208 end 209 else %plot 1D field (usual graph y vs x) 210 Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam.Coordinates);% 211 if testzoomaxes 212 [zoomaxes,Coordinates]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam.Coordinates); 213 AxeData.ZoomAxes=zoomaxes; 214 end 215 if ~isempty(Coordinates) 216 PlotParamOut.Coordinates=Coordinates; 217 end 218 PlotType='line'; 219 end 220 221 %% text display 222 if isempty(index_2D) && isempty(index_1D)%text display alone 223 htext=findobj(hfig,'Tag','TableDisplay'); 224 else %text display added to plot 151 225 htext=findobj(hfig,'Tag','text_display'); 152 if isempty(htext) 153 htext=uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.09 0.9 0.71],'Tag','text_display'); 154 end 226 end 227 if ~isempty(htext) 155 228 if isempty(index_0D) 156 229 set(htext,'String',{''}) … … 158 231 [errormsg]=plot_text(Data,CellVarIndex(index_0D),VarType(index_0D),htext); 159 232 end 160 haxes=[];161 end162 163 %% test axes and figure164 if ~isempty(index_2D)|| ~isempty(index_1D)% plot165 testnewfig=1;%test to create a new figure (default)166 testzoomaxes=0;%test for the existence of a zoom secondary figure attached to the plotting axes167 if exist('haxes','var')168 if ishandle(haxes)169 if isequal(get(haxes,'Type'),'axes')170 testnewfig=0;171 AxeData=get(haxes,'UserData');172 if isfield(AxeData,'ZoomAxes')&& ishandle(AxeData.ZoomAxes)173 if isequal(get(AxeData.ZoomAxes,'Type'),'axes')174 testzoomaxes=1;175 zoomaxes=AxeData.ZoomAxes;176 end177 end178 end179 end180 end181 % create a new figure and axes if the plotting axes does not exist182 if testnewfig183 hfig=figure;184 set(hfig,'Units','normalized')185 haxes=axes;186 set(haxes,'position',[0.13,0.2,0.775,0.73])187 PlotParam.NextPlot='add'; %parameter for plot_profile and plot_his188 else189 hfig=get(haxes,'parent');190 set(0,'CurrentFigure',hfig)% the parent of haxes becomes the current figure191 set(hfig,'CurrentAxes',haxes)% haxes becomes the current axes of the parent figure192 end193 194 %% set axes properties195 if isfield(PlotParam.Coordinates,'CheckFixLimits') && isequal(PlotParam.Coordinates.CheckFixLimits,1) %adjust the graph limits196 set(haxes,'XLimMode', 'manual')197 set(haxes,'YLimMode', 'manual')198 else199 set(haxes,'XLimMode', 'auto')200 set(haxes,'YLimMode', 'auto')201 end202 if ~isfield(PlotParam.Coordinates,'CheckFixAspectRatio')&& isfield(Data,'CoordUnit')203 PlotParam.Coordinates.CheckFixAspectRatio=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default204 end205 % if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)206 % set(haxes,'DataAspectRatioMode','manual')207 % set(haxes,'DataAspectRatio',[1 1 1])208 % else209 % set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio210 % end211 errormsg='';212 213 %% plot if the input field is valid214 AxeData=get(haxes,'UserData');215 if isempty(index_2D)216 plot_plane([],[],[],haxes);%removes images or vector plots if any217 else %plot 2D field218 [tild,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex(index_2D),VarType(index_2D),haxes,PlotParam,PosColorbar);219 AxeData.NbDim=2;220 if testzoomaxes && isempty(errormsg)221 [zoomaxes,PlotParamOut,tild,errormsg]=plot_plane(Data,CellVarIndex(index_2D),VarType(index_2D),zoomaxes,PlotParam,PosColorbar);222 AxeData.ZoomAxes=zoomaxes;223 end224 end225 if isempty(index_1D)226 if ~isempty(haxes)227 plot_profile([],[],[],haxes);%228 end229 else %plot 1D field (usual graph y vs x)230 Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam.Coordinates);%231 if testzoomaxes232 [zoomaxes,Coordinates]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam.Coordinates);233 AxeData.ZoomAxes=zoomaxes;234 end235 if ~isempty(Coordinates)236 PlotParamOut.Coordinates=Coordinates;237 end238 PlotType='line';239 end240 % text display241 htext=findobj(hfig,'Tag','text_display');242 if ~isempty(htext)243 if isempty(index_0D)244 set(htext,'String',{''})245 else246 [errormsg]=plot_text(Data,CellVarIndex(index_0D),VarType(index_0D),htext);247 end248 end249 233 end 250 234 … … 255 239 256 240 %% update the parameters stored in AxeData 257 if ishandle(haxes) 241 if ishandle(haxes)&&( ~isempty(index_2D)|| ~isempty(index_1D)) 242 % AxeData=[]; 258 243 if isfield(PlotParamOut,'MinX') 259 244 AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX];%'[PlotParamOut.MinX PlotParamOut.MaxX]; … … 264 249 265 250 %% update the plotted field stored in parent figure 266 267 FigData=get(hfig,'UserData'); 268 if strcmp(get(hfig,'tag'),'view_field') 269 set(hfig,'UserData',[]); % refresh user data in view_field (set by civ/TestCiv ) 270 end 271 tagaxes=get(haxes,'tag');% tag of the current plot axis 272 if isfield(FigData,tagaxes) 273 FigData.(tagaxes)=Data; 274 set(hfig,'UserData',FigData) 251 if ~isempty(index_2D)|| ~isempty(index_1D) 252 FigData=get(hfig,'UserData'); 253 % if strcmp(get(hfig,'tag'),'view_field') 254 % set(hfig,'UserData',[]); % refresh user data in view_field (set by civ/TestCiv ) 255 % end 256 tagaxes=get(haxes,'tag');% tag of the current plot axis 257 if isfield(FigData,tagaxes) 258 FigData.(tagaxes)=Data; 259 set(hfig,'UserData',FigData) 260 end 275 261 end 276 262 … … 280 266 errormsg=[]; 281 267 txt_cell={}; 268 Data={}; 282 269 for icell=1:length(CellVarIndex) 283 270 VarIndex=CellVarIndex{icell};% indices of the selected variables in the list data.ListVarName … … 294 281 VarName=FieldData.ListVarName{VarIndex(ivar)}; 295 282 VarValue=FieldData.(VarName); 283 Data =[Data [{VarName}; num2cell(VarValue)]]; 296 284 if size(VarValue,1)~=1 297 VarValue=VarValue'; 285 VarValue=VarValue';% put the different values on a line 298 286 end 299 287 if size(VarValue,1)==1 … … 304 292 end 305 293 end 306 set(htext,'String',txt_cell) 307 set(htext,'UserData',txt_cell)% for storage during mouse display 294 if strcmp(get(htext,'Type'),'uitable') 295 get(htext,'ColumnName') 296 set(htext,'ColumnName',Data(1,:)) 297 set(htext,'Data',Data(2:end,:)) 298 else 299 set(htext,'String',txt_cell) 300 set(htext,'UserData',txt_cell)% for storage during mouse display 301 end 302 308 303 309 304 %------------------------------------------------------------------- … … 499 494 500 495 %% determine plot aspect ratio 501 if is equal(Coordinates.CheckFixAspectRatio,1)&&isfield(Coordinates,'AspectRatio')496 if isfield(Coordinates,'CheckFixAspectRatio') && isequal(Coordinates.CheckFixAspectRatio,1)&&isfield(Coordinates,'AspectRatio') 502 497 set(haxes,'DataAspectRatioMode','manual') 503 498 set(haxes,'DataAspectRatio',[Coordinates.AspectRatio 1 1]) 504 499 else 505 500 set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio 506 AspectRatio=get(haxes,'DataAspectRatio') 501 AspectRatio=get(haxes,'DataAspectRatio'); 507 502 CoordinatesOut.AspectRatio=AspectRatio(1)/AspectRatio(2); 508 503 end … … 824 819 set(haxes,'DataAspectRatioMode','manual') 825 820 if isfield(PlotParam.Coordinates,'AspectRatio') 826 set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio PlotParam.Coordinates.AspectRatio PlotParam.Coordinates.AspectRatio])821 set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio 1 1]) 827 822 else 828 823 set(haxes,'DataAspectRatio',[1 1 1]) … … 887 882 % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFixAspectRatio is 888 883 % requested: 889 if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)890 set(haxes,'DataAspectRatioMode','manual')891 set(haxes,'DataAspectRatio',[1 1 1])892 end893 884 set(hima,'Tag','ima') 894 885 set(hima,'HitTest','off') … … 906 897 set(hima,'YData',AY); 907 898 end 899 908 900 % set the transparency to 0.5 if vectors are also plotted 909 901 if isfield(PlotParam.Scalar,'Opacity')&& ~isempty(PlotParam.Scalar.Opacity) … … 1129 1121 PlotParamOut.Coordinates.y_units=y_units; 1130 1122 end 1123 if isfield(PlotParam,'Coordinates') && isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1) 1124 set(haxes,'DataAspectRatioMode','manual') 1125 if isfield(PlotParam.Coordinates,'AspectRatio') 1126 set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio 1 1]) 1127 end 1128 else 1129 set(haxes,'DataAspectRatioMode','auto') 1130 end 1131 1131 %------------------------------------------------------------------- 1132 1132 % --- function for plotting vectors -
trunk/src/set_object.m
r427 r429 501 501 end 502 502 if numel(IndexObj)==1 % if only one object is selected, the projection is in uvmat 503 % plotaxes=hhuvmat.axes3;%handle of axes3 in view_field504 503 PlotType=plot_field(ProjData,hhuvmat.axes3,read_GUI(get(hhuvmat.axes3,'parent')));%update the current uvmat plot 505 504 else % if a second object is selected, the projection is in view_field, and this second object is selected 506 505 hview_field=findobj(allchild(0),'tag','view_field'); 507 506 if isempty(hview_field) 508 PlotType=view_field(ProjData); %open the view_field GUI for plot 509 % hview_field=view_field;%open the GUI view_field if it is not found 507 hview_field=view_field(ProjData); %open the view_field GUI for plot 510 508 else 511 509 hhview_field=guidata(hview_field); … … 513 511 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 514 512 end 515 % PlotHandles=guidata(hview_field); 516 % plotaxes=PlotHandles.axes3;%handle of axes3 in view_field 517 end 518 % fighandle=get(plotaxes,'parent'); 519 % PlotParam=read_GUI(fighandle); 520 % PlotType=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot 521 end 522 if strcmp(PlotType,'text') 523 hview_field=findobj(allchild(0),'tag','view_field'); %case of no projection (pure object display) 524 if ~isempty(hview_field) 525 delete(hview_field) 526 end 527 end 528 513 haxes=findobj(hview_field,'tag','axes3'); 514 Data=get(hview_field,'UserData'); 515 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 516 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 517 pos_table=get(h_TableDisplay,'Position'); 518 pos=get(hview_field,'Position'); 519 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 520 drawnow 521 set(hview_field,'UserData',Data);% restore the previously stored GUI position after GUI resizing 522 else 523 set(hview_field,'Position',Data.GUISize) 524 end 525 end 526 end 527 529 528 %% update the GUI uvmat 530 529 hhuvmat=guidata(huvmat);%handles of elements in the uvmat GUI -
trunk/src/uvmat.m
r428 r429 239 239 UvData.Object{1}.ProjMode='projection';%main plotting plane 240 240 set(handles.ListObject,'Value',1)% default: empty projection objectproj_field 241 set(handles.ListObject,'String',{'plane _0'})241 set(handles.ListObject,'String',{'plane'}) 242 242 set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field 243 set(handles.ListObject_1,'String',{'plane _0'})243 set(handles.ListObject_1,'String',{'plane'}) 244 244 set(handles.Fields,'Value',1) 245 245 set(handles.Fields,'string',{''}) … … 3546 3546 3547 3547 %------------------------------------------------------------------ 3548 3549 3550 3551 3548 %------------------------------------------------------------- 3552 3549 % --- Executes on selection change in transform_fct. … … 3600 3597 end 3601 3598 3602 % check the current path to the selected function3599 %% check the current path to the selected function 3603 3600 if isa(list_transform{ind_coord},'function_handle') 3604 3601 func=functions(list_transform{ind_coord}); … … 3611 3608 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 3612 3609 3613 % delete drawn objects3610 %% delete drawn objects 3614 3611 hother=findobj('Tag','proj_object');%find all the proj objects 3615 3612 for iobj=1:length(hother) … … 3632 3629 end 3633 3630 set(handles.ListObject,'Value',1) 3634 set(handles.ListObject,'String',{''}) 3631 set(handles.ListObject,'String',{'plane'}) 3632 set(handles.ListObject_1,'Value',1) 3633 set(handles.ListObject_1,'String',{'plane'}) 3635 3634 3636 3635 %delete mask if it is displayed … … 4031 4030 set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised 4032 4031 end 4033 % desactivate the edit object mode 4032 4033 %% desactivate the edit object mode 4034 4034 set(handles.edit_object,'Value',0) 4035 4035 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4036 4036 4037 %% update the second plot (on view_field) if view_field is already openened 4038 axes_view_field=[];%default 4039 if length(IndexObj)==2 && (length(IndexObj_old)==1 || ~isequal(IndexObj(2),IndexObj_old(2))) 4040 hview_field=findobj(allchild(0),'tag','view_field'); 4041 if ~isempty(hview_field) 4042 PlotHandles=guidata(hview_field); 4043 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4044 axes_view_field=PlotHandles.axes3; 4045 plot_field(ProjData,axes_view_field,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles); 4037 %% update the plot on view_field if view_field is already openened 4038 hview_field=findobj(allchild(0),'tag','view_field'); 4039 if isempty(hview_field) 4040 hhview_field.axes3=[]; 4041 else 4042 Data=get(hview_field,'UserData'); 4043 hhview_field=guidata(hview_field); 4044 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4045 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfachhview_fiel 4046 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 4047 haxes=findobj(hview_field,'tag','axes3'); 4048 pos=get(hview_field,'Position'); 4049 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 4050 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4051 pos_table=get(h_TableDisplay,'Position'); 4052 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 4053 drawnow% needed to change position before the next command 4054 set(hview_field,'UserData',Data);% restore the previously stored GUI position after GUI resizing 4055 else 4056 set(hview_field,'Position',Data.GUISize)% return to the previously stored GUI position and size 4046 4057 end 4047 4058 end 4048 4059 4049 4060 %% update the color of the graphic object representation: the selected object in magenta, others in blue 4050 update_object_color(handles.axes3,axes_view_field,UvData.Object{IndexObj(end)}.DisplayHandle_uvmat) 4061 update_object_color(handles.axes3,hhview_field.axes3,UvData.Object{IndexObj(end)}.DisplayHandle_uvmat) 4062 hview_field=findobj(allchild(0),'tag','view_field'); 4051 4063 4052 4064 %------------------------------------------------------------------------ … … 4228 4240 UvData.Object{IndexObj(end)}.Name=list_object{IndexObj(end)}; 4229 4241 4230 %% show the second plot (on view_field)4231 4242 %% show the projection of the selected object on view_field 4243 ProjData= proj_field(UvData.Field,UvData.Object{IndexObj});%project the current field on ObjectData 4232 4244 hview_field=findobj(allchild(0),'tag','view_field'); 4233 4245 if isempty(hview_field) 4234 4246 hview_field=view_field; 4235 4247 end 4236 PlotHandles=guidata(hview_field); 4237 plot_field(ProjData,PlotHandles.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles); 4248 hhview_field=guidata(hview_field); 4249 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the GUI view_field); 4250 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 4251 haxes=findobj(hview_field,'tag','axes3'); 4252 pos=get(hview_field,'Position'); 4253 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 4254 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4255 pos_table=get(h_TableDisplay,'Position'); 4256 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 4257 else 4258 Data=get(hview_field,'UserData'); 4259 set(hview_field,'Position',Data.GUISize) 4260 end 4238 4261 else 4239 4262 hview_field=findobj(allchild(0),'tag','view_field'); … … 4481 4504 set(handles.edit_object,'Value',0); %suppress the object edit mode 4482 4505 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4506 ListObject=get(handles.ListObject,'String'); 4507 if ~strcmp(ListObject{end},'') 4508 ListObject=[ListObject;{''}]; %append a blank to the list (if nort already done) to indicate the creation of a new object 4509 set(handles.ListObject,'String',ListObject) 4510 end 4511 IndexObj=length(ListObject); 4512 set(handles.ListObject,'Value',IndexObj) 4483 4513 UvData=get(handles.uvmat,'UserData'); 4514 UvData.Object{IndexObj}=[]; %create a new empty object 4484 4515 data.Name=data.Type;% default name=type 4485 4516 data.Coord=[0 0]; %default … … 4506 4537 delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered 4507 4538 end 4508 4509 %set(handles.ViewField,'Value',1) % indicate that the object selected in ListObject (projection oin view_field) is visualised4510 %set(handles.ViewObject,'Value',1)% then the object selected in ListObject_1 is not visualised4511 4539 hset_object=set_object(data,handles);% call the set_object interface 4512 4540 hhset_object=guidata(hset_object); 4513 4541 hchild=get(hset_object,'children'); 4514 4542 set(hchild,'enable','on') 4515 %set(hhset_object.PLOT,'enable','on')% activate the refresh button4516 %set(handles.MenuObject,'checked','on')4517 4543 set(handles.uvmat,'UserData',UvData) 4518 4544 set(handles.CheckZoom,'Value',0) %desactivate the zoom for object creation by the mouse 4519 4545 CheckZoom_Callback(handles.uvmat, [], handles) 4520 4546 set(handles.delete_object,'Visible','on') 4521 4522 4547 4523 4548 %------------------------------------------------------------------------ … … 4536 4561 %read the file 4537 4562 data=xml2struct(fileinput); 4538 % data.enable_plot=1; 4563 4539 4564 [tild,data.Name]=fileparts(FileName);% object name set as file name 4540 % hset_object=findobj(allchild(0),'tag','set_object'); 4541 % if ~isempty(hset_object) 4542 % delete(hset_object)% delete existing version of set_object 4543 % end 4565 ListObject=get(handles.ListObject,'String'); 4566 if ~strcmp(ListObject{end},'') 4567 ListObject=[ListObject;{''}]; %append a blank to the list (if not already done) to indicate the creation of a new object 4568 set(handles.ListObject,'String',ListObject) 4569 end 4570 set(handles.ListObject,'Value',length(ListObject)) 4544 4571 hset_object=set_object(data);% call the set_object interface 4545 4572 set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object -
trunk/src/view_field.m
r428 r429 88 88 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles_mouse}) 89 89 set(hObject,'DeleteFcn',{@closefcn})% 90 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% 90 91 ViewFieldData.axes3=[];%initiates the record of the current field (will be updated by plot_field) 91 set(handles.view_field,'UserData',ViewFieldData);%store the current field 92 set(handles.view_field,'Units','pixels') 93 ViewFieldData.GUISize=get(handles.view_field,'Position'); 94 set(handles.view_field,'UserData',ViewFieldData);%store the initial fig size in UserData 92 95 AxeData.LimEditBox=1; %initialise AxeData, the parent figure sets plot parameters 93 96 set(handles.axes3,'UserData',AxeData) … … 100 103 write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters 101 104 end 105 106 %------------------------------------------------------------------------ 107 %--- activated when resizing the GUI view_field 108 function ResizeFcn(gcbo,eventdata,handles) 109 %------------------------------------------------------------------------ 110 set(handles.view_field,'Units','pixels') 111 size_fig=get(handles.view_field,'Position'); 112 Data=get(handles.view_field,'UserData'); 113 Data.GUISize=size_fig; 114 set(handles.view_field,'UserData',Data) 115 116 %% reset position of text_display or TableDisplay 117 if strcmp(get(handles.TableDisplay,'Visible'),'off') 118 pos_1=get(handles.text_display,'Position'); 119 pos_1(1)=size_fig(3)-pos_1(3); 120 pos_1(2)=size_fig(4)-pos_1(4); 121 set(handles.text_display,'Position',pos_1) 122 % reset position of TableDisplay 123 else 124 pos_1=get(handles.TableDisplay,'Position'); 125 pos_1(1)=size_fig(3)-pos_1(3); 126 pos_1(2)=size_fig(4)-pos_1(4); 127 set(handles.TableDisplay,'Position',pos_1) 128 end 129 130 %% reset position of Coordinates 131 pos_2=get(handles.Coordinates,'Position'); 132 pos_2(1)=size_fig(3)-pos_1(3); 133 pos_2(2)=pos_1(2)-pos_2(4); 134 set(handles.Coordinates,'Position',pos_2) 135 136 %% reset position of Scalar 137 pos_3=get(handles.Scalar,'Position'); 138 pos_3(1)=size_fig(3)-pos_3(3); 139 if strcmp(get(handles.Scalar,'visible'),'on') 140 pos_3(2)=pos_2(2)-pos_3(4); 141 else 142 pos_3(2)=pos_2(2); 143 end 144 set(handles.Scalar,'Position',pos_3) 145 146 %% reset position of Vectors 147 pos_4=get(handles.Vectors,'Position'); 148 pos_4(1)=size_fig(3)-pos_4(3); 149 if strcmp(get(handles.Vectors,'visible'),'on') 150 pos_4(2)=pos_3(2)-pos_4(4); 151 else 152 pos_4(2)=pos_3(2); 153 end 154 set(handles.Vectors,'Position',pos_4) 155 156 %% reset position and scale of axis 157 bord=[50 40 30 60]; %bordure left,inf, right,sup 158 pos(1)=bord(1); 159 pos(2)=bord(2); 160 pos(3)=max(1,pos_1(1)-pos(1)-bord(3)); 161 pos(4)=max(1,size_fig(4)-bord(4)); 162 set(handles.axes3,'Position',pos) 163 164 %------------------------------------------------------------------------ 102 165 %------------------------------------------------------------------------ 103 166 % --- Outputs from this function are returned to the command menuline. … … 105 168 %------------------------------------------------------------------------ 106 169 varargout{1} = handles.output;% the only output argument is the handle to the GUI figure 170 varargout{2} = strcmp(get(handles.axes3,'Visible'),'on');% check active plot axis 107 171 108 172 %------------------------------------------------------------------------ … … 271 335 runpm(hObject,eventdata,handles,increment) 272 336 273 %------------------------------------------------------------------- 274 %Executes on button press in runmin: make one step backward and call 275 %run0. The step backward is along the fields series 1 or 2 depending on 276 %the scan_i and scan_j check box (exclusive each other) 277 %------------------------------------------------------------------- 278 function RunMovie_Callback(hObject, eventdata, handles) 279 %------------------------------------------------------------------ 280 set(handles.RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow 281 drawnow 282 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d 283 set(handles.STOP,'Visible','on') 284 set(handles.speed,'Visible','on') 285 set(handles.speed_txt,'Visible','on') 286 set(handles.RunMovie,'BusyAction','queue') 287 testavi=0; 288 UvData=get(handles.view_field,'UserData'); 289 290 while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command 291 runpm(hObject,eventdata,handles,increment) 292 pause(1.02-get(handles.speed,'Value'))% wait for next image 293 end 294 if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 295 UvData.aviobj=close(UvData.aviobj); 296 set(handles.view_field,'UserData',UvData); 297 end 298 set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 299 337 % %------------------------------------------------------------------- 338 % %Executes on button press in runmin: make one step backward and call 339 % %run0. The step backward is along the fields series 1 or 2 depending on 340 % %the scan_i and scan_j check box (exclusive each other) 341 % %------------------------------------------------------------------- 342 % function RunMovie_Callback(hObject, eventdata, handles) 343 % %------------------------------------------------------------------ 344 % set(handles.RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow 345 % drawnow 346 % increment=str2num(get(handles.increment_scan,'String')); %get the field increment d 347 % set(handles.STOP,'Visible','on') 348 % set(handles.speed,'Visible','on') 349 % set(handles.speed_txt,'Visible','on') 350 % set(handles.RunMovie,'BusyAction','queue') 351 % testavi=0; 352 % UvData=get(handles.view_field,'UserData'); 353 % 354 % while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command 355 % runpm(hObject,eventdata,handles,increment) 356 % pause(1.02-get(handles.speed,'Value'))% wait for next image 357 % end 358 % if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 359 % UvData.aviobj=close(UvData.aviobj); 360 % set(handles.view_field,'UserData',UvData); 361 % end 362 % set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 300 363 301 364 -
trunk/src/write_plot_param.m
r428 r429 1 %'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation1 %'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation 2 2 function write_plot_param(handles,PlotParam) 3 3 %% coordinates 4 if isfield(PlotParam,'Coordinates') 4 if isempty(PlotParam.Coordinates) 5 set(handles.Coordinates,'Visible','off') 6 set(handles.axes3,'Visible','off') 7 set(handles.text_display,'Visible','off') 8 set(handles.TableDisplay,'Visible','on') 9 else 10 set(handles.Coordinates,'Visible','on') 11 set(handles.axes3,'Visible','on') 12 set(handles.text_display,'Visible','on') 13 if isfield(handles,'TableDisplay') 14 set(handles.TableDisplay,'Visible','off') 15 end 5 16 Coordinates=PlotParam.Coordinates; 6 17 if isfield(Coordinates,'CheckFixAspectRatio') … … 15 26 if isfield(Coordinates,'AspectRatio') 16 27 set(handles.num_AspectRatio,'String',num2str(Coordinates.AspectRatio)) 17 end 28 end 18 29 if isfield(Coordinates,'MinX') 19 30 set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
Note: See TracChangeset
for help on using the changeset viewer.