-#define BBTK_VTK_NEW(CLASS,VTKPARENT) \
- inline static Pointer New(const std::string& name) \
- { \
- /*vtkDebugLeaks::ConstructClass(#VTKPARENT);*/ \
- bbtkDebugMessage("object",1,"##> "<<#CLASS \
- <<"::New(\""<<name<<"\")"<<std::endl); \
- Pointer p = MakeBlackBoxPointer(new Self(name)); \
- bbtkDebugMessage("object",1,"<## "<<#CLASS \
- <<"::New(\""<<name<<"\")"<<std::endl); \
- return p; \
- } \
-//===========================================================================
-
-//===========================================================================
-#define BBTK_VTK_CLONE(CLASS,VTKPARENT) \
- inline bbtk::BlackBox::Pointer bbClone(const std::string& name) \
- { \
- /*vtkDebugLeaks::ConstructClass(#VTKPARENT);*/ \
- bbtkDebugMessage("object",1,"##> "<<#CLASS \
- <<"::bbClone(\""<<name<<"\")"<<std::endl); \
- Pointer p = MakeBlackBoxPointer(new Self(*this,name)); \
- bbtkDebugMessage("object",1,"<## "<<#CLASS \
- <<"::bbClone(\""<<name<<"\")"<<std::endl); \
- return p; \
- }
-
-
-//===========================================================================
-#define BBTK_VTK_BLACK_BOX_INTERFACE(CLASS,PARENTBLACKBOX,VTKPARENT) \
- BBTK_BLACK_BOX_INTERFACE_WITHOUT_NEW(CLASS,PARENTBLACKBOX); \
- typedef VTKPARENT vtkParent; \
- BBTK_VTK_DELETE(); \
- public : \
- BBTK_VTK_NEW(CLASS,VTKPARENT); \
- BBTK_VTK_CLONE(CLASS,VTKPARENT);
+#define BBTK_VTK_DELETE() \
+ int bbDelete() { \
+ for (int i=0; i<mVtkObject->GetNumberOfInputPorts();++i) \
+ mVtkObject->SetInput(i,0); \
+ bbGetOutputOut()->SetSource(NULL); \
+ int refs = mVtkObject->GetReferenceCount()-1; \
+ mVtkObject->Delete(); \
+ return refs; \
+ }