]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget_Base.cxx
#3483 PlaneWidget_Base Box
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPlaneWidget_Base.cxx
diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget_Base.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget_Base.cxx
new file mode 100644 (file)
index 0000000..25b743a
--- /dev/null
@@ -0,0 +1,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)
+//===== 
+#include "bbcreaVtkPlaneWidget_Base.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneWidget_Base)
+BBTK_BLACK_BOX_IMPLEMENTATION(PlaneWidget_Base,bbtk::AtomicBlackBox);
+//===== 
+// 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)
+//===== 
+void PlaneWidget_Base::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+    
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+    printf("EED PlaneWidget_Base::Process \n");
+    
+    if ((bbGetInputType()==1)  &&  (bbGetInputIn()!=NULL) )
+    {
+        std::vector<double> origin = bbGetInputIn()->GetCenter();
+        std::vector<double> normal = bbGetInputIn()->GetNormal();
+
+        printf("EED PlaneWidget_Base::Process normal  %f %f %f \n", normal[0],normal[1],normal[2] );
+        printf("EED PlaneWidget_Base::Process origin  %f %f %f \n", origin[0],origin[1],origin[2] );
+
+        origin[0] = origin[0] + normal[0]*bbGetInputParam();
+        origin[1] = origin[1] + normal[1]*bbGetInputParam();
+        origin[2] = origin[2] + normal[2]*bbGetInputParam();
+
+        printf("EED PlaneWidget_Base::Process origin2  %f %f %f \n", origin[0],origin[1],origin[2] );
+
+        bbGetInputIn()->SetOrigin(origin);
+        bbGetInputIn()->Process();
+
+    }
+    printf("EED PlaneWidget_Base::Process 2 \n");
+
+}
+
+//===== 
+// 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)
+//===== 
+void PlaneWidget_Base::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+   bbSetInputType(0);
+   bbSetInputParam(0);
+
+}
+//===== 
+// 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)
+//===== 
+void PlaneWidget_Base::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// 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)
+//===== 
+void PlaneWidget_Base::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaVtk
+
+