2012-01-06 16:09:03 +00:00
|
|
|
#ifndef _PAYSAGES_QT_BASEFORM_H_
|
|
|
|
#define _PAYSAGES_QT_BASEFORM_H_
|
2012-01-05 16:32:41 +00:00
|
|
|
|
|
|
|
#include <QWidget>
|
2012-01-06 16:09:03 +00:00
|
|
|
#include <QPushButton>
|
2012-02-05 11:31:16 +00:00
|
|
|
#include <QComboBox>
|
2012-02-21 13:41:02 +00:00
|
|
|
#include "basepreview.h"
|
2012-01-05 18:39:17 +00:00
|
|
|
#include "baseinput.h"
|
2012-01-05 19:41:10 +00:00
|
|
|
#include "../lib_paysages/shared/types.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "../lib_paysages/noise.h"
|
2012-05-29 13:32:23 +00:00
|
|
|
#include "../lib_paysages/curve.h"
|
2012-03-08 15:10:25 +00:00
|
|
|
#include "../lib_paysages/color.h"
|
2012-06-27 10:30:00 +00:00
|
|
|
#include "../lib_paysages/pack.h"
|
2012-01-05 16:32:41 +00:00
|
|
|
|
|
|
|
class BaseForm:public QWidget
|
|
|
|
{
|
2012-01-05 18:39:17 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
public:
|
2012-02-05 11:31:16 +00:00
|
|
|
BaseForm(QWidget* parent, bool auto_apply=false, bool with_layers=false);
|
2012-06-02 09:46:24 +00:00
|
|
|
void hideButtons();
|
2012-06-27 10:30:00 +00:00
|
|
|
virtual void savePack(PackStream* stream);
|
|
|
|
virtual void loadPack(PackStream* stream);
|
2012-01-05 16:32:41 +00:00
|
|
|
|
2012-01-26 22:30:20 +00:00
|
|
|
signals:
|
|
|
|
void configApplied();
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
public slots:
|
|
|
|
virtual void revertConfig();
|
2012-01-06 16:09:03 +00:00
|
|
|
virtual void applyConfig();
|
2012-01-05 16:32:41 +00:00
|
|
|
|
2012-01-07 16:53:23 +00:00
|
|
|
protected slots:
|
2012-01-25 22:32:06 +00:00
|
|
|
virtual void configChangeEvent();
|
2012-02-05 11:31:16 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void layerAddClicked();
|
|
|
|
void layerDelClicked();
|
|
|
|
void layerListChanged();
|
2012-01-07 16:53:23 +00:00
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
protected:
|
2012-02-21 13:41:02 +00:00
|
|
|
void addPreview(BasePreview* preview, QString label);
|
2012-01-06 16:09:03 +00:00
|
|
|
QPushButton* addButton(QString label);
|
2012-06-23 22:11:25 +00:00
|
|
|
BaseInput* addInput(BaseInput* input);
|
|
|
|
BaseInput* addInputInt(QString label, int* value, int min, int max, int small_step, int large_step);
|
|
|
|
BaseInput* addInputDouble(QString label, double* value, double min, double max, double small_step, double large_step);
|
|
|
|
BaseInput* addInputBoolean(QString label, int* value);
|
|
|
|
BaseInput* addInputColor(QString label, Color* value);
|
|
|
|
BaseInput* addInputColorGradation(QString label, ColorGradation* value);
|
|
|
|
BaseInput* addInputNoise(QString label, NoiseGenerator* value);
|
2012-06-27 12:49:51 +00:00
|
|
|
BaseInput* addInputCurve(QString label, Curve* value, double xmin, double xmax, double ymin, double ymax, QString xlabel, QString ylabel);
|
2012-06-23 22:11:25 +00:00
|
|
|
BaseInput* addInputMaterial(QString label, SurfaceMaterial* material);
|
|
|
|
BaseInput* addInputEnum(QString label, int* value, const QStringList& values);
|
2012-06-02 09:46:24 +00:00
|
|
|
|
2012-06-27 13:28:12 +00:00
|
|
|
void updatePreviews();
|
|
|
|
void disablePreviewsUpdate();
|
|
|
|
|
2012-02-05 11:31:16 +00:00
|
|
|
int currentLayer();
|
|
|
|
void setLayerCount(int layer_count);
|
|
|
|
|
|
|
|
virtual void layerAddedEvent();
|
|
|
|
virtual void layerDeletedEvent(int layer);
|
|
|
|
virtual void layerSelectedEvent(int layer);
|
|
|
|
|
2012-01-05 16:32:41 +00:00
|
|
|
private:
|
2012-06-27 13:28:12 +00:00
|
|
|
bool auto_update_previews;
|
2012-01-27 23:01:21 +00:00
|
|
|
bool auto_apply;
|
2012-02-05 11:31:16 +00:00
|
|
|
bool with_layers;
|
|
|
|
QComboBox* layer_list;
|
|
|
|
QPushButton* layer_new;
|
|
|
|
QPushButton* layer_del;
|
2012-01-05 16:32:41 +00:00
|
|
|
QWidget* previews;
|
|
|
|
QWidget* form;
|
2012-04-14 15:52:16 +00:00
|
|
|
QWidget* form_labels;
|
|
|
|
QWidget* form_previews;
|
|
|
|
QWidget* form_controls;
|
2012-01-06 16:09:03 +00:00
|
|
|
QWidget* buttons;
|
2012-01-10 20:51:27 +00:00
|
|
|
QPushButton* button_apply;
|
|
|
|
QPushButton* button_revert;
|
2012-01-05 16:32:41 +00:00
|
|
|
};
|
|
|
|
|
2012-01-06 16:09:03 +00:00
|
|
|
#endif // _PAYSAGES_QT_BASEFORM_H_
|