2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkItkBlackBoxMacros.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.8 $
34 =========================================================================*/
42 * \brief Defines macros for the creation of itk object inherited black boxes
44 #ifndef __bbtkItkBlackBoxMacros_h__
45 #define __bbtkItkBlackBoxMacros_h__
46 //===========================================================================
47 //============================================================================
48 // ITK Specific macros
49 //===========================================================================
50 //===========================================================================
52 //===========================================================================
53 #define BBTK_ITK_DELETE() \
55 int refs = itkParent::GetReferenceCount()-1; \
56 itkParent::UnRegister(); \
59 //===========================================================================
61 //===========================================================================
62 #define BBTK_ITK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX,ITKPARENT) \
63 BBTK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX); \
64 typedef ITKPARENT itkParent; \
66 //===========================================================================
68 //===========================================================================
69 /// Declares an itk-inherited AtomicBlackBox input
70 #define BBTK_DECLARE_ITK_INPUT(NAME,TYPE) \
72 TYPE bbGetInput##NAME () \
73 { return itkParent::GetInput(); } \
74 void bbSetInput##NAME (TYPE d) \
75 { itkParent::SetInput(d); \
76 /*bbSetModifiedStatus();*/ }
77 //===========================================================================
79 //===========================================================================
80 #define BBTK_DECLARE_ITK_OUTPUT(NAME,TYPE) \
82 TYPE bbGetOutput##NAME () \
83 { return itkParent::GetOutput(); } \
84 void bbSetOutput##NAME (TYPE d) \
85 { /*PARENT::GetOutput() = d;*/ }
86 //===========================================================================
88 //===========================================================================
89 /// Declares an AtomicBlackBox input corresponding to an inherited itk parameter
90 /// which was declared by itkSetMacro/itkGetMacro
91 /// The NAME **MUST** be the same than the itk parameter name
92 #define BBTK_DECLARE_ITK_PARAM(NAME,TYPE) \
94 TYPE bbGetInput##NAME () \
95 { return itkParent::Get##NAME(); } \
96 void bbSetInput##NAME (TYPE d) \
97 { itkParent::Set##NAME(d); \
98 /*bbSetModifiedStatus();*/ }
99 //===========================================================================
101 //============================================================================
102 /// Defines the default bbUserProcess method for itk inherited black boxes
103 /// (calls itkParent::Update)
104 #define BBTK_ITK_PROCESS() \
106 inline void bbUserProcess() \
108 bbtkBlackBoxDebugMessage("process",1,"**> Processing..." \
110 itkParent::Update(); \
111 bbtkBlackBoxDebugMessage("process",2,"<** Processing" \
115 //============================================================================
117 //===========================================================================
119 //===========================================================================