ITK  5.0.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 ITK_TEMPLATE_EXPORT TriangleMeshToSimplexMeshFilter:public MeshToMeshFilter< TInputMesh, TOutputMesh >
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(TriangleMeshToSimplexMeshFilter);
49 
52 
55 
59 
61  itkNewMacro(Self);
62 
65 
66  using InputMeshType = TInputMesh;
67  using InputMeshPointer = typename TInputMesh::Pointer;
69 
70  using InputBoundaryAssignmentsContainerPointer = typename TInputMesh::BoundaryAssignmentsContainerPointer;
71 
72  using InputPointsContainer = typename TInputMesh::PointsContainer;
73  using InputPointsContainerPointer = typename InputPointsContainer::Pointer;
74  using InputPointsContainerIterator = typename InputPointsContainer::Iterator;
75  using InputPointsContainerConstIterator = typename InputPointsContainer::ConstIterator;
76 
77  using OutputMeshPointer = typename TOutputMesh::Pointer;
79  using OutputPixelType = typename TOutputMesh::PixelType;
80  using OutputPointsContainer = typename TOutputMesh::PointsContainer;
81  using OutputPointsContainerPointer = typename OutputPointsContainer::Pointer;
82  using OutputPointsContainerIterator = typename TOutputMesh::PointsContainer::Iterator;
83 
84  using InputBoundnaryAssignmentIdentifier = typename TInputMesh::BoundaryAssignmentIdentifier;
85 
86  using InputCellType = typename TInputMesh::CellType;
87  using InputCellAutoPointer = typename InputCellType::CellAutoPointer;
88  using CellAutoPointer = typename TInputMesh::CellAutoPointer;
93 
94  using CellIdentifier = typename TOutputMesh::CellIdentifier;
95  using PointIdentifier = typename TOutputMesh::PointIdentifier;
96  using CellFeatureIdentifier = typename TOutputMesh::CellFeatureIdentifier;
97 
98  using EdgeIdentifierType = std::pair< CellIdentifier, CellIdentifier >;
99  using IndexSetType = std::set< CellIdentifier >;
100 
103 
107 
110 
111  using OutputCellType = typename TOutputMesh::CellType;
112  using OutputCellAutoPointer = typename TOutputMesh::CellAutoPointer;
115 
116 protected:
117 
120 
121  void PrintSelf(std::ostream & os, Indent indent) const override;
122 
126  void GenerateData() override;
127 
131  void Initialize();
132 
136  void CreateSimplexPoints();
137 
143  void CreateEdgeForTrianglePair(CellIdentifier pointIndex,
144  CellIdentifier boundaryId,
145  TOutputMesh *outputMesh);
146 
151  void CreateSimplexNeighbors();
152 
156  void CreateCells();
157 
161  void CreateNewEdge(CellIdentifier currentCellId, CellFeatureIdentifier featureId,
162  PointIdentifier startPointId, PointIdentifier endPointId,
163  const InputMeshType *input);
164 
165 
169  InputPointType ComputeFaceCenter(CellIdentifier faceId, const InputMeshType *inputMesh);
170 
175 
183 
188 
193 
198 
203 
208 
213 
218 
223 
228 };
229 } //end of namespace
230 
231 #ifndef ITK_MANUAL_INSTANTIATION
232 #include "itkTriangleMeshToSimplexMeshFilter.hxx"
233 #endif
234 
235 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
Light weight base class for most itk classes.
typename TOutputMesh::CellFeatureIdentifier CellFeatureIdentifier
typename TOutputMesh::CellIdentifier CellIdentifier
A wrapper of the STL &quot;map&quot; container.
typename InputPointsContainer::ConstIterator InputPointsContainerConstIterator
EdgeNeighborListType::Pointer m_EdgeNeighborList
stores the two neighboring cells (faces) of an edge
std::pair< CellIdentifier, CellIdentifier > EdgeIdentifierType
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
typename TInputMesh::PointsContainer InputPointsContainer
VertexNeighborListType::Pointer m_VertexNeighborList
stores all edges starting from a vertex
typename InputMeshType::Pointer InputMeshPointer
typename TOutputMesh::PointIdentifier PointIdentifier
typename TOutputMesh::PointsContainer::Iterator OutputPointsContainerIterator
typename TInputMesh::CellAutoPointer CellAutoPointer
typename InputCellType::CellAutoPointer InputCellAutoPointer
typename OutputPointsContainer::Pointer OutputPointsContainerPointer
typename InputPointsContainer::Iterator InputPointsContainerIterator
Represents a polygon in a Mesh.
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
This filter converts a triangle mesh into a 2-simplex mesh.
typename TOutputMesh::CellAutoPointer OutputCellAutoPointer
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.
typename TInputMesh::BoundaryAssignmentsContainerPointer InputBoundaryAssignmentsContainerPointer
typename TOutputMesh::PointsContainer OutputPointsContainer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputPointsContainer::Pointer InputPointsContainerPointer
EdgeMapPointer m_Edges
stores all edges of the input mesh.
typename TInputMesh::BoundaryAssignmentIdentifier InputBoundnaryAssignmentIdentifier