git-svn-id: svn://db.shs.com.ru/libs@703 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-15 10:38:43 +00:00
parent 64209212a9
commit b8f2ee0dfb
21 changed files with 772 additions and 151 deletions

View File

@@ -18,6 +18,7 @@
#include "view_editor.h"
#include "ui_view_editor.h"
#include <QFileDialog>
#include <colorbutton.h>
#include <spinslider.h>
@@ -27,6 +28,7 @@ ViewEditor::ViewEditor(QWidget * parent): QWidget(parent) {
ui->setupUi(this);
view = 0;
active = true;
ui->checkCameraLight->setCheckState(Qt::PartiallyChecked);
}
@@ -44,7 +46,10 @@ void ViewEditor::assignQGLView(QGLView * v) {
ui->colorSelectionHalo->setColor(view->selectionHaloColor());
ui->checkFXAA->setChecked(view->isFeatureEnabled(QGLView::qglFXAA));
ui->checkCameraOrbit->setChecked(view->isCameraOrbit());
ui->checkCameraLight->setCheckState((Qt::CheckState)view->cameraLightMode());
ui->checkService->setChecked(view->isServiceMode());
ui->lineHDR->setProperty("GLpath", view->environmentMapFile());
ui->lineHDR->setText(QFileInfo(view->environmentMapFile()).fileName());
active = true;
}
@@ -140,13 +145,32 @@ void ViewEditor::on_checkCameraOrbit_clicked(bool val) {
}
void ViewEditor::on_checkCameraLight_clicked(bool val) {
if (!view || !active) return;
view->setCameraLightOn(val);
}
void ViewEditor::on_checkService_clicked(bool val) {
if (!view || !active) return;
view->setServiceMode(val);
}
void ViewEditor::on_checkCameraLight_stateChanged(int s) {
if (!view || !active) return;
view->setCameraLightMode((QGLView::CameraLightMode)s);
}
void ViewEditor::on_buttonHDRClear_clicked() {
if (!view || !active) return;
ui->lineHDR->setText("");
ui->lineHDR->setProperty("GLpath", "");
view->setEnvironmentMapFile("");
}
void ViewEditor::on_buttonHDRSelect_clicked() {
if (!view || !active) return;
QString str = QFileDialog::getOpenFileName(this, "Select image", ui->lineHDR->property("GLpath").toString(), "Radiance HDR(*.hdr)");
if (str.isEmpty()) return;
ui->lineHDR->setText(QFileInfo(str).fileName());
ui->lineHDR->setProperty("GLpath", str);
view->setEnvironmentMapFile(str);
}