ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkNormalQuadEdgeMeshFilter.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 itkNormalQuadEdgeMeshFilter_h
19 #define itkNormalQuadEdgeMeshFilter_h
20 
23 #include "itkTriangleHelper.h"
24 
25 namespace itk
26 {
67 template< typename TInputMesh, typename TOutputMesh >
68 class ITK_TEMPLATE_EXPORT NormalQuadEdgeMeshFilter:
69  public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
70 {
71 public:
76 
77  itkNewMacro (Self);
78 
79  itkTypeMacro (NormalQuadEdgeMeshFilter,
81 
82  using InputMeshType = TInputMesh;
83  using InputMeshPointer = typename InputMeshType::Pointer;
84  using InputPointIdentifier = typename InputMeshType::PointIdentifier;
87  using InputQEType = typename InputMeshType::QEType;
88 
89  using OutputMeshType = TOutputMesh;
90  using OutputMeshPointer = typename OutputMeshType::Pointer;
93  using OutputQEType = typename OutputMeshType::QEType;
94  using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
95  using OutputPointIdIterator = typename OutputMeshType::PointIdIterator;
96  using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
97  using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
98  using OutputCellType = typename OutputMeshType::CellType;
99  using OutputCellIdentifier = typename OutputMeshType::CellIdentifier;
100  using OutputCellAutoPointer = typename OutputMeshType::CellAutoPointer;
101  using OutputCellsContainerPointer = typename OutputMeshType::CellsContainerConstIterator;
102  using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
103 
105 
108 
109  using OutputCellDataContainer = typename OutputMeshType::CellDataContainer;
110  using OutputPointDataContainer = typename OutputMeshType::PointDataContainer;
111 
112  using OutputMeshTraits = typename OutputMeshType::MeshTraits;
113  using OutputVertexNormalType = typename OutputMeshTraits::PixelType;
114  using OutputVertexNormalComponentType = typename OutputVertexNormalType::ValueType;
115 
116  using OutputFaceNormalType = typename OutputMeshTraits::CellPixelType;
117  using OutputFaceNormalComponentType = typename OutputFaceNormalType::ValueType;
118 
119  enum WeightType {
120  GOURAUD = 0, // Uniform weights
121  THURMER, // Angle on a triangle at the given vertex
122  AREA
123  };
124 
125  itkSetMacro (Weight, WeightType);
126  itkGetConstMacro (Weight, WeightType);
127 
128 protected:
130  ~NormalQuadEdgeMeshFilter() override = default;
131  void PrintSelf(std::ostream & os, Indent indent) const override;
132 
134 
141  OutputFaceNormalType ComputeFaceNormal(OutputPolygonType *iPoly);
142 
147  void ComputeAllFaceNormals();
148 
153  void ComputeAllVertexNormals();
154 
159  OutputVertexNormalType ComputeVertexNormal(const OutputPointIdentifier & iId, OutputMeshType *outputMesh);
160 
165  const OutputCellIdentifier & iCId,
166  OutputMeshType *outputMesh);
167 
172  void GenerateData() override;
173 
174 private:
175  NormalQuadEdgeMeshFilter (const Self &) = delete;
176  void operator=(const Self &) = delete;
177 };
178 }
179 
180 #include "itkNormalQuadEdgeMeshFilter.hxx"
181 #endif
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
typename OutputMeshType::CellAutoPointer OutputCellAutoPointer
Light weight base class for most itk classes.
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename OutputMeshTraits::PixelType OutputVertexNormalType
typename InputMeshType::PointIdentifier InputPointIdentifier
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerPointer
Filter which computes normals to faces and vertices and store it in the output mesh. Normals to face are first computed, then normals to vertices are computed as linear combination of neighbor face normals, i.e. .
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename OutputPolygonType::SelfAutoPointer OutputPolygonAutoPointer
typename InputMeshType::Pointer InputMeshPointer
typename OutputVertexNormalType::ValueType OutputVertexNormalComponentType
typename InputMeshType::QEType InputQEType
typename OutputMeshType::QEType OutputQEType
A convenience class for computation of various triangle elements in 2D or 3D.
typename OutputMeshType::PointIdIterator OutputPointIdIterator
typename OutputMeshType::CellIdentifier OutputCellIdentifier
typename OutputMeshType::CellType OutputCellType
typename OutputMeshType::MeshTraits OutputMeshTraits
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
Implements an Automatic Pointer to an object.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename OutputMeshType::VectorType OutputVectorType
typename OutputMeshTraits::CellPixelType OutputFaceNormalType
typename OutputMeshType::PointDataContainer OutputPointDataContainer
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
typename OutputMeshType::CellDataContainer OutputCellDataContainer
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerConstIterator
typename OutputFaceNormalType::ValueType OutputFaceNormalComponentType