3
#include <QScriptEngine>
5
#include <QApplication>
7
#include "SyntopiaCore/Logging/Logging.h"
8
#include "../../SyntopiaCore/GLEngine/Sphere.h"
11
using namespace SyntopiaCore::Logging;
15
namespace StructureSynth {
16
namespace JavaScriptSupport {
19
// Dont know why Qt has chosen to make 'sleep' protected.
20
class MyThread : public QThread {
22
static void sleep(unsigned long msecs) { msleep(msecs); }
35
void Debug::Info(QString input) {
39
void Debug::Message(QString input) {
40
QMessageBox::information(0, "JavaScript Message", input);
43
void Debug::ShowProgress(QString caption) {
45
progress = new QProgressDialog(caption, "Cancel", 0, 1000, 0);
46
progress->setWindowModality(Qt::WindowModal);
51
void Debug::SetProgress(double percentage) {
52
if (progress) progress->setValue(percentage*1000.0);
53
qApp->processEvents();
56
void Debug::HideProgress() {
61
void Debug::Sleep(int ms) {
65
void World::addSphere2(Vector3 center, float radius) {
66
SyntopiaCore::GLEngine::Object3D* o = new SyntopiaCore::GLEngine::Sphere( center.getObj(), radius);
67
o->setColor(this->rgb, this->alpha);
71
void World::setColor2(Vector3 rgb, float alpha) {
72
this->rgb = rgb.getObj();
76
Vector3::Vector3(){ };
78
Vector3::Vector3(float x, float y, float z){
79
//INFO(QString("Vector3(%1,%2,%3)").arg(x).arg(y).arg(z));
80
v = SyntopiaCore::Math::Vector3f(x,y,z);
83
Vector3::Vector3(const StructureSynth::JavaScriptSupport::Vector3 & vx) : QObject(), QScriptable() {
85
//INFO(QString("Vector3 CopyConstructor(%1,%2,%3)").arg(v.x()).arg(v.y()).arg(v.z()));