VTK  9.6.1
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
18
19#ifndef vtkOutputWindow_h
20#define vtkOutputWindow_h
21
22#include "vtkCommonCoreModule.h" // For export macro
23#include "vtkDebugLeaksManager.h" // Must be included before singletons
24#include "vtkObject.h"
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkOutputWindowPrivateAccessor;
28class VTKCOMMONCORE_EXPORT vtkOutputWindow : public vtkObject
29{
30public:
31 // Methods from vtkObject
32 vtkTypeMacro(vtkOutputWindow, vtkObject);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
44
53 static void SetInstance(vtkOutputWindow* instance);
54
56
63 virtual void DisplayText(const char*);
64 virtual void DisplayErrorText(const char*);
65 virtual void DisplayWarningText(const char*);
66 virtual void DisplayGenericWarningText(const char*);
67 virtual void DisplayDebugText(const char*);
69
71
80 vtkBooleanMacro(PromptUser, bool);
81 vtkSetMacro(PromptUser, bool);
83
85
110 {
112 NEVER = 0,
115 };
116 vtkSetClampMacro(DisplayMode, int, DEFAULT, ALWAYS_STDERR);
117 vtkGetMacro(DisplayMode, int);
123protected:
126
135
141 vtkGetMacro(CurrentMessageType, MessageTypes);
142
143 enum class StreamType
144 {
145 Null,
146 StdOutput,
147 StdError,
148 };
149
155
157
158private:
159 std::atomic<MessageTypes> CurrentMessageType;
160 int DisplayMode;
161 std::atomic<int> InStandardMacros; // used to suppress display to output streams from standard
162 // macros when logging is enabled.
163
165
166 vtkOutputWindow(const vtkOutputWindow&) = delete;
167 void operator=(const vtkOutputWindow&) = delete;
168};
169
170VTK_ABI_NAMESPACE_END
171#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.