]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Functors/BaseVertexFunction.h
...
[FrontAlgorithms.git] / lib / fpa / Functors / BaseVertexFunction.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Functors__BaseVertexFunction__h__
6 #define __fpa__Functors__BaseVertexFunction__h__
7
8 #include <itkDataObject.h>
9 #include <itkObject.h>
10
11 namespace fpa
12 {
13   namespace Functors
14   {
15     /**
16      */
17     template< class _TVertex >
18     class LightBaseVertexFunction
19       : public itk::Object
20     {
21     public:
22       typedef _TVertex TVertex;
23       typedef itk::Object                     Superclass;
24       typedef LightBaseVertexFunction         Self;
25       typedef itk::SmartPointer< Self >       Pointer;
26       typedef itk::SmartPointer< const Self > ConstPointer;
27
28     public:
29       itkTypeMacro( fpa::Functors::LightBaseVertexFunction, itk::Object );
30
31       itkSetConstObjectMacro( DataObject, itk::DataObject );
32
33     public:
34       template< class _TDataObject = itk::DataObject >
35       const _TDataObject* GetDataObject( ) const
36         {
37           return(
38             dynamic_cast< const _TDataObject* >(
39               this->m_DataObject.GetPointer( )
40               )
41             );
42         }
43
44     protected:
45       LightBaseVertexFunction( )
46         : Superclass( ),
47           m_DataObject( NULL )
48         {
49         }
50
51       virtual ~LightBaseVertexFunction( )
52         {
53         }
54
55     private:
56       // Purposely not implemented.
57       LightBaseVertexFunction( const Self& other );
58       Self& operator=( const Self& other );
59
60     protected:
61       itk::DataObject::ConstPointer m_DataObject;
62     };
63
64     /**
65      */
66     template< class _TVertex, class _TValue >
67     class BaseVertexFunction
68       : public LightBaseVertexFunction< _TVertex >
69     {
70     public:
71       typedef _TVertex TVertex;
72       typedef _TValue  TValue;
73       typedef LightBaseVertexFunction< _TVertex > Superclass;
74       typedef BaseVertexFunction                  Self;
75       typedef itk::SmartPointer< Self >           Pointer;
76       typedef itk::SmartPointer< const Self >     ConstPointer;
77
78     public:
79       itkTypeMacro(
80         fpa::Functors::RegionGrow::BaseVertexFunction,
81         fpa::Functors::RegionGrow::LightBaseVertexFunction
82         );
83
84     public:
85       virtual TValue Evaluate(
86         const TVertex& vertex, const TVertex& parent
87         ) const = 0;
88
89     protected:
90       BaseVertexFunction( )
91         : Superclass( )
92         {
93         }
94
95       virtual ~BaseVertexFunction( )
96         {
97         }
98
99     private:
100       // Purposely not implemented.
101       BaseVertexFunction( const Self& other );
102       Self& operator=( const Self& other );
103     };
104
105   } // ecapseman
106
107 } // ecapseman
108
109 #endif // __fpa__Functors__BaseVertexFunction__h__
110 // eof - $RCSfile$