ITK  4.2.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 = 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 
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
292