VTK  9.5.2
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
34
35#ifndef vtkOutputWindow_h
36#define vtkOutputWindow_h
37
38#include "vtkCommonCoreModule.h" // For export macro
39#include "vtkDebugLeaksManager.h" // Must be included before singletons
40#include "vtkObject.h"
41
42VTK_ABI_NAMESPACE_BEGIN
43class vtkOutputWindowPrivateAccessor;
44class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
45{
46public:
47 // Methods from vtkObject
48 vtkTypeMacro(vtkOutputWindow, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
60
69 static void SetInstance(vtkOutputWindow* instance);
70
72
79 virtual void DisplayText(const char*);
80 virtual void DisplayErrorText(const char*);
81 virtual void DisplayWarningText(const char*);
82 virtual void DisplayGenericWarningText(const char*);
83 virtual void DisplayDebugText(const char*);
85
87
96 vtkBooleanMacro(PromptUser, bool);
97 vtkSetMacro(PromptUser, bool);
99
101
126 {
128 NEVER = 0,
131 };
132 vtkSetClampMacro(DisplayMode, int, DEFAULT, ALWAYS_STDERR);
133 vtkGetMacro(DisplayMode, int);
139protected:
142
151
157 vtkGetMacro(CurrentMessageType, MessageTypes);
158
159 enum class StreamType
160 {
161 Null,
162 StdOutput,
163 StdError,
164 };
165
171
173
174private:
175 std::atomic<MessageTypes> CurrentMessageType;
176 int DisplayMode;
177 std::atomic<int> InStandardMacros; // used to suppress display to output streams from standard
178 // macros when logging is enabled.
179
181
182 vtkOutputWindow(const vtkOutputWindow&) = delete;
183 void operator=(const vtkOutputWindow&) = delete;
184};
185
186VTK_ABI_NAMESPACE_END
187#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.