X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkVtkBlackBoxMacros.h;h=6453a7070f63f4b6fa45eaada4f0c437f8614aee;hb=436130ef5084e737c29470409da795832ed2129b;hp=4fce6738d3826d3717dc7d2c5ab4a41a06d0184d;hpb=e64f1a51510b44580500fd9ec30b4c937255bf75;p=bbtk.git diff --git a/kernel/src/bbtkVtkBlackBoxMacros.h b/kernel/src/bbtkVtkBlackBoxMacros.h index 4fce673..6453a70 100644 --- a/kernel/src/bbtkVtkBlackBoxMacros.h +++ b/kernel/src/bbtkVtkBlackBoxMacros.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkVtkBlackBoxMacros.h,v $ Language: C++ - Date: $Date: 2008/05/07 06:31:37 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/07/29 07:31:13 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,6 +23,10 @@ */ #ifndef __bbtkVtkBlackBoxMacros_h__ #define __bbtkVtkBlackBoxMacros_h__ +//#include +//#include +#include + //=========================================================================== //============================================================================ @@ -31,51 +35,94 @@ //=========================================================================== +//=========================================================================== +#define BBTK_VTK_DELETE() \ + void bbDelete() { \ + bbGetOutputOut()->SetSource(NULL); \ + vtkParent::Delete(); \ + } + +// bbmDescriptorPointer.reset(); +//=========================================================================== + +//=========================================================================== +#define BBTK_VTK_NEW(CLASS,VTKPARENT) \ + inline static Pointer New(const std::string& name) \ + { \ + vtkDebugLeaks::ConstructClass(#VTKPARENT); \ + bbtkDebugMessage("object",1,"##> "<<#CLASS \ + <<"::New(\""< "<<#CLASS \ + <<"::bbClone(\""<(PARENT::GetInput()); } \ + { return dynamic_cast(vtkParent::GetInput()); } \ void bbSetInput##NAME (TYPE d) \ - { PARENT::SetInput( (vtkDataObject*) d); /*PARENT::GetOutput() = d;*/ } + { vtkParent::SetInput( (vtkDataObject*) d); /*vtkParent::GetOutput() = d;*/ } //=========================================================================== @@ -84,22 +131,31 @@ /// inherited vtk parameter /// which was declared by vtkSetMacro/vtkGetMacro /// The NAME **MUST** be the same than the vtk parameter name -#define BBTK_DECLARE_VTK_PARAM(PARENT,NAME,TYPE) \ +#define BBTK_DECLARE_VTK_PARAM(NAME,TYPE) \ public: \ TYPE bbGetInput##NAME () \ - { return PARENT::Get##NAME(); } \ + { return vtkParent::Get##NAME(); } \ void bbSetInput##NAME (TYPE d) \ - { PARENT::Set##NAME(d); \ + { vtkParent::Set##NAME(d); \ /*bbSetModifiedStatus();*/ } //=========================================================================== -//=========================================================================== -#define BBTK_VTK_DELETE(VTKPARENT) \ - void bbDelete() { \ - bbGetOutputOut()->SetSource(NULL); \ - VTKPARENT::Delete(); } -//=========================================================================== + +//============================================================================ +/// Defines the default bbUserProcess method for vtk inherited black boxes +/// (calls vtkParent::Update) +#define BBTK_VTK_PROCESS() \ + public: \ + inline void bbUserProcess() \ + { \ + bbtkDebugMessage("process",1,"**> Processing ["<