Changeset 680


Ignore:
Timestamp:
Aug 29, 2013, 12:32:50 AM (11 years ago)
Author:
sommeria
Message:

cleaning , suppres effect of backward arrow in set_object.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r674 r680  
    13201320%------------------------------------------------------------------------
    13211321function ListCoord_CellSelectionCallback(hObject, eventdata, handles)
    1322 
    13231322if ~isempty(eventdata.Indices)
    13241323    iline=eventdata.Indices(1);% selected line number
     
    13501349function key_press_fcn(hObject,eventdata,handles)
    13511350
    1352 xx=double(get(handles.geometry_calib,'CurrentCharacter')); %get the keyboard character
     1351xx=double(get(handles.geometry_calib,'CurrentCharacter'));%get the keyboard character
    13531352%if ismember(xx,[8 127])%backspace or delete
    1354 if ismember(xx,[30 31 8 127])% arrow upward, downward, backspace or delete
     1353if ismember(xx,[30 31 127])% arrow upward, downward, or delete
    13551354    Coord=get(handles.ListCoord,'Data');
    1356     ind=find(Coord(:,6));
     1355    ind=find(Coord(:,6));%find the marker '+' for line selection
    13571356    Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark
    13581357    switch xx
     
    13611360        case 31% arrow downward
    13621361            Coord(ind+1,6)=1;
    1363         case {8 127}% remove line
     1362        case 127% remove line
    13641363            Coord(ind,:)=[];
     1364            PLOT_Callback(hObject,eventdata,handles)
    13651365    end
    13661366    set(handles.ListCoord,'Data',Coord);
    1367     PLOT_Callback(hObject,eventdata,handles)
    13681367end
    13691368
  • trunk/src/mouse_down.m

    r669 r680  
    6262    hset_object=findobj(allchild(0),'Name','set_object');
    6363    if ~isempty(hset_object)
    64         hPLOT=findobj(hset_object,'tag','PLOT');
     64        hPLOT=findobj(hset_object,'tag','REFRESH');
    6565        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'
    6666    end
     
    285285                    %indicate on the list of the GUI uvmat which object has been selected
    286286            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 %                 else
    291 %                     IndexObj=[1 IndexObj];
    292 %                 end
    293287                set(hhuvmat.ListObject,'Value',IndexObj);
    294 %                 set(hhuvmat.ListObject,'UserData',IndexObj);
    295288            else
    296289                set(hhuvmat.ListObject_1,'Value',IndexObj);
     
    298291                UvData.ProjObject{IndexObj}.Name=list_str{IndexObj};
    299292            end
    300 %             h_set_object=findobj(allchild(0),'Tag','set_object');
    301 %             if ~isempty(h_set_object)
    302 %                 delete(h_set_object)
    303 %             end
    304293            set_object(UvData.ProjObject{IndexObj})
    305294            axes(hchild);%set back the current axes haxes
  • trunk/src/plot_object.m

    r655 r680  
    410410        end     
    411411    else% no patch image requested, erase existing ones
     412        if isfield(PlotData,'SubObject')
    412413        for iobj=1:length(PlotData.SubObject)
    413414            if ishandle(PlotData.SubObject(iobj)) && strcmp(get(PlotData.SubObject(iobj),'Type'),'image')
    414415                delete(PlotData.SubObject(iobj))
    415416            end
     417        end
    416418        end
    417419    end
     
    467469            hh=rectangle('Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'LineWidth',2,'EdgeColor',col);
    468470        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);
    470472        otherwise
    471473            msgbox_uvmat('ERROR','unknown ObjectData.Type in plot_object.m')
  • trunk/src/set_object.m

    r675 r680  
    3636function varargout = set_object(varargin)
    3737
    38 % Last Modified by GUIDE v2.5 26-Jan-2012 22:00:47
    39 
    40 % Begin initialization code - DO NOT PLOT
     38% Last Modified by GUIDE v2.5 28-Aug-2013 20:41:02
     39
     40% Begin initialization code - DO NOT REFRESH
    4141gui_Singleton = 1;
    4242gui_State = struct('gui_Name',       mfilename, ...
     
    5555    gui_mainfcn(gui_State, varargin{:});
    5656end
    57 % End initialization code - DO NOT PLOT
     57% End initialization code - DO NOT REFRESH
    5858%------------------------------------------------------------------------
    5959%------------------------------------------------------------------------
     
    6363%'IndexObj': NON USED ANYMORE (To suppress) index of the object (on the UvData list) that set_object will modify
    6464%        if =[] or absent: index still undefined (create mode in uvmat)
    65 %        if=0; no associated object (used for series), the button 'PLOT' is  then unvisible
     65%        if=0; no associated object (used for series), the button 'REFRESH' is  then unvisible
    6666%'data': read from an existing object selected in the interface
    6767%      .Name : class of object ('POINTS','LINE',....)
     
    7070%      .ParentButton: handle of the uicontrol object calling the interface
    7171% 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)
    7373% parameters on the uvmat interface (obtained by 'get_plot_handle.m')
    7474function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds)
     
    164164set(get(handles.set_object,'children'),'enable','off')
    165165set(handles.SAVE,'enable','on')
    166 % set(handles.PLOT,'enable','off')
     166% set(handles.REFRESH,'enable','off')
    167167
    168168
     
    415415
    416416%------------------------------------------------------------------------
    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%------------------------------------------------------------------------
     419function REFRESH_Callback(hObject, eventdata, handles)
     420
     421set(handles.REFRESH,'BackgroundColor',[1 1 0])
    421422drawnow
    422423
     
    429430    set(hseries,'UserData',SeriesData);
    430431    end
    431     set(handles.PLOT,'BackgroundColor',[1 0 0])
     432    set(handles.REFRESH,'BackgroundColor',[1 0 0])
    432433    return
    433434end
     
    504505end
    505506
    506 %% plot the field projected on the object
     507%% refresh the field projected on the object
    507508hview_field=[];%default
    508509IndexObj_1=get(hhuvmat.ListObject_1,'Value');
     
    516517        if ~isempty(errormsg)
    517518            msgbox_uvmat('ERROR', ['set_object/tps_coeff_field/' errormsg])
    518             set(handles.PLOT,'enable','on')
     519            set(handles.REFRESH,'enable','on')
    519520            return
    520521        end
     
    523524    if ~isempty(errormsg)
    524525        msgbox_uvmat('ERROR', ['set_object/proj_field/' errormsg])
    525         set(handles.PLOT,'enable','on')
     526        set(handles.REFRESH,'enable','on')
    526527        return
    527528    end
     
    557558end
    558559
    559 %% update the object plot
     560%% update the object refresh
    560561hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
    561562% if we are editing the object used for projection in uvmat
     
    570571    UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=...
    571572             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)
    573574    ObjectInfo=get(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData');
    574575    ObjectInfo.IndexObj=IndexObj;
     
    587588set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update
    588589set(hhuvmat.CheckViewField,'Value',1)
    589 set(handles.PLOT,'BackgroundColor',[1 0 0])
     590set(handles.REFRESH,'BackgroundColor',[1 0 0])
    590591%------------------------------------------------------------------------
    591592% --- Executes on button press in MenuCoord.
     
    691692
    692693% update graph
    693 PLOT_Callback(hObject, eventdata, handles)
     694REFRESH_Callback(hObject, eventdata, handles)
    694695
    695696%------------------------------------------------------------------------
     
    719720function Coord_CellEditCallback(hObject, eventdata, handles)
    720721%------------------------------------------------------------------------
    721 ListType=get(handles.Type,'String');
    722 Type=ListType{get(handles.Type,'Value')};
    723 switch Type
    724     % add lines if multi line input needed
    725     case{'points','polyline','polygon'}
    726         Input=str2num(eventdata.EditData);%pasted input
    727         Coord=get(handles.Coord,'Data');
    728         iline=eventdata.Indices(1);% selected line number
    729         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 column
    731         end
    732         Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input';
    733         set(handles.Coord,'Data',Coord)
    734 end
    735 
     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%------------------------------------------------------------------------
    736737% --- Executes when selected cell(s) is changed in ListCoord.
     738%------------------------------------------------------------------------
    737739function Coord_CellSelectionCallback(hObject, eventdata, handles)
    738740
    739741if ~isempty(eventdata.Indices)
    740742    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
    742744end
    743745
     
    748750
    749751xx=double(get(handles.set_object,'CurrentCharacter')); %get the keyboard character
    750 if ismember(xx,[8 127 31])%backspace or delete, or downward
     752if ismember(xx,[127 31])% delete, or downward
    751753    Coord=get(handles.Coord,'Data');
    752754    iline=get(handles.Coord,'UserData');
  • trunk/src/uvmat.m

    r675 r680  
    47154715if check_plot
    47164716    hhset_object=guidata(hset_object);
    4717     set_object('PLOT_Callback',1,[],hhset_object);% call the GUI set_object
     4717    set_object('REFRESH_Callback',1,[],hhset_object);% call the GUI set_object
    47184718end
    47194719
     
    47214721function MenuBrowseObject_Callback(hObject, eventdata, handles)
    47224722%------------------------------------------------------------------------
    4723 %get the object file 
     4723%get the object file
    47244724fileinput=uigetfile_uvmat('pick an xml object file:',get(handles.RootPath,'String'),'.xml');
    47254725if ~isempty(fileinput)
     
    47294729        msgbox_uvmat('WARNING','The xml file does not have the heading ProjObject for projection objects')
    47304730    end
    4731    % [tild,data.Name]=fileparts(fileinput);% object name set as file name
    47324731    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);
    47404734    UvData=get(handles.uvmat,'UserData');
    47414735    UvData.ProjObject{IndexObj}=[]; %create a new empty object
     
    47434737    UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
    47444738    set(handles.uvmat,'UserData',UvData)
    4745 %     set(handles.ListObject,'String',ListObject)
    4746 %     set(handles.ListObject,'Value',IndexObj)
    47474739    set(handles.CheckViewObject,'Value',1)
    47484740    set(handles.CheckViewField,'Value',1)
    47494741    hset_object=set_object(data);% call the set_object interface
    47504742    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
    47534744    set(handles.CheckEditObject,'Value',0); %suppress the object edit mode
    47544745    CheckEditObject_Callback([],[],handles)
    47554746    set(handles.DeleteObject,'Visible','on')
    47564747end
    4757 
    4758 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    4759 % % MenuEdit Callbacks
    4760 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    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)
    47734748
    47744749%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.