/*========================================================================= Program: bbtk Module: $RCSfile: bbtkVtkBlackBoxMacros.h,v $ Language: C++ 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 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ /** * \file * \brief Defines macros for the creation of vtk object inherited black boxes */ #ifndef __bbtkVtkBlackBoxMacros_h__ #define __bbtkVtkBlackBoxMacros_h__ //#include //#include #include //=========================================================================== //============================================================================ // VTK Specific macros //=========================================================================== //=========================================================================== //=========================================================================== #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(\""<(vtkParent::GetInput()); } \ void bbSetInput##NAME (TYPE d) \ { vtkParent::SetInput( (vtkDataObject*) d); /*vtkParent::GetOutput() = d;*/ } //=========================================================================== //=========================================================================== /// Declares an AtomicBlackBox input corresponding to an /// 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(NAME,TYPE) \ public: \ TYPE bbGetInput##NAME () \ { return vtkParent::Get##NAME(); } \ void bbSetInput##NAME (TYPE d) \ { vtkParent::Set##NAME(d); \ /*bbSetModifiedStatus();*/ } //=========================================================================== //============================================================================ /// 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 ["<