VTK  9.7.20260805
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
22
23#ifndef vtkOutputWindow_h
24#define vtkOutputWindow_h
25
26#include "vtkCommonCoreModule.h" // For export macro
27#include "vtkDebugLeaksManager.h" // Must be included before singletons
28#include "vtkObject.h"
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkOutputWindowPrivateAccessor;
32class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
33{
34public:
35 // Methods from vtkObject
36 vtkTypeMacro(vtkOutputWindow, vtkObject);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
48
57 static void SetInstance(vtkOutputWindow* instance);
58
60
67 virtual void DisplayText(const char*);
68 virtual void DisplayErrorText(const char*);
69 virtual void DisplayWarningText(const char*);
70 virtual void DisplayGenericWarningText(const char*);
71 virtual void DisplayDebugText(const char*);
73
75
84 vtkBooleanMacro(PromptUser, bool);
85 vtkSetMacro(PromptUser, bool);
87
89
94 vtkBooleanMacro(ShowWindow, bool);
95 vtkSetMacro(ShowWindow, bool);
97
99
124 {
126 NEVER = 0,
129 };
130 vtkSetClampMacro(DisplayMode, int, DEFAULT, ALWAYS_STDERR);
131 vtkGetMacro(DisplayMode, int);
137protected:
140
149
155 vtkGetMacro(CurrentMessageType, MessageTypes);
156
157 enum class StreamType
158 {
162 };
163
169
171 bool ShowWindow = true;
172
173private:
174 std::atomic<MessageTypes> CurrentMessageType;
175 int DisplayMode;
176 std::atomic<int> InStandardMacros; // used to suppress display to output streams from standard
177 // macros when logging is enabled.
178
180
181 vtkOutputWindow(const vtkOutputWindow&) = delete;
182 void operator=(const vtkOutputWindow&) = delete;
183};
184
185VTK_ABI_NAMESPACE_END
186#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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.