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 "bbvtkText3D.h"
5 #include "bbvtkPackage.h"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text3D)
12 BBTK_BLACK_BOX_IMPLEMENTATION(Text3D,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 Text3D::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')
31 // First time : creates the text actor and sets its text.
32 if (_textActor == NULL)
34 _textActor = vtkTextActor3D::New();
35 _textProp = vtkTextProperty::New();
36 if ( bbGetInputRenderer()!=NULL )
38 bbGetInputRenderer()->AddActor( _textActor );
40 _textProp->SetFontSize( 14 );
41 _textActor->SetTextProperty( _textProp );
43 // If the text actor already exists in the scene, simply refresh its text.
46 _textProp->SetColor( bbGetInputColour()[0] , bbGetInputColour()[1], bbGetInputColour()[2] );
48 _textActor->SetInput( bbGetInputIn().c_str() );
49 _textActor->SetPosition( bbGetInputX(), bbGetInputY(),bbGetInputZ() );
51 if ( bbGetInputTransform()!=NULL )
53 _textActor->SetUserTransform( bbGetInputTransform() );
56 bbSetOutputOut(_textActor);
61 // 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)
63 void Text3D::bbUserSetDefaultValues()
66 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
67 // Here we initialize the input 'In' to 0
68 bbSetInputIn("<void>");
73 std::vector<double> colour;
77 bbSetInputColour(colour);
78 bbSetInputRenderer(NULL);
79 bbSetInputTransform(NULL);
85 // 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)
87 void Text3D::bbUserInitializeProcessing()
90 // THE INITIALIZATION METHOD BODY :
92 // but this is where you should allocate the internal/output pointers
98 // 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)
100 void Text3D::bbUserFinalizeProcessing()
103 // THE FINALIZATION METHOD BODY :
105 // but this is where you should desallocate the internal/output pointers
110 // EO namespace bbvtk