18 #ifndef __itkEdgeDecimationQuadEdgeMeshFilter_h
19 #define __itkEdgeDecimationQuadEdgeMeshFilter_h
39 template<
typename TInput,
typename TOutput,
typename TCriterion >
81 typedef std::map< OutputQEType *, PriorityQueueItemType * >
QueueMapType;
210 std::list< OutputCellIdentifier > r1, r2, elements_to_be_tested;
216 r1.push_back( qe_it->GetLeft() );
217 qe_it = qe_it->GetOnext();
219 while ( qe_it != qe );
221 qe = iEdge->GetSym();
222 qe_it = qe->GetOnext();
226 r2.push_back( qe_it->GetLeft() );
227 qe_it = qe_it->GetOnext();
229 while ( qe_it != qe );
234 std::set_symmetric_difference( r1.begin(), r1.end(),
235 r2.begin(), r2.end(),
236 std::back_inserter(elements_to_be_tested) );
238 typename std::list< OutputCellIdentifier >::iterator
239 it = elements_to_be_tested.begin();
243 bool orientation_ok(
true);
248 int k(0), replace_k(0);
253 while ( ( it != elements_to_be_tested.end() ) && orientation_ok )
264 p_id = qe_it->GetOrigin();
269 pt[k++] = output->GetPoint(p_id);
270 qe_it = qe_it->GetLnext();
272 while ( qe_it != qe );
274 n_bef = TriangleType::ComputeNormal(pt[0], pt[1], pt[2]);
279 n_aft = TriangleType::ComputeNormal(iPt, pt[1], pt[2]);
282 n_aft = TriangleType::ComputeNormal(pt[0], iPt, pt[2]);
285 n_aft = TriangleType::ComputeNormal(pt[0], pt[1], iPt);
289 orientation_ok = ( n_bef * n_aft ) < 0.;
293 return orientation_ok;
309 #include "itkEdgeDecimationQuadEdgeMeshFilter.hxx"
OperatorType::Pointer OperatorPointer
void DeleteElement(OutputQEType *iEdge)
Delete a given edge in the priority queue.
QueueMapType m_QueueMapper
DecimationQuadEdgeMeshFilter< TInput, TOutput, TCriterion > Superclass
CriterionType::PriorityType PriorityType
QuadEdgeMeshEulerOperatorJoinVertexFunction< OutputMeshType, OutputQEType > OperatorType
QueueMapType::const_iterator QueueMapConstIterator
OperatorPointer m_JoinVertexFunction
CriterionType::MeasureType MeasureType
bool IsEdgeOKToBeProcessed(OutputQEType *iEdge)
Check if iEdge is valid and then can be processed.
OutputMeshType::Pointer OutputMeshPointer
PriorityQueuePointer m_PriorityQueue
QuadEdgeMeshPolygonCell< OutputCellType > OutputPolygonType
OutputMeshType * GetOutput(void)
Collapse a given edge by joining its dest and its org.
OutputMeshType::QEType OutputQEType
OutputMeshType::PointIdentifier OutputPointIdentifier
OutputMeshType::EdgeCellType OutputEdgeCellType
virtual void PushOrUpdateElement(OutputQEType *iEdge)
Push iEdge in the priority queue if it is not already, else its corresponding priority value is updat...
QuadEdgeType * GetEdgeRingEntry() const
OutputMeshType::CellsContainerPointer OutputCellsContainerPointer
OutputMeshType::CellsContainerIterator OutputCellsContainerIterator
unsigned long SizeValueType
bool IsCriterionSatisfied()
PriorityQueueType::Pointer PriorityQueuePointer
virtual bool ProcessWithoutAnyTopologicalGuarantee()
OutputMeshType::CellIdentifier OutputCellIdentifier
OutputMeshType::CellType OutputCellType
virtual void DeletePoint(const OutputPointIdentifier &iIdToBeDeleted, const OutputPointIdentifier &iRemaing)
EdgeDecimationQuadEdgeMeshFilter()
A convenience class for computation of various triangle elements in 2D or 3D.
void PushElement(OutputQEType *iEdge)
Push one edge in the priority queue.
bool CheckOrientation(OutputQEType *iEdge, const OutputPointIdentifier &iId, const OutputPointType &iPt)
OutputMeshType::PointType OutputPointType
void FillPriorityQueue()
Fill the priority queue.
std::map< OutputQEType *, PriorityQueueItemType * > QueueMapType
virtual unsigned int CheckQEProcessingStatus()
virtual void JoinVertexFailed()
QueueMapType::iterator QueueMapIterator
SmartPointer< const Self > ConstPointer
CriterionType::PriorityQueueWrapperType PriorityQueueItemType
CriterionType::MeasureType MeasureType
OutputPointType::VectorType OutputVectorType
PriorityQueueContainer< PriorityQueueItemType *, ElementWrapperPointerInterface< PriorityQueueItemType * >, PriorityType > PriorityQueueType
void TagElementOut(OutputQEType *iEdge)
virtual MeasureType MeasureEdge(OutputQEType *iEdge)=0
Compute the measure value for iEdge.
InputMeshType::Pointer InputMeshPointer
SmartPointer< Self > Pointer
virtual bool ProcessWithTopologicalGuarantee()
CriterionType::Pointer CriterionPointer
void operator=(const Self &)
OutputMeshType::Pointer OutputMeshPointer
EdgeDecimationQuadEdgeMeshFilter Self
virtual ~EdgeDecimationQuadEdgeMeshFilter()
virtual OutputPointType Relocate(OutputQEType *iEdge)=0
CriterionType::PriorityType PriorityType
void Extract()
Extract the edge to be processed.
SizeValueType NumberOfCommonVerticesIn0Ring() const