Changeset 252 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 15, 2011, 11:17:08 PM (10 years ago)
Author:
sommeria
Message:

various bugs corrected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r251 r252  
    230230set(hObject,'WindowButtonUpFcn',{'mouse_up',handles})
    231231set(hObject,'DeleteFcn',{@closefcn})%
     232set(handles.list_object_1,'ButtonDownFcn',{@list_object_1_Callback,handles})% allows activation of lis_object_1_callback with right mouse click
     233set(handles.list_object_2,'ButtonDownFcn',{@list_object_2_Callback,handles})
    232234
    233235%% refresh projection plane
     
    16761678function runplus_Callback(hObject, eventdata, handles)
    16771679%-------------------------------------------------------------------
     1680eventdata
    16781681set(handles.runplus,'BackgroundColor',[1 1 0])%paint the command button in yellow
    16791682drawnow
     
    25702573else
    25712574    % create a default projection
    2572 %     UvData.Object{1}.ProjMode='projection';%main plotting plane
    2573 %     UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
    2574 %     set(handles.list_object_1,'Value',1);
    2575 %     set(handles.list_object_1,'String',{''});
     2575    UvData.Object{1}.ProjMode='projection';%main plotting plane
     2576    UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
     2577    set(handles.list_object_1,'Value',1);
     2578    list_object=get(handles.list_object_1,'String')
     2579    if isempty(list_object)
     2580        list_object={''};
     2581    elseif ~isempty(list_object{1})
     2582        list_object=[{''};list_object];
     2583    end
     2584    set(handles.list_object_1,'String',list_object);
     2585    set(handles.list_object_2,'String',list_object);
    25762586end
    25772587% if ~isfield(UvData.Object{1},'plotaxes')
     
    42954305list_str=get(handles.list_object_1,'String');
    42964306IndexObj=get(handles.list_object_1,'Value');
    4297 str_1=list_str{IndexObj};
    4298 % val_2=get(handles.list_object_2,'Value');
    4299 % str_2=get(handles.list_object_2,'String');
    4300 % if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second
    4301 %     set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...')
    4302 %     list_object_2_Callback(hObject, eventdata, handles)
    4303 % end
    4304 update_object(handles,IndexObj,1,str_1)
     4307%IndexObj(2)=get(handles.list_object_2,'Value');
     4308update_object(handles,IndexObj,1,list_str{IndexObj})
    43054309
    43064310%------------------------------------------------------------------------
     
    43104314list_str=get(handles.list_object_2,'String');
    43114315IndexObj=get(handles.list_object_2,'Value');
    4312 if ischar(list_str) || isempty(list_str{IndexObj})% || strcmp(list_str{IndexObj},'...')
     4316%IndexObj(2)=get(handles.list_object_2,'Value')-1;
     4317% if no projection object is selected, close view_field
     4318if ischar(list_str) || isempty(list_str{IndexObj})
    43134319    hview_field=findobj(allchild(0),'Tag','view_field');
    43144320    if ~isempty(hview_field)
     
    43204326    end
    43214327else
    4322     update_object(handles,IndexObj,2,list_str{IndexObj})
     4328    if isequal(get(handles.uvmat,'SelectionType'),'alt')
     4329        option=4;%will show object properties on the GUI set_object
     4330    else
     4331        option=2; % just update the projection
     4332    end
     4333    update_object(handles,IndexObj,option,list_str{IndexObj})   
    43234334end
    43244335
     
    43274338%------------------------------------------------------------------------
    43284339UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    4329 if numel(UvData.Object)<IndexObj;
     4340if numel(UvData.Object)<max(IndexObj);
    43304341    return
    43314342end
     4343% if option==1 ||option==3
    43324344ObjectData=UvData.Object{IndexObj};
     4345% else
     4346%    ObjectData=UvData.Object{IndexObj};
     4347% end
    43334348ObjectData.Name=ObjectName;
    43344349if isequal(get(handles.edit_object,'Value'),1)
     
    43524367    end
    43534368end
    4354 hset_object=set_object(ObjectData,[],ZBounds);% call the set_object interface,
    4355 
    4356 % %project the current field on the object and plot it
    4357 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    4358 if option==1%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes)
     4369
     4370if option==3 ||option==4% right mouse selection, show the GUI set_object:
     4371    hset_object=set_object(ObjectData,[],ZBounds);
     4372end
     4373
     4374%project on the selected object and update the corresponding plot
     4375hview_field=findobj(allchild(0),'tag','view_field');
     4376% PlotHandles=guidata(hview_field);
     4377if option==1 ||  option==3%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes)
    43594378    PlotHandles=handles;
    43604379else
    4361     hview_field=findobj(allchild(0),'tag','view_field');
    43624380    if isempty(hview_field)
    43634381        hview_field=view_field;
     
    43654383    PlotHandles=guidata(hview_field);
    43664384end
    4367 %plot_field(ProjData,PlotHandles.axes3,PlotHandles);
    4368 set(handles.uvmat,'UserData',UvData)
    4369 hother=findobj('Tag','proj_object');%find all the proj objects
     4385if option==1 ||option==2% lefet mouse selection, peroject the field:
     4386    ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
     4387    plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles);
     4388    UvData.Object=update_obj(UvData,IndexObj,[]);
     4389    set(handles.uvmat,'UserData',UvData)
     4390end
     4391
     4392
     4393% set(handles.uvmat,'UserData',UvData)
     4394hother=[findobj(handles.axes3,'Tag','proj_object') ;findobj(PlotHandles.axes3,'Tag','proj_object')] ;%find all the proj objects
     4395hother=[hother ;findobj(handles.axes3,'Tag','DeformPoint'); findobj(PlotHandles.axes3,'Tag','DeformPoint')];
    43704396for iobj=1:length(hother)
    43714397    if isequal(get(hother(iobj),'Type'),'rectangle')||isequal(get(hother(iobj),'Type'),'patch')
     
    43834409    set(hother(iobj),'Selected','off')
    43844410end
    4385 hother=findobj('Tag','DeformPoint');
    4386 set(hother,'Color','b');
    4387 set(hother,'Selected','off')
    43884411if isfield(ObjectData,'DisplayHandle_uvmat')
    43894412    if ishandle(ObjectData.DisplayHandle_uvmat)
     
    44174440        end
    44184441    end
    4419     %     end
    4420 end
    4421 % pause(0.1)
    4422 figure(hset_object)%put set_object in front
     4442end
    44234443
    44244444%------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.