ITK  6.0.0
Insight Toolkit
itkNormalQuadEdgeMeshFilter.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 itkNormalQuadEdgeMeshFilter_h
19#define itkNormalQuadEdgeMeshFilter_h
20
23#include "itkTriangleHelper.h"
24#include "ITKQuadEdgeMeshFilteringExport.h"
25namespace itk
26{
32{
33public:
37 enum class Weight : uint8_t
38 {
39 GOURAUD = 0, // Uniform weights
40 THURMER, // Angle on a triangle at the given vertex
41 AREA
42 };
43};
44// Define how to print enumeration
45extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream &
46 operator<<(std::ostream & out, const NormalQuadEdgeMeshFilterEnums::Weight value);
47
92template <typename TInputMesh, typename TOutputMesh>
93class ITK_TEMPLATE_EXPORT NormalQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
94{
95public:
96 ITK_DISALLOW_COPY_AND_MOVE(NormalQuadEdgeMeshFilter);
97
102
103 itkNewMacro(Self);
104
105 itkOverrideGetNameOfClassMacro(NormalQuadEdgeMeshFilter);
106
107 using InputMeshType = TInputMesh;
109 using InputPointIdentifier = typename InputMeshType::PointIdentifier;
112 using InputQEType = typename InputMeshType::QEType;
113
114 using OutputMeshType = TOutputMesh;
118 using OutputQEType = typename OutputMeshType::QEType;
119 using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
120 using OutputPointIdIterator = typename OutputMeshType::PointIdIterator;
121 using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
122 using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
123 using OutputCellType = typename OutputMeshType::CellType;
124 using OutputCellIdentifier = typename OutputMeshType::CellIdentifier;
125 using OutputCellAutoPointer = typename OutputMeshType::CellAutoPointer;
126 using OutputCellsContainerPointer = typename OutputMeshType::CellsContainerConstIterator;
127 using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
128
130
133
134 using OutputCellDataContainer = typename OutputMeshType::CellDataContainer;
135 using OutputPointDataContainer = typename OutputMeshType::PointDataContainer;
136
137 using OutputMeshTraits = typename OutputMeshType::MeshTraits;
138 using OutputVertexNormalType = typename OutputMeshTraits::PixelType;
139 using OutputVertexNormalComponentType = typename OutputVertexNormalType::ValueType;
140
141 using OutputFaceNormalType = typename OutputMeshTraits::CellPixelType;
142 using OutputFaceNormalComponentType = typename OutputFaceNormalType::ValueType;
143
145#if !defined(ITK_LEGACY_REMOVE)
147 using WeightType = WeightEnum;
148 static constexpr WeightEnum GOURAUD = WeightEnum::GOURAUD;
149 static constexpr WeightEnum THURMER = WeightEnum::THURMER;
150 static constexpr WeightEnum AREA = WeightEnum::AREA;
151#endif
152
153 itkSetEnumMacro(Weight, WeightEnum);
154 itkGetConstMacro(Weight, WeightEnum);
155
156protected:
158 ~NormalQuadEdgeMeshFilter() override = default;
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override;
161
162 WeightEnum m_Weight{};
163
170 OutputFaceNormalType
172
177 void
179
184 void
186
193
198 Weight(const OutputPointIdentifier & iPId, const OutputCellIdentifier & iCId, OutputMeshType * outputMesh);
199
204 void
205 GenerateData() override;
206};
207} // namespace itk
210#include "itkNormalQuadEdgeMeshFilter.hxx"
211#endif
Implements an Automatic Pointer to an object.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename InputMeshType::Pointer InputMeshPointer
Contains enum classes used by NormalQuadEdgeMeshFilter class.
Filter which computes normals to faces and vertices and store it in the output mesh....
typename OutputMeshType::PointIdIterator OutputPointIdIterator
typename InputMeshType::QEType InputQEType
typename OutputFaceNormalType::ValueType OutputFaceNormalComponentType
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerPointer
void ComputeAllFaceNormals()
Compute the normal to all faces on the mesh.
OutputVertexNormalComponentType Weight(const OutputPointIdentifier &iPId, const OutputCellIdentifier &iCId, OutputMeshType *outputMesh)
Definition of the weight in the 0-ring used for the vertex normal computation. By default m_Weight = ...
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerConstIterator
typename OutputMeshType::CellIdentifier OutputCellIdentifier
typename OutputMeshType::QEType OutputQEType
typename OutputMeshType::MeshTraits OutputMeshTraits
typename OutputMeshTraits::CellPixelType OutputFaceNormalType
typename OutputMeshType::CellAutoPointer OutputCellAutoPointer
OutputVertexNormalType ComputeVertexNormal(const OutputPointIdentifier &iId, OutputMeshType *outputMesh)
Compute the normal to one vertex by a weighted sum of the faces normal in the 0-ring.
void ComputeAllVertexNormals()
Compute the normal to all vertices on the mesh.
OutputFaceNormalType ComputeFaceNormal(OutputPolygonType *iPoly)
Compute the normal to a face iPoly. It assumes that iPoly != 0 and iPoly is a Triangle,...
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputMeshTraits::PixelType OutputVertexNormalType
typename OutputMeshType::CellType OutputCellType
typename OutputPolygonType::SelfAutoPointer OutputPolygonAutoPointer
typename OutputVertexNormalType::ValueType OutputVertexNormalComponentType
~NormalQuadEdgeMeshFilter() override=default
typename OutputMeshType::CellDataContainer OutputCellDataContainer
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename OutputMeshType::PointDataContainer OutputPointDataContainer
typename InputMeshType::PointIdentifier InputPointIdentifier
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
typename OutputMeshType::VectorType OutputVectorType
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
A convenience class for computation of various triangle elements in 2D or 3D.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216