ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
42 };
43};
44// Define how to print enumeration
45extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream &
46operator<<(std::ostream & out, const NormalQuadEdgeMeshFilterEnums::Weight value);
47
83template <typename TInputMesh, typename TOutputMesh>
84class ITK_TEMPLATE_EXPORT NormalQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
85{
86public:
87 ITK_DISALLOW_COPY_AND_MOVE(NormalQuadEdgeMeshFilter);
88
93
94 itkNewMacro(Self);
95
96 itkOverrideGetNameOfClassMacro(NormalQuadEdgeMeshFilter);
97
98 using InputMeshType = TInputMesh;
99 using InputMeshPointer = typename InputMeshType::Pointer;
100 using InputPointIdentifier = typename InputMeshType::PointIdentifier;
101 using InputPointType = typename InputMeshType::PointType;
102 using InputVectorType = typename InputMeshType::VectorType;
103 using InputQEType = typename InputMeshType::QEType;
104
105 using OutputMeshType = TOutputMesh;
106 using OutputMeshPointer = typename OutputMeshType::Pointer;
107 using OutputPointType = typename OutputMeshType::PointType;
108 using OutputVectorType = typename OutputPointType::VectorType;
109 using OutputQEType = typename OutputMeshType::QEType;
110 using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
111 using OutputPointIdIterator = typename OutputMeshType::PointIdIterator;
112 using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
113 using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
114 using OutputCellType = typename OutputMeshType::CellType;
115 using OutputCellIdentifier = typename OutputMeshType::CellIdentifier;
116 using OutputCellAutoPointer = typename OutputMeshType::CellAutoPointer;
117 using OutputCellsContainerPointer = typename OutputMeshType::CellsContainerConstIterator;
118 using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
119
121
124
125 using OutputCellDataContainer = typename OutputMeshType::CellDataContainer;
126 using OutputPointDataContainer = typename OutputMeshType::PointDataContainer;
127
128 using OutputMeshTraits = typename OutputMeshType::MeshTraits;
129 using OutputVertexNormalType = typename OutputMeshTraits::PixelType;
130 using OutputVertexNormalComponentType = typename OutputVertexNormalType::ValueType;
131
132 using OutputFaceNormalType = typename OutputMeshTraits::CellPixelType;
133 using OutputFaceNormalComponentType = typename OutputFaceNormalType::ValueType;
134
136#if !defined(ITK_LEGACY_REMOVE)
138 using WeightType = WeightEnum;
139 static constexpr WeightEnum GOURAUD = WeightEnum::GOURAUD;
140 static constexpr WeightEnum THURMER = WeightEnum::THURMER;
141 static constexpr WeightEnum AREA = WeightEnum::AREA;
142#endif
143
144 itkSetEnumMacro(Weight, WeightEnum);
145 itkGetConstMacro(Weight, WeightEnum);
146
147protected:
149 ~NormalQuadEdgeMeshFilter() override = default;
150 void
151 PrintSelf(std::ostream & os, Indent indent) const override;
152
154
161 OutputFaceNormalType
163
168 void
170
175 void
177
184
189 Weight(const OutputPointIdentifier & iPId, const OutputCellIdentifier & iCId, OutputMeshType * outputMesh);
190
195 void
196 GenerateData() override;
197};
198} // namespace itk
200
201#include "itkNormalQuadEdgeMeshFilter.hxx"
202#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
Contains enum classes used by NormalQuadEdgeMeshFilter class.
typename OutputMeshType::CellDataContainer OutputCellDataContainer
typename OutputMeshType::PointIdIterator OutputPointIdIterator
typename InputMeshType::QEType InputQEType
typename OutputFaceNormalType::ValueType OutputFaceNormalComponentType
typename InputMeshType::VectorType InputVectorType
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerPointer
void ComputeAllFaceNormals()
Compute the normal to all faces on the mesh.
QuadEdgeMeshPolygonCell< OutputCellType > OutputPolygonType
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 InputMeshType::PointIdentifier InputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename OutputMeshType::CellIdentifier OutputCellIdentifier
typename OutputMeshType::QEType OutputQEType
typename InputMeshType::PointType InputPointType
typename OutputMeshType::Pointer OutputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
typename OutputMeshType::MeshTraits OutputMeshTraits
typename OutputMeshTraits::CellPixelType OutputFaceNormalType
typename OutputMeshType::CellAutoPointer OutputCellAutoPointer
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
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.
SmartPointer< const Self > ConstPointer
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 OutputPointType::VectorType OutputVectorType
typename OutputMeshTraits::PixelType OutputVertexNormalType
typename OutputMeshType::CellType OutputCellType
typename OutputPolygonType::SelfAutoPointer OutputPolygonAutoPointer
typename OutputMeshType::PointDataContainer OutputPointDataContainer
typename OutputMeshType::PointType OutputPointType
QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh > Superclass
NormalQuadEdgeMeshFilterEnums::Weight WeightEnum
typename OutputVertexNormalType::ValueType OutputVertexNormalComponentType
TriangleHelper< OutputPointType > TriangleType
~NormalQuadEdgeMeshFilter() override=default
Implements transparent reference counting.
A convenience class for computation of various triangle elements in 2D or 3D.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)