ITK  4.2.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 protected:
115 
119 
120  void operator=(const Self &) {}
121 
122  void PrintSelf(std::ostream & os, Indent indent) const;
123 
127  virtual void GenerateData();
128 
132  void Initialize();
133 
137  void CreateSimplexPoints();
138 
144  void CreateEdgeForTrianglePair(CellIdentifier pointIndex, CellIdentifier boundaryId);
145 
150  void CreateSimplexNeighbors();
151 
155  void CreateCells();
156 
160  void CreateNewEdge(CellIdentifier currentCellId, CellFeatureIdentifier featureId,
161  PointIdentifier startPointId, PointIdentifier endPointId);
162 
166  InputPointType ComputeFaceCenter(CellIdentifier faceId);
167 
172 
180 
185 
190 
195 
200 
205 
210 
215 
220 
225 };
226 } //end of namespace
227 
228 #ifndef ITK_MANUAL_INSTANTIATION
229 #include "itkTriangleMeshToSimplexMeshFilter.hxx"
230 #endif
231 
232 #endif
233