]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Config.h.in
...
[FrontAlgorithms.git] / lib / fpa / Config.h.in
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Config__h__
6 #define __fpa__Config__h__
7
8 #include <itkMacro.h>
9
10 #define VTK_FOUND @VTK_FOUND@
11 #if VTK_FOUND == 1
12 #  define USE_VTK
13 #else
14 #  undef USE_VTK
15 #endif
16
17 // -------------------------------------------------------------------------
18 #define fpaTraitsMacro( __p__, __t__ )                                  \
19   typedef __p__ __t__::TFilter         TFilter;                         \
20   typedef __p__ __t__::TMarksInterface TMarksInterface;                 \
21   typedef __p__ __t__::TSeedsInterface TSeedsInterface;                 \
22   typedef __p__ __t__::TInternalTraits::TInputValue   TInputValue;      \
23   typedef __p__ __t__::TInternalTraits::TMark         TMark;            \
24   typedef __p__ __t__::TInternalTraits::TNeighborhood TNeighborhood;    \
25   typedef __p__ __t__::TInternalTraits::TNode         TNode;            \
26   typedef __p__ __t__::TInternalTraits::TNodes        TNodes;           \
27   typedef __p__ __t__::TInternalTraits::TOutputValue  TOutputValue;     \
28   typedef __p__ __t__::TInternalTraits::TPoint        TPoint;           \
29   typedef __p__ __t__::TInternalTraits::TSeed         TSeed;            \
30   typedef __p__ __t__::TInternalTraits::TSeeds        TSeeds;           \
31   typedef __p__ __t__::TInternalTraits::TVertex       TVertex;          \
32   itkStaticConstMacro(                                                  \
33     Dimension, unsigned int, __t__::TInternalTraits::Dimension          \
34     )
35
36 // -------------------------------------------------------------------------
37 #define fpaInternalTraitsMacro( __p__, __t__ )                          \
38   typedef __p__ __t__::TInputValue   TInputValue;                       \
39   typedef __p__ __t__::TMark         TMark;                             \
40   typedef __p__ __t__::TNeighborhood TNeighborhood;                     \
41   typedef __p__ __t__::TNode         TNode;                             \
42   typedef __p__ __t__::TNodes        TNodes;                            \
43   typedef __p__ __t__::TOutputValue  TOutputValue;                      \
44   typedef __p__ __t__::TPoint        TPoint;                            \
45   typedef __p__ __t__::TSeed         TSeed;                             \
46   typedef __p__ __t__::TSeeds        TSeeds;                            \
47   typedef __p__ __t__::TVertex       TVertex;                           \
48   itkStaticConstMacro( Dimension, unsigned int, __t__::Dimension )
49
50 // -------------------------------------------------------------------------
51 #define fpaFilterInputMacro( __n__, __t__ )                             \
52   __t__* Get##__n__( )                                                  \
53   {                                                                     \
54     return(                                                             \
55       dynamic_cast< __t__* >(                                           \
56         this->itk::ProcessObject::GetInput(                             \
57           this->m_##__n__##Idx                                          \
58           ) ) );                                                        \
59   }                                                                     \
60   const __t__* Get##__n__( ) const                                      \
61   {                                                                     \
62     return(                                                             \
63       dynamic_cast< const __t__* >(                                     \
64         this->itk::ProcessObject::GetInput(                             \
65           this->m_##__n__##Idx                                          \
66           ) ) );                                                        \
67   }                                                                     \
68   void Set##__n__( __t__* i )                                           \
69   {                                                                     \
70     this->itk::ProcessObject::SetNthInput( this->m_##__n__##Idx, i );   \
71   }
72
73 // -------------------------------------------------------------------------
74 #define fpaFilterInputConfigureMacro( __n__, __t__ )            \
75   this->m_##__n__##Idx = this->GetNumberOfRequiredInputs( );    \
76   this->itk::ProcessObject::SetNumberOfRequiredInputs(          \
77     this->m_##__n__##Idx + 1                                    \
78     )
79
80 // -------------------------------------------------------------------------
81 #define fpaFilterOutputMacro( __n__, __t__ )    \
82   __t__* Get##__n__( )                          \
83   {                                             \
84     return(                                     \
85       dynamic_cast< __t__* >(                   \
86         this->itk::ProcessObject::GetOutput(    \
87           this->m_##__n__##Idx                  \
88           ) ) );                                \
89   }                                             \
90   const __t__* Get##__n__( ) const              \
91   {                                             \
92     return(                                     \
93       dynamic_cast< const __t__* >(             \
94         this->itk::ProcessObject::GetOutput(    \
95           this->m_##__n__##Idx                  \
96           ) ) );                                \
97   }
98
99 // -------------------------------------------------------------------------
100 #define fpaFilterOutputConfigureMacro( __n__, __t__ )           \
101   this->m_##__n__##Idx = this->GetNumberOfRequiredOutputs( );   \
102   this->itk::ProcessObject::SetNumberOfRequiredOutputs(         \
103     this->m_##__n__##Idx + 1                                    \
104     );                                                          \
105   this->SetNthOutput( this->m_##__n__##Idx, __t__::New( ) )
106
107 #endif // __fpa__Config__h__
108 // eof - $RCSfile$