18 #ifndef __itkCleanQuadEdgeMeshFilter_h
19 #define __itkCleanQuadEdgeMeshFilter_h
35 template<
class TInput,
class TOutput=TInput >
72 itkStaticConstMacro(PointDimension,
unsigned int, InputMeshType::PointDimension);
122 if ( ( m_AbsoluteTolerance == zeroValue ) && ( m_RelativeTolerance != zeroValue ) )
124 itkAssertOrThrowMacro( ( m_RelativeTolerance > zeroValue ) && ( m_RelativeTolerance < 1. ),
125 "Relative tolerance out of range" );
127 bounding_box->SetPoints( this->GetInput()->GetPoints() );
128 bounding_box->ComputeBoundingBox();
130 m_AbsoluteTolerance2 = m_RelativeTolerance * m_RelativeTolerance
131 * bounding_box->GetDiagonalLength2();
134 if ( m_AbsoluteTolerance != zeroValue )
136 m_AbsoluteTolerance2 = m_AbsoluteTolerance * m_AbsoluteTolerance;
149 criterion->SetTopologicalChange(
false);
150 criterion->SetMeasureBound(m_AbsoluteTolerance2);
153 decimate->SetInput( this->GetInput() );
154 decimate->SetCriterion(criterion);
164 while ( p_it != p_end )
166 pOut.CastFrom( p_it.Value() );
167 output->SetPoint(p_it.Index(), pOut);
177 while ( c_it != c_end )
180 QEGeom = qe->GetQEGeom();
181 output->AddEdgeWithSecurePointList( QEGeom->GetOrigin(),
182 QEGeom->GetDestination() );
187 c_it = temp->GetCells()->Begin();
188 c_end = temp->GetCells()->End();
191 while ( c_it != c_end )
199 pit != pe->InternalPointIdsEnd(); ++pit )
201 points.push_back( ( *pit ) );
203 output->AddFaceWithSecurePointList(points);
217 while ( p_it != p_end )
220 if ( output->FindEdge(
id) == 0 )
222 output->DeletePoint(
id);
227 output->SqueezePointsIds();
230 void PrintSelf(std::ostream & os,
Indent indent)
const
232 Superclass::PrintSelf(os, indent);
233 os << indent <<
"AbsoluteTolerance2: " << m_AbsoluteTolerance2 << std::endl;
234 os << indent <<
"AbsoluteTolerance: " << m_AbsoluteTolerance << std::endl;
235 os << indent <<
"RelativeTolerance: " << m_RelativeTolerance << std::endl;
240 void operator=(
const Self &);