]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
27a43f46cf24e3627d878902f262d83fdd938058
[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                     printf(" wxVtkBaseView_Info::Process %f %f %f\n",  vtkbasedata->GetX(), vtkbasedata->GetY(), vtkbasedata->GetZ() );
40                         marImageData *marimagedata = vtkbasedata->GetMarImageData();
41                         if (marimagedata!=NULL)
42                         {
43                                 bbSetOutputImage( marimagedata->GetImageData() );                               
44                         } // MarImageData
45                         std::vector<double> LstWindowColorLevel;
46                         LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
47                         LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
48                         bbSetOutputWindowColorLevel( LstWindowColorLevel );
49                         
50                         std::vector<double> lstPoint;
51                         lstPoint.push_back( vtkbasedata->GetX() );
52                         lstPoint.push_back( vtkbasedata->GetY() );
53                         lstPoint.push_back( vtkbasedata->GetZ() );
54                         bbSetOutputPoint( lstPoint );
55
56                         double normal[3];
57                         std::vector<double> lstNormal;
58                         bbGetInputwxVtkBaseView()->GetNormal( normal );
59                         lstNormal.push_back( normal[0] );
60                         lstNormal.push_back( normal[1] );
61                         lstNormal.push_back( normal[2] );
62                         bbSetOutputNormal( lstNormal );
63                         
64                         bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );                      
65                 }  // BaseData
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 wxVtkBaseView_Info::bbUserSetDefaultValues()
72 {
73 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
74 //    Here we initialize the input 'In' to 0
75         std::vector<double> LstWindowColorLevel;
76         LstWindowColorLevel.push_back( 1000 );
77         LstWindowColorLevel.push_back( 500 );
78         bbSetOutputWindowColorLevel( LstWindowColorLevel );
79     bbSetOutputDirection(2);
80     bbSetOutputInterpolation(true);
81     bbSetOutputvtkRenderer(NULL);
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 wxVtkBaseView_Info::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 wxVtkBaseView_Info::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 bbcreaMaracasVisu
110
111