ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkOutputWindow.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18/*=========================================================================
19 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkOutputWindow_h
29#define itkOutputWindow_h
30
31#include <atomic>
32#include <mutex>
33#include "itkObject.h"
34
35namespace itk
36{
37
38struct OutputWindowGlobals;
39
49class ITKCommon_EXPORT OutputWindow : public Object
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(OutputWindow);
53
59
61 itkOverrideGetNameOfClassMacro(OutputWindow);
62
68 static Pointer
69 New();
70
72 static Pointer
74
77 static void
79
81 virtual void
82 DisplayText(const char *);
83
87 virtual void
88 DisplayErrorText(const char * t)
89 {
90 this->DisplayText(t);
91 }
92
96 virtual void
97 DisplayWarningText(const char * t)
98 {
99 this->DisplayText(t);
100 }
101
105 virtual void
107 {
108 this->DisplayText(t);
109 }
110
114 virtual void
115 DisplayDebugText(const char * t)
116 {
117 this->DisplayText(t);
118 }
119
122 virtual void
123 DisplayDebugText(const char * file,
124 unsigned int line,
125 const char * className,
126 const void * objectAddress,
127 const char * message);
128
130 virtual void
131 DisplayWarningText(const char * file,
132 unsigned int line,
133 const char * className,
134 const void * objectAddress,
135 const char * message);
136
138 virtual void
139 DisplayErrorText(const char * file,
140 unsigned int line,
141 const char * className,
142 const void * objectAddress,
143 const char * message);
144
145
147 virtual void
148 DisplayGenericOutputText(const char * file, unsigned int line, const char * message);
149
154 itkSetMacro(PromptUser, bool);
155 itkGetConstMacro(PromptUser, bool);
156 itkBooleanMacro(PromptUser);
158protected:
160 ~OutputWindow() override;
161 void
162 PrintSelf(std::ostream & os, Indent indent) const override;
163
164private:
165 itkGetGlobalDeclarationMacro(OutputWindowGlobals, PimplGlobals);
166
167 std::atomic<bool> m_PromptUser{};
168 std::mutex m_cerrMutex{};
169 static OutputWindowGlobals * m_PimplGlobals;
170};
171} // end namespace itk
172
173#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
static void SetInstance(OutputWindow *instance)
virtual void DisplayText(const char *)
virtual void DisplayErrorText(const char *file, unsigned int line, const char *className, const void *objectAddress, const char *message)
static OutputWindowGlobals * m_PimplGlobals
std::atomic< bool > m_PromptUser
~OutputWindow() override
virtual void DisplayGenericOutputText(const char *t)
virtual void DisplayWarningText(const char *t)
virtual void DisplayErrorText(const char *t)
virtual void DisplayGenericOutputText(const char *file, unsigned int line, const char *message)
static Pointer GetInstance()
SmartPointer< Self > Pointer
static Pointer New()
virtual void DisplayDebugText(const char *t)
virtual void DisplayDebugText(const char *file, unsigned int line, const char *className, const void *objectAddress, const char *message)
virtual void DisplayWarningText(const char *file, unsigned int line, const char *className, const void *objectAddress, const char *message)
SmartPointer< const Self > ConstPointer
void PrintSelf(std::ostream &os, Indent indent) const override
itkGetGlobalDeclarationMacro(OutputWindowGlobals, PimplGlobals)
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....