Changeset 955
 Timestamp:
 Jun 22, 2016, 7:54:40 PM (7 years ago)
 Location:
 trunk/src
 Files:

 8 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/mouse_down.m
r926 r955 430 430 set(hhuvmat.CheckViewObject,'Value',1) 431 431 end 432 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object 432 %get handles of the GUI set_object 433 h_set_object=findobj(allchild(0),'Tag','set_object'); 434 hh_set_object=guidata(h_set_object); 435 if strcmp(ObjectData.Type,'plane_z')&& ~isempty(ObjectData.Coord) 436 Delta_x=(xy(1,1)ObjectData.Coord(1,1));%displacement along x 437 Delta_y=(xy(1,2)ObjectData.Coord(1,2));%displacement along y 438 Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y);%modulus of displacement 439 ObjectData.Angle(1)=90*Delta_x/Delta_mod; 440 ObjectData.Angle(2)=90*Delta_y/Delta_mod; 441 ObjectData.Angle(3)=0;% plane rotated by 90 ° along the axis of mouse displacement since the origin 442 set(hh_set_object.num_Angle_1,'String',num2str(ObjectData.Angle(1))) 443 set(hh_set_object.num_Angle_2,'String',num2str(ObjectData.Angle(2))) 444 set(hh_set_object.num_Angle_3,'String',num2str(ObjectData.Angle(3))) 445 drawing_status='off'; 446 else 447 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object 448 set(hh_set_object.Coord,'Data',ObjectData.Coord);%append the current mouse cordinates in the GUI set_object 449 drawing_status='create'; 450 end 433 451 %TODO replace 0 by z coord for 3D 434 452 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.(CurrentGUI_tag); … … 449 467 PlotData.IndexObj=IndexObj; 450 468 set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion) 451 AxeData.Drawing='create';% flag for mouse motion 452 453 %show object coordinates in the GUI set_object 454 h_set_object=findobj(allchild(0),'Tag','set_object'); 455 hh_set_object=guidata(h_set_object); 456 set(hh_set_object.Coord,'Data',ObjectData.Coord); 469 AxeData.Drawing=drawing_status;% flag for mouse motion 457 470 end 458 471 
trunk/src/mouse_up.m
r954 r955 116 116 end 117 117 end 118 case 'plane_z'119 if size(ObjectData.Coord,1)==1 % this is the mouse up for the first point, continue until next click120 check_multiple=1;121 end122 DX=(xy(1,1)ObjectData.Coord(1,1));123 DY=(xy(1,2)ObjectData.Coord(1,2));124 ObjectData.Phi=(angle(DX+i*DY))*180/pi;%rectangle width125 118 otherwise 126 119 check_multiple=1; 
trunk/src/plot_object.m
r954 r955 150 150 xline=[xline; ObjectData.Coord(1,1)];%closing the line 151 151 yline=[yline; ObjectData.Coord(1,2)]; 152 case {'plane',' volume'}152 case {'plane','plane_z','volume'} 153 153 if ~isfield(ObjectData,'Angle') 154 154 ObjectData.Angle=[0 0 0]; 155 155 end 156 phi=ObjectData.Angle(3)*pi/180;%angle in radians 156 if strcmp(ObjectData.Type,'plane_z') 157 Angle_1=ObjectData.Angle(1); 158 Angle_2=ObjectData.Angle(2); 159 norm_angle=sqrt(Angle_1*Angle_1+Angle_2*Angle_2); 160 cosphi=Angle_1/norm_angle;%angle in radians 161 sinphi=Angle_2/norm_angle;%angle in radians 162 else 163 cosphi=cos(ObjectData.Angle(3)*pi/180);%angle in radians 164 sinphi=sin(ObjectData.Angle(3)*pi/180);%angle in radians 165 end 157 166 x0=xline(1); y0=yline(1); 158 167 xlim=get(haxes,'XLim'); … … 177 186 % axes lines 178 187 xline=NaN(1,13); 179 xline(1)=x0+min(0,XMin)*cos (phi); % min end of the x axes180 yline(1)=y0+min(0,XMin)*sin (phi);181 xline(2)=x0+XMax*cos (phi);% max end of the x axes182 yline(2)=y0+XMax*sin (phi);183 xline(8)=x0min(0,YMin)*sin (phi);% min end of the y axes184 yline(8)=y0+min(0,YMin)*cos (phi);185 xline(9)=x0YMax*sin (phi);% max end of the y axes186 yline(9)=y0+YMax*cos (phi);188 xline(1)=x0+min(0,XMin)*cosphi; % min end of the x axes 189 yline(1)=y0+min(0,XMin)*sinphi; 190 xline(2)=x0+XMax*cosphi;% max end of the x axes 191 yline(2)=y0+XMax*sinphi; 192 xline(8)=x0min(0,YMin)*sinphi;% min end of the y axes 193 yline(8)=y0+min(0,YMin)*cosphi; 194 xline(9)=x0YMax*sinphi;% max end of the y axes 195 yline(9)=y0+YMax*cosphi; 187 196 188 197 %arrows on x axis 189 198 arrow_scale=graph_scale/20; 199 phi=acos(cosphi); 190 200 xline(3)=xline(2)arrow_scale*cos(phipi/8); 191 201 yline(3)=yline(2)arrow_scale*sin(phipi/8); … … 247 257 end 248 258 end 249 if ismember(ObjectData.Type,{'line','polyline','polygon' ,'plane_z'})259 if ismember(ObjectData.Type,{'line','polyline','polygon'}) 250 260 if length(xline)<2 251 261 theta=0; … … 462 472 end 463 473 end 464 case {'line','polyline','polygon' ,'plane_z'}474 case {'line','polyline','polygon'} 465 475 hh=line(xline,yline,'Color',col); 466 476 PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sublines … … 470 480 col,'LineStyle','none','Marker','.','Tag','DeformPoint','SelectionHighlight','off','UserData',hh); 471 481 end 472 case {'plane','volume' }482 case {'plane','volume','plane_z'} 473 483 hh=line(xline,yline,'Color',col); 474 484 PlotData.SubObject(1)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object'); 
trunk/src/proj_field.m
r954 r955 955 955 test90x=0;%=1 for 90 degree rotation alround x axis 956 956 test90y=0;%=1 for 90 degree rotation alround y axis 957 if strcmp(ObjectData.Type,'plane_z')958 Delta_x=ObjectData.Coord(2,1)ObjectData.Coord(1,1);959 Delta_y=ObjectData.Coord(2,2)ObjectData.Coord(1,2);960 Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y);961 ObjectData.Angle=[0 0 0];962 ObjectData.Angle(1)=90*Delta_x/Delta_mod;963 ObjectData.Angle(2)=90*Delta_y/Delta_mod;964 end957 % if strcmp(ObjectData.Type,'plane_z') 958 % Delta_x=ObjectData.Coord(2,1)ObjectData.Coord(1,1); 959 % Delta_y=ObjectData.Coord(2,2)ObjectData.Coord(1,2); 960 % Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y); 961 % ObjectData.Angle=[0 0 0]; 962 % ObjectData.Angle(1)=90*Delta_x/Delta_mod; 963 % ObjectData.Angle(2)=90*Delta_y/Delta_mod; 964 % end 965 965 if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0]) 966 966 test90y=isequal(ObjectData.Angle,[0 90 0]); … … 996 996 end 997 997 InterpMesh=min(DX,DY);%mesh used for interpolation in a slanted plane 998 if strcmp(ObjectData.Type,'plane_z')999 InterpMesh=10*InterpMesh;%TODO: temporary, to shorten computation1000 end998 % if strcmp(ObjectData.Type,'plane_z') 999 % InterpMesh=10*InterpMesh;%TODO: temporary, to shorten computation 1000 % end 1001 1001 1002 1002 %% extrema along each axis … … 1674 1674 YI=Origin(2)+ix(2)*Grid_x+iy(2)*Grid_y+iz(2)*Grid_z; 1675 1675 ZI=Origin(3)+ix(3)*Grid_x+iy(3)*Grid_y+iz(3)*Grid_z; 1676 1677 X=permute(X,[3 1 2]);1678 Y=permute(Y,[3 1 2]);1679 Z=permute(Z,[3 1 2]);1676 [X,Y,Z]=meshgrid(Coord{3},Coord{2},Coord{1}); 1677 % X=permute(X,[3 1 2]); 1678 % Y=permute(Y,[3 1 2]); 1679 % Z=permute(Z,[3 1 2]); 1680 1680 for ivar=VarIndex 1681 1681 VarName=FieldData.ListVarName{ivar}; 1682 1682 ListVarName=[ListVarName VarName]; 1683 1683 VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes 1684 FieldData.(VarName)=permute(FieldData.(VarName),[2 3 1]); 1684 1685 ProjData.(VarName)=interp3(X,Y,Z,double(FieldData.(VarName)),XI,YI,ZI); 1685 1686 end 
trunk/src/series/merge_proj.m
r953 r955 103 103 WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series 104 104 end 105 105 tild=phys([],[]);% test to provoke the inclusion of the function phys at compilation 106 106 %% define the directory for result file (with path=RootPath{1}) 107 107 OutputDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files 
trunk/src/set_object.m
r954 r955 119 119 Type_Callback(hObject, eventdata, handles)% update the GUI set_object depending on the object type 120 120 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 121 if isfield(data,'RangeZ') && length(ZBounds) >= 2121 if isfield(data,'RangeZ') 122 122 set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3)) 123 DZ=max(data.RangeZ);%slider step 124 if ~isnan(ZBounds(1)) && ZBounds(2)~=ZBounds(1) 125 rel_step(1)=min(DZ/(ZBounds(2)ZBounds(1)),0.2);%must be smaller than 1 126 rel_step(2)=0.1; 127 set(handles.z_slider,'Visible','on') 128 set(handles.z_slider,'Min',ZBounds(1)) 129 set(handles.z_slider,'Max',ZBounds(2)) 130 set(handles.z_slider,'SliderStep',rel_step) 131 set(handles.z_slider,'Value',(ZBounds(1)+ZBounds(2))/2) 123 if length(ZBounds) >= 2 124 DZ=max(data.RangeZ);%slider step 125 if ~isnan(ZBounds(1)) && ZBounds(2)~=ZBounds(1) 126 rel_step(1)=min(DZ/(ZBounds(2)ZBounds(1)),0.2);%must be smaller than 1 127 rel_step(2)=0.1; 128 set(handles.z_slider,'Visible','on') 129 set(handles.z_slider,'Min',ZBounds(1)) 130 set(handles.z_slider,'Max',ZBounds(2)) 131 set(handles.z_slider,'SliderStep',rel_step) 132 set(handles.z_slider,'Value',(ZBounds(1)+ZBounds(2))/2) 133 end 132 134 end 133 135 end … … 281 283 ObjectStyle=menu{value}; 282 284 %%%%%%%%% TODO 283 test3D= 0; %TODO: update test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case285 test3D=strcmp(ObjectStyle,'plane_z'); %TODO: generalize 284 286 %%%%%%%%% 285 287 %default setting 
trunk/src/uvmat.m
r954 r955 962 962 data.CoordUnit=UvData.Field.CoordUnit; 963 963 end 964 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh)&&~strcmp(data.Type,'plane_z') 965 data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 964 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 965 %data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 966 data.DX=UvData.Field.CoordMesh; 967 data.DY=UvData.Field.CoordMesh; 966 968 switch data.Type 967 969 case {'line','polyline','points'} … … 985 987 data.RangeX=UvData.Field.CoordMesh; 986 988 data.RangeY=UvData.Field.CoordMesh; 989 case 'plane_z' 990 data.Angle=[0 0 0]; 991 data.DX=10*UvData.Field.CoordMesh; 992 data.DY=10*UvData.Field.CoordMesh; 993 data.RangeZ=UvData.Field.CoordMesh; 987 994 otherwise 988 995 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 989 996 end 990 data.DX=UvData.Field.CoordMesh;991 data.DY=UvData.Field.CoordMesh;992 997 end 993 998 if isfield(UvData.Field,'ProjModeRequest')
Note: See TracChangeset
for help on using the changeset viewer.