Changeset 575 for trunk/src/mouse_motion.m
- Timestamp:
- Feb 27, 2013, 6:39:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r542 r575 110 110 for icell=1:numel(CellInfo)%look for all physical fields 111 111 if NbDimArray(icell)>=2 % select 2D field 112 if isfield(Field,' Mesh') && ~isempty(Field.Mesh)&& strcmp(CellInfo{icell}.CoordType,'scattered')%case of unstructured data112 if isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&& strcmp(CellInfo{icell}.CoordType,'scattered')%case of unstructured data 113 113 X=Field.(Field.ListVarName{CellInfo{icell}.CoordIndex(end)}); 114 114 Y=Field.(Field.ListVarName{CellInfo{icell}.CoordIndex(end-1)}); 115 flag_vec=(X<(xy(1,1)+Field. Mesh/3) & X>(xy(1,1)-Field.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse116 (Y<(xy(1,2)+Field. Mesh/3) & Y>(xy(1,2)-Field.Mesh/3));%f115 flag_vec=(X<(xy(1,1)+Field.CoordMesh/3) & X>(xy(1,1)-Field.CoordMesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse 116 (Y<(xy(1,2)+Field.CoordMesh/3) & Y>(xy(1,2)-Field.CoordMesh/3));%f 117 117 ivec=find(flag_vec,1);% search the (first) selected vector index ivec 118 118 hhh=findobj(CurrentAxes,'Tag','vector_marker'); … … 125 125 set(CurrentFig,'CurrentAxes',CurrentAxes) 126 126 rectangle('Curvature',[1 1],... 127 'Position',[X(ivec)-Field. Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh],'EdgeColor','m',...127 'Position',[X(ivec)-Field.CoordMesh/2 Y(ivec)-Field.CoordMesh/2 Field.CoordMesh Field.CoordMesh],'EdgeColor','m',... 128 128 'LineStyle','-','Tag','vector_marker'); 129 129 else 130 130 set(hhh,'Visible','on') 131 set(hhh,'Position',[X(ivec)-Field. Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh])131 set(hhh,'Position',[X(ivec)-Field.CoordMesh/2 Y(ivec)-Field.CoordMesh/2 Field.CoordMesh Field.CoordMesh]) 132 132 end 133 133 end
Note: See TracChangeset
for help on using the changeset viewer.