ITK
4.2.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Mesh
include
itkSimplexMesh.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 __itkSimplexMesh_h
19
#define __itkSimplexMesh_h
20
21
#include "
itkMesh.h
"
22
#include "
itkSimplexMeshGeometry.h
"
23
#include "
itkVertexCell.h
"
24
#include "
itkTriangleCell.h
"
25
#include "
itkFixedArray.h
"
26
#include <vector>
27
#include <algorithm>
28
#include <set>
29
30
namespace
itk
31
{
43
template
<
typename
TPixelType,
unsigned
int
VDimension = 3,
44
typename
TMeshTraits =
45
DefaultStaticMeshTraits< TPixelType, VDimension, VDimension, TPixelType, TPixelType, TPixelType >
46
>
47
class
SimplexMesh
:
public
Mesh
< TPixelType, VDimension, TMeshTraits >
48
{
49
public
:
51
typedef
SimplexMesh
Self
;
52
54
typedef
Mesh< TPixelType, VDimension, TMeshTraits >
Superclass
;
55
57
typedef
SmartPointer< Self >
Pointer
;
58
60
typedef
SmartPointer< const Self >
ConstPointer
;
61
63
typedef
typename
SimplexMeshGeometry::IndexArray
IndexArray
;
64
66
typedef
std::set< SizeValueType >
NeighborSetType
;
67
69
typedef
typename
NeighborSetType::iterator
NeighborSetIterator
;
70
72
typedef
std::vector< SizeValueType >
NeighborListType
;
73
75
typedef
typename
TMeshTraits::PointType
PointType
;
76
78
typedef
typename
TMeshTraits::PointIdentifier
PointIdentifier
;
79
81
typedef
typename
PointType::VectorType
VectorType
;
82
84
typedef
CovariantVector< typename VectorType::ValueType, 3 >
CovariantVectorType
;
85
87
typedef
typename
Superclass::CellType
CellType
;
88
90
typedef
typename
CellType::CellAutoPointer
CellAutoPointer
;
91
93
typedef
itk::LineCell< CellType >
LineType
;
94
97
typedef
itk::MapContainer< SizeValueType, SimplexMeshGeometry * >
GeometryMapType
;
98
100
typedef
typename
GeometryMapType::Pointer
GeometryMapPointer
;
101
103
typedef
typename
GeometryMapType::Iterator
GeometryMapIterator
;
104
typedef
typename
GeometryMapType::ConstIterator
GeometryMapConstIterator
;
105
107
itkNewMacro(
Self
);
108
110
itkTypeMacro(
SimplexMesh
,
Mesh
);
111
113
typedef
TMeshTraits
MeshTraits
;
114
typedef
typename
MeshTraits::PixelType
PixelType
;
115
typedef
typename
MeshTraits::PointsContainer
PointsContainer
;
116
typedef
typename
Superclass::PointsContainerPointer
PointsContainerPointer
;
117
typedef
typename
Superclass::PointsContainer::Iterator
PointsContainerIterator
;
118
typedef
typename
Superclass::PointsContainerConstIterator
PointsContainerConstIterator
;
119
typedef
typename
Superclass::CellsContainerPointer
CellsContainerPointer
;
120
typedef
typename
Superclass::CellsContainerConstPointer
CellsContainerConstPointer
;
121
typedef
typename
Superclass::CellsContainerIterator
CellsContainerIterator
;
122
typedef
typename
Superclass::CellsContainerConstIterator
CellsContainerConstIterator
;
123
typedef
typename
Superclass::CellIdentifier
CellIdentifier
;
124
126
itkSetMacro(GeometryData,
GeometryMapPointer
);
127
129
itkGetConstReferenceMacro(GeometryData,
GeometryMapPointer
);
130
132
itkSetMacro(LastCellId,
CellIdentifier
);
133
135
itkGetConstMacro(LastCellId,
CellIdentifier
);
136
141
virtual
void
CopyInformation
(
const
DataObject
*data);
142
149
CellIdentifier
AddEdge
(
PointIdentifier
startPointId,
PointIdentifier
endPointId);
150
158
CellIdentifier
AddFace
(
CellAutoPointer
& cellPointer);
159
164
CellIdentifier
ReplaceFace
(
CellIdentifier
replaceIndex,
CellAutoPointer
& cellPointer);
165
169
IndexArray
GetNeighbors
(
PointIdentifier
pointId)
const
;
170
174
NeighborListType
*
GetNeighbors
(
PointIdentifier
pointId,
unsigned
int
radius,
NeighborListType
*list =
NULL
)
const
;
175
181
void
AddNeighbor
(
PointIdentifier
pointId,
PointIdentifier
neighborId);
182
186
void
ReplaceNeighbor
(
PointIdentifier
pointId,
PointIdentifier
oldNeighborId,
PointIdentifier
newNeighborIdx);
187
191
void
SwapNeighbors
(
PointIdentifier
pointId,
PointIdentifier
firstNeighborId,
PointIdentifier
secondNeighborId);
192
196
void
SetGeometryData
(
PointIdentifier
pointId,
SimplexMeshGeometry
*);
197
201
void
SetBarycentricCoordinates
(
PointIdentifier
idx,
PointType
values);
202
206
PointType
GetBarycentricCoordinates
(
PointIdentifier
idx)
const
;
207
211
void
SetReferenceMetrics
(
PointIdentifier
idx,
PointType
values);
212
216
PointType
GetReferenceMetrics
(
PointIdentifier
idx)
const
;
217
221
void
SetPhi
(
PointIdentifier
idx,
double
values);
222
226
double
GetPhi
(
PointIdentifier
idx)
const
;
227
231
void
SetMeanCurvature
(
PointIdentifier
idx,
double
values);
232
236
double
GetMeanCurvature
(
PointIdentifier
idx)
const
;
237
241
void
SetRadius
(
PointIdentifier
idx,
double
values);
242
246
double
GetRadius
(
PointIdentifier
idx)
const
;
247
251
void
SetDistance
(
PointIdentifier
idx,
double
values);
252
256
double
GetDistance
(
PointIdentifier
idx)
const
;
257
259
CovariantVectorType
ComputeNormal
(
PointIdentifier
idx)
const
;
260
261
protected
:
263
SimplexMesh
();
264
virtual
~SimplexMesh
();
265
void
PrintSelf
(std::ostream & os,
Indent
indent)
const
;
267
271
GeometryMapPointer
m_GeometryData
;
272
279
CellIdentifier
m_LastCellId
;
280
281
private
:
282
SimplexMesh
(
const
Self
&);
//purposely not implemented
283
// void operator=(const Self&); //purposely not implemented
284
};
// End Class: SimplexMesh
285
}
// end namespace itk
286
287
#ifndef ITK_MANUAL_INSTANTIATION
288
#include "itkSimplexMesh.hxx"
289
#endif
290
291
#endif
292
Generated on Tue Jul 10 2012 23:44:33 for ITK by
1.8.1