2014-08-28 13:09:47 +00:00
|
|
|
#include "WaterModeler.h"
|
|
|
|
|
|
|
|
#include "MainModelerWindow.h"
|
2015-08-17 20:55:30 +00:00
|
|
|
#include "Scenery.h"
|
|
|
|
#include "TerrainDefinition.h"
|
2015-08-18 23:17:49 +00:00
|
|
|
#include "FloatPropertyBind.h"
|
2015-08-20 22:25:34 +00:00
|
|
|
#include "OpenGLRenderer.h"
|
|
|
|
#include "OpenGLWater.h"
|
2014-08-28 13:09:47 +00:00
|
|
|
|
2015-08-20 22:25:34 +00:00
|
|
|
WaterModeler::WaterModeler(MainModelerWindow *ui):
|
|
|
|
ui(ui)
|
2014-08-28 13:09:47 +00:00
|
|
|
{
|
2015-08-20 22:25:34 +00:00
|
|
|
QObject *toggle_water = ui->findQmlObject("camera_toggle_water");
|
|
|
|
if (toggle_water)
|
|
|
|
{
|
|
|
|
connect(toggle_water, SIGNAL(changed(bool)), this, SLOT(enableRendering(bool)));
|
|
|
|
}
|
|
|
|
|
|
|
|
prop_water_height = new FloatPropertyBind(ui, "water_height", "value", ui->getScenery()->getTerrain()->propWaterHeight());
|
2014-08-28 13:09:47 +00:00
|
|
|
}
|
|
|
|
|
2015-08-18 23:17:49 +00:00
|
|
|
WaterModeler::~WaterModeler()
|
2014-08-28 13:09:47 +00:00
|
|
|
{
|
2015-08-18 23:17:49 +00:00
|
|
|
delete prop_water_height;
|
2014-08-28 13:09:47 +00:00
|
|
|
}
|
2015-08-20 22:25:34 +00:00
|
|
|
|
|
|
|
void WaterModeler::enableRendering(bool enable)
|
|
|
|
{
|
|
|
|
ui->getRenderer()->getWater()->setEnabled(enable);
|
|
|
|
}
|