1 /*=========================================================================
4 Module: $RCSfile: bbtkItkBlackBoxMacros.h,v $
6 Date: $Date: 2008/05/07 07:26:50 $
7 Version: $Revision: 1.2 $
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(); }
36 //===========================================================================
38 //===========================================================================
39 #define BBTK_ITK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX,ITKPARENT) \
40 BBTK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX); \
41 typedef ITKPARENT itkParent; \
43 //===========================================================================
45 //===========================================================================
46 /// Declares an itk-inherited AtomicBlackBox input
47 #define BBTK_DECLARE_ITK_INPUT(NAME,TYPE) \
49 TYPE bbGetInput##NAME () \
50 { return itkParent::GetInput(); } \
51 void bbSetInput##NAME (TYPE d) \
52 { itkParent::SetInput(d); \
53 /*bbSetModifiedStatus();*/ }
54 //===========================================================================
56 //===========================================================================
57 #define BBTK_DECLARE_ITK_OUTPUT(NAME,TYPE) \
59 TYPE bbGetOutput##NAME () \
60 { return itkParent::GetOutput(); } \
61 void bbSetOutput##NAME (TYPE d) \
62 { /*PARENT::GetOutput() = d;*/ }
63 //===========================================================================
65 //===========================================================================
66 /// Declares an AtomicBlackBox input corresponding to an inherited itk parameter
67 /// which was declared by itkSetMacro/itkGetMacro
68 /// The NAME **MUST** be the same than the itk parameter name
69 #define BBTK_DECLARE_ITK_PARAM(NAME,TYPE) \
71 TYPE bbGetInput##NAME () \
72 { return itkParent::Get##NAME(); } \
73 void bbSetInput##NAME (TYPE d) \
74 { itkParent::Set##NAME(d); \
75 /*bbSetModifiedStatus();*/ }
76 //===========================================================================
78 //============================================================================
79 /// Defines the default bbUserProcess method for itk inherited black boxes
80 /// (calls itkParent::Update)
81 #define BBTK_ITK_PROCESS() \
83 inline void bbUserProcess() \
85 bbtkDebugMessage("process",1,"**> Processing ["<<bbGetFullName() \
87 itkParent::Update(); \
88 bbtkDebugMessage("process",2,"<** Processing ["<<bbGetFullName() \
91 //============================================================================
93 //===========================================================================
95 //===========================================================================