www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgsurfview/@dataviewer/show.m

    function show(obj,plottype)
%SHOW Function to switch between plot types.
%
%  obj.show(plottype) where plottype is the index of the plot type, or zero
%    to show the "Click 'Evaluate Now'" card.
% It is the caller's responsibility to be sure that the plot is up to date.

%  Copyright 2000-2009 The MathWorks, Inc. and Ford Global Technologies, Inc.


if nargin>1 && plottype>0
    obj.currentplottype = plottype;
	set(obj.layout, 'currentcard', 1);
    for n=1:obj.MaxPlots
        i_showplottype(obj, plottype, n);
    end
else
	set(obj.layout, 'currentcard', 2);
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%
function i_showplottype(obj, plottype, frameindex)

code = obj.haserror(plottype,frameindex);
if code<0
    % error last time.  show the "blank" card which contains
    % and error message
    blankcard = size(obj.framedata,1);
    set(obj.plotcards{frameindex}, 'currentcard', blankcard);
elseif code>0
    if (code==plottype)
        error(message('mbc:cgsurfview:dataviewer:InvalidArgument4'));
    end
    % replaced with a different plot type last time.  show that card
    i_showplottype(obj, code, frameindex);
else
    set(obj.plotcards{frameindex}, 'currentcard', plottype);
    if frameindex<=length(obj.visiblecards)
        % Only update the visiblecards value for plots that are actually
        % showing
        obj.visiblecards(frameindex) = plottype;
    end
end