git-svn-id: svn://db.shs.com.ru/libs@691 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -43,18 +43,6 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLView
|
||||
view->view()->setDepthStart(0.1);
|
||||
view->view()->setSelectionMode(Scene::smMultiSelection);
|
||||
|
||||
spinFOV->setValue(view->view()->FOV());
|
||||
spinDepthStart->setValue(view->view()->depthStart());
|
||||
groupHoverHalo->setChecked(view->view()->isHoverHaloEnabled());
|
||||
groupSelectionHalo->setChecked(view->view()->isSelectionHaloEnabled());
|
||||
spinHoverHaloFill->setValue(view->view()->hoverHaloFillAlpha());
|
||||
spinSelectionHaloFill->setValue(view->view()->selectionHaloFillAlpha());
|
||||
colorHoverHalo->setColor(view->view()->hoverHaloColor());
|
||||
colorSelectionHalo->setColor(view->view()->selectionHaloColor());
|
||||
checkFXAA->setChecked(view->view()->isFeatureEnabled(QGLView::qglFXAA));
|
||||
colorBack->setColor(view->view()->backColor());
|
||||
colorAmbient->setColor(view->view()->ambientColor());
|
||||
checkCameraOrbit->setChecked(view->view()->isCameraOrbit());
|
||||
|
||||
groupShadows->setChecked(view->view()->isFeatureEnabled(QGLView::qglShadowsEnabled));
|
||||
groupEyeAccomodation->setChecked(view->view()->isFeatureEnabled(QGLView::qglEyeAccomodationEnabled));
|
||||
@@ -88,6 +76,7 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLView
|
||||
matEditor->assignQGLView(view->view());
|
||||
objectEditor->assignQGLView(view->view());
|
||||
primitiveEditor->assignQGLView(view->view());
|
||||
viewEditor->assignQGLView(view->view());
|
||||
|
||||
session.load();
|
||||
|
||||
|
||||
@@ -61,24 +61,6 @@ private:
|
||||
bool isChanged;
|
||||
|
||||
private slots:
|
||||
void on_spinFOV_valueChanged(double val) {view->view()->setFOV(val);}
|
||||
void on_spinDepthStart_valueChanged(double val) {view->view()->setDepthStart(val);}
|
||||
void on_spinViewGamma_valueChanged(double val) {view->view()->setGamma(val);}
|
||||
void on_comboViewRenderMode_currentIndexChanged(int val) {static int modes[] = {GL_POINT, GL_LINE, GL_FILL}; view->view()->setRenderMode((ObjectBase::RenderMode)modes[val]);}
|
||||
void on_groupHoverHalo_clicked(bool val) {view->view()->setHoverHaloEnabled(val);}
|
||||
void on_groupSelectionHalo_clicked(bool val) {view->view()->setSelectionHaloEnabled(val);}
|
||||
void on_spinHoverHaloFill_valueChanged(double val) {view->view()->setHoverHaloFillAlpha(val);}
|
||||
void on_spinSelectionHaloFill_valueChanged(double val) {view->view()->setSelectionHaloFillAlpha(val);}
|
||||
void on_colorHoverHalo_colorChanged(QColor color) {view->view()->setHoverHaloColor(color);}
|
||||
void on_colorSelectionHalo_colorChanged(QColor color) {view->view()->setSelectionHaloColor(color);}
|
||||
void on_checkAutoExposure_toggled(bool val) {view->view()->setAutoExposure(val);}
|
||||
void on_checkFXAA_clicked(bool val) {view->view()->setFeature(QGLView::qglFXAA, val);}
|
||||
void on_colorBack_colorChanged(QColor color) {view->view()->setBackColor(color);}
|
||||
void on_colorAmbient_colorChanged(QColor color) {view->view()->setAmbientColor(color);}
|
||||
void on_checkCameraOrbit_clicked(bool val) {view->view()->setCameraOrbit(val);}
|
||||
void on_checkCameraLight_clicked(bool val) {view->view()->setCameraLightOn(val);}
|
||||
void on_checkService_clicked(bool val) {view->view()->setServiceMode(val);}
|
||||
|
||||
void on_groupShadows_clicked(bool val) {view->view()->setFeature(QGLView::qglShadowsEnabled, val);}
|
||||
void on_groupEyeAccomodation_clicked(bool val) {view->view()->setFeature(QGLView::qglEyeAccomodationEnabled, val);}
|
||||
void on_groupBloom_clicked(bool val) {view->view()->setFeature(QGLView::qglBloomEnabled, val);}
|
||||
|
||||
@@ -58,433 +58,7 @@
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QFormLayout" name="formLayout_9">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>FOV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="SpinSlider" name="spinFOV">
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>179.900000000000006</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>60.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Depth start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinDepthStart">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="stepType">
|
||||
<enum>QAbstractSpinBox::AdaptiveDecimalStepType</enum>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Draw mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboViewRenderMode">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Point</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Wireframe</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Solid</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Back color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="ColorButton" name="colorBack">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>10</red>
|
||||
<green>10</green>
|
||||
<blue>10</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Ambient</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="ColorButton" name="colorAmbient">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>10</red>
|
||||
<green>10</green>
|
||||
<blue>10</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>Gamma</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="SpinSlider" name="spinViewGamma">
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupHoverHalo">
|
||||
<property name="title">
|
||||
<string>Hover halo</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="ColorButton" name="colorHoverHalo">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>251</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Fill</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SpinSlider" name="spinHoverHaloFill">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.300000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkFXAA">
|
||||
<property name="text">
|
||||
<string>FXAA</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkService">
|
||||
<property name="text">
|
||||
<string>Service mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkAutoExposure">
|
||||
<property name="text">
|
||||
<string>Auto exposure</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QGroupBox" name="groupSelectionHalo">
|
||||
<property name="title">
|
||||
<string>Selection halo</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_8">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="ColorButton" name="colorSelectionHalo">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>143</green>
|
||||
<blue>239</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>Fill</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SpinSlider" name="spinSelectionHaloFill">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.300000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupCamera">
|
||||
<property name="title">
|
||||
<string>Camera</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkCameraOrbit">
|
||||
<property name="text">
|
||||
<string>Orbit</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkCameraLight">
|
||||
<property name="text">
|
||||
<string>Camera Light</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Fog</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_10">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Density:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="SpinSlider" name="spinFogDensity">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorFogBack">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>128</red>
|
||||
<green>128</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Decay:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SpinSlider" name="spinFogDecay">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="squareScale">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="spinMaximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="ViewEditor" name="viewEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -1372,11 +946,6 @@
|
||||
<extends>QWidget</extends>
|
||||
<header>spinslider.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>colorbutton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>GLWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
@@ -1407,6 +976,12 @@
|
||||
<header>primitiveeditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ViewEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>view_editor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../qad/utils/qad_utils.qrc"/>
|
||||
|
||||
152
qglengine/widgets/view_editor.cpp
Normal file
152
qglengine/widgets/view_editor.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
QGLView
|
||||
Copyright (C) 2019 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "view_editor.h"
|
||||
#include "ui_view_editor.h"
|
||||
#include <colorbutton.h>
|
||||
#include <spinslider.h>
|
||||
|
||||
|
||||
ViewEditor::ViewEditor(QWidget * parent): QWidget(parent) {
|
||||
ui = new Ui::ViewEditor();
|
||||
ui->setupUi(this);
|
||||
view = 0;
|
||||
active = true;
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::assignQGLView(QGLView * v) {
|
||||
view = v;
|
||||
if (!view) return;
|
||||
active = false;
|
||||
ui->spinFOV->setValue(view->FOV());
|
||||
ui->spinDepthStart->setValue(view->depthStart());
|
||||
ui->groupHoverHalo->setChecked(view->isHoverHaloEnabled());
|
||||
ui->groupSelectionHalo->setChecked(view->isSelectionHaloEnabled());
|
||||
ui->spinHoverHaloFill->setValue(view->hoverHaloFillAlpha());
|
||||
ui->spinSelectionHaloFill->setValue(view->selectionHaloFillAlpha());
|
||||
ui->colorHoverHalo->setColor(view->hoverHaloColor());
|
||||
ui->colorSelectionHalo->setColor(view->selectionHaloColor());
|
||||
ui->checkFXAA->setChecked(view->isFeatureEnabled(QGLView::qglFXAA));
|
||||
ui->checkCameraOrbit->setChecked(view->isCameraOrbit());
|
||||
ui->checkService->setChecked(view->isServiceMode());
|
||||
active = true;
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::changeEvent(QEvent * e) {
|
||||
QWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinFOV_valueChanged(double val) {
|
||||
if (!view || !active) return;
|
||||
view->setFOV(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinDepthStart_valueChanged(double val) {
|
||||
if (!view || !active) return;
|
||||
view->setDepthStart(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinViewGamma_valueChanged(double val) {
|
||||
if (!view || !active) return;
|
||||
view->setGamma(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_comboViewRenderMode_currentIndexChanged(int val) {
|
||||
if (!view || !active) return;
|
||||
static int modes[] = {GL_POINT, GL_LINE, GL_FILL};
|
||||
view->setRenderMode((ObjectBase::RenderMode)modes[val]);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_groupHoverHalo_clicked(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setHoverHaloEnabled(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_groupSelectionHalo_clicked(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setSelectionHaloEnabled(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinHoverHaloFill_valueChanged(double val) {
|
||||
if (!view || !active) return;
|
||||
view->setHoverHaloFillAlpha(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinSelectionHaloFill_valueChanged(double val) {
|
||||
if (!view || !active) return;
|
||||
view->setSelectionHaloFillAlpha(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_colorHoverHalo_colorChanged(QColor color) {
|
||||
if (!view || !active) return;
|
||||
view->setHoverHaloColor(color);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_colorSelectionHalo_colorChanged(QColor color) {
|
||||
if (!view || !active) return;
|
||||
view->setSelectionHaloColor(color);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_checkAutoExposure_toggled(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setAutoExposure(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_checkFXAA_clicked(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setFeature(QGLView::qglFXAA, val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_checkCameraOrbit_clicked(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setCameraOrbit(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);
|
||||
}
|
||||
65
qglengine/widgets/view_editor.h
Normal file
65
qglengine/widgets/view_editor.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
QGLView
|
||||
Copyright (C) 2019 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VIEW_EDITOR_H
|
||||
#define VIEW_EDITOR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "qglview.h"
|
||||
|
||||
namespace Ui {
|
||||
class ViewEditor;
|
||||
}
|
||||
|
||||
class ViewEditor: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ViewEditor(QWidget * parent = 0);
|
||||
|
||||
void assignQGLView(QGLView * v);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent * e);
|
||||
|
||||
Ui::ViewEditor * ui;
|
||||
QGLView * view;
|
||||
bool active;
|
||||
|
||||
private slots:
|
||||
void on_spinFOV_valueChanged(double val);
|
||||
void on_spinDepthStart_valueChanged(double val);
|
||||
void on_spinViewGamma_valueChanged(double val);
|
||||
void on_comboViewRenderMode_currentIndexChanged(int val);
|
||||
void on_groupHoverHalo_clicked(bool val);
|
||||
void on_groupSelectionHalo_clicked(bool val);
|
||||
void on_spinHoverHaloFill_valueChanged(double val);
|
||||
void on_spinSelectionHaloFill_valueChanged(double val);
|
||||
void on_colorHoverHalo_colorChanged(QColor color);
|
||||
void on_colorSelectionHalo_colorChanged(QColor color);
|
||||
void on_checkAutoExposure_toggled(bool val);
|
||||
void on_checkFXAA_clicked(bool val);
|
||||
void on_checkCameraOrbit_clicked(bool val);
|
||||
void on_checkCameraLight_clicked(bool val);
|
||||
void on_checkService_clicked(bool val);
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // VIEW_EDITOR_H
|
||||
473
qglengine/widgets/view_editor.ui
Normal file
473
qglengine/widgets/view_editor.ui
Normal file
@@ -0,0 +1,473 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewEditor</class>
|
||||
<widget class="QWidget" name="ViewEditor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>328</width>
|
||||
<height>538</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QFormLayout" name="formLayout_9">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Draw mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboViewRenderMode">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Point</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Wireframe</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Solid</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkFXAA">
|
||||
<property name="text">
|
||||
<string>FXAA</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkAutoExposure">
|
||||
<property name="text">
|
||||
<string>Auto exposure</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkService">
|
||||
<property name="text">
|
||||
<string>Service mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupCamera">
|
||||
<property name="title">
|
||||
<string>Camera</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>Gamma:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="SpinSlider" name="spinViewGamma">
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>FOV:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkCameraLight">
|
||||
<property name="text">
|
||||
<string>CamLight</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="SpinSlider" name="spinFOV">
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>179.900000000000006</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>60.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkCameraOrbit">
|
||||
<property name="text">
|
||||
<string>Orbit</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Depth start:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QDoubleSpinBox" name="spinDepthStart">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="stepType">
|
||||
<enum>QAbstractSpinBox::AdaptiveDecimalStepType</enum>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupHoverHalo">
|
||||
<property name="title">
|
||||
<string>Hover halo</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Fill:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SpinSlider" name="spinHoverHaloFill">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.300000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorHoverHalo">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>251</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupSelectionHalo">
|
||||
<property name="title">
|
||||
<string>Selection halo</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>Fill:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SpinSlider" name="spinSelectionHaloFill">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.300000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorSelectionHalo">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>143</green>
|
||||
<blue>239</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Fog</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_10">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Density:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="SpinSlider" name="spinFogDensity">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorFogBack">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>128</red>
|
||||
<green>128</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Decay:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SpinSlider" name="spinFogDecay">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="squareScale">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="spinMaximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SpinSlider</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>spinslider.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>colorbutton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user