From 57e7341ce0e0a35d03d9bde6365cd61cdd5fd190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Thu, 19 Jan 2012 16:03:34 +0000 Subject: [PATCH] paysages : Noise dialog WIP. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@228 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- gui_qt/dialognoise.cpp | 69 +++++++++++++++++++++++++++++++++++++----- gui_qt/dialognoise.h | 7 +++++ 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/gui_qt/dialognoise.cpp b/gui_qt/dialognoise.cpp index e27fc7e..1e5d496 100644 --- a/gui_qt/dialognoise.cpp +++ b/gui_qt/dialognoise.cpp @@ -5,7 +5,9 @@ #include #include #include +#include #include +#include #include "../lib_paysages/shared/functions.h" @@ -62,19 +64,72 @@ private: DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): QDialog(parent) { + QWidget* previews; + QWidget* form; + QWidget* buttons; + QSlider* slider; + QPushButton* button; + _base = value; _current = noiseCreateGenerator(); noiseCopy(_base, _current); - setLayout(new QVBoxLayout()); + setLayout(new QHBoxLayout()); - previewLevel = new PreviewLevel(this, _current); - layout()->addWidget(new QLabel("Level preview")); - layout()->addWidget(previewLevel); - previewTotal = new PreviewTotal(this, _current); - layout()->addWidget(new QLabel("Total preview")); - layout()->addWidget(previewTotal); + previews = new QWidget(this); + previews->setLayout(new QVBoxLayout()); + layout()->addWidget(previews); + + previewLevel = new PreviewLevel(previews, _current); + previews->layout()->addWidget(new QLabel("Level preview")); + previews->layout()->addWidget(previewLevel); + previewTotal = new PreviewTotal(previews, _current); + previews->layout()->addWidget(new QLabel("Total preview")); + previews->layout()->addWidget(previewTotal); + + form = new QWidget(this); + form->setLayout(new QVBoxLayout()); + layout()->addWidget(form); + + form->layout()->addWidget(new QLabel("Layers")); + levels = new QListWidget(form); + form->layout()->addWidget(levels); + + form->layout()->addWidget(new QLabel("Layer height")); + slider = new QSlider(form); + slider->setOrientation(Qt::Horizontal); + slider->setMinimumWidth(150); + slider->setMaximumWidth(400); + slider->setMinimum(0); + slider->setMaximum(1000); + slider->setTickInterval(100); + slider->setTickPosition(QSlider::TicksBelow); + form->layout()->addWidget(slider); + + form->layout()->addWidget(new QLabel("Layer scaling")); + slider = new QSlider(form); + slider->setOrientation(Qt::Horizontal); + slider->setMinimumWidth(150); + slider->setMaximumWidth(400); + slider->setMinimum(0); + slider->setMaximum(1000); + slider->setTickInterval(100); + slider->setTickPosition(QSlider::TicksBelow); + form->layout()->addWidget(slider); + + buttons = new QWidget(form); + buttons->setLayout(new QHBoxLayout()); + form->layout()->addWidget(buttons); + + button = new QPushButton("Validate", buttons); + buttons->layout()->addWidget(button); + + button = new QPushButton("Reset", buttons); + buttons->layout()->addWidget(button); + + button = new QPushButton("Cancel", buttons); + buttons->layout()->addWidget(button); setWindowTitle("Paysages 3D - Noise editor"); } diff --git a/gui_qt/dialognoise.h b/gui_qt/dialognoise.h index 10da810..342062e 100644 --- a/gui_qt/dialognoise.h +++ b/gui_qt/dialognoise.h @@ -2,6 +2,7 @@ #define _PAYSAGES_QT_DIALOGNOISE_H_ #include +#include #include "preview.h" #include "../lib_paysages/shared/types.h" @@ -21,12 +22,18 @@ public slots: protected: virtual void closeEvent(QCloseEvent* e); +private slots: + void cancelClicked(); + void revertClicked(); + void applyClicked(); + private: NoiseGenerator* _base; NoiseGenerator* _current; NoiseLevel _current_level; Preview* previewLevel; Preview* previewTotal; + QListWidget* levels; }; #endif