Changeset 307
- Timestamp:
- Nov 28, 2011, 8:43:30 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r304 r307 227 227 varargout{1} = handles.output; 228 228 229 % %------------------------------------------------------------------------ 230 % % --- function activated by the Open/Browse... option in the upper menu bar. 231 % function MenuBrowse_Callback(hObject, eventdata, handles) 232 % %------------------------------------------------------------------------ 233 % %get the current input root file name to initiate the browser 234 % filebase=get(handles.RootName,'String'); 235 % oldfile=''; %default 236 % if isempty(filebase)|| isequal(filebase,'')%loads the previously stored root file name 237 % dir_perso=prefdir; 238 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 239 % if exist(profil_perso,'file') 240 % h=load (profil_perso); 241 % if isfield(h,'filebase')&& ischar(h.filebase) 242 % oldfile=h.filebase; 243 % end 244 % if isfield(h,'RootPath') && ischar(h.RootPath) 245 % oldfile=h.RootPath; 246 % end 247 % end 248 % else 249 % oldfile=filebase; 250 % end 251 % ind_opening=1;%default 252 % browse.incr_pair=[0 0]; %default 253 % menu={'*.xml;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.nc;', ' (*.xml,*.civ,*.png,*.jpg ,.tif, *.avi,*.nc)'; 254 % '*.xml', '.xml files '; ... 255 % '*.civ', '.civ files '; ... 256 % '*.png','.png image files'; ... 257 % '*.jpg',' jpeg image files'; ... 258 % '*.tif','.tif image files'; ... 259 % '*.avi;*.AVI','.avi movie files'; ... 260 % '*.nc','.netcdf files'; ... 261 % '*.*', 'All Files (*.*)'}; 262 % [FileName, PathName, filtindex] = uigetfile( menu, 'Pick a file',oldfile); 263 % fileinput=[PathName FileName];%complete file name 264 % sizf=size(fileinput); 265 % if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 266 % 267 % %% prepare the GUI with parameters from the input file if opened from uvmat 268 % errormsg=display_file_name(handles,fileinput); 269 % if ~isempty(errormsg) 270 % msgbox_uvmat('ERROR',erromsg) 271 % end 272 273 % 274 % [path,name,ext]=fileparts(fileinput); 275 % testeditxml=0; 276 % if isequal(ext,'.xml') 277 % testeditxml=1; 278 % t_browse=xmltree(fileinput); 279 % head_element=get(t_browse,1); 280 % if isfield(head_element,'name')&& isequal(head_element.name,'ImaDoc') 281 % testeditxml=0; 282 % end 283 % end 284 % if testeditxml==1 || isequal(ext,'.xls') 285 % heditxml=editxml({fileinput}); 286 % set(heditxml,'Tag','browser') 287 % waitfor(heditxml,'Tag','idle') 288 % if ~ishandle(heditxml) 289 % return 290 % end 291 % attr=findobj(get(heditxml,'children'),'Tag','CurrentAttributes'); 292 % set(handles.browse,'UserData',fileinput)% store for future opening with browser 293 % fileinput=get(attr,'UserData'); 294 % if ~exist(fileinput,'file') 295 % return 296 % end 297 % end 298 % [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput); 299 % filebase=fullfile(RootPath,RootFile); 300 % num_i1=str2double(str1); 301 % if isnan(num_i1),num_i1=1;end 302 % num_i2=str2double(str2); 303 % if isnan(num_i2),num_i2=num_i1;end 304 % num_j1=stra2num(str_a); 305 % if isnan(num_j1),num_j1=1;end 306 % num_j2=stra2num(str_b); 307 % if isnan(num_j2),num_j2=num_j1;end 308 % if isequal(get(handles.ListCompareMode,'Value'),1) 309 % browse=[];%initialisation 310 % else 311 % browse=get(handlesRootName,'UserData'); 312 % end 313 % browse.num_i1=num_i1; 314 % browse.num_i2=num_i2; 315 % browse.num_j1=num_j1; 316 % browse.num_j2=num_j2; 317 % if length(ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat 318 % browse.nom_type_ima=nom_type; 319 % browse.ext_ima=ext; 320 % set(handles.ImaExt,'String',ext) 321 % end 322 % set(handles.ImaDoc,'String',ext); 323 % 324 % 325 % set(handles.RootName,'UserData',browse);% store information from browser 326 % RootName_Callback(hObject, eventdata, handles); 229 %------------------------------------------------------------------------ 230 % --- function activated by the Open/Browse... option in the upper menu bar. 231 function MenuBrowse_Callback(hObject, eventdata, handles) 232 %------------------------------------------------------------------------ 233 %get the current input root file name to initiate the browser 234 filebase=get(handles.RootName,'String'); 235 oldfile=''; %default 236 if isempty(filebase)|| isequal(filebase,'')%loads the previously stored root file name 237 dir_perso=prefdir; 238 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 239 if exist(profil_perso,'file') 240 h=load (profil_perso); 241 if isfield(h,'filebase')&& ischar(h.filebase) 242 oldfile=h.filebase; 243 end 244 if isfield(h,'RootPath') && ischar(h.RootPath) 245 oldfile=h.RootPath; 246 end 247 end 248 else 249 oldfile=filebase; 250 end 251 ind_opening=1;%default 252 browse.incr_pair=[0 0]; %default 253 menu={'*.xml;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.nc;', ' (*.xml,*.civ,*.png,*.jpg ,.tif, *.avi,*.nc)'; 254 '*.xml', '.xml files '; ... 255 '*.civ', '.civ files '; ... 256 '*.png','.png image files'; ... 257 '*.jpg',' jpeg image files'; ... 258 '*.tif','.tif image files'; ... 259 '*.avi;*.AVI','.avi movie files'; ... 260 '*.nc','.netcdf files'; ... 261 '*.*', 'All Files (*.*)'}; 262 [FileName, PathName, filtindex] = uigetfile( menu, 'Pick a file',oldfile); 263 fileinput=[PathName FileName];%complete file name 264 sizf=size(fileinput); 265 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 266 267 %% prepare the GUI with parameters from the input file if opened from uvmat 268 errormsg=display_file_name(handles,fileinput); 269 if ~isempty(errormsg) 270 msgbox_uvmat('ERROR',erromsg) 271 end 272 273 274 [path,name,ext]=fileparts(fileinput); 275 testeditxml=0; 276 if isequal(ext,'.xml') 277 testeditxml=1; 278 t_browse=xmltree(fileinput); 279 head_element=get(t_browse,1); 280 if isfield(head_element,'name')&& isequal(head_element.name,'ImaDoc') 281 testeditxml=0; 282 end 283 end 284 if testeditxml==1 || isequal(ext,'.xls') 285 heditxml=editxml({fileinput}); 286 set(heditxml,'Tag','browser') 287 waitfor(heditxml,'Tag','idle') 288 if ~ishandle(heditxml) 289 return 290 end 291 attr=findobj(get(heditxml,'children'),'Tag','CurrentAttributes'); 292 set(handles.browse,'UserData',fileinput)% store for future opening with browser 293 fileinput=get(attr,'UserData'); 294 if ~exist(fileinput,'file') 295 return 296 end 297 end 298 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput); 299 filebase=fullfile(RootPath,RootFile); 300 num_i1=str2double(str1); 301 if isnan(num_i1),num_i1=1;end 302 num_i2=str2double(str2); 303 if isnan(num_i2),num_i2=num_i1;end 304 num_j1=stra2num(str_a); 305 if isnan(num_j1),num_j1=1;end 306 num_j2=stra2num(str_b); 307 if isnan(num_j2),num_j2=num_j1;end 308 if isequal(get(handles.ListCompareMode,'Value'),1) 309 browse=[];%initialisation 310 else 311 browse=get(handlesRootName,'UserData'); 312 end 313 browse.num_i1=num_i1; 314 browse.num_i2=num_i2; 315 browse.num_j1=num_j1; 316 browse.num_j2=num_j2; 317 if length(ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat 318 browse.nom_type_ima=nom_type; 319 browse.ext_ima=ext; 320 set(handles.ImaExt,'String',ext) 321 end 322 set(handles.ImaDoc,'String',ext); 323 324 set(handles.RootName,'UserData',browse);% store information from browser 325 RootName_Callback(hObject, eventdata, handles); 327 326 328 327 % ----------------------------------------------------------------------- … … 416 415 num_ref_j=num_j1; 417 416 browse.incr_pair=[0 0];%default 418 if ~isempty(imformats(ext_input(2:end)))||strcmpi(ext_input,'.avi')% if the extension corresponds to an image or movie format recognized by Matlab 417 418 % form=imformats(ext_input(2:end)); 419 if ~isempty(ext_input)&&(~isempty(imformats(ext_input(2:end)))||strcmpi(ext_input,'.avi'))% if the extension corresponds to an image or movie format recognized by Matlab 419 420 ext_ima=ext_input; 420 421 nom_type_ima=nom_type_input; … … 967 968 % be performed, while the result is needed for next steps. 968 969 displ_pair={''}; 969 select=ones(size(1:nbpair)) %flag for displayed pairs =1 for display970 select=ones(size(1:nbpair));%flag for displayed pairs =1 for display 970 971 testpair=0; 971 972 … … 1061 1062 1062 1063 %% determine the default selection in the pair menu 1063 ichoice=find(select,1) % index of selected pair1064 ichoice=find(select,1);% index of selected pair 1064 1065 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 1065 initial=get(handles.ListPairCiv1,'Value') %initial choice of pair1066 initial=get(handles.ListPairCiv1,'Value');%initial choice of pair 1066 1067 if initial>nbpair || (numel(select)>=initial && ~isequal(select(initial),1)) 1067 1068 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu -
trunk/src/plot_object.m
r231 r307 39 39 %% default output 40 40 hh=[];%default output 41 if isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot41 if ~isfield(ObjectDataIn,'Style')|| isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot 42 42 return 43 43 end -
trunk/src/set_object.m
r292 r307 672 672 hhuvmat=guidata(huvmat);%handles in the uvmat GUI 673 673 ObjectName=get(handles.TITLE,'String');%name of the current object 674 ListObject=get(hhuvmat.list_object_1,'String');%position in the objet list 675 IndexObj_1=get(hhuvmat.list_object_1,'Value'); 676 if isequal(get(hhuvmat.list_object_2,'Visible'),'on') 677 IndexObj_2=get(hhuvmat.list_object_2,'Value'); 678 List2=get(hhuvmat.list_object_2,'String'); 674 ListObject=get(hhuvmat.ListObject,'String');%position in the objet list 675 IndexObj=get(hhuvmat.ListObject,'Value'); 676 IndexObj_1=IndexObj(1); 677 % if isequal(get(hhuvmat.list_object_2,'Visible'),'on') 678 % IndexObj_2=get(hhuvmat.list_object_2,'Value'); 679 % List2=get(hhuvmat.list_object_2,'String'); 680 if numel(IndexObj)==2 681 IndexObj_2=IndexObj(2); 679 682 else 680 683 IndexObj_2=[]; … … 729 732 end 730 733 ListObject{IndexObj,1}=ObjectName; 731 set(hhuvmat. list_object_1,'String',ListObject)732 set(hhuvmat.list_object_2,'String',ListObject)734 set(hhuvmat.ListObject,'String',ListObject) 735 % set(hhuvmat.list_object_2,'String',ListObject) 733 736 734 737 %% update the object plot and projection field 735 738 if testnew 736 set(hhuvmat.list_object_2,'Value',IndexObj) 739 set(hhuvmat.ListObject,'Value',IndexObj) 740 % set(hhuvmat.list_object_2,'Value',IndexObj) 737 741 ObjectData.DisplayHandle_uvmat=hhuvmat.axes3; 738 742 ObjectData.DisplayHandle_view_field=[]; 739 743 else 740 if isfield(UvData.Object{IndexObj},'DisplayHandle_uvmat')% save the previous object graph handles 744 IndexObj 745 UvData.Object{IndexObj} 746 if IndexObj<=length(UvData.Object) && isfield(UvData.Object{IndexObj},'DisplayHandle_uvmat')% save the previous object graph handles 741 747 ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj}.DisplayHandle_uvmat; 742 748 else -
trunk/src/uvmat.m
r302 r307 4851 4851 % set(handles.uvmat,'UserData',UvData) 4852 4852 set(handles.delete_object,'Visible','on') 4853 set(handles.uvmat_title,'Visible','on')4854 set(handles.view_field_title,'Visible','on')4853 % set(handles.uvmat_title,'Visible','on') 4854 % set(handles.view_field_title,'Visible','on') 4855 4855 4856 4856 %------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.