ITK  6.0.0
Insight Toolkit
itkDOMWriter.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#ifndef itkDOMWriter_h
20#define itkDOMWriter_h
21
22#include "itkDOMNodeXMLWriter.h"
23#include "itkObject.h"
24#include "itkLogger.h"
25
26namespace itk
27{
28
66template <typename TInput>
67class ITK_TEMPLATE_EXPORT DOMWriter : public Object
68{
69public:
70 ITK_DISALLOW_COPY_AND_MOVE(DOMWriter);
74 using Self = DOMWriter;
75
76 itkOverrideGetNameOfClassMacro(DOMWriter);
77
78 using InputType = TInput;
79
82
85
87 itkSetStringMacro(FileName);
88
90 itkGetStringMacro(FileName);
91
93 virtual void
94 SetInput(const InputType * input);
95
97 const InputType *
98 GetInput() const;
99
104 itkGetConstMacro(Logger, LoggerType *);
105
111 void
112 Update(DOMNodeType * outputdom, const void * userdata = nullptr);
113
117 virtual void
119
120protected:
122
130 virtual void
131 GenerateData(DOMNodeType * outputdom, const void * userdata) const = 0;
132
133private:
135 itkSetObjectMacro(IntermediateDOM, DOMNodeType);
136 itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType);
140 std::string m_FileName{};
141
143 const InputType * m_Input{};
144
146 typename LightObject::ConstPointer m_InputHolder{};
147
149 DOMNodePointer m_IntermediateDOM{};
150
152 mutable LoggerPointer m_Logger{};
153};
154
155} // namespace itk
156
157#ifndef ITK_MANUAL_INSTANTIATION
158# include "itkDOMWriter.hxx"
159#endif
160
161#endif // itkDOMWriter_h
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:54
Class to write an ITK object to an XML file or a DOM object, using the DOM APIs.
Definition: itkDOMWriter.h:68
void Update(DOMNodeType *outputdom, const void *userdata=nullptr)
virtual void Update()
virtual void GenerateData(DOMNodeType *outputdom, const void *userdata) const =0
TInput InputType
Definition: itkDOMWriter.h:78
virtual void SetInput(const InputType *input)
typename DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMWriter.h:81
typename LoggerType::Pointer LoggerPointer
Definition: itkDOMWriter.h:84
const InputType * GetInput() const
Light weight base class for most itk classes.
Used for logging information during a run.
Definition: itkLogger.h:37
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....