www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgsurfview/@dataviewer/canPrint.m
function out = canPrint(obj,plottype) %CANPRINT Check whether printing is possible. % CANPRINT(OBJ, TYPE) checks whether printing is possible for % the specified plot type. This does not take into account the currnet % configuration of the surface viewer such as whether a view has reduced % its dimensionality. TYPE is the index of the plot type, as returned by % getPlotTypes. The return value is true or false. % % CANPRINT(OBJ) checks whether printing is possible for the current % dataviewer configuration. This will only return true if there is at % least one visible plot that supports printing and is not displaying % data errors. % Copyright 2000-2009 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin==2 out = obj.plottypes(plottype).cancopy; else % Loop over actual visible views to see if they can copy out = false; vc = obj.visiblecards; for n = 1:numel(vc) % The visible card may be greater than the number of plot types if % the "message" card is being shown. This is not printable so % nothing needs to be |-ed with out. if vc(n)<=length(obj.plottypes) out = out || obj.plottypes(vc(n)).cancopy; end end end