Changeset 1098 for trunk/src/mouse_down.m
- Timestamp:
- Apr 13, 2021, 7:19:35 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r1093 r1098 115 115 AxeData.CurrentOrigin=xy(1,1:2);% The current point set by the mouse becomes the current origin 116 116 117 if test_edit_vect 117 if test_edit_vect 118 118 ivec=[]; 119 119 FigData=get(hCurrentGUI,'UserData'); … … 123 123 [CellInfo,NbDim,errormsg]=find_field_cells(Field);%analyse the physical fields contained in Field 124 124 if isempty(errormsg) 125 for icell=1:numel(CellInfo)%look for all physical fields 126 if NbDim(icell)==2 % select 2D field 127 if isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&... 128 ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data 129 X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x}); 130 Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y}); 131 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 132 (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f 133 ivec=find(flag_vec,1);% search the (first) selected vector index ivec 125 for icell=1:numel(CellInfo)%look for all physical fields 126 if NbDim(icell)==2 % select 2D field 127 if isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&... 128 ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data 129 X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x}); 130 Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y}); 131 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 132 (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f 133 ivec=find(flag_vec,1);% search the (first) selected vector index ivec 134 end 134 135 end 135 136 end 136 end137 137 end 138 138 end
Note: See TracChangeset
for help on using the changeset viewer.