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