Home > classes > @cdata > display.m

display

PURPOSE ^

DISPLAY implement terminal display for cdata object.

SYNOPSIS ^

function varargout = display(varargin)

DESCRIPTION ^

 DISPLAY implement terminal display for cdata object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: DISPLAY implement terminal display for cdata object.

 M-FILE INFO: Get information about this methods by calling
              >> cdata.getInfo('display')

              Get information about a specified set-plist by calling:
              >> cdata.getInfo('display', 'None')

 VERSION:     $Id: display.m,v 1.11 2008/08/04 17:02:02 ingo Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % DISPLAY implement terminal display for cdata object.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: DISPLAY implement terminal display for cdata object.
0005 %
0006 % M-FILE INFO: Get information about this methods by calling
0007 %              >> cdata.getInfo('display')
0008 %
0009 %              Get information about a specified set-plist by calling:
0010 %              >> cdata.getInfo('display', 'None')
0011 %
0012 % VERSION:     $Id: display.m,v 1.11 2008/08/04 17:02:02 ingo Exp $
0013 %
0014 % HISTORY:     31-01-2007 M Hewitson
0015 %                 Creation
0016 %
0017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0018 
0019 function varargout = display(varargin)
0020 
0021   %%% Check if this is a call for parameters
0022   if utils.helper.isinfocall(varargin{:})
0023     varargout{1} = getInfo(varargin{3});
0024     return
0025   end
0026 
0027   cdatas = utils.helper.collect_objects(varargin(:), 'cdata');
0028 
0029   txt = {};
0030 
0031   for i=1:numel(cdatas)
0032     banner = sprintf('-------- cdata %02d ------------', i);
0033     txt{end+1} = banner;
0034     txt{end+1} = ' ';
0035 
0036     x     = cdatas(i).getX;
0037     y     = cdatas(i).y;
0038     xinfo = whos('x');
0039     yinfo = whos('y');
0040 
0041     txt{end+1} = sprintf('  x:  [%dx%d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0042     txt{end+1} = sprintf('  y:  [%dx%d], %s', yinfo.size(1), yinfo.size(2), yinfo.class);
0043 
0044     banner_end(1:length(banner)) = '-';
0045     txt{end+1} = banner_end;
0046 
0047     txt{end+1} = ' ';
0048   end
0049 
0050   if nargout == 0
0051     for ii=1:length(txt)
0052       disp(txt{ii});
0053     end
0054   end
0055 
0056   varargout{1} = txt;
0057 end
0058 
0059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0060 %                               Local Functions                               %
0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0062 
0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0064 %
0065 % FUNCTION:    getInfo
0066 %
0067 % DESCRIPTION: Get Info Object
0068 %
0069 % HISTORY:     11-07-07 M Hewitson
0070 %                Creation.
0071 %
0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0073 
0074 function ii = getInfo(varargin)
0075   if nargin == 1 && strcmpi(varargin{1}, 'None')
0076     sets = {};
0077     pl   = [];
0078   else
0079     sets = {'Default'};
0080     pl   = getDefaultPlist;
0081   end
0082   % Build info object
0083   ii = minfo(mfilename, 'cdata', '', 'Output', '$Id: display.m,v 1.11 2008/08/04 17:02:02 ingo Exp $', sets, pl);
0084 end
0085 
0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0087 %
0088 % FUNCTION:    getDefaultPlist
0089 %
0090 % DESCRIPTION: Get Default Plist
0091 %
0092 % HISTORY:     11-07-07 M Hewitson
0093 %                Creation.
0094 %
0095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0096 
0097 function plo = getDefaultPlist()
0098   plo = plist();
0099 end
0100

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003