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)
20 // THE MAIN PROCESSING METHOD BODY
21 // Here we simply set the input 'In' value to the output 'Out'
22 // And print out the output value
23 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
24 // void bbSet{Input|Output}NAME(const TYPE&)
25 // const TYPE& bbGet{Input|Output}NAME() const
27 // * NAME is the name of the input/output
28 // (the one provided in the attribute 'name' of the tag 'input')
29 // * TYPE is the C++ type of the input/output
30 // (the one provided in the attribute 'type' of the tag 'input')
32 // bbSetOutputOut( bbGetInputIn() );
33 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
36 vtkProp3D* vtkprop3D=bbGetInputIn();
39 std::string className = vtkprop3D->GetClassName();
40 std::string wantedClass = "vtkOpenGLActor";
41 if(className == wantedClass)
43 vtkActor *vtkactor=((vtkActor*)vtkprop3D);
44 vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
45 vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
46 double r = bbGetInputColor()[0];
47 double g = bbGetInputColor()[1];
48 double b = bbGetInputColor()[2];
49 vtkactor->GetProperty()->SetColor( r,g,b );
52 if ( bbGetInputTransform()!=NULL )
54 vtkprop3D->SetUserTransform( bbGetInputTransform() );
57 // bbSetOutputOut( vtkactor );
61 if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() ))
64 if (bbGetInputActive()==true )
66 bbGetInputRenderer()->AddActor( vtkprop3D );
68 bbGetInputRenderer()->RemoveActor( vtkprop3D );
70 backActive=bbGetInputActive();
75 // 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)
77 void Actor::bbUserSetDefaultValues()
80 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
81 // Here we initialize the input 'In' to 0
83 std::vector<double> color;
87 bbSetInputActive( false );
88 backActive=bbGetInputActive();
90 bbSetInputOpacity( 1 );
91 bbSetInputLineWidth( 0.5 );
92 bbSetInputRenderer( NULL );
93 bbSetInputColor( color );
97 // 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)
99 void Actor::bbUserInitializeProcessing()
102 // THE INITIALIZATION METHOD BODY :
104 // but this is where you should allocate the internal/output pointers
110 // 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)
112 void Actor::bbUserFinalizeProcessing()
115 // THE FINALIZATION METHOD BODY :
117 // but this is where you should desallocate the internal/output pointers
122 // EO namespace bbcreaVtk