VTK  9.6.20260415
vtkOutputWindow.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
41
42#ifndef vtkOutputWindow_h
43#define vtkOutputWindow_h
44
45#include "vtkCommonCoreModule.h" // For export macro
46#include "vtkDebugLeaksManager.h" // Must be included before singletons
47#include "vtkObject.h"
48
49VTK_ABI_NAMESPACE_BEGIN
50class vtkOutputWindowPrivateAccessor;
51class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
52{
53public:
54 // Methods from vtkObject
55 vtkTypeMacro(vtkOutputWindow, vtkObject);
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
67
76 static void SetInstance(vtkOutputWindow* instance);
77
79
86 virtual void DisplayText(const char*);
87 virtual void DisplayErrorText(const char*);
88 virtual void DisplayWarningText(const char*);
89 virtual void DisplayGenericWarningText(const char*);
90 virtual void DisplayDebugText(const char*);
92
94
103 vtkBooleanMacro(PromptUser, bool);
104 vtkSetMacro(PromptUser, bool);
106
108
113 vtkBooleanMacro(ShowWindow, bool);
114 vtkSetMacro(ShowWindow, bool);
116
118
143 {
145 NEVER = 0,
148 };
149 vtkSetClampMacro(DisplayMode, int, DEFAULT, ALWAYS_STDERR);
150 vtkGetMacro(DisplayMode, int);
156protected:
159
168
174 vtkGetMacro(CurrentMessageType, MessageTypes);
175
176 enum class StreamType
177 {
181 };
182
188
190 bool ShowWindow = true;
191
192private:
193 std::atomic<MessageTypes> CurrentMessageType;
194 int DisplayMode;
195 std::atomic<int> InStandardMacros; // used to suppress display to output streams from standard
196 // macros when logging is enabled.
197
199
200 vtkOutputWindow(const vtkOutputWindow&) = delete;
201 void operator=(const vtkOutputWindow&) = delete;
202};
203
204VTK_ABI_NAMESPACE_END
205#endif
a simple class to control print indentation
Definition vtkIndent.h:108
virtual void DisplayGenericWarningText(const char *)
Display the text.
void SetDisplayModeToAlways()
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
void SetDisplayModeToNever()
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
virtual void SetDisplayMode(int)
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
virtual StreamType GetDisplayStream(MessageTypes msgType) const
Returns the standard output stream to post the message of the given type on.
friend class vtkOutputWindowPrivateAccessor
void SetDisplayModeToAlwaysStdErr()
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
DisplayModes
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
void PrintSelf(ostream &os, vtkIndent indent) override
Print ObjectFactor to stream.
static vtkOutputWindow * GetInstance()
Return the singleton instance with no reference counting.
static vtkOutputWindow * New()
Creates a new instance of vtkOutputWindow.
void SetDisplayModeToDefault()
Flag indicates how the vtkOutputWindow handles displaying of text to stderr / stdout.
~vtkOutputWindow() override
virtual void DisplayDebugText(const char *)
Display the text.
static void SetInstance(vtkOutputWindow *instance)
Supply a user defined output window.
virtual void DisplayWarningText(const char *)
Display the text.
virtual void DisplayText(const char *)
Display the text.
virtual void DisplayErrorText(const char *)
Display the text.