1 /*=========================================================================
3 Module: $RCSfile: bbtkItkBlackBoxMacros.h,v $
5 Date: $Date: 2009/05/28 08:12:06 $
6 Version: $Revision: 1.7 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
35 * \brief Defines macros for the creation of itk object inherited black boxes
37 #ifndef __bbtkItkBlackBoxMacros_h__
38 #define __bbtkItkBlackBoxMacros_h__
39 //===========================================================================
40 //============================================================================
41 // ITK Specific macros
42 //===========================================================================
43 //===========================================================================
45 //===========================================================================
46 #define BBTK_ITK_DELETE() \
48 int refs = itkParent::GetReferenceCount()-1; \
49 itkParent::UnRegister(); \
52 //===========================================================================
54 //===========================================================================
55 #define BBTK_ITK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX,ITKPARENT) \
56 BBTK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX); \
57 typedef ITKPARENT itkParent; \
59 //===========================================================================
61 //===========================================================================
62 /// Declares an itk-inherited AtomicBlackBox input
63 #define BBTK_DECLARE_ITK_INPUT(NAME,TYPE) \
65 TYPE bbGetInput##NAME () \
66 { return itkParent::GetInput(); } \
67 void bbSetInput##NAME (TYPE d) \
68 { itkParent::SetInput(d); \
69 /*bbSetModifiedStatus();*/ }
70 //===========================================================================
72 //===========================================================================
73 #define BBTK_DECLARE_ITK_OUTPUT(NAME,TYPE) \
75 TYPE bbGetOutput##NAME () \
76 { return itkParent::GetOutput(); } \
77 void bbSetOutput##NAME (TYPE d) \
78 { /*PARENT::GetOutput() = d;*/ }
79 //===========================================================================
81 //===========================================================================
82 /// Declares an AtomicBlackBox input corresponding to an inherited itk parameter
83 /// which was declared by itkSetMacro/itkGetMacro
84 /// The NAME **MUST** be the same than the itk parameter name
85 #define BBTK_DECLARE_ITK_PARAM(NAME,TYPE) \
87 TYPE bbGetInput##NAME () \
88 { return itkParent::Get##NAME(); } \
89 void bbSetInput##NAME (TYPE d) \
90 { itkParent::Set##NAME(d); \
91 /*bbSetModifiedStatus();*/ }
92 //===========================================================================
94 //============================================================================
95 /// Defines the default bbUserProcess method for itk inherited black boxes
96 /// (calls itkParent::Update)
97 #define BBTK_ITK_PROCESS() \
99 inline void bbUserProcess() \
101 bbtkBlackBoxDebugMessage("process",1,"**> Processing..." \
103 itkParent::Update(); \
104 bbtkBlackBoxDebugMessage("process",2,"<** Processing" \
108 //============================================================================
110 //===========================================================================
112 //===========================================================================