Changeset 542 for trunk/src/mouse_motion.m
- Timestamp:
- Sep 15, 2012, 7:04:56 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r537 r542 104 104 text_displ_3=''; 105 105 text_displ_4=''; 106 text_displ_5=''; 106 107 ivec=[]; 107 108 xName=''; … … 140 141 elseif (isfield(CellInfo{icell},'VarIndex_vector_x') && isequal(ivar,CellInfo{icell}.VarIndex_vector_x))||isequal(ivar,CellInfo{icell}.VarIndex_vector_y)||... 141 142 (isfield(CellInfo{icell},'VarIndex_vector_z') && isequal(ivar,CellInfo{icell}.VarIndex_vector_z)) 142 text_displ_ 3=[text_displ_3var_text];143 text_displ_4=[text_displ_4 var_text]; 143 144 else 144 text_displ_ 4=[text_displ_4var_text];145 text_displ_5=[text_displ_5 var_text]; 145 146 end 146 147 end … … 168 169 VarVal=Field.(VarName)(indy0,indx0,:); 169 170 var_text=[VarName '=' num2str(VarVal) ',']; 170 text_displ_ 2=[text_displ_2var_text];171 text_displ_4=[text_displ_4 var_text]; 171 172 end 172 173 end … … 175 176 end 176 177 end 177 % display the current x,y coordinates in the absence of detected vector178 % display the current x,y plot coordinates in the absence of detected vector 178 179 if isempty(ivec) 179 180 if isempty(xName) … … 183 184 text_displ_1=[xName '=' num2str(xy(1,1),4) ', ' yName '=' num2str(xy(1,2),4) ',']; 184 185 end 185 %display the z coordinate if defined by the projection plane 186 if isfield(Field,'PlaneCoord') 187 % ZIndex=Field.ZIndex; 188 if size(Field.PlaneCoord)>=[1 3] 189 z=Field.PlaneCoord(1,3); 190 if isfield(Field,'PlaneAngle')&&~isequal(Field.PlaneAngle,[0 0 0]) 191 om=norm(Field.PlaneAngle);%norm of rotation angle in radians 192 OmAxis=Field.PlaneAngle/om; %unit vector marking the rotation axis 193 cos_om=cos(pi*om/180); 194 sin_om=sin(pi*om/180); 195 coeff=OmAxis(3)*(1-cos_om); 196 norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; 197 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; 198 norm_plane(3)=OmAxis(3)*coeff+cos_om; 199 Z0=norm_plane*Field.PlaneCoord'/norm_plane(3); 200 z=Z0-norm_plane(1)*xy(1,1)/norm_plane(3)-norm_plane(2)*xy(1,2)/norm_plane(3); 201 end 186 %display the z coordinate if defined by the projection plane 187 if isfield(Field,'ObjectCoord') && length(Field.ObjectCoord)>=3 188 pos=[xy(1,1) xy(1,2) 0]; 189 if isfield(Field,'ObjectAngle')&&~isequal(Field.ObjectAngle,[0 0 0]) 190 om=norm(Field.ObjectAngle);%norm of rotation angle in radians 191 OmAxis=Field.ObjectAngle/om; %unit vector marking the rotation axis 192 cos_om=cos(pi*om/180); 193 sin_om=sin(pi*om/180); 194 pos=[xy(1,1) xy(1,2) 0]; 195 pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis; 202 196 end 197 pos=pos+Field.ObjectCoord; 198 text_displ_3=[text_displ_3 'x,y,z=' num2str(pos,4)]; 203 199 end 204 if ~isempty(z)205 text_displ_1=[text_displ_1 ' z=' num2str(z,4)];206 end200 % if ~isempty(z) 201 % text_displ_1=[text_displ_1 ' z=' num2str(z,4)]; 202 % end 207 203 % case of PIV correlation display 208 204 if test_piv … … 242 238 [Data,errormsg,result_conv]= civ_matlab(Param); 243 239 if ~isempty(errormsg) 244 text_displ_ 4=errormsg;240 text_displ_5=errormsg; 245 241 else 246 242 rangx(1)=-(isx2-ibx2)+shiftx; … … 281 277 end 282 278 if ~isempty(text_displ_1) 283 set(handles.text_display,'String',[{text_displ_1};{text_displ_2};{text_displ_3};{text_displ_4}]) 279 text_displ=[{text_displ_1};{text_displ_2};{text_displ_3};{text_displ_4};{text_displ_5}]; 280 ind_blank=find(strcmp('',text_displ)); 281 if ~isempty(ind_blank) 282 text_displ(ind_blank)=[]; 283 end 284 set(handles.text_display,'String',text_displ) 284 285 else 285 286 set(handles.text_display,'String',get(handles.text_display,'UserData'))
Note: See TracChangeset
for help on using the changeset viewer.