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

31 lines
755 B
C++
Raw Normal View History

2014-08-28 13:09:47 +00:00
#include "WaterModeler.h"
#include "MainModelerWindow.h"
#include "Scenery.h"
#include "TerrainDefinition.h"
#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
}
WaterModeler::~WaterModeler()
2014-08-28 13:09:47 +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);
}