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)
4 #include "bbcreaVtkPlaneWidget.h"
5 #include "bbcreaVtkPackage.h"
11 void boxcreaVtkPlaneWidget::Execute() // virtual
13 std::vector<double> center = _box->_boxcreavtkplanewidget.GetCenter();
14 std::vector<double> normal = _box->_boxcreavtkplanewidget.GetNormal();
15 SetNormalIn( normal );
16 double delta = 0.00000001;
19 // 0 Center and Normal change
22 if ( (_ReactiveType==0) || (_ReactiveType==1) )
24 if (abs(_cxBack-center[0])>delta ) ok=true;
25 if (abs(_cyBack-center[1])>delta ) ok=true;
26 if (abs(_czBack-center[2])>delta ) ok=true;
27 }// if ReacitivityType 1 3
28 if ( (_ReactiveType==0) || (_ReactiveType==2) )
30 if (abs(_nxBack-normal[0])>delta ) ok=true;
31 if (abs(_nyBack-normal[1])>delta ) ok=true;
32 if (abs(_nzBack-normal[2])>delta ) ok=true;
33 }// if ReacitivityType 2 3
43 _box->bbSetOutputOut( _box->_boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
44 _box->bbSetOutputCenter( center );
45 _box->bbSetOutputNormal( normal );
47 // _box->bbSignalOutputModification(std::string("Out"));
48 // _box->bbSignalOutputModification(std::string("Center"));
49 // _box->bbSignalOutputModification(std::string("Normal"));
50 _box->bbSignalOutputModification();
54 //----------------------------------------------------------------------------------------------
55 //----------------------------------------------------------------------------------------------
56 //----------------------------------------------------------------------------------------------
57 //----------------------------------------------------------------------------------------------
59 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneWidget)
60 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneWidget,bbtk::AtomicBlackBox);
62 // 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)
64 void PlaneWidget::Process()
66 // THE MAIN PROCESSING METHOD BODY
67 // Here we simply set the input 'In' value to the output 'Out'
68 // And print out the output value
69 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
70 // void bbSet{Input|Output}NAME(const TYPE&)
71 // const TYPE& bbGet{Input|Output}NAME() const
73 // * NAME is the name of the input/output
74 // (the one provided in the attribute 'name' of the tag 'input')
75 // * TYPE is the C++ type of the input/output
76 // (the one provided in the attribute 'type' of the tag 'input')
77 if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL))
79 bbSetOutputOut( NULL );
80 std::vector<double> center;
81 std::vector<double> normal;
82 bbSetOutputCenter( center );
83 bbSetOutputNormal( normal );
85 _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
86 _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
87 _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
88 _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
89 _boxcreavtkplanewidget.SetRepresentation( bbGetInputRepresentation() );
90 _boxcreavtkplanewidget.SetOrigin( bbGetInputOrigin() );
91 _boxcreavtkplanewidget.SetNormalIn( bbGetInputNormalIn() );
92 _boxcreavtkplanewidget._ReactiveType=bbGetInputReactiveType();
93 _boxcreavtkplanewidget.Process();
95 bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
96 bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
97 bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
98 bbSetOutputBase( &_boxcreavtkplanewidget );
99 int sizeN = bbGetInputOrigin().size();
100 int sizeC = _boxcreavtkplanewidget.GetCenter().size();
103 double nx = bbGetInputOrigin()[0];
104 double ny = bbGetInputOrigin()[1];
105 double nz = bbGetInputOrigin()[2];
109 double cx =_boxcreavtkplanewidget.GetCenter()[0];
110 double cy =_boxcreavtkplanewidget.GetCenter()[1];
111 double cz =_boxcreavtkplanewidget.GetCenter()[2];
117 // 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)
119 void PlaneWidget::bbUserSetDefaultValues()
121 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
122 // Here we initialize the input 'In' to 0
123 _boxcreavtkplanewidget._box = this;
124 _boxcreavtkplanewidget._cxBack = -10000000;
125 _boxcreavtkplanewidget._cyBack = -10000000;
126 _boxcreavtkplanewidget._czBack = -10000000;
127 _boxcreavtkplanewidget._ReactiveType = 0;
129 bbSetInputActive(false);
131 bbSetInputResolution(60);
132 bbSetInputRepresentation(1);
133 bbSetInputRenderer(NULL);
134 bbSetInputReactiveType( _boxcreavtkplanewidget._ReactiveType );
135 bbSetOutputOut(NULL);
136 bbSetOutputBase(NULL);
140 // 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)
142 void PlaneWidget::bbUserInitializeProcessing()
144 // THE INITIALIZATION METHOD BODY :
146 // but this is where you should allocate the internal/output pointers
151 // 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)
153 void PlaneWidget::bbUserFinalizeProcessing()
155 // THE FINALIZATION METHOD BODY :
157 // but this is where you should desallocate the internal/output pointers
161 } // EO namespace bbcreaVtk