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"
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Actor)
13 BBTK_BLACK_BOX_IMPLEMENTATION(Actor,bbtk::AtomicBlackBox);
15 // 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)
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')
30 // bbSetOutputOut( bbGetInputIn() );
31 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
32 if (bbGetInputIn()!=NULL)
34 vtkProp3D* vtkprop3D=bbGetInputIn();
35 std::string className = vtkprop3D->GetClassName();
36 std::string wantedClass = "vtkOpenGLActor";
37 if(className == wantedClass)
39 vtkActor *vtkactor=((vtkActor*)vtkprop3D);
40 vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
41 vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
42 double r = bbGetInputColor()[0];
43 double g = bbGetInputColor()[1];
44 double b = bbGetInputColor()[2];
45 vtkactor->GetProperty()->SetColor( r,g,b );
47 if ( bbGetInputTransform()!=NULL )
49 vtkprop3D->SetUserTransform( bbGetInputTransform() );
51 // bbSetOutputOut( vtkactor );
53 if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() ))
55 if (bbGetInputActive()==true )
57 bbGetInputRenderer()->AddActor( vtkprop3D );
59 bbGetInputRenderer()->RemoveActor( vtkprop3D );
61 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()
71 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
72 // Here we initialize the input 'In' to 0
74 std::vector<double> color;
78 bbSetInputActive( false );
79 backActive=bbGetInputActive();
81 bbSetInputOpacity( 1 );
82 bbSetInputLineWidth( 0.5 );
83 bbSetInputRenderer( NULL );
84 bbSetInputColor( color );
85 bbSetInputTransform( NULL );
89 // 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)
91 void Actor::bbUserInitializeProcessing()
94 // THE INITIALIZATION METHOD BODY :
96 // but this is where you should allocate the internal/output pointers
102 // 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)
104 void Actor::bbUserFinalizeProcessing()
107 // THE FINALIZATION METHOD BODY :
109 // but this is where you should desallocate the internal/output pointers
114 // EO namespace bbcreaVtk