IGSTK
igstkVTKLoggerOutput.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkVTKLoggerOutput.h,v $
5  Language: C++
6  Date: $Date: 2008-02-11 01:41:51 $
7  Version: $Revision: 1.11 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/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  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 
21 #ifndef __igstkVTKLoggerOutput_h
22 #define __igstkVTKLoggerOutput_h
23 
24 #include <vtkOutputWindow.h>
25 #include <vtkSmartPointer.h>
26 #include <igstkLogger.h>
27 #include "igstkMacros.h"
28 
29 
30 namespace igstk
31 {
46 class VTKLoggerOutput : public vtkOutputWindow
47 {
48 public:
51  typedef vtkOutputWindow Superclass;
52  typedef vtkSmartPointer<Self> Pointer;
53  typedef vtkSmartPointer<const Self> ConstPointer;
54 
56  igstkTypeMacro(VTKLoggerOutput, vtkOutputWindow);
57 
59  static VTKLoggerOutput* New();
60 
62  virtual void DisplayText(const char* t);
63 
67  virtual void DisplayErrorText(const char *t);
68 
72  virtual void DisplayWarningText(const char *t);
73 
77  virtual void DisplayGenericWarningText(const char *t);
78 
82  virtual void DisplayDebugText(const char *t);
83 
88  virtual void OverrideVTKWindow();
89 
91  typedef std::ostream StdOStreamType;
92 
94  void Print(StdOStreamType& os);
95 
98 
101  igstkGetMacro( NumberOfErrorMessages, unsigned int );
102 
105  igstkGetMacro( NumberOfWarningMessages, unsigned int );
106 
107 protected:
109  VTKLoggerOutput();
110 
112  virtual ~VTKLoggerOutput();
113 
115  void UnRegister(vtkObjectBase *o);
116 
118  void PrintSelf(StdOStreamType& os, itk::Indent indent) const;
119 
120 private:
121 
123  int m_InUnRegister;
124 
129  unsigned int m_NumberOfErrorMessages;
130 
135  unsigned int m_NumberOfWarningMessages;
136 
137 };
138 
140 std::ostream& operator<<(std::ostream& os, VTKLoggerOutput& o);
141 } // end namespace igstk
142 
143 
144 #endif // __igstkVTKLoggerOutput_h
#define igstkTypeMacro(thisClass, superclass)
Type Macro defines the GetNameOfClass() method for every class where it is invoked.
Definition: igstkMacros.h:128
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
VTKLoggerOutput()
Constructor.
virtual void DisplayDebugText(const char *t)
Send a string as a debug message to display.
virtual void DisplayText(const char *t)
Send a string to display.
virtual void DisplayGenericWarningText(const char *t)
Send a string as a message to display.
virtual void OverrideVTKWindow()
Overrides the default VTK log window.
std::ostream & operator<<(std::ostream &os, const igstk::AffineTransform &o)
static VTKLoggerOutput * New()
Create an object.
vtkSmartPointer< const Self > ConstPointer
std::ostream StdOStreamType
Type definition for the standard output stream.
This class overrides vtk::OutputWindow to redirect messages from VTK to itk::Logger.
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
virtual void DisplayErrorText(const char *t)
Send a string as an error message to display.
void Print(StdOStreamType &os)
Print information about this object.
void PrintSelf(StdOStreamType &os, itk::Indent indent) const
Print information about this object.
virtual void DisplayWarningText(const char *t)
Send a string as a warningmessage to display.
#define igstkLoggerMacro()
Macro that defines all the standard elements related to the Logger.
Definition: igstkMacros.h:143
VTKLoggerOutput Self
Standard class typedefs.
void UnRegister(vtkObjectBase *o)
Override UnRegister for special reference count handling.
vtkSmartPointer< Self > Pointer
virtual ~VTKLoggerOutput()
Destructor.