ITK  4.6.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 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  DOMWriter(const Self &); //purposely not implemented
127  void operator=(const Self &); //purposely not implemented
128 
130  itkSetObjectMacro( IntermediateDOM, DOMNodeType );
131  itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType );
133 
135  std::string m_FileName;
136 
139 
142 
145 
148 };
149 
150 } // namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkDOMWriter.hxx"
154 #endif
155 
156 #endif // __itkDOMWriter_h
Light weight base class for most itk classes.
DOMNode DOMNodeType
Definition: itkDOMWriter.h:77
virtual void GenerateData(DOMNodeType *outputdom, const void *userdata) const =0
Logger LoggerType
Definition: itkDOMWriter.h:80
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:52
void operator=(const Self &)
virtual void SetInput(const InputType *input)
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:131
virtual void Update()
DOMNodePointer m_IntermediateDOM
Definition: itkDOMWriter.h:144
const InputType * m_Input
Definition: itkDOMWriter.h:138
Base class for most ITK classes.
Definition: itkObject.h:57
LightObject::ConstPointer m_InputHolder
Definition: itkDOMWriter.h:141
Used for logging information during a run.
Definition: itkLogger.h:36
const InputType * GetInput() const
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:147