Changeset 680
- Timestamp:
- Aug 29, 2013, 12:32:50 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r674 r680 1320 1320 %------------------------------------------------------------------------ 1321 1321 function ListCoord_CellSelectionCallback(hObject, eventdata, handles) 1322 1323 1322 if ~isempty(eventdata.Indices) 1324 1323 iline=eventdata.Indices(1);% selected line number … … 1350 1349 function key_press_fcn(hObject,eventdata,handles) 1351 1350 1352 xx=double(get(handles.geometry_calib,'CurrentCharacter')); 1351 xx=double(get(handles.geometry_calib,'CurrentCharacter'));%get the keyboard character 1353 1352 %if ismember(xx,[8 127])%backspace or delete 1354 if ismember(xx,[30 31 8 127])% arrow upward, downward, backspaceor delete1353 if ismember(xx,[30 31 127])% arrow upward, downward, or delete 1355 1354 Coord=get(handles.ListCoord,'Data'); 1356 ind=find(Coord(:,6)); 1355 ind=find(Coord(:,6));%find the marker '+' for line selection 1357 1356 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark 1358 1357 switch xx … … 1361 1360 case 31% arrow downward 1362 1361 Coord(ind+1,6)=1; 1363 case {8 127}% remove line1362 case 127% remove line 1364 1363 Coord(ind,:)=[]; 1364 PLOT_Callback(hObject,eventdata,handles) 1365 1365 end 1366 1366 set(handles.ListCoord,'Data',Coord); 1367 PLOT_Callback(hObject,eventdata,handles)1368 1367 end 1369 1368 -
trunk/src/mouse_down.m
r669 r680 62 62 hset_object=findobj(allchild(0),'Name','set_object'); 63 63 if ~isempty(hset_object) 64 hPLOT=findobj(hset_object,'tag',' PLOT');64 hPLOT=findobj(hset_object,'tag','REFRESH'); 65 65 test_create=strcmp(get(hPLOT,'enable'),'on') &&~get(hhuvmat.CheckEditObject,'Value');% create new object if set_object is in mode enable and uvmat not in mode 'EditObject' 66 66 end … … 285 285 %indicate on the list of the GUI uvmat which object has been selected 286 286 if strcmp(get(hCurrentGUI,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field 287 % IndexObj=get(hhuvmat.ListObject,'Value');288 % if IndexObj>IndexObj_old(1)289 % IndexObj=[IndexObj_old(1) IndexObj];290 % else291 % IndexObj=[1 IndexObj];292 % end293 287 set(hhuvmat.ListObject,'Value',IndexObj); 294 % set(hhuvmat.ListObject,'UserData',IndexObj);295 288 else 296 289 set(hhuvmat.ListObject_1,'Value',IndexObj); … … 298 291 UvData.ProjObject{IndexObj}.Name=list_str{IndexObj}; 299 292 end 300 % h_set_object=findobj(allchild(0),'Tag','set_object');301 % if ~isempty(h_set_object)302 % delete(h_set_object)303 % end304 293 set_object(UvData.ProjObject{IndexObj}) 305 294 axes(hchild);%set back the current axes haxes -
trunk/src/plot_object.m
r655 r680 410 410 end 411 411 else% no patch image requested, erase existing ones 412 if isfield(PlotData,'SubObject') 412 413 for iobj=1:length(PlotData.SubObject) 413 414 if ishandle(PlotData.SubObject(iobj)) && strcmp(get(PlotData.SubObject(iobj),'Type'),'image') 414 415 delete(PlotData.SubObject(iobj)) 415 416 end 417 end 416 418 end 417 419 end … … 467 469 hh=rectangle('Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'LineWidth',2,'EdgeColor',col); 468 470 case 'ellipse' 469 hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col );471 hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col,'LineWidth',2); 470 472 otherwise 471 473 msgbox_uvmat('ERROR','unknown ObjectData.Type in plot_object.m') -
trunk/src/set_object.m
r675 r680 36 36 function varargout = set_object(varargin) 37 37 38 % Last Modified by GUIDE v2.5 2 6-Jan-2012 22:00:4739 40 % Begin initialization code - DO NOT PLOT38 % Last Modified by GUIDE v2.5 28-Aug-2013 20:41:02 39 40 % Begin initialization code - DO NOT REFRESH 41 41 gui_Singleton = 1; 42 42 gui_State = struct('gui_Name', mfilename, ... … … 55 55 gui_mainfcn(gui_State, varargin{:}); 56 56 end 57 % End initialization code - DO NOT PLOT57 % End initialization code - DO NOT REFRESH 58 58 %------------------------------------------------------------------------ 59 59 %------------------------------------------------------------------------ … … 63 63 %'IndexObj': NON USED ANYMORE (To suppress) index of the object (on the UvData list) that set_object will modify 64 64 % if =[] or absent: index still undefined (create mode in uvmat) 65 % if=0; no associated object (used for series), the button ' PLOT' is then unvisible65 % if=0; no associated object (used for series), the button 'REFRESH' is then unvisible 66 66 %'data': read from an existing object selected in the interface 67 67 % .Name : class of object ('POINTS','LINE',....) … … 70 70 % .ParentButton: handle of the uicontrol object calling the interface 71 71 % PlotHandles: set of handles of the elements contolling the plotting of the projected field: 72 % if =[] or absent, no plot(mask mode in uvmat)72 % if =[] or absent, no refresh (mask mode in uvmat) 73 73 % parameters on the uvmat interface (obtained by 'get_plot_handle.m') 74 74 function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds) … … 164 164 set(get(handles.set_object,'children'),'enable','off') 165 165 set(handles.SAVE,'enable','on') 166 % set(handles. PLOT,'enable','off')166 % set(handles.REFRESH,'enable','off') 167 167 168 168 … … 415 415 416 416 %------------------------------------------------------------------------ 417 % --- Executes on button press in PLOT: refresh the current object , plot the object and its projected field 418 function PLOT_Callback(hObject, eventdata, handles) 419 420 set(handles.PLOT,'BackgroundColor',[1 1 0]) 417 % --- Executes on button press in REFRESH: refresh the current object , refresh the object and its projected field 418 %------------------------------------------------------------------------ 419 function REFRESH_Callback(hObject, eventdata, handles) 420 421 set(handles.REFRESH,'BackgroundColor',[1 1 0]) 421 422 drawnow 422 423 … … 429 430 set(hseries,'UserData',SeriesData); 430 431 end 431 set(handles. PLOT,'BackgroundColor',[1 0 0])432 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 432 433 return 433 434 end … … 504 505 end 505 506 506 %% plotthe field projected on the object507 %% refresh the field projected on the object 507 508 hview_field=[];%default 508 509 IndexObj_1=get(hhuvmat.ListObject_1,'Value'); … … 516 517 if ~isempty(errormsg) 517 518 msgbox_uvmat('ERROR', ['set_object/tps_coeff_field/' errormsg]) 518 set(handles. PLOT,'enable','on')519 set(handles.REFRESH,'enable','on') 519 520 return 520 521 end … … 523 524 if ~isempty(errormsg) 524 525 msgbox_uvmat('ERROR', ['set_object/proj_field/' errormsg]) 525 set(handles. PLOT,'enable','on')526 set(handles.REFRESH,'enable','on') 526 527 return 527 528 end … … 557 558 end 558 559 559 %% update the object plot560 %% update the object refresh 560 561 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; 561 562 % if we are editing the object used for projection in uvmat … … 570 571 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=... 571 572 plot_object(UvData.ProjObject{IndexObj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'m'); 572 %indicate the object index in the user data of the object plot(needed for further mouse editing)573 %indicate the object index in the user data of the object refresh (needed for further mouse editing) 573 574 ObjectInfo=get(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData'); 574 575 ObjectInfo.IndexObj=IndexObj; … … 587 588 set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update 588 589 set(hhuvmat.CheckViewField,'Value',1) 589 set(handles. PLOT,'BackgroundColor',[1 0 0])590 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 590 591 %------------------------------------------------------------------------ 591 592 % --- Executes on button press in MenuCoord. … … 691 692 692 693 % update graph 693 PLOT_Callback(hObject, eventdata, handles)694 REFRESH_Callback(hObject, eventdata, handles) 694 695 695 696 %------------------------------------------------------------------------ … … 719 720 function Coord_CellEditCallback(hObject, eventdata, handles) 720 721 %------------------------------------------------------------------------ 721 ListType=get(handles.Type,'String');722 Type=ListType{get(handles.Type,'Value')};723 switch Type724 % add lines if multi line input needed725 case{'points','polyline','polygon'}726 Input=str2num(eventdata.EditData);%pasted input727 Coord=get(handles.Coord,'Data');728 iline=eventdata.Indices(1);% selected line number729 if size(Coord,1)<iline+numel(Input)730 Coord=[Coord ; zeros(iline+numel(Input)-size(Coord,1),size(Coord,2))];% append zeros to fit the new column731 end732 Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input';733 set(handles.Coord,'Data',Coord)734 end735 722 % ListType=get(handles.Type,'String'); 723 % Type=ListType{get(handles.Type,'Value')}; 724 % switch Type 725 % % add lines if multi line input needed 726 % case{'points','polyline','polygon'} 727 % Input=str2num(eventdata.EditData);%pasted input 728 % Coord=get(handles.Coord,'Data'); 729 % iline=eventdata.Indices(1);% selected line number 730 % if size(Coord,1)<iline+numel(Input) 731 % Coord=[Coord ; zeros(iline+numel(Input)-size(Coord,1),size(Coord,2))];% append zeros to fit the new column 732 % end 733 % Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input'; 734 % set(handles.Coord,'Data',Coord) 735 % end 736 %------------------------------------------------------------------------ 736 737 % --- Executes when selected cell(s) is changed in ListCoord. 738 %------------------------------------------------------------------------ 737 739 function Coord_CellSelectionCallback(hObject, eventdata, handles) 738 740 739 741 if ~isempty(eventdata.Indices) 740 742 iline=eventdata.Indices(1);% selected line number 741 set(handles.Coord,'UserData',iline) 743 set(handles.Coord,'UserData',iline)% used possibly for line deletion or table extension, using key_press_fcn 742 744 end 743 745 … … 748 750 749 751 xx=double(get(handles.set_object,'CurrentCharacter')); %get the keyboard character 750 if ismember(xx,[ 8 127 31])%backspace ordelete, or downward752 if ismember(xx,[127 31])% delete, or downward 751 753 Coord=get(handles.Coord,'Data'); 752 754 iline=get(handles.Coord,'UserData'); -
trunk/src/uvmat.m
r675 r680 4715 4715 if check_plot 4716 4716 hhset_object=guidata(hset_object); 4717 set_object(' PLOT_Callback',1,[],hhset_object);% call the GUI set_object4717 set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object 4718 4718 end 4719 4719 … … 4721 4721 function MenuBrowseObject_Callback(hObject, eventdata, handles) 4722 4722 %------------------------------------------------------------------------ 4723 %get the object file 4723 %get the object file 4724 4724 fileinput=uigetfile_uvmat('pick an xml object file:',get(handles.RootPath,'String'),'.xml'); 4725 4725 if ~isempty(fileinput) … … 4729 4729 msgbox_uvmat('WARNING','The xml file does not have the heading ProjObject for projection objects') 4730 4730 end 4731 % [tild,data.Name]=fileparts(fileinput);% object name set as file name4732 4731 ListObject=get(handles.ListObject,'String'); 4733 4734 % if ~strcmp(ListObject{end},'') 4735 % ListObject=[ListObject;{''}]; %append a blank to the list (if not already done) to indicate the creation of a new object 4736 % set(handles.ListObject,'String',ListObject) 4737 % end 4738 ListObject=[ListObject;{data.Name}]; 4739 IndexObj=length(ListObject); 4732 ListObject=[ListObject;{data.Name}]; 4733 IndexObj=length(ListObject); 4740 4734 UvData=get(handles.uvmat,'UserData'); 4741 4735 UvData.ProjObject{IndexObj}=[]; %create a new empty object … … 4743 4737 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 4744 4738 set(handles.uvmat,'UserData',UvData) 4745 % set(handles.ListObject,'String',ListObject)4746 % set(handles.ListObject,'Value',IndexObj)4747 4739 set(handles.CheckViewObject,'Value',1) 4748 4740 set(handles.CheckViewField,'Value',1) 4749 4741 hset_object=set_object(data);% call the set_object interface 4750 4742 hhset_object=guidata(hset_object); 4751 set_object('PLOT_Callback',hObject,eventdata,hhset_object);% plot projection 4752 %set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object 4743 set_object('REFRESH_Callback',hObject,eventdata,hhset_object);% plot projection 4753 4744 set(handles.CheckEditObject,'Value',0); %suppress the object edit mode 4754 4745 CheckEditObject_Callback([],[],handles) 4755 4746 set(handles.DeleteObject,'Visible','on') 4756 4747 end 4757 4758 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4759 % % MenuEdit Callbacks4760 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4761 % %------------------------------------------------------------------------4762 % function MenuEditObject_Callback(hObject, eventdata, handles)4763 % %------------------------------------------------------------------------4764 % set(handles.CheckEditObject,'Value',1)4765 % edit_Callback(hObject, eventdata, handles)4766 %4767 % %------------------------------------------------------------------------4768 % function MenuEditVectors_Callback(hObject, eventdata, handles)4769 % %------------------------------------------------------------------------4770 % set(handles.edit_vect,'Visible','on')4771 % set(handles.edit_vect,'Value',1)4772 % edit_vect_Callback(hObject, eventdata, handles)4773 4748 4774 4749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset
for help on using the changeset viewer.