ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
IO
SpatialObjects
include
itkPolygonGroupSpatialObjectXMLFile.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
#ifndef __itkPolygonGroupSpatialObjectXMLFile_h
19
#define __itkPolygonGroupSpatialObjectXMLFile_h
20
21
22
#include "
itkPolygonGroupSpatialObject.h
"
23
#include "
itkXMLFile.h
"
24
namespace
itk
25
{
26
/* 3D Polygon Groups only ones that make sense for this data type */
27
typedef
PolygonGroupSpatialObject< 3 >
PGroupSpatialObjectType
;
28
35
class
ITK_EXPORT
PolygonGroupSpatialObjectXMLFileReader
:
36
public
XMLReader
< PGroupSpatialObjectType >
37
{
38
public
:
40
typedef
PolygonGroupSpatialObjectXMLFileReader
Self
;
41
typedef
XMLReader< PGroupSpatialObjectType >
Superclass
;
42
typedef
SmartPointer< Self >
Pointer
;
43
44
typedef
PGroupSpatialObjectType
PolygonGroupType
;
45
typedef
PolygonSpatialObject< 3 >
PolygonSpatialObjectType
;
46
typedef
SpatialObjectPoint< 3 >
PointType
;
47
typedef
std::vector< PointType >
PointListType
;
48
50
itkTypeMacro(
PolygonGroupSpatialObjectXMLFileReader
,
XMLReader
);
51
53
itkNewMacro(
Self
);
54
55
public
:
57
virtual
int
CanReadFile(
const
char
*name);
58
59
protected
:
60
PolygonGroupSpatialObjectXMLFileReader
() {}
61
virtual
~PolygonGroupSpatialObjectXMLFileReader
() {}
62
63
virtual
void
StartElement(
const
char
*name,
const
char
**atts);
64
65
virtual
void
EndElement(
const
char
*name);
66
67
virtual
void
CharacterDataHandler(
const
char
*inData,
int
inLength);
68
69
private
:
70
PolygonGroupSpatialObjectXMLFileReader
(
const
Self &);
//purposely not
71
// implemented
72
void
operator=(
const
Self &);
//purposely not
73
// implemented
74
75
PGroupSpatialObjectType::Pointer
m_PGroup
;
76
PolygonSpatialObjectType::Pointer
m_CurPoly
;
77
PointListType
m_CurPointList
;
78
std::string
m_CurCharacterData
;
79
};
80
87
class
ITK_EXPORT
PolygonGroupSpatialObjectXMLFileWriter
:
88
public
XMLWriterBase
< PGroupSpatialObjectType >
89
{
90
public
:
92
typedef
XMLWriterBase< PGroupSpatialObjectType >
Superclass
;
93
typedef
PolygonGroupSpatialObjectXMLFileWriter
Self
;
94
typedef
SmartPointer< Self >
Pointer
;
95
97
itkNewMacro(
Self
);
98
100
itkTypeMacro(
PolygonGroupSpatialObjectXMLFileWriter
,
101
XMLWriterBase< PGroupSpatialObjectType >
);
102
typedef
PGroupSpatialObjectType
PolygonGroupType
;
103
typedef
PolygonSpatialObject< 3 >
PolygonSpatialObjectType
;
104
106
virtual
int
CanWriteFile(
const
char
*name);
107
109
virtual
int
WriteFile();
110
111
protected
:
112
PolygonGroupSpatialObjectXMLFileWriter
() {}
113
virtual
~PolygonGroupSpatialObjectXMLFileWriter
() {}
114
115
private
:
116
PolygonGroupSpatialObjectXMLFileWriter
(
const
Self &);
//purposely not
117
// implemented
118
void
operator=(
const
Self &);
//purposely not
119
// implemented
120
};
121
}
122
#endif
123
Generated on Sun Dec 9 2012 01:22:51 for ITK by
1.8.2