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 "bbwtshape3D.h"
5 #include "bbwtPackage.h"
6 #include "bbtkUtilities.h"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,shape3D)
12 BBTK_BLACK_BOX_IMPLEMENTATION(shape3D,bbtk::WtBlackBox);
14 // 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)
16 void shape3D::Process()
19 // THE MAIN PROCESSING METHOD BODY
20 // Here we simply set the input 'In' value to the output 'Out'
21 // And print out the output value
22 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
23 // void bbSet{Input|Output}NAME(const TYPE&)
24 // const TYPE& bbGet{Input|Output}NAME() const
26 // * NAME is the name of the input/output
27 // (the one provided in the attribute 'name' of the tag 'input')
28 // * TYPE is the C++ type of the input/output
29 // (the one provided in the attribute 'type' of the tag 'input')
30 // bbSetOutputOut( bbGetInputIn() );
31 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
32 std::cout<<"JFGA shape3D::Process START"<<std::endl;
34 Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget();
37 skull.file = 'http://x.babymri.org/?skull.vtk';
45 //w->doJavaScript("alert(window.rr.container);");
46 //w->doJavaScript("skull3.file = 'http://x.babymri.org/?skull.vtk';\
47 window.rr.add(skull3);\
48 window.rr.render();");
49 w->doJavaScript(w->jsRef() + ".skull.file = 'http://x.babymri.org/?skull.vtk';\
50 " + w->jsRef() + ".r.add("+ w->jsRef()+".skull); \
51 " + w->jsRef() + ".r.render();");
56 // w->doJavaScript("var skull = new X.mesh(); skull.file= 'http://x.babymri.org/?skull.vtk';window.rr.add(skull);window.rr.render();");
60 // w->doJavaScript("var skull2 = new X.mesh();skull2.file= ''http://x.babymri.org/?lefthemisphere.smoothwm'';window.rr.add(skull2);window.rr.render();");
62 // w->doJavaScript("r.add(skull);");
63 //w->doJavaScript(";alert('-+++> '+x+'<>'+y);");
64 // w->doJavaScript("r.render();");
65 std::cout<<"JFGA shape3D::Process END"<<std::endl;
69 // 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)
71 void shape3D::CreateWidget(Wt::WContainerWidget* parent)
75 Wt::WContainerWidget* w = new Wt::WContainerWidget(parent);
76 //Wt::WText* text = new Wt::WText("<div id=\"3d\" style=\"background-color: #000; width: 100%; height: 70%; margin-bottom: 2px;\"></div>",w);
78 // std::string cadena ="var x = 100;\
82 /*std::string cadena = " \
83 goog.require('X.renderer3D'); \
84 goog.require('X.cube'); \
85 goog.require('X.mesh'); \
86 var run = function() { \
87 window.r = new X.renderer3D(); \
90 window.skull = new X.mesh(); \
92 var bot1 = function(){ \
93 skull.file = 'http://x.babymri.org/?skull.vtk'; \
97 var bot3 = function() \
99 skull.file = 'mesh1.vtk'; \
103 var bot2 = function(){ \
104 r.removeAll() \ };"*/
106 std::string cadena =" \
107 window.r = new X.renderer3D(); \
108 r.container = '" +text->id()+ "'; \
110 window.skull = new X.mesh(); \
111 window.skull2 = new X.mesh(); \
117 std::string cadena =" \
118 window.r = new X.renderer3D(); \
119 r.container = '" +text->id()+ "'; \
121 window.skull = new X.mesh(); \
122 skull.file='http://x.babymri.org/?skull.vtk';\
127 std::string cadena =" \
128 var r = new X.renderer3D(); \
129 " + w->jsRef() + ".r = r; \
130 r.container = '" +w->id()+ "'; \
132 var skull = new X.mesh(); \
133 skull.file = 'http://x.babymri.org/?avf.vtk';\
134 " + w->jsRef() + ".skull = skull; \
138 window.skulll = skull; \
142 std::cout<<"SHAPE 3d --- CADENA ---- "<<cadena<<std::endl;
143 std::cout<<"SHAPE 3d --- JSREF ---- "<<w->jsRef()<<std::endl;
144 // Wt::WWebWidget::jsStringLiteral(cadena);
145 w->doJavaScript(cadena);
146 bbSetOutputWidget( w );
148 //Wt::WContainerWidget* l = (Wt::WContainerWidget*)bbGetOutputWidget();
149 //w->doJavaScript("x = 13; alert('Ahasora ' + x + ' <> ' + y);");
152 // 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)
154 void shape3D::bbUserSetDefaultValues()
157 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
158 // Here we initialize the input 'In' to 0
159 bbSetInputShape("C");
164 // 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)
166 void shape3D::bbUserInitializeProcessing()
169 // THE INITIALIZATION METHOD BODY :
171 // but this is where you should allocate the internal/output pointers
177 // 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)
179 void shape3D::bbUserFinalizeProcessing()
182 // THE FINALIZATION METHOD BODY :
184 // but this is where you should desallocate the internal/output pointers