]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/MarksInterfaceWithCollisions.h
...
[FrontAlgorithms.git] / lib / fpa / Base / MarksInterfaceWithCollisions.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__MarksInterfaceWithCollisions__h__
7 #define __fpa__Base__MarksInterfaceWithCollisions__h__
8
9 #include <fpa/Base/MarksInterface.h>
10 #include <utility>
11 #include <vector>
12
13 namespace fpa
14 {
15   namespace Base
16   {
17     /**
18      */
19     template< class _TVertex >
20     class MarksInterfaceWithCollisions
21       : public fpa::Base::MarksInterface< _TVertex >
22     {
23     public:
24       typedef _TVertex                             TVertex;
25       typedef MarksInterfaceWithCollisions         Self;
26       typedef fpa::Base::MarksInterface< TVertex > Superclass;
27
28       // Minigraph to represent collisions
29       typedef std::pair< TVertex, bool >    TCollision;
30       typedef std::vector< TCollision >     TCollisionsRow;
31       typedef std::vector< TCollisionsRow > TCollisions;
32
33     public:
34       bool StopAtOneFront( ) const;
35       void StopAtOneFrontOn( );
36       void StopAtOneFrontOff( );
37       void SetStopAtOneFront( bool v );
38
39     protected:
40       MarksInterfaceWithCollisions( itk::ProcessObject* filter );
41       virtual ~MarksInterfaceWithCollisions( );
42
43       virtual void _InitMarks( unsigned long nSeeds ) override;
44       virtual bool _Collisions( const TVertex& a, const TVertex& b ) override;
45
46     protected:
47       bool         m_StopAtOneFront;
48       TCollisions  m_Collisions;
49       unsigned int m_NumberOfFronts;
50     };
51
52   } // ecapseman
53
54 } // ecapseman
55
56 #ifndef ITK_MANUAL_INSTANTIATION
57 #  include <fpa/Base/MarksInterfaceWithCollisions.hxx>
58 #endif // ITK_MANUAL_INSTANTIATION
59
60 #endif // __fpa__Base__MarksInterfaceWithCollisions__h__
61
62 // eof - $RCSfile$