Changeset 627 for trunk/src/mouse_down.m
- Timestamp:
- May 3, 2013, 10:11:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r625 r627 118 118 if isfield(FigData,tagaxes) 119 119 Field=FigData.(tagaxes); 120 [CellVarIndex,NbDim,VarType]=find_field_cells(Field);%analyse the physical fields contained in Field 121 for icell=1:numel(CellVarIndex)%look for all physical fields 120 [CellInfo,NbDim,errormsg]=find_field_cells(Field);%analyse the physical fields contained in Field 121 if isempty(errormsg) 122 for icell=1:numel(CellInfo)%look for all physical fields 122 123 if NbDim(icell)==2 % select 2D field 123 if isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data 124 X=Field.(Field.ListVarName{VarType{icell}.coord_x}); 125 Y=Field.(Field.ListVarName{VarType{icell}.coord_y}); 124 if isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&... 125 ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data 126 X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x}); 127 Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y}); 126 128 flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse 127 129 (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f … … 129 131 end 130 132 end 133 end 131 134 end 132 135 end … … 173 176 end 174 177 175 %% delete the current zoom rectangle176 % if isfield(AxeData,'CurrentRectZoom') && ~isempty(AxeData.CurrentRectZoom) && ishandle(AxeData.CurrentRectZoom)177 % delete(AxeData.CurrentRectZoom)178 % AxeData.CurrentRectZoom=[];179 % end180 181 178 %% zoom has first priority, stop here 182 179 if CheckZoom 183 180 return 181 end 182 183 %% Creation of a display window zoom of text_display 184 if isequal(get(hObject,'SelectionType'),'alt') && strcmp(htype,'axes') && ~test_edit && ~test_create 185 set(0,'Unit','pixels') 186 GUISize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 187 Width=300;% fig width in points (1/72 inch) 188 Height=200; 189 Left=GUI_pos(1)+GUI_pos(3)-Width; %right edge close to the right, with margin=40 190 Bottom=GUI_pos(2)+GUI_pos(4)-Height; %put fig at top right 191 hfig_text=figure('Name','text_display','MenuBar','none','NumberTitle','off','Position',[Left,Bottom,Width,Height]); 192 AxeData.htext_display=uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.05 0.9 0.9],'Max',2,'BackgroundColor',[1 1 1],... 193 'FontUnits','points','FontSize',14); 194 set(hchild,'UserData',AxeData); 195 return %leave the function once a uicontrol has been selected 184 196 end 185 197 … … 380 392 set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion) 381 393 AxeData.Drawing='create';% flag for mouse motion 382 383 384 %initiate a new object (no data .Coord yet recorded) 385 %if ~isfield(UvData.ProjObject{IndexObj},'Coord'); 386 % ObjectData.Coord=[]; 387 388 % if isempty(ListObject) 389 % ListObject={ObjectName}; 390 % else 391 % ListObject{end}=ObjectName; 392 % end 393 % UvData.ProjObject{IndexObj}=[]; %create a new empty object 394 % UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; % axes for plot_object 395 % UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 396 397 % PlotData=get(AxeData.CurrentObject,'UserData'); 398 % PlotData.IndexObj=IndexObj; 399 % set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion) 400 % AxeData.Drawing='create';% flag for mouse motion 394 401 395 %show object coordinates in the GUI set_object 402 396 h_set_object=findobj(allchild(0),'Tag','set_object'); … … 475 469 if ~isfield(Field,'FF') 476 470 Field.ListVarName=[Field.ListVarName 'FF']; 477 Field.VarDimName=[Field.VarDimName Field.VarDimName{ VarType{icell}.coord_x}];471 Field.VarDimName=[Field.VarDimName Field.VarDimName{CellInfo{icell}.VarIndex_coord_x}]; 478 472 nbvar=length(Field.ListVarName); 479 473 Field.VarAttribute{nbvar}.Role='errorflag';
Note: See TracChangeset
for help on using the changeset viewer.