paysages3d/src/interface/modeler/quickapp/MainModelerWindow.cpp

38 lines
852 B
C++
Raw Normal View History

2014-08-28 08:29:12 +00:00
#include "MainModelerWindow.h"
#include "OpenGLView.h"
#include "Scenery.h"
#include "OpenGLRenderer.h"
2014-08-28 13:09:47 +00:00
#include "AtmosphereModeler.h"
#include "WaterModeler.h"
2014-08-28 08:29:12 +00:00
MainModelerWindow::MainModelerWindow()
{
scenery = new Scenery();
scenery->autoPreset();
renderer = new OpenGLRenderer(scenery);
qmlRegisterType<OpenGLView>("Paysages", 1, 0, "OpenGLView");
setTitle(QObject::tr("Paysages 3D"));
setResizeMode(QQuickView::SizeRootObjectToView);
setSource(QUrl("qrc:///main.qml"));
2014-08-28 13:09:47 +00:00
atmosphere = new AtmosphereModeler(this);
water = new WaterModeler(this);
2014-08-28 08:29:12 +00:00
}
MainModelerWindow::~MainModelerWindow()
{
2014-08-28 13:09:47 +00:00
delete atmosphere;
delete water;
2014-08-28 08:29:12 +00:00
delete renderer;
delete scenery;
}
2014-08-28 13:09:47 +00:00
QObject *MainModelerWindow::findQmlObject(const QString &objectName)
{
return rootObject()->findChild<QObject *>(objectName);
}