1 #ifndef __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__HXX__
2 #define __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__HXX__
4 // -------------------------------------------------------------------------
5 template< class V, class R, class VV, class VC, class B >
6 unsigned int fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
7 GetNumberOfMembershipFunctions( ) const
9 return( this->m_Functions.size( ) );
12 // -------------------------------------------------------------------------
13 template< class V, class R, class VV, class VC, class B >
14 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
15 ClearMembershipFunctions( )
17 this->m_Functions.clear( );
21 // -------------------------------------------------------------------------
22 template< class V, class R, class VV, class VC, class B >
23 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
24 AddMembershipFunction( TMembershipFunction* function )
26 this->m_Functions.push_back( function );
30 // -------------------------------------------------------------------------
31 template< class V, class R, class VV, class VC, class B >
32 fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
33 RegionGrowWithMultipleCriteria( )
38 // -------------------------------------------------------------------------
39 template< class V, class R, class VV, class VC, class B >
40 fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
41 ~RegionGrowWithMultipleCriteria( )
45 // -------------------------------------------------------------------------
46 template< class V, class R, class VV, class VC, class B >
47 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
50 this->Superclass::_BeforeMainLoop( );
51 this->m_ActualFunction = this->m_Functions.begin( );
54 // -------------------------------------------------------------------------
55 template< class V, class R, class VV, class VC, class B >
56 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
59 this->Superclass::_AfterLoop( );
63 while( !( this->m_AuxiliaryQueue.empty( ) ) )
66 _TNode node = this->m_AuxiliaryQueue.front( );
67 this->m_AuxiliaryQueue.pop( );
68 this->_QueuePush( node );
71 typename _TMarks::iterator mIt = this->m_Marks.find( node.Vertex );
72 if( mIt != this->m_Marks.end( ) )
73 this->m_Marks.erase( mIt );
77 // Move to next function
78 this->m_ActualFunction++;
81 // -------------------------------------------------------------------------
82 template< class V, class R, class VV, class VC, class B >
83 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
86 while( this->m_ActualFunction != this->m_Functions.end( ) )
87 this->Superclass::_Loop( );
90 // -------------------------------------------------------------------------
91 template< class V, class R, class VV, class VC, class B >
92 bool fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
93 _CheckMembership( const _TNode& n ) const
95 if( this->m_ActualFunction != this->m_Functions.end( ) )
97 bool ret = ( *( this->m_ActualFunction ) )->Evaluate( n.Vertex );
99 this->m_AuxiliaryQueue.push( n );
106 #endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__HXX__