]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx
869a8f7e58c20346ef43798a1568d4b0db629ec0
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPlaneWidget.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 "bbcreaVtkPlaneWidget.h"
5 #include "bbcreaVtkPackage.h"
6 namespace bbcreaVtk
7 {
8
9
10
11 void boxcreaVtkPlaneWidget::Execute()  // virutal
12 {
13    box->bbSetOutputOut( box->_boxcreavtkplanewidget.GetPlaneSource()->GetOutput()  );
14         box->bbSignalOutputModification(std::string("Out"));
15         box->bbSetOutputCenter( box->_boxcreavtkplanewidget.GetCenter() );
16         box->bbSignalOutputModification(std::string("Center"));
17         box->bbSetOutputNormal( box->_boxcreavtkplanewidget.GetNormal() );
18         box->bbSignalOutputModification(std::string("Normal"));
19 }
20
21 //----------------------------------------------------------------------------------------------
22 //----------------------------------------------------------------------------------------------
23 //----------------------------------------------------------------------------------------------
24 //----------------------------------------------------------------------------------------------
25
26 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneWidget)
27 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneWidget,bbtk::AtomicBlackBox);
28 //===== 
29 // 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)
30 //===== 
31 void PlaneWidget::Process()
32 {
33
34 // THE MAIN PROCESSING METHOD BODY
35 //   Here we simply set the input 'In' value to the output 'Out'
36 //   And print out the output value
37 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
38 //    void bbSet{Input|Output}NAME(const TYPE&)
39 //    const TYPE& bbGet{Input|Output}NAME() const 
40 //    Where :
41 //    * NAME is the name of the input/output
42 //      (the one provided in the attribute 'name' of the tag 'input')
43 //    * TYPE is the C++ type of the input/output
44 //      (the one provided in the attribute 'type' of the tag 'input')
45
46
47         if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL))
48         {
49                 bbSetOutputOut( NULL );
50                 std::vector<double> center;
51                 std::vector<double> normal;
52                 bbSetOutputCenter( center );
53                 bbSetOutputNormal( normal );
54         } else {
55                 _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
56                 _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
57                 _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
58                 _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
59                 _boxcreavtkplanewidget.SetRepresentation( bbGetInputRepresentation() );
60                 _boxcreavtkplanewidget.SetOrigin( bbGetInputOrigin() );
61         _boxcreavtkplanewidget.SetNormalIn( bbGetInputNormalIn() );
62                 _boxcreavtkplanewidget.Process();
63                 
64                 bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
65                 bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
66                 bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
67         }
68         
69 }
70 //===== 
71 // 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)
72 //===== 
73 void PlaneWidget::bbUserSetDefaultValues()
74 {
75
76 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
77 //    Here we initialize the input 'In' to 0
78
79    bbSetInputActive(false);
80    bbSetInputIn(NULL);
81    bbSetInputResolution(60);
82    bbSetInputRepresentation(1);
83    bbSetInputRenderer(NULL);
84    bbSetOutputOut(NULL);
85    _boxcreavtkplanewidget.box = this;
86 }
87 //===== 
88 // 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)
89 //===== 
90 void PlaneWidget::bbUserInitializeProcessing()
91 {
92
93 //  THE INITIALIZATION METHOD BODY :
94 //    Here does nothing 
95 //    but this is where you should allocate the internal/output pointers 
96 //    if any 
97
98   
99 }
100 //===== 
101 // 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)
102 //===== 
103 void PlaneWidget::bbUserFinalizeProcessing()
104 {
105
106 //  THE FINALIZATION METHOD BODY :
107 //    Here does nothing 
108 //    but this is where you should desallocate the internal/output pointers 
109 //    if any
110   
111 }
112
113 }// EO namespace bbcreaVtk
114
115