ITK  5.2.0
Insight Toolkit
itkTriangleMeshToSimplexMeshFilter.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  * 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_MOVE(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:
119 
120  void
121  PrintSelf(std::ostream & os, Indent indent) const override;
122 
126  void
127  GenerateData() override;
128 
132  void
133  Initialize();
134 
138  void
139  CreateSimplexPoints();
140 
146  void
147  CreateEdgeForTrianglePair(CellIdentifier pointIndex, CellIdentifier boundaryId, TOutputMesh * outputMesh);
148 
153  void
154  CreateSimplexNeighbors();
155 
159  void
160  CreateCells();
161 
165  void
166  CreateNewEdge(CellIdentifier currentCellId,
167  CellFeatureIdentifier featureId,
168  PointIdentifier startPointId,
169  PointIdentifier endPointId,
170  const InputMeshType * input);
171 
172 
177  ComputeFaceCenter(CellIdentifier faceId, const InputMeshType * inputMesh);
178 
183 
191 
196 
201 
206 
211 
216 
221 
226 
231 
236 };
237 } // namespace itk
238 
239 #ifndef ITK_MANUAL_INSTANTIATION
240 # include "itkTriangleMeshToSimplexMeshFilter.hxx"
241 #endif
242 
243 #endif
itk::TriangleMeshToSimplexMeshFilter::PointIdentifier
typename TOutputMesh::PointIdentifier PointIdentifier
Definition: itkTriangleMeshToSimplexMeshFilter.h:95
itk::TriangleMeshToSimplexMeshFilter::InputCellType
typename TInputMesh::CellType InputCellType
Definition: itkTriangleMeshToSimplexMeshFilter.h:86
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
itk::TriangleMeshToSimplexMeshFilter
This filter converts a triangle mesh into a 2-simplex mesh.
Definition: itkTriangleMeshToSimplexMeshFilter.h:45
itk::TriangleMeshToSimplexMeshFilter::InputPointsContainerPointer
typename InputPointsContainer::Pointer InputPointsContainerPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:73
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::TriangleMeshToSimplexMeshFilter::OutputPointsContainer
typename TOutputMesh::PointsContainer OutputPointsContainer
Definition: itkTriangleMeshToSimplexMeshFilter.h:80
itk::TriangleMeshToSimplexMeshFilter::m_FaceSet
IndexSetType * m_FaceSet
stores all faces (triangles) of the input mesh
Definition: itkTriangleMeshToSimplexMeshFilter.h:182
itk::TriangleMeshToSimplexMeshFilter::OutputCellAutoPointer
typename TOutputMesh::CellAutoPointer OutputCellAutoPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:112
itk::MeshToMeshFilter::InputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
Definition: itkMeshToMeshFilter.h:66
itk::TriangleMeshToSimplexMeshFilter::m_EdgeCellId
CellIdentifier m_EdgeCellId
Definition: itkTriangleMeshToSimplexMeshFilter.h:220
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::TriangleMeshToSimplexMeshFilter::EdgeMapPointer
typename EdgeMapType::Pointer EdgeMapPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:106
itk::TriangleMeshToSimplexMeshFilter::OutputPointsContainerPointer
typename OutputPointsContainer::Pointer OutputPointsContainerPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:81
itk::TriangleMeshToSimplexMeshFilter::InputBoundaryAssignmentsContainerPointer
typename TInputMesh::BoundaryAssignmentsContainerPointer InputBoundaryAssignmentsContainerPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:70
itk::TriangleMeshToSimplexMeshFilter::OutputPointType
typename TOutputMesh::PointType OutputPointType
Definition: itkTriangleMeshToSimplexMeshFilter.h:78
itk::TriangleMeshToSimplexMeshFilter::m_NewSimplexCellPointer
OutputCellAutoPointer m_NewSimplexCellPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:235
itk::TriangleMeshToSimplexMeshFilter::m_Edges
EdgeMapPointer m_Edges
stores all edges of the input mesh.
Definition: itkTriangleMeshToSimplexMeshFilter.h:190
itk::TriangleMeshToSimplexMeshFilter::EdgeIdentifierType
std::pair< CellIdentifier, CellIdentifier > EdgeIdentifierType
Definition: itkTriangleMeshToSimplexMeshFilter.h:98
itk::PolygonCell
Represents a polygon in a Mesh.
Definition: itkPolygonCell.h:53
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TriangleMeshToSimplexMeshFilter::OutputPixelType
typename TOutputMesh::PixelType OutputPixelType
Definition: itkTriangleMeshToSimplexMeshFilter.h:79
itk::TriangleMeshToSimplexMeshFilter::OutputCellType
typename TOutputMesh::CellType OutputCellType
Definition: itkTriangleMeshToSimplexMeshFilter.h:111
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::TriangleMeshToSimplexMeshFilter::CellFeatureIdentifier
typename TOutputMesh::CellFeatureIdentifier CellFeatureIdentifier
Definition: itkTriangleMeshToSimplexMeshFilter.h:96
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
itk::TriangleMeshToSimplexMeshFilter::m_LineCellIndices
LineCellIndexType::Pointer m_LineCellIndices
Definition: itkTriangleMeshToSimplexMeshFilter.h:205
itk::TriangleMeshToSimplexMeshFilter::CellIdentifier
typename TOutputMesh::CellIdentifier CellIdentifier
Definition: itkTriangleMeshToSimplexMeshFilter.h:94
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::TriangleMeshToSimplexMeshFilter::OutputPointsContainerIterator
typename TOutputMesh::PointsContainer::Iterator OutputPointsContainerIterator
Definition: itkTriangleMeshToSimplexMeshFilter.h:82
itk::TriangleMeshToSimplexMeshFilter::m_VertexNeighborList
VertexNeighborListType::Pointer m_VertexNeighborList
stores all edges starting from a vertex
Definition: itkTriangleMeshToSimplexMeshFilter.h:200
itk::TriangleCell
Definition: itkTriangleCell.h:45
itk::MeshToMeshFilter
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
Definition: itkMeshToMeshFilter.h:47
itk::TriangleMeshToSimplexMeshFilter::InputPointsContainerConstIterator
typename InputPointsContainer::ConstIterator InputPointsContainerConstIterator
Definition: itkTriangleMeshToSimplexMeshFilter.h:75
itk::TriangleMeshToSimplexMeshFilter::m_IdOffset
PointIdentifier m_IdOffset
Definition: itkTriangleMeshToSimplexMeshFilter.h:215
itk::TriangleMeshToSimplexMeshFilter::m_HandledEdgeIds
IdVectorPointer m_HandledEdgeIds
Definition: itkTriangleMeshToSimplexMeshFilter.h:225
itk::TriangleMeshToSimplexMeshFilter::IdVectorPointer
typename IdVectorType::Pointer IdVectorPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:109
itk::TriangleMeshToSimplexMeshFilter::InputPointsContainer
typename TInputMesh::PointsContainer InputPointsContainer
Definition: itkTriangleMeshToSimplexMeshFilter.h:72
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
itkMeshToMeshFilter.h
itk::TriangleMeshToSimplexMeshFilter::CellAutoPointer
typename TInputMesh::CellAutoPointer CellAutoPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:88
itkVectorContainer.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TriangleMeshToSimplexMeshFilter::m_CellIdxOffset
CellIdentifier m_CellIdxOffset
Definition: itkTriangleMeshToSimplexMeshFilter.h:210
itkPolygonCell.h
itk::TriangleMeshToSimplexMeshFilter::m_NewInputMeshCellPointer
InputCellAutoPointer m_NewInputMeshCellPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:230
itk::TriangleMeshToSimplexMeshFilter::InputPointType
typename TInputMesh::PointType InputPointType
Definition: itkTriangleMeshToSimplexMeshFilter.h:68
itkSimplexMesh.h
itkMapContainer.h
itk::TriangleMeshToSimplexMeshFilter::IndexSetType
std::set< CellIdentifier > IndexSetType
Definition: itkTriangleMeshToSimplexMeshFilter.h:99
itk::TriangleMeshToSimplexMeshFilter::InputBoundnaryAssignmentIdentifier
typename TInputMesh::BoundaryAssignmentIdentifier InputBoundnaryAssignmentIdentifier
Definition: itkTriangleMeshToSimplexMeshFilter.h:84
itk::TriangleMeshToSimplexMeshFilter::m_EdgeNeighborList
EdgeNeighborListType::Pointer m_EdgeNeighborList
stores the two neighboring cells (faces) of an edge
Definition: itkTriangleMeshToSimplexMeshFilter.h:195
itk::TriangleMeshToSimplexMeshFilter::InputCellAutoPointer
typename InputCellType::CellAutoPointer InputCellAutoPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:87
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::TriangleMeshToSimplexMeshFilter::InputPointsContainerIterator
typename InputPointsContainer::Iterator InputPointsContainerIterator
Definition: itkTriangleMeshToSimplexMeshFilter.h:74