//===== // 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 "bbvtkText3D.h" #include "bbvtkPackage.h" #include "vtkTextActor3D.h" #include "vtkTextProperty.h" namespace bbvtk { BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text3D) BBTK_BLACK_BOX_IMPLEMENTATION(Text3D,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 Text3D::Process() { // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value // INPUT/OUTPUT ACCESSORS ARE OF THE FORM : // void bbSet{Input|Output}NAME(const TYPE&) // const TYPE& bbGet{Input|Output}NAME() const // Where : // * NAME is the name of the input/output // (the one provided in the attribute 'name' of the tag 'input') // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') vtkTextActor3D *textActor = vtkTextActor3D::New(); vtkTextProperty *textprop = vtkTextProperty::New(); textprop->SetColor( bbGetInputColour()[0] , bbGetInputColour()[1], bbGetInputColour()[2] ); textprop->SetFontSize( 14 ); textActor->SetTextProperty( textprop ); textActor->SetInput( bbGetInputIn().c_str() ); textActor->SetPosition( bbGetInputX(), bbGetInputY(),bbGetInputZ() ); bbGetInputRenderer()->AddActor( textActor ); bbSetOutputOut(textActor); } //===== // 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 Text3D::bbUserSetDefaultValues() { // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn(""); bbSetInputX(0); bbSetInputY(0); bbSetInputZ(0); std::vector colour; colour.push_back(1); colour.push_back(0); colour.push_back(0); bbSetInputColour(colour); bbSetInputRenderer(NULL); } //===== // 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 Text3D::bbUserInitializeProcessing() { // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers // if any } //===== // 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 Text3D::bbUserFinalizeProcessing() { // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any } } // EO namespace bbvtk