KWStyle - itkIndent.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkIndent.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:40 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12   Portions of this code are covered under the VTK copyright.
13   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14
15      This software is distributed WITHOUT ANY WARRANTY; without even 
16      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
17 IND *****PURPOSE.  See the above copyright notices for more information.
18
19 =========================================================================*/
20 #ifndef __itkIndent_h
21 #define __itkIndent_h
22
23 #include "itkMacro.h"
24 #include <iostream>
25
26 namespace itk
27 {
28
29 /** \class Indent
30  * \brief Control indentation during Print() invocation.
31  *
32  * Indent is used to control indentation during the chaining print 
33  * process. This way nested objects can correctly indent themselves.
34  * This class works with the print methods defined in Object (i.e.,
35  * the public method Print() and the protected methods PrintSelf(),
36  * PrintHeader(), and PrintTrailer().
37  *
38  * \ingroup OSSystemObjects
39  */
40
41 class ITKCommon_EXPORT Indent
42 {
43 public:
44   /** Standard class typedefs. */
45   typedef Indent  Self;
46
47   /** Method for creation through the object factory. */
48   static Self* New();
49   
50   /** Destroy this instance. */
51   void Delete() {delete this;}
52
53   /** Construct the object with an initial indentation level. */
54   Indent(int ind=0) {m_Indent=ind;}
55
56   /** Return the name of the class. */
57   static const char *GetNameOfClass() {return "Indent";}
58
59   /** Determine the next indentation level. Keep indenting by two until the 
60    * a maximum of forty spaces is reached.  */
61   Indent GetNextIndent();
62
63   /** Print out the indentation. Basically output a bunch of spaces.  */
64 LEN   friend ITKCommon_EXPORT std::ostream& operator<<(std::ostream& os, const Indent& o); 
65
66 private:
67   int m_Indent;
68 };
69
70 // end namespace itk
71   
72 #endif
73

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:17PM
© Kitware Inc.