2012-06-02 09:46:24 +00:00
|
|
|
#include "formmaterial.h"
|
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
#include "previewmaterial.h"
|
2012-06-02 09:46:24 +00:00
|
|
|
|
|
|
|
/**************** Form ****************/
|
|
|
|
FormMaterial::FormMaterial(QWidget* parent, SurfaceMaterial* material) : BaseForm(parent)
|
|
|
|
{
|
|
|
|
_initial = material;
|
|
|
|
_material = *_initial;
|
|
|
|
|
|
|
|
addInputColor(tr("Base color"), &_material.base);
|
|
|
|
addInputDouble(tr("Light reflection"), &_material.reflection, 0.0, 1.0, 0.01, 0.1);
|
2012-06-22 22:13:55 +00:00
|
|
|
addInputDouble(tr("Light reflection shininess"), &_material.shininess, 0.0, 30.0, 0.1, 1.0);
|
2012-06-02 09:46:24 +00:00
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
_preview_color = new PreviewMaterial(this, &_material);
|
2012-06-02 09:46:24 +00:00
|
|
|
addPreview(_preview_color, tr("Lighting preview"));
|
|
|
|
|
|
|
|
revertConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
void FormMaterial::getMaterial(SurfaceMaterial* material)
|
|
|
|
{
|
|
|
|
*material = _material;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FormMaterial::revertConfig()
|
|
|
|
{
|
|
|
|
_material = *_initial;
|
|
|
|
|
|
|
|
BaseForm::revertConfig();
|
|
|
|
}
|