]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/BaseProcessObjects.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / BaseProcessObjects.h
1 #ifndef __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__
2 #define __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__
3
4 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
5 #include <cpPlugins/Interface/ProcessObject.h>
6
7 // -------------------------------------------------------------------------
8 #define cpPlugins_Interface_Define_ProcessObject( O, S )        \
9   class cpPlugins_Interface_EXPORT O                            \
10     : public S                                                  \
11   {                                                             \
12   public:                                                       \
13     typedef O                               Self;               \
14     typedef S                               Superclass;         \
15     typedef itk::SmartPointer< Self >       Pointer;            \
16     typedef itk::SmartPointer< const Self > ConstPointer;       \
17   public:                                                       \
18     itkTypeMacro( O, S );                                       \
19   protected:                                                    \
20     O( );                                                       \
21     virtual ~O( );                                              \
22   private:                                                      \
23     O( const Self& );                                           \
24     Self& operator=( const Self& );                             \
25   }
26
27 // -------------------------------------------------------------------------
28 #define cpPlugins_Interface_Code_ProcessObject( O )     \
29   cpPlugins::Interface::O::O( ) : Superclass( )         \
30   {                                                     \
31     this->m_ClassName = "cpPlugins::Interface::#O";     \
32     this->m_ClassCategory = "#O";                       \
33   }                                                     \
34   cpPlugins::Interface::O::~O( ) { }
35
36 // -------------------------------------------------------------------------
37 #define cpPlugins_Image_Input_Demangle( T, D, I, O, r, f )      \
38   if( ( O = I->GetITKImage< itk::Image< T, D > >( ) ) != NULL ) \
39     r = this->f< itk::Image< T, D > >( O )
40
41 // -------------------------------------------------------------------------
42 #define cpPlugins_ImageArray_Input_Demangle( A, T, DP, DI, I, O, r, f ) \
43   if(                                                                   \
44     ( O = I->GetITKImage< itk::Image< A< T, DP >, DI > >( ) ) != NULL   \
45     )                                                                   \
46     r = this->f< itk::Image< A< T, DP >, DI > >( O )
47
48 // -------------------------------------------------------------------------
49 #define cpPlugins_Image_Input_Demangle_Dimension_AllScalarTypes( D, I, O, r, f ) \
50   cpPlugins_Image_Input_Demangle( char, D, I, O, r, f );                \
51   else cpPlugins_Image_Input_Demangle( short, D, I, O, r, f );          \
52   else cpPlugins_Image_Input_Demangle( int, D, I, O, r, f );            \
53   else cpPlugins_Image_Input_Demangle( long, D, I, O, r, f );           \
54   else cpPlugins_Image_Input_Demangle( float, D, I, O, r, f );          \
55   else cpPlugins_Image_Input_Demangle( double, D, I, O, r, f );         \
56   else cpPlugins_Image_Input_Demangle( unsigned char, D, I, O, r, f );  \
57   else cpPlugins_Image_Input_Demangle( unsigned short, D, I, O, r, f ); \
58   else cpPlugins_Image_Input_Demangle( unsigned int, D, I, O, r, f );   \
59   else cpPlugins_Image_Input_Demangle( unsigned long, D, I, O, r, f )
60
61 // -------------------------------------------------------------------------
62 #define cpPlugins_Image_Input_Demangle_Dimension_AllTypes( D, I, O, r, f ) \
63   cpPlugins_Image_Input_Demangle( char, D, I, O, r, f );                \
64   else cpPlugins_Image_Input_Demangle( short, D, I, O, r, f );          \
65   else cpPlugins_Image_Input_Demangle( int, D, I, O, r, f );            \
66   else cpPlugins_Image_Input_Demangle( long, D, I, O, r, f );           \
67   else cpPlugins_Image_Input_Demangle( float, D, I, O, r, f );          \
68   else cpPlugins_Image_Input_Demangle( double, D, I, O, r, f );         \
69   else cpPlugins_Image_Input_Demangle( unsigned char, D, I, O, r, f );  \
70   else cpPlugins_Image_Input_Demangle( unsigned short, D, I, O, r, f ); \
71   else cpPlugins_Image_Input_Demangle( unsigned int, D, I, O, r, f );   \
72   else cpPlugins_Image_Input_Demangle( unsigned long, D, I, O, r, f );  \
73   else cpPlugins_Image_Input_Demangle(                                  \
74     std::complex< float >, D, I, O, r, f                                \
75     );                                                                  \
76   else cpPlugins_Image_Input_Demangle(                                  \
77     std::complex< double >, D, I, O, r, f                               \
78     );                                                                  \
79   else cpPlugins_Image_Input_Demangle(                                  \
80     itk::RGBPixel< char >, D, I, O, r, f                                \
81     );                                                                  \
82   else cpPlugins_Image_Input_Demangle(                                  \
83     itk::RGBPixel< short >, D, I, O, r, f                               \
84     );                                                                  \
85   else cpPlugins_Image_Input_Demangle(                                  \
86     itk::RGBPixel< int >, D, I, O, r, f                                 \
87     );                                                                  \
88   else cpPlugins_Image_Input_Demangle(                                  \
89     itk::RGBPixel< long >, D, I, O, r, f                                \
90     );                                                                  \
91   else cpPlugins_Image_Input_Demangle(                                  \
92     itk::RGBPixel< unsigned char >, D, I, O, r, f                       \
93     );                                                                  \
94   else cpPlugins_Image_Input_Demangle(                                  \
95     itk::RGBPixel< unsigned short >, D, I, O, r, f                      \
96     );                                                                  \
97   else cpPlugins_Image_Input_Demangle(                                  \
98     itk::RGBPixel< unsigned int >, D, I, O, r, f                        \
99     );                                                                  \
100   else cpPlugins_Image_Input_Demangle(                                  \
101     itk::RGBPixel< unsigned long >, D, I, O, r, f                       \
102     );                                                                  \
103   else cpPlugins_Image_Input_Demangle(                                  \
104     itk::RGBPixel< float >, D, I, O, r, f                               \
105     );                                                                  \
106   else cpPlugins_Image_Input_Demangle(                                  \
107     itk::RGBPixel< double >, D, I, O, r, f                              \
108     );                                                                  \
109   else cpPlugins_Image_Input_Demangle(                                  \
110     itk::RGBAPixel< char >, D, I, O, r, f                               \
111     );                                                                  \
112   else cpPlugins_Image_Input_Demangle(                                  \
113     itk::RGBAPixel< short >, D, I, O, r, f                              \
114     );                                                                  \
115   else cpPlugins_Image_Input_Demangle(                                  \
116     itk::RGBAPixel< int >, D, I, O, r, f                                \
117     );                                                                  \
118   else cpPlugins_Image_Input_Demangle(                                  \
119     itk::RGBAPixel< long >, D, I, O, r, f                               \
120     );                                                                  \
121   else cpPlugins_Image_Input_Demangle(                                  \
122     itk::RGBAPixel< unsigned char >, D, I, O, r, f                      \
123     );                                                                  \
124   else cpPlugins_Image_Input_Demangle(                                  \
125     itk::RGBAPixel< unsigned short >, D, I, O, r, f                     \
126     );                                                                  \
127   else cpPlugins_Image_Input_Demangle(                                  \
128     itk::RGBAPixel< unsigned int >, D, I, O, r, f                       \
129     );                                                                  \
130   else cpPlugins_Image_Input_Demangle(                                  \
131     itk::RGBAPixel< unsigned long >, D, I, O, r, f                      \
132     );                                                                  \
133   else cpPlugins_Image_Input_Demangle(                                  \
134     itk::RGBAPixel< float >, D, I, O, r, f                              \
135     );                                                                  \
136   else cpPlugins_Image_Input_Demangle(                                  \
137     itk::RGBAPixel< double >, D, I, O, r, f                             \
138     );                                                                  \
139   else cpPlugins_Image_Input_Demangle(                                  \
140     itk::Offset< D >, D, I, O, r, f                                     \
141     );                                                                  \
142   else cpPlugins_ImageArray_Input_Demangle(                             \
143     itk::Vector, float, D, D, I, O, r, f                                \
144     );                                                                  \
145   else cpPlugins_ImageArray_Input_Demangle(                             \
146     itk::Vector, double, D, D, I, O, r, f                               \
147     );                                                                  \
148   else cpPlugins_ImageArray_Input_Demangle(                             \
149     itk::Point, float, D, D, I, O, r, f                                 \
150     );                                                                  \
151   else cpPlugins_ImageArray_Input_Demangle(                             \
152     itk::Point, double, D, D, I, O, r, f                                \
153     );                                                                  \
154   else cpPlugins_ImageArray_Input_Demangle(                             \
155     itk::CovariantVector, float, D, D, I, O, r, f                       \
156     );                                                                  \
157   else cpPlugins_ImageArray_Input_Demangle(                             \
158     itk::CovariantVector, double, D, D, I, O, r, f                      \
159     );                                                                  \
160   else cpPlugins_ImageArray_Input_Demangle(                             \
161     itk::SymmetricSecondRankTensor, float, D, D, I, O, r, f             \
162     );                                                                  \
163   else cpPlugins_ImageArray_Input_Demangle(                             \
164     itk::SymmetricSecondRankTensor, double, D, D, I, O, r, f            \
165     )
166
167 namespace cpPlugins
168 {
169   namespace Interface
170   {
171     cpPlugins_Interface_Define_ProcessObject( SourceObject, ProcessObject );
172     cpPlugins_Interface_Define_ProcessObject( SinkObject, ProcessObject );
173     cpPlugins_Interface_Define_ProcessObject( FilterObject, ProcessObject );
174     cpPlugins_Interface_Define_ProcessObject( ImageSource, SourceObject );
175     cpPlugins_Interface_Define_ProcessObject( MeshSource, SourceObject );
176     cpPlugins_Interface_Define_ProcessObject( ImageSink, SinkObject );
177     cpPlugins_Interface_Define_ProcessObject( MeshSink, SinkObject );
178     cpPlugins_Interface_Define_ProcessObject(
179       ImageToImageFilter, FilterObject
180       );
181     cpPlugins_Interface_Define_ProcessObject(
182       ImageToMeshFilter, FilterObject
183       );
184     cpPlugins_Interface_Define_ProcessObject(
185       MeshToImageFilter, FilterObject
186       );
187     cpPlugins_Interface_Define_ProcessObject(
188       MeshToMeshFilter, FilterObject
189       );
190
191   } // ecapseman
192
193 } // ecapseman
194
195 #endif // __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__
196
197 // eof - $RCSfile$