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 "bbcreaVtkPlaneSource.h"
5 #include "bbcreaVtkPackage.h"
6 #include "vtkPlaneSource.h"
7 #include "vtkDataSet.h"
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneSource)
13 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,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 PlaneSource::Process()
23 vtkPlaneSource *plane;
24 plane = vtkPlaneSource::New();
25 c[0] = bbGetInputCenter()[0];
26 c[1] = bbGetInputCenter()[1];
27 c[2] = bbGetInputCenter()[2];
35 if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) )
46 if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==1) && (bbGetInputNormal()[2]==0) )
57 if ((bbGetInputNormal()[0]==1) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==0) )
77 plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() );
78 plane->SetOrigin( p0 );
79 plane->SetPoint1( p1 );
80 plane->SetPoint2( p2 );
82 plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] );
84 plane->SetCenter( c );
86 bbSetOutputPlane( (vtkDataSet*)plane );
87 bbSetOutputPolyData( plane->GetOutput() );
91 // 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)
93 void PlaneSource::bbUserSetDefaultValues()
95 std::vector<double> c;
96 std::vector<double> n;
105 bbSetInputXResolution(100);
106 bbSetInputYResolution(100);
109 // 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)
111 void PlaneSource::bbUserInitializeProcessing()
117 // 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)
119 void PlaneSource::bbUserFinalizeProcessing()
125 // EO namespace bbcreaVtk