Ignore:
Timestamp:
Dec 19, 2010, 10:11:04 PM (13 years ago)
Author:
sommeria
Message:

many bug repairs and corrections for mouse action
create_grid: option for black marjkers for grid detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_object.m

    r38 r156  
    3737
    3838function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col)
     39%% default output
    3940hh=[];%default output
    4041if isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot
     
    4849    return % no object representation yet available
    4950end
    50 if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style)
     51if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style)
    5152    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
    5253    return
    5354end
    54 if ~isfield(ObjectData,'Style')|isempty(ObjectData.Style)|~ischar(ObjectData.Style)
     55if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style)
    5556    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
    5657    return
     
    6364ZMax=0;
    6465
    65 %determine the plotting axes (with handle 'haxes')
     66%% determine the plotting axes (with handle 'haxes')
    6667test_newobj=1;
    6768if ishandle(hplot)
    68     if isequal(get(hplot,'Tag'),'proj_object') 
     69    if isequal(get(hplot,'Tag'),'proj_object')% hplot is the handle of an object representation 
    6970        test_newobj=0;
    7071        haxes=get(hplot,'parent');
    71     elseif isequal(get(hplot,'Type'),'axes')
    72         axes(hplot)
     72    elseif isequal(get(hplot,'Type'),'axes')% hplot is the handle of an axis
     73        currentfig=get(hplot,'parent');
     74        set(0,'CurrentFigure',currentfig)
    7375        haxes=hplot;
    74     elseif isequal(get(hplot,'Type'),'figure')
    75         figure(hplot);%set the input figure as the current one
     76        set(currentfig,'CurrentAxes',haxes);
     77    elseif isequal(get(hplot,'Type'),'figure')% hplot is the handle of a figure
     78        set(0,'CurrentFigure',hplot);%set the input figure as the current one
    7679        haxes=findobj(hplot,'Type','axes');%look for axes in the figure
    7780        haxes=haxes(1);
    78         axes(haxes); %set the first found axis as the current one
     81        set(hplot,'CurrentAxes',haxes);%set the first found axis as the current one
    7982    else
    8083        figure; %create new figure
     
    8891end
    8992
    90 %default input parameters
     93%% default input parameters
    9194if ~isfield(ObjectData,'ProjMode')|isempty(ObjectData.ProjMode)
    9295     ObjectData.ProjMode='projection';%default
     
    148151sizcoord=size(ObjectData.Coord);
    149152
    150 %determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
     153%% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
    151154test_line= isequal(ObjectData.Style,'points')|isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|...
    152155    isequal(ObjectData.Style,'polygon')| isequal(ObjectData.Style,'plane')| isequal(ObjectData.Style,'volume');
     
    206209end
    207210
    208 %shading image
     211%% shading image
    209212if test_patch
    210213    npMx=512;
     
    267270
    268271PlotData=[];%default
    269 %MODIFY AN EXISTING OBJECT PLOT
     272%% MODIFY AN EXISTING OBJECT PLOT
    270273if test_newobj==0;
    271274    hh=hplot;
     
    326329end
    327330
    328 %create the object
     331%% create the object
    329332if test_newobj
    330333    axes(haxes)
Note: See TracChangeset for help on using the changeset viewer.