ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkDecimationQuadEdgeMeshFilter.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 itkDecimationQuadEdgeMeshFilter_h
19#define itkDecimationQuadEdgeMeshFilter_h
20
21#include "itkIntTypes.h"
23
24namespace itk
25{
31template <typename TInput, typename TOutput, typename TCriterion>
32class ITK_TEMPLATE_EXPORT DecimationQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdgeMeshFilter<TInput, TOutput>
33{
34public:
35 ITK_DISALLOW_COPY_AND_MOVE(DecimationQuadEdgeMeshFilter);
36
41
43 itkOverrideGetNameOfClassMacro(DecimationQuadEdgeMeshFilter);
44
45 using InputMeshType = TInput;
46 using InputMeshPointer = typename InputMeshType::Pointer;
47
48 using OutputMeshType = TOutput;
49 using OutputMeshPointer = typename OutputMeshType::Pointer;
50
51 using CriterionType = TCriterion;
52 using CriterionPointer = typename CriterionType::Pointer;
53 using MeasureType = typename CriterionType::MeasureType;
54 using PriorityType = typename CriterionType::PriorityType;
55 using PriorityQueueItemType = typename CriterionType::PriorityQueueWrapperType;
56
57 itkSetObjectMacro(Criterion, CriterionType);
58
59protected:
63
64 ~DecimationQuadEdgeMeshFilter() override = default;
65
68
69 void
70 GenerateData() override
71 {
73
74 Initialize();
76 m_Iteration = 0;
77 this->m_OutputMesh = this->GetOutput();
78 do
79 {
80 this->Extract();
81
83 {
84 return;
85 }
86
88 } while (!IsCriterionSatisfied());
89
90 this->GetOutput()->SqueezePointsIds();
91 this->GetOutput()->DeleteUnusedCellData();
92 }
93
94 virtual void
96 {}
97 virtual void
99
100 virtual void
101 Extract() = 0;
102
103 virtual bool
105
106 virtual bool
108
109 virtual bool
111
112 void
113 PrintSelf(std::ostream & os, Indent indent) const override
114 {
115 this->Superclass::PrintSelf(os, indent);
116 os << indent << "Criterion: " << m_Criterion << std::endl;
117 }
118
121};
122} // namespace itk
123
124#endif
virtual bool ProcessWithTopologicalGuarantee()=0
typename CriterionType::Pointer CriterionPointer
typename CriterionType::PriorityQueueWrapperType PriorityQueueItemType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual bool IsCriterionSatisfied()=0
virtual bool ProcessWithoutAnyTopologicalGuarantee()=0
~DecimationQuadEdgeMeshFilter() override=default
typename InputMeshType::Pointer InputMeshPointer
typename CriterionType::PriorityType PriorityType
QuadEdgeMeshToQuadEdgeMeshFilter< TInput, TOutput > Superclass
typename CriterionType::MeasureType MeasureType
typename OutputMeshType::Pointer OutputMeshPointer
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void PrintSelf(std::ostream &os, Indent indent) const
OutputMeshType * GetOutput()
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86