ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDOMWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 
65 template< typename TInput >
66 class ITK_TEMPLATE_EXPORT DOMWriter : public Object
67 {
68 public:
69  ITK_DISALLOW_COPY_AND_ASSIGN(DOMWriter);
71 
73  using Self = DOMWriter;
74 
75  itkTypeMacro(DOMWriter, Object);
76 
77  using InputType = TInput;
78 
81 
82  using LoggerType = Logger;
84 
86  itkSetStringMacro(FileName);
87 
89  itkGetStringMacro(FileName);
90 
92  virtual void SetInput( const InputType* input );
93 
95  const InputType* GetInput() const;
96 
101  itkGetConstMacro( Logger, LoggerType* );
102 
108  void Update( DOMNodeType* outputdom, const void* userdata = nullptr );
109 
113  virtual void Update();
114 
115 protected:
116  DOMWriter();
117 
125  virtual void GenerateData( DOMNodeType* outputdom, const void* userdata ) const = 0;
126 
127 private:
129  itkSetObjectMacro( IntermediateDOM, DOMNodeType );
130  itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType );
132 
134  std::string m_FileName;
135 
138 
141 
144 
147 };
148 
149 } // namespace itk
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkDOMWriter.hxx"
153 #endif
154 
155 #endif // itkDOMWriter_h
Light weight base class for most itk classes.
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:53
TInput InputType
Definition: itkDOMWriter.h:77
typename LoggerType::Pointer LoggerPointer
Definition: itkDOMWriter.h:83
typename DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMWriter.h:80
std::string m_FileName
Definition: itkDOMWriter.h:130
DOMNodePointer m_IntermediateDOM
Definition: itkDOMWriter.h:143
const InputType * m_Input
Definition: itkDOMWriter.h:137
Base class for most ITK classes.
Definition: itkObject.h:60
LightObject::ConstPointer m_InputHolder
Definition: itkDOMWriter.h:140
Used for logging information during a run.
Definition: itkLogger.h:36
Class to write an ITK object to an XML file or a DOM object, using the DOM APIs.
Definition: itkDOMWriter.h:66
LoggerPointer m_Logger
Definition: itkDOMWriter.h:146