//===== // 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) //===== #include "bbcreaVtkPlaneSource.h" #include "bbcreaVtkPackage.h" #include "vtkPlaneSource.h" #include "vtkDataSet.h" #include "iostream" namespace bbcreaVtk { BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneSource) BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,bbtk::AtomicBlackBox); //===== // 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) //===== void PlaneSource::Process() { vtkPlaneSource *plane; plane = vtkPlaneSource::New(); double p0[3]; p0[0]=0; p0[1]=0; p0[2]=0; double p1[3]; p1[0]=0; p1[1]=1; p1[2]=0; double p2[3]; p2[0]=0; p2[1]=0; p2[2]=1; double c[3]; c[0]=bbGetInputCenter()[0]; c[1]=bbGetInputCenter()[1]; c[2]=bbGetInputCenter()[2]; plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() ); plane->SetOrigin( p0 ); plane->SetPoint1( p1 ); plane->SetPoint2( p2 ); plane->Update( ); plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); plane->Update( ); plane->SetCenter( c ); plane->Update( ); bbSetOutputPlane( (vtkDataSet*)plane ); bbSetOutputPolyData( plane->GetOutput() ); } //===== // 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) //===== void PlaneSource::bbUserSetDefaultValues() { std::vector c; std::vector n; c.push_back(0); c.push_back(0); c.push_back(0); n.push_back(1); n.push_back(0); n.push_back(0); bbSetInputCenter(c); bbSetInputNormal(n); bbSetInputXResolution(100); bbSetInputYResolution(100); } //===== // 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) //===== void PlaneSource::bbUserInitializeProcessing() { } //===== // 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) //===== void PlaneSource::bbUserFinalizeProcessing() { } } // EO namespace bbcreaVtk