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 printf("EED ClipPolyData::Process Start\n");
38 if ((bbGetInputIn()!=NULL) && (bbGetInputImplicitFunction()!=NULL) )
40 if (bbGetInputType()==0)
42 vtkClipPolyData *clip = vtkClipPolyData::New();
43 clip->SetInputData( bbGetInputIn() );
44 clip->SetClipFunction( bbGetInputImplicitFunction() );
45 clip->GenerateClipScalarsOn();
46 clip->GenerateClippedOutputOff();
47 if (bbGetInputInside()==true)
54 bbSetOutputOut( clip->GetOutput() );
56 if (bbGetInputType()==1)
58 vtkExtractPoints *clip = vtkExtractPoints::New();
59 clip->SetInputData( bbGetInputIn() );
60 clip->SetImplicitFunction( bbGetInputImplicitFunction() );
61 if (bbGetInputInside()==true)
63 clip->ExtractInsideOn();
65 clip->ExtractInsideOff();
68 bbSetOutputOut( clip->GetOutput() );
71 printf("EED Warnning! ClipPolyData::Process In or ImplicitFunction is EMPTY\n");
72 } // if In ImplicitFunction != NULL
76 // 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)
78 void ClipPolyData::bbUserSetDefaultValues()
81 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
82 // Here we initialize the input 'In' to 0
85 bbSetInputInside( true );
86 bbSetInputImplicitFunction( NULL );
90 // 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)
92 void ClipPolyData::bbUserInitializeProcessing()
95 // THE INITIALIZATION METHOD BODY :
97 // but this is where you should allocate the internal/output pointers
103 // 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)
105 void ClipPolyData::bbUserFinalizeProcessing()
108 // THE FINALIZATION METHOD BODY :
110 // but this is where you should desallocate the internal/output pointers
115 // EO namespace bbcreaVtk