KWStyle - itkOutputWindow.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkOutputWindow.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:43 $
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 __itkOutputWindow_h
21 #define __itkOutputWindow_h
22
23 #include "itkObject.h"
24
25 namespace itk
26 {
27 /** \class OutputWindow
28  * \brief Messages sent from the system are collected by this object.
29  *
30  * Text messages that the system should display to the user are sent to 
31  * this object (or subclasses of this object).
32  *
33  * \ingroup OSSystemObjects
34  */
35 class ITKCommon_EXPORT OutputWindow : public Object
36 {
37 public:
38   /** Standard class typedefs. */
39   typedef OutputWindow        Self;
40 TDA   typedef Object  Superclass;
41   typedef SmartPointer<Self>  Pointer;
42 TDA   typedef SmartPointer<const Self>  ConstPointer;
43   
44   /** Run-time type information (and related methods). */
45   itkTypeMacro(OutputWindow, Object);
46
47   /** This is a singleton pattern New.  There will only be ONE
48    * reference to a OutputWindow object per process.  Clients that
49    * call this must call Delete on the object so that the reference
50    * counting will work.   The single instance will be unreferenced when
51    * the program exits. */
52   static Pointer New();
53
54   /** Return the singleton instance with no reference counting. */
55   static Pointer GetInstance();
56
57   /** Supply a user defined output window. Call ->Delete() on the supplied
58    * instance after setting it. */
59   static void SetInstance(OutputWindow *instance);
60
61   /** Send a string to display. */
62   virtual void DisplayText(const char*);
63
64   /** Send a string as an error message to display.
65    * The default implementation calls DisplayText() but subclasses
66    * could present this message differently. */
67   virtual void DisplayErrorText(const char *t) { this->DisplayText(t); };
68
69   /** Send a string as a warningmessage to display.
70    * The default implementation calls DisplayText() but subclasses
71    * could present this message differently. */
72   virtual void DisplayWarningText(const char *t) { this->DisplayText(t); };
73
74   /** Send a string as a message to display.
75    * The default implementation calls DisplayText() but subclasses
76    * could present this message differently. */
77   virtual void DisplayGenericOutputText(const char *t) {this->DisplayText(t);}
78
79   /** Send a string as a debug message to display.
80    * The default implementation calls DisplayText() but subclasses
81    * could present this message differently. */
82   virtual void DisplayDebugText(const char *t) { this->DisplayText(t); };
83   
84   /** If PromptUser is set to true then each time a line of text
85    * is displayed, the user is asked if they want to keep getting
86    * messages. */
87   itkSetMacro(PromptUser,bool);
88   itkGetMacro(PromptUser,bool);
89   itkBooleanMacro(PromptUser);
90   
91 protected:
92   OutputWindow();
93   virtual ~OutputWindow();
94   virtual void PrintSelf(std::ostream& os, Indent indent) const;
95
96 private:
97   OutputWindow(const Self&); //purposely not implemented
98   void operator=(const Self&); //purposely not implemented
99
100   bool m_PromptUser;
101   static Pointer m_Instance;
102 };
103   
104 // end namespace itk
105
106 #endif
107

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