ITK  4.13.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 
71  typedef DOMWriter Self;
72 
73  itkTypeMacro(DOMWriter, Object);
74 
75  typedef TInput InputType;
76 
79 
80  typedef Logger LoggerType;
82 
84  itkSetStringMacro(FileName);
85 
87  itkGetStringMacro(FileName);
88 
90  virtual void SetInput( const InputType* input );
91 
93  const InputType* GetInput() const;
94 
99  itkGetConstMacro( Logger, LoggerType* );
100 
106  void Update( DOMNodeType* outputdom, const void* userdata = ITK_NULLPTR );
107 
111  virtual void Update();
112 
113 protected:
114  DOMWriter();
115 
123  virtual void GenerateData( DOMNodeType* outputdom, const void* userdata ) const = 0;
124 
125 private:
126  ITK_DISALLOW_COPY_AND_ASSIGN(DOMWriter);
127 
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
DOMNode DOMNodeType
Definition: itkDOMWriter.h:77
Logger LoggerType
Definition: itkDOMWriter.h:80
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:53
TInput InputType
Definition: itkDOMWriter.h:73
LoggerType::Pointer LoggerPointer
Definition: itkDOMWriter.h:81
DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMWriter.h:78
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:59
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
DOMWriter Self
Definition: itkDOMWriter.h:71
LoggerPointer m_Logger
Definition: itkDOMWriter.h:146