ITK  4.6.0
Insight Segmentation and Registration Toolkit
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 
55 
58 
61 
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 
85 
87  typedef typename Superclass::CellType CellType;
88 
91 
94 
98 
101 
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;
117  typedef typename Superclass::PointsContainer::Iterator PointsContainerIterator;
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 = ITK_NULLPTR) 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 
197 
202 
207 
212 
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 
260 
261 protected:
263  SimplexMesh();
264  virtual ~SimplexMesh();
265  void PrintSelf(std::ostream & os, Indent indent) const;
267 
272 
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
PointType GetBarycentricCoordinates(PointIdentifier idx) const
GeometryMapType::Pointer GeometryMapPointer
PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkMesh.h:176
IndexArray GetNeighbors(PointIdentifier pointId) const
double GetMeanCurvature(PointIdentifier idx) const
PointType::VectorType VectorType
SmartPointer< Self > Pointer
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
void PrintSelf(std::ostream &os, Indent indent) const
SelfAutoPointer CellAutoPointer
MeshTraits::PointsContainer PointsContainer
GeometryMapType::Iterator GeometryMapIterator
Mesh< TPixelType, VDimension, TMeshTraits > Superclass
void SetMeanCurvature(PointIdentifier idx, double values)
CovariantVectorType ComputeNormal(PointIdentifier idx) const
TMeshTraits::PointIdentifier PointIdentifier
virtual void CopyInformation(const DataObject *data)
CovariantVector< typename VectorType::ValueType, 3 > CovariantVectorType
MeshTraits::PointIdentifier PointIdentifier
Definition: itkPointSet.h:105
std::set< SizeValueType > NeighborSetType
Superclass::CellsContainerConstIterator CellsContainerConstIterator
CellsContainer::Iterator CellsContainerIterator
Definition: itkMesh.h:179
The class represents a 2-simplex mesh.
A wrapper of the STL &quot;map&quot; container.
Superclass::CellIdentifier CellIdentifier
Superclass::CellsContainerIterator CellsContainerIterator
Superclass::PointsContainer::Iterator PointsContainerIterator
CellIdentifier ReplaceFace(CellIdentifier replaceIndex, CellAutoPointer &cellPointer)
double GetPhi(PointIdentifier idx) const
MeshTraits::CellIdentifier CellIdentifier
Definition: itkMesh.h:148
void SetBarycentricCoordinates(PointIdentifier idx, PointType values)
GeometryMapType::ConstIterator GeometryMapConstIterator
NeighborSetType::iterator NeighborSetIterator
virtual void SetGeometryData(GeometryMapPointer _arg)
double GetDistance(PointIdentifier idx) const
TMeshTraits::PointType PointType
Superclass::CellsContainerPointer CellsContainerPointer
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:108
std::vector< SizeValueType > NeighborListType
CellsContainer::ConstIterator CellsContainerConstIterator
Definition: itkMesh.h:178
CellType::CellAutoPointer CellAutoPointer
void SetDistance(PointIdentifier idx, double values)
PointType GetReferenceMetrics(PointIdentifier idx) const
The non-const iterator type for the map.
PointsContainer::Pointer PointsContainerPointer
Definition: itkMesh.h:165
CellIdentifier AddEdge(PointIdentifier startPointId, PointIdentifier endPointId)
Superclass::CellType CellType
CellIdentifier m_LastCellId
The const iterator type for the map.
void SetRadius(PointIdentifier idx, double values)
CellType::CellAutoPointer CellAutoPointer
Definition: itkMesh.h:190
GeometryMapPointer m_GeometryData
void ReplaceNeighbor(PointIdentifier pointId, PointIdentifier oldNeighborId, PointIdentifier newNeighborIdx)
SimplexMeshGeometry::IndexArray IndexArray
CellsContainer::Pointer CellsContainerPointer
Definition: itkMesh.h:166
MeshTraits::PointType PointType
Definition: itkPointSet.h:106
void SetPhi(PointIdentifier idx, double values)
CellsContainer::ConstPointer CellsContainerConstPointer
Definition: itkMesh.h:167
double GetRadius(PointIdentifier idx) const
void AddNeighbor(PointIdentifier pointId, PointIdentifier neighborId)
SmartPointer< const Self > ConstPointer
void SetReferenceMetrics(PointIdentifier idx, PointType values)
SimplexMesh Self
CellIdentifier AddFace(CellAutoPointer &cellPointer)
handle geometric properties for vertices of a simplx mesh
CellInterface< CellPixelType, CellTraits > CellType
Definition: itkMesh.h:189
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::CellsContainerConstPointer CellsContainerConstPointer
void SwapNeighbors(PointIdentifier pointId, PointIdentifier firstNeighborId, PointIdentifier secondNeighborId)
TMeshTraits MeshTraits
itk::LineCell< CellType > LineType
MeshTraits::PixelType PixelType
Superclass::PointsContainerConstIterator PointsContainerConstIterator
A templated class holding a n-Dimensional covariant vector.
virtual ~SimplexMesh()
Base class for all data objects in ITK.
Superclass::PointsContainerPointer PointsContainerPointer
itk::MapContainer< SizeValueType, SimplexMeshGeometry * > GeometryMapType