ITK  6.0.0
Insight Toolkit
itkSimplexMesh.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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"
23#include "itkVertexCell.h"
24#include "itkTriangleCell.h"
25#include "itkFixedArray.h"
26#include <vector>
27#include <algorithm>
28#include <set>
29
30namespace itk
31{
43template <typename TPixelType,
44 unsigned int VDimension = 3,
45 typename TMeshTraits =
46 DefaultStaticMeshTraits<TPixelType, VDimension, VDimension, TPixelType, TPixelType, TPixelType>>
47class ITK_TEMPLATE_EXPORT SimplexMesh : public Mesh<TPixelType, VDimension, TMeshTraits>
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(SimplexMesh);
51
54
57
60
63
66
68 using NeighborSetType = std::set<SizeValueType>;
69
71 using NeighborSetIterator = typename NeighborSetType::iterator;
72
74 using NeighborListType = std::vector<SizeValueType>;
75
78
80 using PointIdentifier = typename TMeshTraits::PointIdentifier;
81
84
87
89 using typename Superclass::CellType;
90
93
96
100
103
107
108 // Backward compatibility to expose enum from class.
110
112 itkNewMacro(Self);
113
115 itkOverrideGetNameOfClassMacro(SimplexMesh);
116
118 using MeshTraits = TMeshTraits;
119 using PixelType = typename MeshTraits::PixelType;
120 using PointsContainer = typename MeshTraits::PointsContainer;
121 using typename Superclass::PointsContainerPointer;
122 using PointsContainerIterator = typename Superclass::PointsContainer::Iterator;
123 using typename Superclass::PointsContainerConstIterator;
124 using typename Superclass::CellsContainerPointer;
125 using typename Superclass::CellsContainerConstPointer;
126 using typename Superclass::CellsContainerIterator;
127 using typename Superclass::CellsContainerConstIterator;
128 using typename Superclass::CellIdentifier;
129
131 itkSetMacro(GeometryData, GeometryMapPointer);
132
134 itkGetConstReferenceMacro(GeometryData, GeometryMapPointer);
135
137 itkSetMacro(LastCellId, CellIdentifier);
138
140 itkGetConstMacro(LastCellId, CellIdentifier);
141
146 void
147 CopyInformation(const DataObject * data) override;
148
156 AddEdge(PointIdentifier startPointId, PointIdentifier endPointId);
157
166 AddFace(CellAutoPointer & cellPointer);
167
173 ReplaceFace(CellIdentifier replaceIndex, CellAutoPointer & cellPointer);
174
180
185 GetNeighbors(PointIdentifier idx, unsigned int radius, NeighborListType * list = nullptr) const;
186
192 void
194
198 void
200
204 void
206
210 void
212
216 void
218
224
228 void
230
236
240 void
241 SetPhi(PointIdentifier idx, double value);
242
246 double
248
252 void
254
258 double
260
264 void
265 SetRadius(PointIdentifier idx, double value);
266
270 double
272
276 void
277 SetDistance(PointIdentifier idx, double value);
278
282 double
284
288
289protected:
292 ~SimplexMesh() override;
293 void
294 PrintSelf(std::ostream & os, Indent indent) const override;
300 GeometryMapPointer m_GeometryData{};
301
308 CellIdentifier m_LastCellId{};
309}; // End Class: SimplexMesh
310} // end namespace itk
311
312#ifndef ITK_MANUAL_INSTANTIATION
313# include "itkSimplexMesh.hxx"
314#endif
315
316#endif
SelfAutoPointer CellAutoPointer
A templated class holding a n-Dimensional covariant vector.
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Represents a line segment for a Mesh.
Definition: itkLineCell.h:41
The const iterator type for the map.
The non-const iterator type for the map.
A wrapper of the STL "map" container.
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:127
Base class for most ITK classes.
Definition: itkObject.h:62
handle geometric properties for vertices of a simplex mesh
itk::FixedArray< IdentifierType, 3 > IndexArray
The class represents a 2-simplex mesh.
void ReplaceNeighbor(PointIdentifier pointIdx, PointIdentifier oldIdx, PointIdentifier newIdx)
typename MeshTraits::PixelType PixelType
void SetGeometryData(PointIdentifier pointId, SimplexMeshGeometry *)
typename TMeshTraits::PointIdentifier PointIdentifier
CellIdentifier ReplaceFace(CellIdentifier replaceIndex, CellAutoPointer &cellPointer)
IndexArray GetNeighbors(PointIdentifier idx) const
void SetDistance(PointIdentifier idx, double value)
PointType GetReferenceMetrics(PointIdentifier idx) const
void SetBarycentricCoordinates(PointIdentifier idx, PointType value)
double GetRadius(PointIdentifier idx) const
void SetMeanCurvature(PointIdentifier idx, double value)
PointType GetBarycentricCoordinates(PointIdentifier idx) const
typename NeighborSetType::iterator NeighborSetIterator
typename PointType::VectorType VectorType
void SetReferenceMetrics(PointIdentifier idx, PointType value)
double GetPhi(PointIdentifier idx) const
CellIdentifier AddFace(CellAutoPointer &cellPointer)
void SwapNeighbors(PointIdentifier pointIdx, PointIdentifier firstIdx, PointIdentifier secondIdx)
typename CellType::CellAutoPointer CellAutoPointer
CellIdentifier AddEdge(PointIdentifier startPointId, PointIdentifier endPointId)
typename GeometryMapType::ConstIterator GeometryMapConstIterator
void PrintSelf(std::ostream &os, Indent indent) const override
typename Superclass::PointsContainer::Iterator PointsContainerIterator
typename GeometryMapType::Iterator GeometryMapIterator
typename TMeshTraits::PointType PointType
void AddNeighbor(PointIdentifier pointIdx, PointIdentifier neighborIdx)
TMeshTraits MeshTraits
std::vector< SizeValueType > NeighborListType
void SetPhi(PointIdentifier idx, double value)
typename GeometryMapType::Pointer GeometryMapPointer
~SimplexMesh() override
CovariantVectorType ComputeNormal(PointIdentifier idx) const
double GetDistance(PointIdentifier idx) const
double GetMeanCurvature(PointIdentifier idx) const
typename SimplexMeshGeometry::IndexArray IndexArray
typename MeshTraits::PointsContainer PointsContainer
NeighborListType * GetNeighbors(PointIdentifier idx, unsigned int radius, NeighborListType *list=nullptr) const
std::set< SizeValueType > NeighborSetType
void SetRadius(PointIdentifier idx, double value)
void CopyInformation(const DataObject *data) override
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....