Ignore:
Timestamp:
Sep 15, 2012, 7:04:56 PM (12 years ago)
Author:
sommeria
Message:

bugs repaired for mask display in phys coord, display of circles in geometry_calib, introduction of x,y,z initial in proj_field/proj_plane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r537 r542  
    104104                    text_displ_3='';
    105105                    text_displ_4='';
     106                    text_displ_5='';
    106107                    ivec=[];
    107108                    xName='';
     
    140141                                        elseif (isfield(CellInfo{icell},'VarIndex_vector_x') && isequal(ivar,CellInfo{icell}.VarIndex_vector_x))||isequal(ivar,CellInfo{icell}.VarIndex_vector_y)||...
    141142                                                (isfield(CellInfo{icell},'VarIndex_vector_z') && isequal(ivar,CellInfo{icell}.VarIndex_vector_z))
    142                                             text_displ_3=[text_displ_3 var_text];
     143                                            text_displ_4=[text_displ_4 var_text];
    143144                                        else
    144                                             text_displ_4=[text_displ_4 var_text];
     145                                            text_displ_5=[text_displ_5 var_text];
    145146                                        end
    146147                                    end
     
    168169                                            VarVal=Field.(VarName)(indy0,indx0,:);
    169170                                            var_text=[VarName '=' num2str(VarVal) ','];
    170                                             text_displ_2=[text_displ_2 var_text];
     171                                            text_displ_4=[text_displ_4 var_text];
    171172                                        end
    172173                                    end
     
    175176                        end
    176177                    end
    177               % display the current x,y coordinates in the absence of detected vector
     178              % display the current x,y plot coordinates in the absence of detected vector
    178179                    if isempty(ivec)
    179180                        if isempty(xName)
     
    183184                        text_displ_1=[xName '=' num2str(xy(1,1),4) ', ' yName '=' num2str(xy(1,2),4) ','];
    184185                    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;
    202196                        end
     197                        pos=pos+Field.ObjectCoord;
     198                        text_displ_3=[text_displ_3 'x,y,z=' num2str(pos,4)];
    203199                    end
    204                     if ~isempty(z)
    205                         text_displ_1=[text_displ_1 ' z=' num2str(z,4)];
    206                     end
     200%                     if ~isempty(z)
     201%                         text_displ_1=[text_displ_1 ' z=' num2str(z,4)];
     202%                     end
    207203               % case of PIV correlation display
    208204                    if test_piv
     
    242238                        [Data,errormsg,result_conv]= civ_matlab(Param);
    243239                        if ~isempty(errormsg)
    244                             text_displ_4=errormsg;
     240                            text_displ_5=errormsg;
    245241                        else
    246242                            rangx(1)=-(isx2-ibx2)+shiftx;
     
    281277end
    282278if ~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)
    284285else
    285286   set(handles.text_display,'String',get(handles.text_display,'UserData'))
Note: See TracChangeset for help on using the changeset viewer.