]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkActor.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 "bbcreaVtkActor.h"
5 #include "bbcreaVtkPackage.h"
6 #include "vtkProperty.h"
7
8
9 namespace bbcreaVtk
10 {
11
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Actor)
13 BBTK_BLACK_BOX_IMPLEMENTATION(Actor,bbtk::AtomicBlackBox);
14 //===== 
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)
16 //===== 
17 void Actor::Process()
18 {
19
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 
26 //    Where :
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')
31
32 //    bbSetOutputOut( bbGetInputIn() );
33 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
34  
35
36      vtkProp3D* vtkprop3D=bbGetInputIn();
37
38
39     std::string className = vtkprop3D->GetClassName();
40     std::string wantedClass = "vtkOpenGLActor";
41     if(className == wantedClass)
42     {
43                 ((vtkActor*)vtkprop3D)->GetProperty()->SetOpacity( bbGetInputOpacity() );
44     }
45      
46      if ( bbGetInputTransform()!=NULL )
47      {
48         vtkprop3D->SetUserTransform( bbGetInputTransform() );
49      }
50
51 //     bbSetOutputOut( vtkactor );
52
53      // Interface Update
54
55     if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() ))
56         {
57         
58         if (bbGetInputActive()==true )
59         {
60                 bbGetInputRenderer()->AddActor( vtkprop3D );
61         }  else {
62                 bbGetInputRenderer()->RemoveActor( vtkprop3D );
63         }  //if Active
64                 backActive=bbGetInputActive();
65         } // if Renderer
66
67 }
68 //===== 
69 // 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)
70 //===== 
71 void Actor::bbUserSetDefaultValues()
72 {
73
74 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
75 //    Here we initialize the input 'In' to 0
76    bbSetInputActive(false);
77    backActive=bbGetInputActive();
78    bbSetInputIn(NULL);
79    bbSetInputOpacity(1);
80    bbSetInputRenderer(NULL);
81
82 }
83 //===== 
84 // 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)
85 //===== 
86 void Actor::bbUserInitializeProcessing()
87 {
88
89 //  THE INITIALIZATION METHOD BODY :
90 //    Here does nothing 
91 //    but this is where you should allocate the internal/output pointers 
92 //    if any 
93
94   
95 }
96 //===== 
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)
98 //===== 
99 void Actor::bbUserFinalizeProcessing()
100 {
101
102 //  THE FINALIZATION METHOD BODY :
103 //    Here does nothing 
104 //    but this is where you should desallocate the internal/output pointers 
105 //    if any
106   
107 }
108 }
109 // EO namespace bbcreaVtk
110
111