ITK  4.13.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 
51 
54 
58 
60  itkNewMacro(Self);
61 
64 
65  typedef TInputMesh InputMeshType;
66  typedef typename TInputMesh::Pointer InputMeshPointer;
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;
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 
118  ~TriangleMeshToSimplexMeshFilter() ITK_OVERRIDE;
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 
145  void CreateEdgeForTrianglePair(CellIdentifier pointIndex,
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 
171  InputPointType ComputeFaceCenter(CellIdentifier faceId, const InputMeshType *inputMesh);
172 
176  IndexSetType *m_FaceSet;
177 
184  EdgeMapPointer m_Edges;
185 
189  typename EdgeNeighborListType::Pointer m_EdgeNeighborList;
190 
194  typename VertexNeighborListType::Pointer m_VertexNeighborList;
195 
199  typename LineCellIndexType::Pointer m_LineCellIndices;
200 
204  CellIdentifier m_CellIdxOffset;
205 
209  PointIdentifier m_IdOffset;
210 
214  CellIdentifier m_EdgeCellId;
215 
219  IdVectorPointer m_HandledEdgeIds;
220 
224  InputCellAutoPointer m_NewInputMeshCellPointer;
225 
229  OutputCellAutoPointer m_NewSimplexCellPointer;
230 };
231 } //end of namespace
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "itkTriangleMeshToSimplexMeshFilter.hxx"
235 #endif
236 
237 #endif
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.
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
itk::MapContainer< EdgeIdentifierType, CellIdentifier > LineCellIndexType
itk::MapContainer< EdgeIdentifierType, CellIdentifier > EdgeMapType
TInputMesh::BoundaryAssignmentsContainerPointer InputBoundaryAssignmentsContainerPointer
itk::VectorContainer< CellIdentifier, CellIdentifier > IdVectorType
Represents a polygon in a Mesh.
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
OutputPointsContainer::Pointer OutputPointsContainerPointer
InputPointsContainer::ConstIterator InputPointsContainerConstIterator