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() // virutal
13 std::vector<double> center = _box->_boxcreavtkplanewidget.GetCenter();
14 std::vector<double> normal = _box->_boxcreavtkplanewidget.GetNormal();
15 double delta = 0.00000001;
18 // 0 Center and Normal change
21 if ( (_ReactiveType==0) || (_ReactiveType==1) )
23 if (abs(_cxBack-center[0])>delta ) ok=true;
24 if (abs(_cyBack-center[1])>delta ) ok=true;
25 if (abs(_czBack-center[2])>delta ) ok=true;
26 }// if ReacitivityType 1 3
27 if ( (_ReactiveType==0) || (_ReactiveType==2) )
29 if (abs(_nxBack-normal[0])>delta ) ok=true;
30 if (abs(_nyBack-normal[1])>delta ) ok=true;
31 if (abs(_nzBack-normal[2])>delta ) ok=true;
32 }// if ReacitivityType 2 3
42 _box->bbSetOutputOut( _box->_boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
43 _box->bbSetOutputCenter( center );
44 _box->bbSetOutputNormal( normal );
46 // _box->bbSignalOutputModification(std::string("Out"));
47 // _box->bbSignalOutputModification(std::string("Center"));
48 // _box->bbSignalOutputModification(std::string("Normal"));
49 _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 printf("EED PlaneWidget::Process 1 \n");
78 if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL))
80 printf("EED PlaneWidget::Process 2 \n");
81 bbSetOutputOut( NULL );
82 std::vector<double> center;
83 std::vector<double> normal;
84 bbSetOutputCenter( center );
85 bbSetOutputNormal( normal );
87 if (bbGetInputOrigin().size()==3) printf("EED PlaneWidget::Process 3 Origin %f, %f, %f \n", bbGetInputOrigin()[0], bbGetInputOrigin()[1], bbGetInputOrigin()[2] );
88 else printf("EED PlaneWidget::Process 3 Origin -1 \n" );
89 _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
90 _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
91 _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
92 _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
93 _boxcreavtkplanewidget.SetRepresentation( bbGetInputRepresentation() );
94 _boxcreavtkplanewidget.SetOrigin( bbGetInputOrigin() );
95 _boxcreavtkplanewidget.SetNormalIn( bbGetInputNormalIn() );
96 _boxcreavtkplanewidget._ReactiveType=bbGetInputReactiveType();
97 _boxcreavtkplanewidget.Process();
99 bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
100 bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
101 bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
102 bbSetOutputBase( &_boxcreavtkplanewidget );
103 int sizeN = bbGetInputOrigin().size();
104 int sizeC = _boxcreavtkplanewidget.GetCenter().size();
107 double nx = bbGetInputOrigin()[0];
108 double ny = bbGetInputOrigin()[1];
109 double nz = bbGetInputOrigin()[2];
113 double cx =_boxcreavtkplanewidget.GetCenter()[0];
114 double cy =_boxcreavtkplanewidget.GetCenter()[1];
115 double cz =_boxcreavtkplanewidget.GetCenter()[2];
121 // 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)
123 void PlaneWidget::bbUserSetDefaultValues()
125 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
126 // Here we initialize the input 'In' to 0
127 _boxcreavtkplanewidget._box = this;
128 _boxcreavtkplanewidget._cxBack = -10000000;
129 _boxcreavtkplanewidget._cyBack = -10000000;
130 _boxcreavtkplanewidget._czBack = -10000000;
131 _boxcreavtkplanewidget._ReactiveType = 0;
133 bbSetInputActive(false);
135 bbSetInputResolution(60);
136 bbSetInputRepresentation(1);
137 bbSetInputRenderer(NULL);
138 bbSetInputReactiveType( _boxcreavtkplanewidget._ReactiveType );
139 bbSetOutputOut(NULL);
140 bbSetOutputBase(NULL);
144 // 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)
146 void PlaneWidget::bbUserInitializeProcessing()
148 // THE INITIALIZATION METHOD BODY :
150 // but this is where you should allocate the internal/output pointers
155 // 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)
157 void PlaneWidget::bbUserFinalizeProcessing()
159 // THE FINALIZATION METHOD BODY :
161 // but this is where you should desallocate the internal/output pointers
165 } // EO namespace bbcreaVtk