Changeset 622 for trunk/src/set_object.m


Ignore:
Timestamp:
Apr 29, 2013, 11:35:27 AM (8 years ago)
Author:
sommeria
Message:

mouse system for uvmat imrpoved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r613 r622  
    475475set(hhuvmat.ListObject,'String',ListObject);%complement the object list
    476476set(hhuvmat.ViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object
    477 check_handle=isfield(UvData.Object{IndexObj},'DisplayHandle') && isfield(UvData.Object{IndexObj}.DisplayHandle,'uvmat')...
    478     && ~isempty(UvData.Object{IndexObj}.DisplayHandle.uvmat) && ishandle(UvData.Object{IndexObj}.DisplayHandle.uvmat);
     477check_handle=isfield(UvData.ProjObject{IndexObj},'DisplayHandle') && isfield(UvData.ProjObject{IndexObj}.DisplayHandle,'uvmat')...
     478    && ~isempty(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat) && ishandle(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat);
    479479if check_handle
    480     obj_handle=UvData.Object{IndexObj}.DisplayHandle.uvmat;
    481 end
    482 UvData.Object{IndexObj}=ObjectData;%record the current object properties in uvmat
     480    obj_handle=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
     481end
     482UvData.ProjObject{IndexObj}=ObjectData;%record the current object properties in uvmat
    483483if check_handle
    484     UvData.Object{IndexObj}.DisplayHandle.uvmat=obj_handle; %preserve the object plot handle if valid
    485 else
    486     UvData.Object{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; %axes taken as object display handle by defualt
     484    UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=obj_handle; %preserve the object plot handle if valid
     485else
     486    UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; %axes taken as object display handle by defualt
    487487end
    488488%set(hhuvmat.edit_object,'Value',1)% set the current object to edit mode
     
    543543
    544544%% update the object plot
    545 hobject=UvData.Object{IndexObj}.DisplayHandle.uvmat;
     545hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
    546546% if we are editing the object used for projection in uvmat
    547547if isequal(IndexObj_1,IndexObj)
    548548    %update the representation of the current object for projection field represented in view_field
    549     for iobj=1:numel(UvData.Object)
    550         UvData.Object{iobj}.DisplayHandle.uvmat=...
    551             plot_object(UvData.Object{iobj},UvData.Object{IndexObj_1},UvData.Object{iobj}.DisplayHandle.uvmat,'b');
     549    for iobj=1:numel(UvData.ProjObject)
     550        UvData.ProjObject{iobj}.DisplayHandle.uvmat=...
     551            plot_object(UvData.ProjObject{iobj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{iobj}.DisplayHandle.uvmat,'b');
    552552    end
    553553else %  we are editing the object used for projection field represented in view_field
    554554    %update the representation of the current object in uvmat
    555     UvData.Object{IndexObj}.DisplayHandle.uvmat=...
    556              plot_object(UvData.Object{IndexObj},UvData.Object{IndexObj_1},UvData.Object{IndexObj}.DisplayHandle.uvmat,'m');
     555    UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=...
     556             plot_object(UvData.ProjObject{IndexObj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'m');
    557557    %indicate the object index in the user data of the object plot (needed for further mouse editing)
    558     ObjectInfo=get(UvData.Object{IndexObj}.DisplayHandle.uvmat,'UserData');
     558    ObjectInfo=get(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData');
    559559    ObjectInfo.IndexObj=IndexObj;
    560     set(UvData.Object{IndexObj}.DisplayHandle.uvmat,'UserData',ObjectInfo)
     560    set(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData',ObjectInfo)
    561561    % update the representation of all objects in view_field
    562     for iobj=1:numel(UvData.Object)
    563         if isfield(UvData.Object{iobj}.DisplayHandle,'view_field')
    564             UvData.Object{iobj}.DisplayHandle.view_field=...
    565                 plot_object(UvData.Object{iobj},UvData.Object{iobj},UvData.Object{iobj}.DisplayHandle.view_field,'b');
     562    for iobj=1:numel(UvData.ProjObject)
     563        if isfield(UvData.ProjObject{iobj}.DisplayHandle,'view_field')
     564            UvData.ProjObject{iobj}.DisplayHandle.view_field=...
     565                plot_object(UvData.ProjObject{iobj},UvData.ProjObject{iobj},UvData.ProjObject{iobj}.DisplayHandle.view_field,'b');
    566566        end
    567567    end
Note: See TracChangeset for help on using the changeset viewer.