Changeset 680 for trunk/src/set_object.m
- Timestamp:
- Aug 29, 2013, 12:32:50 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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');
Note: See TracChangeset
for help on using the changeset viewer.