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

37 lines
1.1 KiB
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"
2015-09-07 23:00:34 +00:00
#include "WaterDefinition.h"
#include "FloatPropertyBind.h"
#include "IntPropertyBind.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)
{
2015-08-28 09:40:35 +00:00
connect(toggle_water, SIGNAL(toggled(bool)), this, SLOT(enableRendering(bool)));
2015-08-20 22:25:34 +00:00
}
prop_model = new IntPropertyBind(ui, "water_model", "value", ui->getScenery()->getWater()->propModel());
prop_height = new FloatPropertyBind(ui, "water_height", "value", ui->getScenery()->getTerrain()->propWaterHeight());
prop_reflexion = new FloatPropertyBind(ui, "water_reflection", "value", ui->getScenery()->getWater()->propReflection());
2014-08-28 13:09:47 +00:00
}
WaterModeler::~WaterModeler()
2014-08-28 13:09:47 +00:00
{
delete prop_model;
delete prop_height;
delete prop_reflexion;
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);
}