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