]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkText3D.cxx
ef38350d3ea4aa35aba036c22337e6f95d8e9547
[bbtk.git] / packages / vtk / src / bbvtkText3D.cxx
1 //===== 
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)
3 //===== 
4 #include "bbvtkText3D.h"
5 #include "bbvtkPackage.h"
6
7 #include "vtkTextActor3D.h"
8 #include "vtkTextProperty.h"
9
10
11 namespace bbvtk
12 {
13
14 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text3D)
15 BBTK_BLACK_BOX_IMPLEMENTATION(Text3D,bbtk::AtomicBlackBox);
16 //===== 
17 // 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)
18 //===== 
19 void Text3D::Process()
20 {
21
22 // THE MAIN PROCESSING METHOD BODY
23 //   Here we simply set the input 'In' value to the output 'Out'
24 //   And print out the output value
25 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
26 //    void bbSet{Input|Output}NAME(const TYPE&)
27 //    const TYPE& bbGet{Input|Output}NAME() const 
28 //    Where :
29 //    * NAME is the name of the input/output
30 //      (the one provided in the attribute 'name' of the tag 'input')
31 //    * TYPE is the C++ type of the input/output
32 //      (the one provided in the attribute 'type' of the tag 'input')
33
34         vtkTextActor3D *textActor = vtkTextActor3D::New();
35         vtkTextProperty *textprop = vtkTextProperty::New();
36         textprop->SetColor( bbGetInputColour()[0] , bbGetInputColour()[1], bbGetInputColour()[2] );
37         textprop->SetFontSize( 14 );
38
39         textActor->SetTextProperty( textprop  );
40
41         textActor->SetInput( bbGetInputIn().c_str()  );
42         textActor->SetPosition(  bbGetInputX(), bbGetInputY(),bbGetInputZ() );
43         if ( bbGetInputRenderer()!=NULL )
44         {
45                 bbGetInputRenderer()->AddActor( textActor );
46         }
47         
48         if ( bbGetInputTransform()!=NULL )
49         {
50                 textActor->SetUserTransform( bbGetInputTransform() );
51         }
52         
53         bbSetOutputOut(textActor);
54         
55 }
56 //===== 
57 // 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)
58 //===== 
59 void Text3D::bbUserSetDefaultValues()
60 {
61
62 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
63 //    Here we initialize the input 'In' to 0
64    bbSetInputIn("<void>");
65         bbSetInputX(0);
66         bbSetInputY(0);
67         bbSetInputZ(0);
68         
69         std::vector<double> colour;
70         colour.push_back(1);
71         colour.push_back(0);
72         colour.push_back(0);
73         bbSetInputColour(colour);
74         bbSetInputRenderer(NULL);
75         bbSetInputTransform(NULL);
76 }
77 //===== 
78 // 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)
79 //===== 
80 void Text3D::bbUserInitializeProcessing()
81 {
82
83 //  THE INITIALIZATION METHOD BODY :
84 //    Here does nothing 
85 //    but this is where you should allocate the internal/output pointers 
86 //    if any 
87
88   
89 }
90 //===== 
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)
92 //===== 
93 void Text3D::bbUserFinalizeProcessing()
94 {
95
96 //  THE FINALIZATION METHOD BODY :
97 //    Here does nothing 
98 //    but this is where you should desallocate the internal/output pointers 
99 //    if any
100   
101 }
102 }
103 // EO namespace bbvtk
104
105