ITK  4.4.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< class TInputMesh, class TOutputMesh >
45 class ITK_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;
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;
124 
128  virtual void GenerateData();
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 
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
238