VTK
vtkOutputWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOutputWindow.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkOutputWindow_h
29 #define vtkOutputWindow_h
30 
31 #include "vtkDebugLeaksManager.h" // Must be included before singletons
32 #include "vtkCommonCoreModule.h" // For export macro
33 #include "vtkObject.h"
34 
35 class VTKCOMMONCORE_EXPORT vtkOutputWindowCleanup
36 {
37 public:
40 
41 private:
42  vtkOutputWindowCleanup(const vtkOutputWindowCleanup& other) = delete;
43  vtkOutputWindowCleanup& operator=(const vtkOutputWindowCleanup& rhs) = delete;
44 };
45 
46 class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
47 {
48 public:
49 // Methods from vtkObject
50  vtkTypeMacro(vtkOutputWindow,vtkObject);
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
61  static vtkOutputWindow* New();
62 
66  static vtkOutputWindow* GetInstance();
71  static void SetInstance(vtkOutputWindow *instance);
72 
74 
81  virtual void DisplayText(const char*);
82  virtual void DisplayErrorText(const char*);
83  virtual void DisplayWarningText(const char*);
84  virtual void DisplayGenericWarningText(const char*);
85  virtual void DisplayDebugText(const char*);
87 
89 
98  vtkBooleanMacro(PromptUser, bool);
99  vtkSetMacro(PromptUser, bool);
101 
103 
110  vtkSetMacro(UseStdErrorForAllMessages, bool);
111  vtkGetMacro(UseStdErrorForAllMessages, bool);
112  vtkBooleanMacro(UseStdErrorForAllMessages, bool);
114 
115 protected:
116  vtkOutputWindow();
117  ~vtkOutputWindow() override;
118 
120  {
125  MESSAGE_TYPE_DEBUG
126  };
127 
133  vtkGetMacro(CurrentMessageType, MessageTypes);
134 
135  bool PromptUser;
137 
138 private:
139  static vtkOutputWindow* Instance;
140  MessageTypes CurrentMessageType;
141 
142 private:
143  vtkOutputWindow(const vtkOutputWindow&) = delete;
144  void operator=(const vtkOutputWindow&) = delete;
145 };
146 
147 // Uses schwartz counter idiom for singleton management
149 
150 
151 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool UseStdErrorForAllMessages
a simple class to control print indentation
Definition: vtkIndent.h:39
base class for writing debug output to a console
static vtkOutputWindowCleanup vtkOutputWindowCleanupInstance
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...