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

This commit is contained in:
2019-12-11 20:18:55 +00:00
parent d7dc7d16a6
commit 11853c0fed
10 changed files with 515 additions and 383 deletions

View File

@@ -152,23 +152,6 @@ void QGLViewWindow::loadFile(const QString & path, bool import) {
}
void QGLViewWindow::selectionChanged() {
ObjectBase * sel_obj = view->view()->selectedObject();
labelName->setText(sel_obj ? sel_obj->name() : "");
/**if (cur == 0) box->hide();
else {
box->setScale(cur->boundingBox().size());
box->setPos(cur->boundingBox().pos());
Box3D b = cur->boundingBox().movedTo(-cur->boundingBox().center());
b.z = -b.z - b.height;
ps->setEmitterRect(b);
cur->addChild(box);
box->show();
}*/
//qDebug() << sel_obj->boundingBox();
}
void QGLViewWindow::on_actionReset_triggered() {
///view->view()->removeObject(axis, false);
view->view()->scene()->destroy();
@@ -242,24 +225,6 @@ void QGLViewWindow::view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) {
default: break;
}
}
\
void QGLViewWindow::on_pushButton_clicked() {
//view->view()->removeLight(view->view()->lightsCount() - 1);
//setWindowTitle(QString::number(view->view()->lightsCount()));
//QVector3D wp = view->view()->light(0)->worldPos();
//view->view()->camera()->setPos(wp);
//view->view()->camera()->setAim(wp + (view->view()->light(0)->worldTransform() * QVector4D(view->view()->light(0)->direction)).toVector3D()*100);
}
void QGLViewWindow::on_pushButton_3_clicked() {
/*ObjectBaseList ol = view->view()->objects(true);
qDebug() << ol.size();
foreach (ObjectBase * i, ol) {
//i->VBO().rebuffer();
}*/
}
void QGLViewWindow::on_actionAdd_plane_triggered() {

View File

@@ -109,12 +109,9 @@ private slots:
void on_actionSaveSelected_triggered();
void on_actionOpen_triggered();
void selectionChanged();
void view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m);
void on_pushButton_clicked();
void on_pushButton_2_clicked() {view->view()->reloadShaders();}
void on_pushButton_3_clicked();
void on_actionAdd_plane_triggered();
void on_actionAdd_cube_triggered();
@@ -125,6 +122,12 @@ private slots:
void on_actionRotate_triggered(bool on);
void on_actionScale_triggered(bool on);
void on_colorFogBack_colorChanged(const QColor & v) {view->view()->setFogColor(v);}
void on_spinFogDensity_valueChanged(double v) {view->view()->setFogDensity(v);}
void on_spinFogDecayConst_valueChanged(double v) {view->view()->setFogDecayConst(v);}
void on_spinFogDecayLinear_valueChanged(double v) {view->view()->setFogDecayLinear(v);}
void on_spinFogDecayQuadratic_valueChanged(double v) {view->view()->setFogDecayQuadratic(v);}
public slots:
signals:

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1125</width>
<height>1032</height>
<width>1107</width>
<height>878</height>
</rect>
</property>
<property name="windowTitle">
@@ -37,23 +37,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelName">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
@@ -73,285 +56,219 @@
<attribute name="title">
<string>Common</string>
</attribute>
<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>
<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</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>
<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>
</item>
<item>
<property name="text">
<string>Wireframe</string>
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</item>
<item>
<property name="text">
<string>Solid</string>
<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>
</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>
<item row="9" column="0" colspan="2">
<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="10" column="0" colspan="2">
<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>
<item row="11" column="0" colspan="2">
<widget class="QGroupBox" name="groupCamera">
<property name="title">
<string>Camera</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkCameraOrbit">
<widget class="QLabel" name="label">
<property name="text">
<string>Orbit</string>
</property>
<property name="checked">
<bool>true</bool>
<string>FOV</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkCameraLight">
<property name="text">
<string>Camera Light</string>
<widget class="SpinSlider" name="spinFOV">
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="checked">
<bool>true</bool>
<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 row="6" column="0" colspan="2">
<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">
@@ -359,6 +276,16 @@
</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">
@@ -369,14 +296,258 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkService">
<property name="text">
<string>Service mode</string>
<item row="2" column="1">
<widget class="QGroupBox" name="groupSelectionHalo">
<property name="title">
<string>Selection halo</string>
</property>
<property name="checked">
<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>
<item row="2" column="2">
<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>
</layout>
</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="QVBoxLayout" name="verticalLayout_12">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Density:</string>
</property>
</widget>
</item>
<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>
<widget class="QLabel" name="label_25">
<property name="text">
<string>Decay:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>^0:</string>
</property>
</widget>
</item>
<item>
<widget class="SpinSlider" name="spinFogDecayConst">
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>1.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>
<property name="spinMaximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>^1:</string>
</property>
</widget>
</item>
<item>
<widget class="SpinSlider" name="spinFogDecayLinear">
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</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>
<property name="spinMaximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>^2:</string>
</property>
</widget>
</item>
<item>
<widget class="SpinSlider" name="spinFogDecayQuadratic">
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>1.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>
<property name="spinMaximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
@@ -401,7 +572,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>951</width>
<width>934</width>
<height>737</height>
</rect>
</property>
@@ -949,13 +1120,6 @@
</widget>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>remove light</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
@@ -963,27 +1127,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>rebuff all</string>
</property>
</widget>
</item>
<item>
<widget class="ColorButton" name="colorMouse">
<property name="color">
<color>
<red>10</red>
<green>10</green>
<blue>10</blue>
</color>
</property>
<property name="useAlphaChannel">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@@ -1040,8 +1183,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>990</width>
<height>853</height>
<width>973</width>
<height>719</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
@@ -1123,7 +1266,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1125</width>
<width>1107</width>
<height>24</height>
</rect>
</property>