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 "bbcreaVtkPlanes_ImplicitFunction.h"
5 #include "bbcreaVtkPackage.h"
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Planes_ImplicitFunction)
13 BBTK_BLACK_BOX_IMPLEMENTATION(Planes_ImplicitFunction,bbtk::AtomicBlackBox);
15 // 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)
17 void Planes_ImplicitFunction::Process()
20 // THE MAIN PROCESSING METHOD BODY
21 // Here we simply set the input 'In' value to the output 'Out'
22 // And print out the output value
23 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
24 // void bbSet{Input|Output}NAME(const TYPE&)
25 // const TYPE& bbGet{Input|Output}NAME() const
27 // * NAME is the name of the input/output
28 // (the one provided in the attribute 'name' of the tag 'input')
29 // * TYPE is the C++ type of the input/output
30 // (the one provided in the attribute 'type' of the tag 'input')
31 // bbSetOutputOut( bbGetInputType() );
32 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
33 printf("EED Planes_ImplicitFunction::Process Start \n");
35 if (bbGetInputPlanes()!=NULL)
37 printf("EED Planes_ImplicitFunction::Process Flag 01 \n");
41 std::vector<double> lstPoints;
42 std::vector<double> lstNormals;
43 size = bbGetInputPlanes()->GetNumberOfPlanes();
46 if (bbGetInputType()==1)
48 std::vector<double> points = bbGetInputPointsIn();
49 std::vector<double> normals = bbGetInputNormalsIn();
50 printf("EED Planes_ImplicitFunction::Process size %d size %d \n",points.size() , normals.size() );
51 if ((points.size() % 3==0) && (normals.size() % 3==0))
55 p = bbGetInputPlanes()->GetPlane(i);
56 tmpDouble[0] = points[i*3+0] ;
57 tmpDouble[1] = points[i*3+1] ;
58 tmpDouble[2] = points[i*3+2] ;
59 p->SetOrigin(tmpDouble);
60 tmpDouble[0] = normals[i*3+0] ;
61 tmpDouble[1] = normals[i*3+1] ;
62 tmpDouble[2] = normals[i*3+2] ;
63 p->SetNormal(tmpDouble);
65 printf("EED Planes_ImplicitFunction::Process normals %f %f %f \n", tmpDouble[0], tmpDouble[1], tmpDouble[2]);
70 if (bbGetInputType()==2)
74 p = bbGetInputPlanes()->GetPlane(i);
75 lstPoints.push_back( p->GetOrigin()[0] );
76 lstPoints.push_back( p->GetOrigin()[1] );
77 lstPoints.push_back( p->GetOrigin()[2] );
78 lstNormals.push_back( p->GetNormal()[0] );
79 lstNormals.push_back( p->GetNormal()[1] );
80 lstNormals.push_back( p->GetNormal()[2] );
82 bbSetOutputPointsOut(lstPoints);
83 bbSetOutputNormalsOut(lstNormals);
86 printf("EED Planes_ImplicitFunction::Process End \n");
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 Planes_ImplicitFunction::bbUserSetDefaultValues()
95 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
96 // Here we initialize the input 'In' to 0
98 bbSetInputPlanes(NULL);
102 // 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)
104 void Planes_ImplicitFunction::bbUserInitializeProcessing()
107 // THE INITIALIZATION METHOD BODY :
109 // but this is where you should allocate the internal/output pointers
115 // 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)
117 void Planes_ImplicitFunction::bbUserFinalizeProcessing()
120 // THE FINALIZATION METHOD BODY :
122 // but this is where you should desallocate the internal/output pointers
127 // EO namespace bbcreaVtk