1 /*=========================================================================
4 Module: $RCSfile: bbtkItkBlackBoxMacros.h,v $
6 Date: $Date: 2008/05/07 12:59:23 $
7 Version: $Revision: 1.3 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
22 * \brief Defines macros for the creation of itk object inherited black boxes
24 #ifndef __bbtkItkBlackBoxMacros_h__
25 #define __bbtkItkBlackBoxMacros_h__
26 //===========================================================================
27 //============================================================================
28 // ITK Specific macros
29 //===========================================================================
30 //===========================================================================
32 //===========================================================================
33 #define BBTK_ITK_DELETE() \
35 itkParent::UnRegister(); \
37 //===========================================================================
39 //===========================================================================
40 #define BBTK_ITK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX,ITKPARENT) \
41 BBTK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX); \
42 typedef ITKPARENT itkParent; \
44 //===========================================================================
46 //===========================================================================
47 /// Declares an itk-inherited AtomicBlackBox input
48 #define BBTK_DECLARE_ITK_INPUT(NAME,TYPE) \
50 TYPE bbGetInput##NAME () \
51 { return itkParent::GetInput(); } \
52 void bbSetInput##NAME (TYPE d) \
53 { itkParent::SetInput(d); \
54 /*bbSetModifiedStatus();*/ }
55 //===========================================================================
57 //===========================================================================
58 #define BBTK_DECLARE_ITK_OUTPUT(NAME,TYPE) \
60 TYPE bbGetOutput##NAME () \
61 { return itkParent::GetOutput(); } \
62 void bbSetOutput##NAME (TYPE d) \
63 { /*PARENT::GetOutput() = d;*/ }
64 //===========================================================================
66 //===========================================================================
67 /// Declares an AtomicBlackBox input corresponding to an inherited itk parameter
68 /// which was declared by itkSetMacro/itkGetMacro
69 /// The NAME **MUST** be the same than the itk parameter name
70 #define BBTK_DECLARE_ITK_PARAM(NAME,TYPE) \
72 TYPE bbGetInput##NAME () \
73 { return itkParent::Get##NAME(); } \
74 void bbSetInput##NAME (TYPE d) \
75 { itkParent::Set##NAME(d); \
76 /*bbSetModifiedStatus();*/ }
77 //===========================================================================
79 //============================================================================
80 /// Defines the default bbUserProcess method for itk inherited black boxes
81 /// (calls itkParent::Update)
82 #define BBTK_ITK_PROCESS() \
84 inline void bbUserProcess() \
86 bbtkDebugMessage("process",1,"**> Processing ["<<bbGetFullName() \
88 itkParent::Update(); \
89 bbtkDebugMessage("process",2,"<** Processing ["<<bbGetFullName() \
92 //============================================================================
94 //===========================================================================
96 //===========================================================================