]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkText3D.cxx
7f7a0d780b511667c26923ec747a75a3c3e77843
[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
8 namespace bbvtk
9 {
10
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text3D)
12 BBTK_BLACK_BOX_IMPLEMENTATION(Text3D,bbtk::AtomicBlackBox);
13 //===== 
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)
15 //===== 
16 void Text3D::Process()
17 {
18
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 
25 //    Where :
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')
30
31   // First time : creates the text actor and sets its text.
32   if (_textActor == NULL)
33     {
34         _textActor = vtkTextActor3D::New();
35         _textProp = vtkTextProperty::New();
36         if ( bbGetInputRenderer()!=NULL )
37         {
38                 bbGetInputRenderer()->AddActor( _textActor );
39         }
40         _textProp->SetFontSize( 14 );
41         _textActor->SetTextProperty( _textProp  );
42     }
43   _textProp->SetColor( bbGetInputColour()[0] , bbGetInputColour()[1], bbGetInputColour()[2] );
44   
45   _textActor->SetInput( bbGetInputIn().c_str()  );
46   _textActor->SetPosition(  bbGetInputX(), bbGetInputY(),bbGetInputZ() );
47         
48   if ( bbGetInputTransform()!=NULL )
49     {
50       _textActor->SetUserTransform( bbGetInputTransform() );
51     }
52   
53   bbSetOutputOut(_textActor);
54   
55 }
56
57 //===== 
58 // 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)
59 //===== 
60 void Text3D::bbUserSetDefaultValues()
61 {
62
63 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
64 //    Here we initialize the input 'In' to 0
65         bbSetInputIn("<void>");
66         bbSetInputX(0);
67         bbSetInputY(0);
68         bbSetInputZ(0);
69         
70         std::vector<double> colour;
71         colour.push_back(1);
72         colour.push_back(0);
73         colour.push_back(0);
74         bbSetInputColour(colour);
75         bbSetInputRenderer(NULL);
76         bbSetInputTransform(NULL);
77
78         _textActor = NULL;
79         _textProp = NULL;
80 }
81 //===== 
82 // 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)
83 //===== 
84 void Text3D::bbUserInitializeProcessing()
85 {
86
87 //  THE INITIALIZATION METHOD BODY :
88 //    Here does nothing 
89 //    but this is where you should allocate the internal/output pointers 
90 //    if any 
91
92   
93 }
94 //===== 
95 // 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)
96 //===== 
97 void Text3D::bbUserFinalizeProcessing()
98 {
99
100 //  THE FINALIZATION METHOD BODY :
101 //    Here does nothing 
102 //    but this is where you should desallocate the internal/output pointers 
103 //    if any
104   
105 }
106 }
107 // EO namespace bbvtk
108
109