0001 function Vp = vb_get_ref_point(Coord, LR, mtype)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 if ~exist('mtype','var')
0014 msize1 = 15;
0015 mtype1 = '.y';
0016 msize2 = 20;
0017 mtype2 = '.r';
0018 else
0019 msize1 = mtype.msize1;
0020 mtype1 = mtype.mtype1;
0021 msize2 = mtype.msize2;
0022 mtype2 = mtype.mtype2;
0023 end
0024
0025 if isfield(Coord, 'FV')
0026 NX = 3;
0027 NY = 2;
0028 Flg = 1;
0029 else
0030 NX = 2;
0031 NY = 2;
0032 Flg = 0;
0033 end
0034
0035 switch LR
0036 case 'L'
0037 Nfig = 1;
0038 V = Coord.LV;
0039 X = Coord.LX;
0040 Y = Coord.LY;
0041 case 'F'
0042 if Flg == 1,
0043 Nfig = 2;
0044 V = Coord.FV;
0045 X = Coord.FX;
0046 Y = Coord.FY;
0047 else
0048 Nfig = 1;
0049 V = Coord.LV;
0050 X = Coord.LX;
0051 Y = Coord.LY;
0052 end
0053 case 'R'
0054 if Flg == 1,
0055 Nfig = 3;
0056 else
0057 Nfig = 2;
0058 end
0059 V = Coord.RV;
0060 X = Coord.RX;
0061 Y = Coord.RY;
0062 end
0063
0064 figure(gcf);
0065
0066
0067
0068 subplot(NY,NX,Nfig)
0069
0070
0071 [xp,yp] = ginput(1);
0072
0073
0074 [Vp, Xp, Yp, dmin] = vb_get_3d_point([xp,yp],V,X,Y);
0075
0076
0077 plot(Xp,Yp,mtype1,'MarkerSize',msize1);
0078
0079
0080 subplot(NY,NX,Nfig+NX)
0081 plot3(Vp(:,1),Vp(:,2),Vp(:,3),mtype2,'MarkerSize',msize2);