]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
1c92d3b581849be9a63c6752fb736058c61cc0a9
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuwxVtkBaseView_Info.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 "bbcreaMaracasVisuwxVtkBaseView_Info.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,wxVtkBaseView_Info)
10 BBTK_BLACK_BOX_IMPLEMENTATION(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
11 //===== 
12 // 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)
13 //===== 
14 void wxVtkBaseView_Info::Process()
15 {
16
17 // THE MAIN PROCESSING METHOD BODY
18 //   Here we simply set the input 'In' value to the output 'Out'
19 //   And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 //    void bbSet{Input|Output}NAME(const TYPE&)
22 //    const TYPE& bbGet{Input|Output}NAME() const 
23 //    Where :
24 //    * NAME is the name of the input/output
25 //      (the one provided in the attribute 'name' of the tag 'input')
26 //    * TYPE is the C++ type of the input/output
27 //      (the one provided in the attribute 'type' of the tag 'input')
28
29 //    bbSetOutputOut( bbGetInputIn() );
30 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
31   
32         if (bbGetInputwxVtkBaseView()!=NULL)
33         {
34                 bbSetOutputvtkRenderer( bbGetInputwxVtkBaseView()->GetRenderer() );
35                 bbSetOutputDirection( bbGetInputwxVtkBaseView()->GetDirection() );
36                 vtkBaseData *vtkbasedata = bbGetInputwxVtkBaseView()->GetVtkBaseData();
37                 if (vtkbasedata!=NULL)
38                 {
39                         marImageData *marimagedata = vtkbasedata->GetMarImageData();
40                         if (marimagedata!=NULL)
41                         {
42                                 bbSetOutputImage( marimagedata->GetImageData() );                               
43                         } // MarImageData
44                         std::vector<double> LstWindowColorLevel;
45                         LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
46                         LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
47                         bbSetOutputWindowColorLevel( LstWindowColorLevel );
48                         
49                         std::vector<double> lstPoint;
50                         lstPoint.push_back( vtkbasedata->GetX() );
51                         lstPoint.push_back( vtkbasedata->GetY() );
52                         lstPoint.push_back( vtkbasedata->GetZ() );
53                         bbSetOutputPoint( lstPoint );
54
55                         double normal[3];
56                         std::vector<double> lstNormal;
57                         bbGetInputwxVtkBaseView()->GetNormal( normal );
58                         lstNormal.push_back( normal[0] );
59                         lstNormal.push_back( normal[1] );
60                         lstNormal.push_back( normal[2] );
61                         bbSetOutputNormal( lstNormal );
62                         
63                         bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );                      
64                 }  // BaseData
65         }
66 }
67 //===== 
68 // 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)
69 //===== 
70 void wxVtkBaseView_Info::bbUserSetDefaultValues()
71 {
72 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
73 //    Here we initialize the input 'In' to 0
74         std::vector<double> LstWindowColorLevel;
75         LstWindowColorLevel.push_back( 1000 );
76         LstWindowColorLevel.push_back( 500 );
77         bbSetOutputWindowColorLevel( LstWindowColorLevel );
78     bbSetOutputDirection(2);
79     bbSetOutputInterpolation(true);
80     bbSetOutputvtkRenderer(NULL);
81 }
82 //===== 
83 // 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)
84 //===== 
85 void wxVtkBaseView_Info::bbUserInitializeProcessing()
86 {
87
88 //  THE INITIALIZATION METHOD BODY :
89 //    Here does nothing 
90 //    but this is where you should allocate the internal/output pointers 
91 //    if any 
92
93   
94 }
95 //===== 
96 // 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)
97 //===== 
98 void wxVtkBaseView_Info::bbUserFinalizeProcessing()
99 {
100
101 //  THE FINALIZATION METHOD BODY :
102 //    Here does nothing 
103 //    but this is where you should desallocate the internal/output pointers 
104 //    if any
105   
106 }
107 }
108 // EO namespace bbcreaMaracasVisu
109
110