X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=wt%2Fbbtk_wt_PKG%2Fsrc%2Fbbwtshape3D.cxx;fp=wt%2Fbbtk_wt_PKG%2Fsrc%2Fbbwtshape3D.cxx;h=5b560a08a62c1787aad759b1e36222090426ca44;hb=aec464d8738507b9d26fc6915c7c063cab636dde;hp=0000000000000000000000000000000000000000;hpb=26116b2d4181a4ed3fffa07fbb75ef527d32d740;p=creaWT.git diff --git a/wt/bbtk_wt_PKG/src/bbwtshape3D.cxx b/wt/bbtk_wt_PKG/src/bbwtshape3D.cxx new file mode 100644 index 0000000..5b560a0 --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtshape3D.cxx @@ -0,0 +1,191 @@ +//===== +// 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 "bbwtshape3D.h" +#include "bbwtPackage.h" +#include "bbtkUtilities.h" + +namespace bbwt +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,shape3D) +BBTK_BLACK_BOX_IMPLEMENTATION(shape3D,bbtk::WtBlackBox); +//===== +// 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 shape3D::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 = " <doJavaScript("alert(window.rr.container);"); +//w->doJavaScript("skull3.file = 'http://x.babymri.org/?skull.vtk';\ + window.rr.add(skull3);\ + window.rr.render();"); + w->doJavaScript(w->jsRef() + ".skull.file = 'http://x.babymri.org/?skull.vtk';\ + " + w->jsRef() + ".r.add("+ w->jsRef()+".skull); \ + " + w->jsRef() + ".r.render();"); + + if(flip == -1) + { + +// w->doJavaScript("var skull = new X.mesh(); skull.file= 'http://x.babymri.org/?skull.vtk';window.rr.add(skull);window.rr.render();"); + } + else + { +// w->doJavaScript("var skull2 = new X.mesh();skull2.file= ''http://x.babymri.org/?lefthemisphere.smoothwm'';window.rr.add(skull2);window.rr.render();"); + } +// w->doJavaScript("r.add(skull);"); + //w->doJavaScript(";alert('-+++> '+x+'<>'+y);"); +// w->doJavaScript("r.render();"); + std::cout<<"JFGA shape3D::Process END"<",w); + +// std::string cadena ="var x = 100;\ + // var y = 200;"; + + + /*std::string cadena = " \ + goog.require('X.renderer3D'); \ + goog.require('X.cube'); \ + goog.require('X.mesh'); \ + var run = function() { \ + window.r = new X.renderer3D(); \ + r.container = 'r'; \ + r.init(); \ + window.skull = new X.mesh(); \ + }; \ + var bot1 = function(){ \ + skull.file = 'http://x.babymri.org/?skull.vtk'; \ + r.add(skull); \ + r.render(); \ + }; \ + var bot3 = function() \ + { \ + skull.file = 'mesh1.vtk'; \ + r.add(skull); \ + r.render(); \ + }; \ + var bot2 = function(){ \ + r.removeAll() \ };"*/ +/* + std::string cadena =" \ + window.r = new X.renderer3D(); \ + r.container = '" +text->id()+ "'; \ + r.init(); \ + window.skull = new X.mesh(); \ + window.skull2 = new X.mesh(); \ + "; +*/ + + +/* + std::string cadena =" \ + window.r = new X.renderer3D(); \ + r.container = '" +text->id()+ "'; \ + r.init(); \ + window.skull = new X.mesh(); \ + skull.file='http://x.babymri.org/?skull.vtk';\ + r.add(skull); \ + r.render() \ + "; +*/ + std::string cadena =" \ + var r = new X.renderer3D(); \ + " + w->jsRef() + ".r = r; \ + r.container = '" +w->id()+ "'; \ + r.init(); \ + var skull = new X.mesh(); \ + skull.file = 'http://x.babymri.org/?avf.vtk';\ + " + w->jsRef() + ".skull = skull; \ + r.add(skull); \ + r.render(); \ + window.rr = r; \ + window.skulll = skull; \ + "; +//window.rr=r; + + std::cout<<"SHAPE 3d --- CADENA ---- "<jsRef()<doJavaScript(cadena); + bbSetOutputWidget( w ); + //Process(); + //Wt::WContainerWidget* l = (Wt::WContainerWidget*)bbGetOutputWidget(); + //w->doJavaScript("x = 13; alert('Ahasora ' + x + ' <> ' + y);"); +} +//===== +// 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 shape3D::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputShape("C"); + flip = 1; + +} +//===== +// 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 shape3D::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 shape3D::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbwt + +