2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbcreaVtkClipPolyData.h"
5 #include "bbcreaVtkPackage.h"
7 #include "vtkExtractPoints.h"
8 #include "vtkClipPolyData.h"
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ClipPolyData)
14 BBTK_BLACK_BOX_IMPLEMENTATION(ClipPolyData,bbtk::AtomicBlackBox);
16 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
18 void ClipPolyData::Process()
21 // THE MAIN PROCESSING METHOD BODY
22 // Here we simply set the input 'In' value to the output 'Out'
23 // And print out the output value
24 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
25 // void bbSet{Input|Output}NAME(const TYPE&)
26 // const TYPE& bbGet{Input|Output}NAME() const
28 // * NAME is the name of the input/output
29 // (the one provided in the attribute 'name' of the tag 'input')
30 // * TYPE is the C++ type of the input/output
31 // (the one provided in the attribute 'type' of the tag 'input')
33 // bbSetOutputOut( bbGetInputIn() );
34 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
36 if ((bbGetInputIn()!=NULL) && (bbGetInputImplicitFunction()!=NULL) )
38 if (bbGetInputType()==0)
40 vtkClipPolyData *clip = vtkClipPolyData::New();
41 clip->SetInputData( bbGetInputIn() );
42 clip->SetClipFunction( bbGetInputImplicitFunction() );
43 clip->GenerateClipScalarsOn();
44 clip->GenerateClippedOutputOff();
45 if (bbGetInputInside()==true)
52 bbSetOutputOut( clip->GetOutput() );
54 if (bbGetInputType()==1)
56 vtkExtractPoints *clip = vtkExtractPoints::New();
57 clip->SetInputData( bbGetInputIn() );
58 clip->SetImplicitFunction( bbGetInputImplicitFunction() );
59 if (bbGetInputInside()==true)
61 clip->ExtractInsideOn();
63 clip->ExtractInsideOff();
66 bbSetOutputOut( clip->GetOutput() );
69 printf("EED Warnning! ClipPolyData::Process In or ImplicitFunction is EMPTY\n");
70 } // if In ImplicitFunction != NULL
74 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
76 void ClipPolyData::bbUserSetDefaultValues()
79 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
80 // Here we initialize the input 'In' to 0
83 bbSetInputInside( true );
84 bbSetInputImplicitFunction( NULL );
88 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
90 void ClipPolyData::bbUserInitializeProcessing()
93 // THE INITIALIZATION METHOD BODY :
95 // but this is where you should allocate the internal/output pointers
101 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
103 void ClipPolyData::bbUserFinalizeProcessing()
106 // THE FINALIZATION METHOD BODY :
108 // but this is where you should desallocate the internal/output pointers
113 // EO namespace bbcreaVtk