ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkTriangleMeshToSimplexMeshFilter.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 itkTriangleMeshToSimplexMeshFilter_h
19 #define itkTriangleMeshToSimplexMeshFilter_h
20 
21 #include "itkMapContainer.h"
22 #include "itkSimplexMesh.h"
23 #include "itkMeshToMeshFilter.h"
24 #include "itkVectorContainer.h"
25 
26 #include "itkPolygonCell.h"
27 namespace itk
28 {
44 template< typename TInputMesh, typename TOutputMesh >
45 class TriangleMeshToSimplexMeshFilter:public MeshToMeshFilter< TInputMesh, TOutputMesh >
46 {
47 public:
48 
51 
54 
58 
60  itkNewMacro(Self);
61 
64 
65  typedef TInputMesh InputMeshType;
66  typedef typename TInputMesh::Pointer InputMeshPointer;
67  typedef typename TInputMesh::PointType InputPointType;
68 
69  typedef typename TInputMesh::BoundaryAssignmentsContainerPointer InputBoundaryAssignmentsContainerPointer;
70 
71  typedef typename TInputMesh::PointsContainer InputPointsContainer;
72  typedef typename InputPointsContainer::Pointer InputPointsContainerPointer;
73  typedef typename InputPointsContainer::Iterator InputPointsContainerIterator;
74  typedef typename InputPointsContainer::ConstIterator InputPointsContainerConstIterator;
75 
76  typedef typename TOutputMesh::Pointer OutputMeshPointer;
77  typedef typename TOutputMesh::PointType OutputPointType;
78  typedef typename TOutputMesh::PixelType OutputPixelType;
79  typedef typename TOutputMesh::PointsContainer OutputPointsContainer;
80  typedef typename OutputPointsContainer::Pointer OutputPointsContainerPointer;
81  typedef typename TOutputMesh::PointsContainer::Iterator OutputPointsContainerIterator;
82 
83  typedef typename TInputMesh::BoundaryAssignmentIdentifier InputBoundnaryAssignmentIdentifier;
84 
85  typedef typename TInputMesh::CellType InputCellType;
86  typedef typename InputCellType::CellAutoPointer InputCellAutoPointer;
87  typedef typename TInputMesh::CellAutoPointer CellAutoPointer;
92 
93  typedef typename TOutputMesh::CellIdentifier CellIdentifier;
94  typedef typename TOutputMesh::PointIdentifier PointIdentifier;
95  typedef typename TOutputMesh::CellFeatureIdentifier CellFeatureIdentifier;
96 
97  typedef std::pair< CellIdentifier, CellIdentifier > EdgeIdentifierType;
98  typedef std::set< CellIdentifier > IndexSetType;
99 
102 
106 
109 
110  typedef typename TOutputMesh::CellType OutputCellType;
111  typedef typename TOutputMesh::CellAutoPointer OutputCellAutoPointer;
114 
115 protected:
116 
120 
121  void operator=(const Self &) {}
122 
123  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
124 
128  virtual void GenerateData() ITK_OVERRIDE;
129 
133  void Initialize();
134 
138  void CreateSimplexPoints();
139 
146  CellIdentifier boundaryId,
147  TOutputMesh *outputMesh);
148 
153  void CreateSimplexNeighbors();
154 
158  void CreateCells();
159 
163  void CreateNewEdge(CellIdentifier currentCellId, CellFeatureIdentifier featureId,
164  PointIdentifier startPointId, PointIdentifier endPointId,
165  const InputMeshType *input);
166 
167 
172 
177 
185 
190 
195 
200 
205 
210 
215 
220 
225 
230 };
231 } //end of namespace
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "itkTriangleMeshToSimplexMeshFilter.hxx"
235 #endif
236 
237 #endif
void CreateNewEdge(CellIdentifier currentCellId, CellFeatureIdentifier featureId, PointIdentifier startPointId, PointIdentifier endPointId, const InputMeshType *input)
add edge cells to the input mesh
itk::MapContainer< PointIdentifier, IndexSetType > VertexNeighborListType
TOutputMesh::CellFeatureIdentifier CellFeatureIdentifier
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
TOutputMesh::PointsContainer::Iterator OutputPointsContainerIterator
Light weight base class for most itk classes.
TInputMesh::BoundaryAssignmentIdentifier InputBoundnaryAssignmentIdentifier
MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass
A wrapper of the STL &quot;map&quot; container.
EdgeNeighborListType::Pointer m_EdgeNeighborList
stores the two neighboring cells (faces) of an edge
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
IndexSetType * m_FaceSet
stores all faces (triangles) of the input mesh
VertexNeighborListType::Pointer m_VertexNeighborList
stores all edges starting from a vertex
itk::MapContainer< EdgeIdentifierType, CellIdentifier > LineCellIndexType
virtual void GenerateData() override
itk::MapContainer< EdgeIdentifierType, CellIdentifier > EdgeMapType
void CreateEdgeForTrianglePair(CellIdentifier pointIndex, CellIdentifier boundaryId, TOutputMesh *outputMesh)
TInputMesh::BoundaryAssignmentsContainerPointer InputBoundaryAssignmentsContainerPointer
itk::VectorContainer< CellIdentifier, CellIdentifier > IdVectorType
Represents a polygon in a Mesh.
InputPointType ComputeFaceCenter(CellIdentifier faceId, const InputMeshType *inputMesh)
This filter converts a triangle mesh into a 2-simplex mesh.
itk::PolygonCell< OutputCellType > OutputPolygonType
std::pair< CellIdentifier, CellIdentifier > EdgeIdentifierType
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InputPointsContainer::Iterator InputPointsContainerIterator
itk::MapContainer< CellIdentifier, EdgeIdentifierType > EdgeNeighborListType
void PrintSelf(std::ostream &os, Indent indent) const override
OutputPointsContainer::Pointer OutputPointsContainerPointer
EdgeMapPointer m_Edges
stores all edges of the input mesh.
InputPointsContainer::ConstIterator InputPointsContainerConstIterator