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 =========================================================================*/
25 #ifndef vtkOutputWindow_h
26 #define vtkOutputWindow_h
27 
28 #include "vtkDebugLeaksManager.h" // Must be included before singletons
29 #include "vtkCommonCoreModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class VTKCOMMONCORE_EXPORT vtkOutputWindowCleanup
33 {
34 public:
37 
38 private:
39  vtkOutputWindowCleanup(const vtkOutputWindowCleanup& other) = delete;
40  vtkOutputWindowCleanup& operator=(const vtkOutputWindowCleanup& rhs) = delete;
41 };
42 
43 class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
44 {
45 public:
46 // Methods from vtkObject
47  vtkTypeMacro(vtkOutputWindow,vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
58  static vtkOutputWindow* New();
59 
63  static vtkOutputWindow* GetInstance();
68  static void SetInstance(vtkOutputWindow *instance);
69 
71 
78  virtual void DisplayText(const char*);
79  virtual void DisplayErrorText(const char*);
80  virtual void DisplayWarningText(const char*);
81  virtual void DisplayGenericWarningText(const char*);
82  virtual void DisplayDebugText(const char*);
84 
86 
95  vtkBooleanMacro(PromptUser, bool);
96  vtkSetMacro(PromptUser, bool);
98 
100 
107  vtkSetMacro(UseStdErrorForAllMessages, bool);
108  vtkGetMacro(UseStdErrorForAllMessages, bool);
109  vtkBooleanMacro(UseStdErrorForAllMessages, bool);
111 
112 protected:
113  vtkOutputWindow();
114  ~vtkOutputWindow() override;
115 
117  {
122  MESSAGE_TYPE_DEBUG
123  };
124 
130  vtkGetMacro(CurrentMessageType, MessageTypes);
131 
132  bool PromptUser;
134 
135 private:
136  static vtkOutputWindow* Instance;
137  MessageTypes CurrentMessageType;
138 
139 private:
140  vtkOutputWindow(const vtkOutputWindow&) = delete;
141  void operator=(const vtkOutputWindow&) = delete;
142 };
143 
144 // Uses schwartz counter idiom for singleton management
146 
147 
148 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
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:33
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...