ITK  5.2.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  * http://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 
26 namespace itk
27 {
28 
66 template <typename TInput>
67 class ITK_TEMPLATE_EXPORT DOMWriter : public Object
68 {
69 public:
70  ITK_DISALLOW_COPY_AND_MOVE(DOMWriter);
72 
74  using Self = DOMWriter;
75 
76  itkTypeMacro(DOMWriter, Object);
77 
78  using InputType = TInput;
79 
82 
83  using LoggerType = Logger;
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
118  Update();
119 
120 protected:
121  DOMWriter();
122 
130  virtual void
131  GenerateData(DOMNodeType * outputdom, const void * userdata) const = 0;
132 
133 private:
135  itkSetObjectMacro(IntermediateDOM, DOMNodeType);
136  itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType);
138 
140  std::string m_FileName;
141 
144 
147 
150 
153 };
154 
155 } // namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 # include "itkDOMWriter.hxx"
159 #endif
160 
161 #endif // itkDOMWriter_h
itk::DOMWriter::m_IntermediateDOM
DOMNodePointer m_IntermediateDOM
Definition: itkDOMWriter.h:149
itk::Logger
Used for logging information during a run.
Definition: itkLogger.h:36
itk::DOMWriter::m_InputHolder
LightObject::ConstPointer m_InputHolder
Definition: itkDOMWriter.h:146
itk::DOMWriter::m_Input
const InputType * m_Input
Definition: itkDOMWriter.h:143
itk::DOMWriter
Class to write an ITK object to an XML file or a DOM object, using the DOM APIs.
Definition: itkDOMWriter.h:67
itk::SmartPointer< Self >
itk::DOMWriter::m_FileName
std::string m_FileName
Definition: itkDOMWriter.h:136
itk::DOMWriter::m_Logger
LoggerPointer m_Logger
Definition: itkDOMWriter.h:152
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkDOMNodeXMLWriter.h
itk::DOMWriter::LoggerPointer
typename LoggerType::Pointer LoggerPointer
Definition: itkDOMWriter.h:84
itk::DOMWriter::DOMNodePointer
typename DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMWriter.h:81
itk::DOMNode
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:53
itkObject.h
itk::DOMWriter::InputType
TInput InputType
Definition: itkDOMWriter.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itkLogger.h