// -------------------------------------------------------------------------
template< class V, class R, class VV, class VC, class B >
void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_BeforeLoop( )
+_BeforeMainLoop( )
{
- this->_BeforeLoop( );
+ this->Superclass::_BeforeMainLoop( );
this->m_ActualFunction = this->m_Functions.begin( );
}
// -------------------------------------------------------------------------
template< class V, class R, class VV, class VC, class B >
-typename fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_TNode fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_QueuePop( )
+void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
+_AfterLoop( )
{
- _TNode node = this->Superclass::_QueuePop( );
- if( this->_IsQueueEmpty( ) )
+ this->Superclass::_AfterLoop( );
+
+ // Replace queue
+ this->_QueueClear( );
+ while( !( this->m_AuxiliaryQueue.empty( ) ) )
{
- std::cerr << "ERROR!!!!" << std::endl;
+ // Get node
+ _TNode node = this->m_AuxiliaryQueue.front( );
+ this->m_AuxiliaryQueue.pop( );
+ this->_QueuePush( node );
+
+ // Unmark it
+ typename _TMarks::iterator mIt = this->m_Marks.find( node.Vertex );
+ if( mIt != this->m_Marks.end( ) )
+ this->m_Marks.erase( mIt );
+
+ } // elihw
+
+ // Move to next function
+ this->m_ActualFunction++;
+}
- } // fi
- return( node );
+// -------------------------------------------------------------------------
+template< class V, class R, class VV, class VC, class B >
+void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
+_Loop( )
+{
+ while( this->m_ActualFunction != this->m_Functions.end( ) )
+ this->Superclass::_Loop( );
}
// -------------------------------------------------------------------------
bool fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
_CheckMembership( const _TNode& n ) const
{
- bool ret = ( *( this->m_ActualFunction ) )->Evaluate( n.Vertex );
- if( !ret )
- this->m_AuxiliaryQueue.push( n );
- return( ret );
+ if( this->m_ActualFunction != this->m_Functions.end( ) )
+ {
+ bool ret = ( *( this->m_ActualFunction ) )->Evaluate( n.Vertex );
+ if( !ret )
+ this->m_AuxiliaryQueue.push( n );
+ return( ret );
+ }
+ else
+ return( false );
}
#endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__HXX__