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 "bbwtSphereXTK.h"
5 #include "bbwtPackage.h"
7 #include<Wt/WApplication>
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,SphereXTK)
14 BBTK_BLACK_BOX_IMPLEMENTATION(SphereXTK,bbtk::AtomicBlackBox);
16 // 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)
18 void SphereXTK::Process()
21 // THE MAIN PROCESSING METHOD BODY
22 // Here we simply set the input 'In' value to the output 'Out'
23 // And print out the output value
24 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
25 // void bbSet{Input|Output}NAME(const TYPE&)
26 // const TYPE& bbGet{Input|Output}NAME() const
28 // * NAME is the name of the input/output
29 // (the one provided in the attribute 'name' of the tag 'input')
30 // * TYPE is the C++ type of the input/output
31 // (the one provided in the attribute 'type' of the tag 'input')
34 Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetInputViewerWTxtk();
35 std::string strRadio = boost::lexical_cast<std::string>( bbGetInputRadio() );
44 alert('Creating sphere');\
45 var sphere = new X.sphere(); \
46 sphere.radius = "+strRadio+"; \
47 sphere.center = [50, 50, 50]; \
48 sphere.color = [0, 1, 0]; \
49 sphere.caption = 'a sphere'; \
50 "+ w->jsRef() + ".sphere = sphere ;\
51 "+ w->jsRef() + ".mRenderer.add("+ w->jsRef() + ".sphere);\
52 "+ w->jsRef() + ".mRenderer.render();\
56 "+ w->jsRef() + ".sphere.radius = "+strRadio+"; \
57 "+ w->jsRef() + ".mRenderer.add("+ w->jsRef() + ".sphere);\
58 "+ w->jsRef() + ".mRenderer.render();\
64 Wt::WApplication::instance()->doJavaScript(jsCom);
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 SphereXTK::bbUserSetDefaultValues()
74 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
75 // Here we initialize the input 'In' to 0
77 std::vector<double> center;
83 bbSetInputViewerWTxtk(NULL);
84 bbSetInputCenter(center);
89 // 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)
91 void SphereXTK::bbUserInitializeProcessing()
94 // THE INITIALIZATION METHOD BODY :
96 // but this is where you should allocate the internal/output pointers
102 // 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)
104 void SphereXTK::bbUserFinalizeProcessing()
107 // THE FINALIZATION METHOD BODY :
109 // but this is where you should desallocate the internal/output pointers