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 "bbcreaVtkActor.h"
5 #include "bbcreaVtkPackage.h"
6 #include "vtkProperty.h"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Actor)
12 BBTK_BLACK_BOX_IMPLEMENTATION(Actor,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)
18 // THE MAIN PROCESSING METHOD BODY
19 // Here we simply set the input 'In' value to the output 'Out'
20 // And print out the output value
21 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
22 // void bbSet{Input|Output}NAME(const TYPE&)
23 // const TYPE& bbGet{Input|Output}NAME() const
25 // * NAME is the name of the input/output
26 // (the one provided in the attribute 'name' of the tag 'input')
27 // * TYPE is the C++ type of the input/output
28 // (the one provided in the attribute 'type' of the tag 'input')
29 // bbSetOutputOut( bbGetInputIn() );
30 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
31 if (bbGetInputIn()!=NULL)
33 vtkProp3D* vtkprop3D = bbGetInputIn();
34 std::string className = vtkprop3D->GetClassName();
35 std::string wantedClass = "vtkOpenGLActor";
36 if(className == wantedClass)
38 vtkActor *vtkactor=((vtkActor*)vtkprop3D);
39 vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
40 vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
41 double r = bbGetInputColor()[0];
42 double g = bbGetInputColor()[1];
43 double b = bbGetInputColor()[2];
44 vtkactor->GetProperty()->SetColor( r,g,b );
46 if ( bbGetInputTransform()!=NULL )
48 vtkprop3D->SetUserTransform( bbGetInputTransform() );
50 // bbSetOutputOut( vtkactor );
52 if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() ))
54 if (bbGetInputActive()==true )
56 bbGetInputRenderer()->AddActor( vtkprop3D );
58 bbGetInputRenderer()->RemoveActor( vtkprop3D );
60 backActive=bbGetInputActive();
66 // 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)
68 void Actor::bbUserSetDefaultValues()
70 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
71 // Here we initialize the input 'In' to 0
72 std::vector<double> color;
76 bbSetInputActive( false );
77 backActive=bbGetInputActive();
79 bbSetInputOpacity( 1 );
80 bbSetInputLineWidth( 0.5 );
81 bbSetInputRenderer( NULL );
82 bbSetInputColor( color );
83 bbSetInputTransform( NULL );
87 // 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)
89 void Actor::bbUserInitializeProcessing()
91 // THE INITIALIZATION METHOD BODY :
93 // 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 Actor::bbUserFinalizeProcessing()
102 // THE FINALIZATION METHOD BODY :
104 // but this is where you should desallocate the internal/output pointers
108 } // EO namespace bbcreaVtk