2012-07-10 19:39:12 +00:00
|
|
|
#include "formterraincanvas.h"
|
|
|
|
|
|
|
|
/**************** Form ****************/
|
2012-07-10 20:00:44 +00:00
|
|
|
FormTerrainCanvas::FormTerrainCanvas(QWidget *parent, Layers* layers):
|
|
|
|
BaseFormLayer(parent, layers)
|
2012-07-10 19:39:12 +00:00
|
|
|
{
|
2012-07-11 13:18:43 +00:00
|
|
|
_definition = terrainCanvasCreate();
|
|
|
|
|
|
|
|
// TODO Area
|
2012-07-19 15:04:27 +00:00
|
|
|
addInputDouble(tr("Apply at height"), &_definition->offset_y, -20.0, 20.0, 0.1, 1.0);
|
2012-07-13 12:23:58 +00:00
|
|
|
addInputHeightMap(tr("Height map"), &_definition->height_map);
|
2012-07-11 13:18:43 +00:00
|
|
|
addInputDouble(tr("Canvas height"), &_definition->height_factor, 0.0, 20.0, 0.1, 1.0);
|
|
|
|
addInputNoise(tr("Detail noise"), _definition->detail_noise);
|
|
|
|
addInputDouble(tr("Detail noise height"), &_definition->detail_height_factor, 0.0, 20.0, 0.1, 1.0);
|
|
|
|
addInputDouble(tr("Detail noise scaling"), &_definition->detail_scaling, 0.0, 20.0, 0.1, 1.0);
|
2012-07-18 15:04:23 +00:00
|
|
|
addInputEnum(tr("Mask shape"), &_definition->mask.mode, QStringList(tr("Square")) << tr("Circle"));
|
|
|
|
addInputDouble(tr("Mask smoothing"), &_definition->mask.smoothing, 0.0, 1.0, 0.01, 0.1);
|
2012-07-11 13:18:43 +00:00
|
|
|
|
|
|
|
revertConfig();
|
2012-07-10 19:39:12 +00:00
|
|
|
}
|
|
|
|
|
2012-07-11 13:18:43 +00:00
|
|
|
FormTerrainCanvas::~FormTerrainCanvas()
|
2012-07-10 19:39:12 +00:00
|
|
|
{
|
2012-07-11 13:18:43 +00:00
|
|
|
terrainCanvasDelete(_definition);
|
2012-07-10 19:39:12 +00:00
|
|
|
}
|
|
|
|
|
2012-07-11 13:18:43 +00:00
|
|
|
void FormTerrainCanvas::layerGetCopy(void* layer_definition)
|
2012-07-10 19:39:12 +00:00
|
|
|
{
|
2012-07-11 13:18:43 +00:00
|
|
|
terrainCanvasCopy((TerrainCanvas*)layer_definition, _definition);
|
2012-07-10 19:39:12 +00:00
|
|
|
}
|
|
|
|
|
2012-07-11 13:18:43 +00:00
|
|
|
void FormTerrainCanvas::layerApply(void* layer_definition)
|
2012-07-10 19:39:12 +00:00
|
|
|
{
|
2012-07-11 13:18:43 +00:00
|
|
|
terrainCanvasCopy(_definition, (TerrainCanvas*)layer_definition);
|
2012-07-10 19:39:12 +00:00
|
|
|
}
|