ITK  5.4.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  * https://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 
64  itkOverrideGetNameOfClassMacro(TriangleMeshToSimplexMeshFilter);
65 
66  using InputMeshType = TInputMesh;
69 
70  using InputBoundaryAssignmentsContainerPointer = typename TInputMesh::BoundaryAssignmentsContainerPointer;
71 
72  using InputPointsContainer = typename TInputMesh::PointsContainer;
74  using InputPointsContainerIterator = typename InputPointsContainer::Iterator;
75  using InputPointsContainerConstIterator = typename InputPointsContainer::ConstIterator;
76 
79  using OutputPixelType = typename TOutputMesh::PixelType;
80  using OutputPointsContainer = typename TOutputMesh::PointsContainer;
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 
182  IndexSetType * m_FaceSet{};
183 
190  EdgeMapPointer m_Edges{};
191 
195  typename EdgeNeighborListType::Pointer m_EdgeNeighborList{};
196 
200  typename VertexNeighborListType::Pointer m_VertexNeighborList{};
201 
205  typename LineCellIndexType::Pointer m_LineCellIndices{};
206 
210  CellIdentifier m_CellIdxOffset{};
211 
215  PointIdentifier m_IdOffset{};
216 
220  CellIdentifier m_EdgeCellId{};
221 
225  IdVectorPointer m_HandledEdgeIds{};
226 
230  InputCellAutoPointer m_NewInputMeshCellPointer{};
231 
235  OutputCellAutoPointer m_NewSimplexCellPointer{};
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::TriangleMeshToSimplexMeshFilter::InputCellType
typename TInputMesh::CellType InputCellType
Definition: itkTriangleMeshToSimplexMeshFilter.h:86
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:42
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::OutputCellAutoPointer
typename TOutputMesh::CellAutoPointer OutputCellAutoPointer
Definition: itkTriangleMeshToSimplexMeshFilter.h:112
itk::MeshToMeshFilter::InputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
Definition: itkMeshToMeshFilter.h:66
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::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::CellIdentifier
typename TOutputMesh::CellIdentifier CellIdentifier
Definition: itkTriangleMeshToSimplexMeshFilter.h:94
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::TriangleMeshToSimplexMeshFilter::OutputPointsContainerIterator
typename TOutputMesh::PointsContainer::Iterator OutputPointsContainerIterator
Definition: itkTriangleMeshToSimplexMeshFilter.h:82
itk::TriangleCell
Definition: itkTriangleCell.h:46
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::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:45
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
itkPolygonCell.h
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::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