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 "bbcreaVtkVectorsExtraction.h"
5 #include "bbcreaVtkPackage.h"
6 #include "vtkDoubleArray.h"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,VectorsExtraction)
12 BBTK_BLACK_BOX_IMPLEMENTATION(VectorsExtraction,bbtk::AtomicBlackBox);
14 // 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)
16 void VectorsExtraction::Process()
19 // THE MAIN PROCESSING METHOD BODY
20 // Here we simply set the input 'In' value to the output 'Out'
21 // And print out the output value
22 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
23 // void bbSet{Input|Output}NAME(const TYPE&)
24 // const TYPE& bbGet{Input|Output}NAME() const
26 // * NAME is the name of the input/output
27 // (the one provided in the attribute 'name' of the tag 'input')
28 // * TYPE is the C++ type of the input/output
29 // (the one provided in the attribute 'type' of the tag 'input')
30 std::cout<< "MLER VectorsExtraction Process Start" << std::endl;
32 if(bbGetInputVectorsFieldImage() != NULL )
34 vtkImageData* m_VectorImage = bbGetInputVectorsFieldImage();
36 std::vector<double> coord = bbGetInputCoordinates();
38 vtkDoubleArray* velocity = vtkDoubleArray::New();
39 velocity = vtkDoubleArray::SafeDownCast(m_VectorImage->GetPointData()->GetArray("velocity"));
41 std::cout<< "# components velocity" << velocity->GetNumberOfComponents()<<std::endl;
48 m_VectorImage->Print(std::cout);
50 bbSetOutputAngle1(ang1);
51 bbSetOutputAngle2(ang2);
55 std::cout<< "MLER VectorsExtraction Process END" << std::endl;
59 // 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)
61 void VectorsExtraction::bbUserSetDefaultValues()
64 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
65 // Here we initialize the input 'In' to 0
66 bbSetInputVectorsFieldImage(NULL);
70 // 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)
72 void VectorsExtraction::bbUserInitializeProcessing()
75 // THE INITIALIZATION METHOD BODY :
77 // but this is where you should allocate the internal/output pointers
83 // 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)
85 void VectorsExtraction::bbUserFinalizeProcessing()
88 // THE FINALIZATION METHOD BODY :
90 // but this is where you should desallocate the internal/output pointers
95 // EO namespace bbcreaVtk