From 3019b82100d4fc405f64cebcddf9aaae253c4293 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 21 Oct 2020 16:17:58 +1000 Subject: [PATCH] Rework 3d light configuration GUI so that point and directional lights aren't separated into distinct tabs This hopefully avoids the papercut issue where its not obvious to users exactly which existing lights are in a scene, and also follows the UI pattern used elsewhere (e.g. symbol layers) --- src/app/3d/qgs3dmapconfigwidget.cpp | 3 +- src/app/3d/qgslightswidget.cpp | 311 ++++++---- src/app/3d/qgslightswidget.h | 59 +- src/ui/3d/map3dconfigwidget.ui | 20 +- src/ui/3d/qgslightswidget.ui | 862 ++++++++++++++-------------- 5 files changed, 699 insertions(+), 556 deletions(-) diff --git a/src/app/3d/qgs3dmapconfigwidget.cpp b/src/app/3d/qgs3dmapconfigwidget.cpp index 018335f96a3..8c0fd04677e 100644 --- a/src/app/3d/qgs3dmapconfigwidget.cpp +++ b/src/app/3d/qgs3dmapconfigwidget.cpp @@ -135,8 +135,7 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas QgsPhongMaterialSettings terrainShadingMaterial = mMap->terrainShadingMaterial(); widgetTerrainMaterial->setSettings( &terrainShadingMaterial, nullptr ); - widgetLights->setPointLights( mMap->pointLights() ); - widgetLights->setDirectionalLights( mMap->directionalLights() ); + widgetLights->setLights( mMap->pointLights(), mMap->directionalLights() ); connect( cboTerrainType, static_cast( &QComboBox::currentIndexChanged ), this, &Qgs3DMapConfigWidget::onTerrainTypeChanged ); connect( cboTerrainLayer, static_cast( &QgsMapLayerComboBox::currentIndexChanged ), this, &Qgs3DMapConfigWidget::onTerrainLayerChanged ); diff --git a/src/app/3d/qgslightswidget.cpp b/src/app/3d/qgslightswidget.cpp index 72da1caf7c2..03dde467452 100644 --- a/src/app/3d/qgslightswidget.cpp +++ b/src/app/3d/qgslightswidget.cpp @@ -20,21 +20,36 @@ #include "qgssettings.h" #include +#include QgsLightsWidget::QgsLightsWidget( QWidget *parent ) : QWidget( parent ) { setupUi( this ); + mLightsModel = new QgsLightsModel( this ); + mLightsListView->setModel( mLightsModel ); + + connect( mLightsListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsLightsWidget::selectedLightChanged ); + btnAddLight->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) ); btnRemoveLight->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) ); dialAzimuth->setMaximum( 359 ); - connect( btnAddLight, &QToolButton::clicked, this, &QgsLightsWidget::onAddLight ); + QMenu *addLightMenu = new QMenu( this ); + QAction *addPointLight = new QAction( tr( "Point Light" ), addLightMenu ); + connect( addPointLight, &QAction::triggered, this, &QgsLightsWidget::onAddLight ); + addLightMenu->addAction( addPointLight ); + + QAction *addDirectionalLight = new QAction( tr( "Directional Light" ), addLightMenu ); + connect( addDirectionalLight, &QAction::triggered, this, &QgsLightsWidget::onAddDirectionalLight ); + addLightMenu->addAction( addDirectionalLight ); + + btnAddLight->setMenu( addLightMenu ); + connect( btnRemoveLight, &QToolButton::clicked, this, &QgsLightsWidget::onRemoveLight ); - connect( cboLights, qgis::overload::of( &QComboBox::currentIndexChanged ), this, &QgsLightsWidget::onCurrentLightChanged ); connect( spinPositionX, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentLightParameters ); connect( spinPositionY, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentLightParameters ); connect( spinPositionZ, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentLightParameters ); @@ -44,13 +59,6 @@ QgsLightsWidget::QgsLightsWidget( QWidget *parent ) connect( spinA1, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentLightParameters ); connect( spinA2, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentLightParameters ); - btnAddDirectionalLight->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) ); - btnRemoveDirectionalLight->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) ); - - connect( btnAddDirectionalLight, &QToolButton::clicked, this, &QgsLightsWidget::onAddDirectionalLight ); - connect( btnRemoveDirectionalLight, &QToolButton::clicked, this, &QgsLightsWidget::onRemoveDirectionalLight ); - - connect( cboDirectionalLights, qgis::overload::of( &QComboBox::currentIndexChanged ), this, &QgsLightsWidget::onCurrentDirectionalLightChanged ); connect( spinDirectionalIntensity, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentDirectionalLightParameters ); connect( btnDirectionalColor, &QgsColorButton::colorChanged, this, &QgsLightsWidget::updateCurrentDirectionalLightParameters ); @@ -59,46 +67,55 @@ QgsLightsWidget::QgsLightsWidget( QWidget *parent ) connect( spinBoxAzimuth, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::onDirectionChange ); connect( spinBoxAltitude, qgis::overload::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::onDirectionChange ); - tabWidget->setCurrentIndex( QgsSettings().value( QStringLiteral( "UI/last3DLightsTab" ), 1 ).toInt() ); + mLightsListView->selectionModel()->select( mLightsModel->index( 0, 0 ), QItemSelectionModel::ClearAndSelect ); + selectedLightChanged( mLightsListView->selectionModel()->selection(), QItemSelection() ); } -QgsLightsWidget::~QgsLightsWidget() +void QgsLightsWidget::setLights( const QList &pointLights, const QList &directionalLights ) { - QgsSettings().setValue( QStringLiteral( "UI/last3DLightsTab" ), tabWidget->currentIndex() ); -} - -void QgsLightsWidget::setPointLights( const QList &pointLights ) -{ - mPointLights = pointLights; - updateLightsList(); - cboLights->setCurrentIndex( 0 ); - onCurrentLightChanged( 0 ); -} - -void QgsLightsWidget::setDirectionalLights( const QList &directionalLights ) -{ - mDirectionalLights = directionalLights; - updateDirectionalLightsList(); - cboDirectionalLights->setCurrentIndex( 0 ); - onCurrentDirectionalLightChanged( 0 ); + mLightsModel->setPointLights( pointLights ); + mLightsModel->setDirectionalLights( directionalLights ); + mLightsListView->selectionModel()->select( mLightsModel->index( 0, 0 ), QItemSelectionModel::ClearAndSelect ); + selectedLightChanged( mLightsListView->selectionModel()->selection(), QItemSelection() ); } QList QgsLightsWidget::pointLights() { - return mPointLights; + return mLightsModel->pointLights(); } QList QgsLightsWidget::directionalLights() { - return mDirectionalLights; + return mLightsModel->directionalLights(); } -void QgsLightsWidget::onCurrentLightChanged( int index ) +void QgsLightsWidget::selectedLightChanged( const QItemSelection &selected, const QItemSelection & ) { - if ( index < 0 || index >= cboLights->count() ) + if ( selected.empty() ) + { + mStackedWidget->setCurrentIndex( 0 ); return; + } - QgsPointLightSettings light = mPointLights.at( index ); + const QgsLightsModel::LightType lightType = static_cast< QgsLightsModel::LightType >( mLightsModel->data( selected.indexes().at( 0 ), QgsLightsModel::LightTypeRole ).toInt() ); + const int listIndex = mLightsModel->data( selected.indexes().at( 0 ), QgsLightsModel::LightListIndex ).toInt(); + + switch ( lightType ) + { + case QgsLightsModel::Point: + mStackedWidget->setCurrentIndex( 1 ); + showSettingsForPointLight( mLightsModel->pointLights().at( listIndex ) ); + break; + + case QgsLightsModel::Directional: + mStackedWidget->setCurrentIndex( 2 ); + showSettingsForDirectionalLight( mLightsModel->directionalLights().at( listIndex ) ); + break; + } +} + +void QgsLightsWidget::showSettingsForPointLight( const QgsPointLightSettings &light ) +{ whileBlocking( spinPositionX )->setValue( light.position().x() ); whileBlocking( spinPositionY )->setValue( light.position().y() ); whileBlocking( spinPositionZ )->setValue( light.position().z() ); @@ -109,12 +126,8 @@ void QgsLightsWidget::onCurrentLightChanged( int index ) whileBlocking( spinA2 )->setValue( light.quadraticAttenuation() ); } -void QgsLightsWidget::onCurrentDirectionalLightChanged( int index ) +void QgsLightsWidget::showSettingsForDirectionalLight( const QgsDirectionalLightSettings &light ) { - if ( index < 0 || index >= cboDirectionalLights->count() ) - return; - - QgsDirectionalLightSettings light = mDirectionalLights.at( index ); mDirectionX = light.direction().x(); mDirectionY = light.direction().y(); mDirectionZ = light.direction().z(); @@ -126,9 +139,7 @@ void QgsLightsWidget::onCurrentDirectionalLightChanged( int index ) void QgsLightsWidget::updateCurrentLightParameters() { - int index = cboLights->currentIndex(); - if ( index < 0 || index >= cboLights->count() ) - return; + const int listIndex = mLightsModel->data( mLightsListView->selectionModel()->selection().indexes().at( 0 ), QgsLightsModel::LightListIndex ).toInt(); QgsPointLightSettings light; light.setPosition( QgsVector3D( spinPositionX->value(), spinPositionY->value(), spinPositionZ->value() ) ); @@ -137,7 +148,8 @@ void QgsLightsWidget::updateCurrentLightParameters() light.setConstantAttenuation( spinA0->value() ); light.setLinearAttenuation( spinA1->value() ); light.setQuadraticAttenuation( spinA2->value() ); - mPointLights[index] = light; + + mLightsModel->setPointLightSettings( listIndex, light ); } void QgsLightsWidget::updateCurrentDirectionalLightParameters() @@ -146,77 +158,54 @@ void QgsLightsWidget::updateCurrentDirectionalLightParameters() labelY->setText( QString::number( mDirectionY, 'f', 2 ) ); labelZ->setText( QString::number( mDirectionZ, 'f', 2 ) ); - int index = cboDirectionalLights->currentIndex(); - if ( index < 0 || index >= cboDirectionalLights->count() ) - return; + const int listIndex = mLightsModel->data( mLightsListView->selectionModel()->selection().indexes().at( 0 ), QgsLightsModel::LightListIndex ).toInt(); QgsDirectionalLightSettings light; light.setDirection( QgsVector3D( mDirectionX, mDirectionY, mDirectionZ ) ); light.setColor( btnDirectionalColor->color() ); light.setIntensity( spinDirectionalIntensity->value() ); - mDirectionalLights[index] = light; + + mLightsModel->setDirectionalLightSettings( listIndex, light ); } void QgsLightsWidget::onAddLight() { - if ( mPointLights.count() >= 8 ) + if ( mLightsModel->pointLights().size() >= 8 ) { QMessageBox::warning( this, tr( "Add Light" ), tr( "It is not possible to add more than 8 lights to the scene." ) ); return; } - mPointLights << QgsPointLightSettings(); - updateLightsList(); - cboLights->setCurrentIndex( cboLights->count() - 1 ); - // To set default parameters of the light - onCurrentDirectionalLightChanged( 0 ); + const QModelIndex newIndex = mLightsModel->addPointLight( QgsPointLightSettings() ); + mLightsListView->selectionModel()->select( newIndex, QItemSelectionModel::ClearAndSelect ); } void QgsLightsWidget::onAddDirectionalLight() { - if ( mDirectionalLights.count() > 4 ) + if ( mLightsModel->directionalLights().size() >= 4 ) { QMessageBox::warning( this, tr( "Add Directional Light" ), tr( "It is not possible to add more than 4 directional lights to the scene." ) ); return; } - mDirectionalLights << QgsDirectionalLightSettings(); - updateDirectionalLightsList(); - cboDirectionalLights->setCurrentIndex( cboDirectionalLights->count() - 1 ); - // To set default parameters of the light - onCurrentDirectionalLightChanged( 0 ); - - emit directionalLightsCountChanged( cboDirectionalLights->count() ); + const QModelIndex newIndex = mLightsModel->addDirectionalLight( QgsDirectionalLightSettings() ); + mLightsListView->selectionModel()->select( newIndex, QItemSelectionModel::ClearAndSelect ); } void QgsLightsWidget::onRemoveLight() { - int index = cboLights->currentIndex(); - if ( index < 0 || index >= cboLights->count() ) + const QItemSelection selected = mLightsListView->selectionModel()->selection(); + if ( selected.empty() ) + { return; + } - mPointLights.removeAt( index ); - updateLightsList(); - if ( index >= cboLights->count() ) - --index; // in case we removed the last light - cboLights->setCurrentIndex( index ); - onCurrentLightChanged( index ); -} + const int directionalCount = mLightsModel->directionalLights().size(); -void QgsLightsWidget::onRemoveDirectionalLight() -{ - int index = cboDirectionalLights->currentIndex(); - if ( index < 0 || index >= cboDirectionalLights->count() ) - return; + mLightsModel->removeRows( selected.indexes().at( 0 ).row(), 1 ); - mDirectionalLights.removeAt( index ); - updateDirectionalLightsList(); - if ( index >= cboDirectionalLights->count() ) - --index; // in case we removed the last light - cboDirectionalLights->setCurrentIndex( index ); - onCurrentDirectionalLightChanged( index ); - - emit directionalLightsCountChanged( cboDirectionalLights->count() ); + if ( mLightsModel->directionalLights().size() != directionalCount ) + emit directionalLightsCountChanged( mLightsModel->directionalLights().size() ); } void QgsLightsWidget::setAzimuthAltitude() @@ -236,16 +225,16 @@ void QgsLightsWidget::setAzimuthAltitude() azimuthAngle = std::fmod( azimuthAngle + 360.0, 360.0 ); } - dialAzimuth->setValue( int( azimuthAngle + 180 ) % 360 ); - spinBoxAzimuth->setValue( azimuthAngle ); + whileBlocking( dialAzimuth )->setValue( int( azimuthAngle + 180 ) % 360 ); + whileBlocking( spinBoxAzimuth )->setValue( azimuthAngle ); if ( horizontalVectorMagnitude == 0 ) - altitudeAngle = mDirectionY >= 0 ? 90 : -90; + altitudeAngle = mDirectionY >= 0 ? -90 : 90; else altitudeAngle = -atan( mDirectionY / horizontalVectorMagnitude ) / M_PI * 180; - spinBoxAltitude->setValue( altitudeAngle ); - sliderAltitude->setValue( altitudeAngle ); + whileBlocking( spinBoxAltitude )->setValue( altitudeAngle ); + whileBlocking( sliderAltitude )->setValue( altitudeAngle ); updateCurrentDirectionalLightParameters(); } @@ -265,24 +254,140 @@ void QgsLightsWidget::onDirectionChange() updateCurrentDirectionalLightParameters(); } -void QgsLightsWidget::updateLightsList() + + +// +// QgsLightsModel +// +QgsLightsModel::QgsLightsModel( QObject *parent ) + : QAbstractListModel( parent ) { - cboLights->blockSignals( true ); - cboLights->clear(); - for ( int i = 0; i < mPointLights.count(); ++i ) - { - cboLights->addItem( tr( "Light %1" ).arg( i + 1 ) ); - } - cboLights->blockSignals( false ); + } -void QgsLightsWidget::updateDirectionalLightsList() +int QgsLightsModel::rowCount( const QModelIndex &parent ) const { - cboDirectionalLights->blockSignals( true ); - cboDirectionalLights->clear(); - for ( int i = 0; i < mDirectionalLights.count(); ++i ) - { - cboDirectionalLights->addItem( tr( "Directional light %1" ).arg( i + 1 ) ); - } - cboDirectionalLights->blockSignals( false ); + Q_UNUSED( parent ) + return mPointLights.size() + mDirectionalLights.size(); +} + +QVariant QgsLightsModel::data( const QModelIndex &index, int role ) const +{ + if ( index.row() < 0 || index.row() >= rowCount( QModelIndex() ) ) + return QVariant(); + + const LightType lightType = index.row() < mPointLights.size() ? Point : Directional; + const int lightListRow = lightType == Point ? index.row() : index.row() - mPointLights.size(); + + switch ( role ) + { + case Qt::DisplayRole: + case Qt::ToolTipRole: + case Qt::EditRole: + switch ( lightType ) + { + case Point: + return tr( "Point light %1" ).arg( lightListRow + 1 ); + + case Directional: + return tr( "Directional light %1" ).arg( lightListRow + 1 ); + } + break; + + case LightTypeRole: + return lightType; + + case LightListIndex: + return lightListRow; + + case Qt::DecorationRole: + return QgsApplication::getThemeIcon( QStringLiteral( "/mActionHighlightFeature.svg" ) ); + + default: + break; + } + return QVariant(); +} + +bool QgsLightsModel::removeRows( int row, int count, const QModelIndex &parent ) +{ + beginRemoveRows( parent, row, row + count - 1 ); + for ( int i = row + count - 1; i >= row; --i ) + { + const LightType lightType = i < mPointLights.size() ? Point : Directional; + const int lightListRow = lightType == Point ? i : i - mPointLights.size(); + + switch ( lightType ) + { + case Point: + mPointLights.removeAt( lightListRow ); + break; + + case Directional: + mDirectionalLights.removeAt( lightListRow ); + break; + } + } + endRemoveRows(); + return true; +} + +void QgsLightsModel::setPointLights( const QList &lights ) +{ + beginRemoveRows( QModelIndex(), 0, mPointLights.size() - 1 ); + mPointLights.clear(); + endRemoveRows(); + + beginInsertRows( QModelIndex(), 0, lights.size() - 1 ); + mPointLights = lights; + endInsertRows(); +} + +void QgsLightsModel::setDirectionalLights( const QList &lights ) +{ + beginRemoveRows( QModelIndex(), mPointLights.size(), mPointLights.size() + mDirectionalLights.size() - 1 ); + mDirectionalLights.clear(); + endRemoveRows(); + + beginInsertRows( QModelIndex(), mPointLights.size(), mPointLights.size() + lights.size() - 1 ); + mDirectionalLights = lights; + endInsertRows(); +} + +QList QgsLightsModel::pointLights() const +{ + return mPointLights; +} + +QList QgsLightsModel::directionalLights() const +{ + return mDirectionalLights; +} + +void QgsLightsModel::setPointLightSettings( int index, const QgsPointLightSettings &light ) +{ + mPointLights[ index ] = light; +} + +void QgsLightsModel::setDirectionalLightSettings( int index, const QgsDirectionalLightSettings &light ) +{ + mDirectionalLights[ index ] = light; +} + +QModelIndex QgsLightsModel::addPointLight( const QgsPointLightSettings &light ) +{ + beginInsertRows( QModelIndex(), mPointLights.size(), mPointLights.size() ); + mPointLights.append( light ); + endInsertRows(); + + return index( mPointLights.size() - 1 ); +} + +QModelIndex QgsLightsModel::addDirectionalLight( const QgsDirectionalLightSettings &light ) +{ + beginInsertRows( QModelIndex(), mPointLights.size() + mDirectionalLights.size(), mPointLights.size() + mDirectionalLights.size() ); + mDirectionalLights.append( light ); + endInsertRows(); + + return index( mPointLights.size() + mDirectionalLights.size() - 1 ); } diff --git a/src/app/3d/qgslightswidget.h b/src/app/3d/qgslightswidget.h index 3e62da00f21..c34e2b8b98e 100644 --- a/src/app/3d/qgslightswidget.h +++ b/src/app/3d/qgslightswidget.h @@ -23,6 +23,47 @@ #include "qgspointlightsettings.h" #include "qgsdirectionallightsettings.h" +class QgsLightsModel : public QAbstractListModel +{ + Q_OBJECT + public: + + enum LightType + { + Point, + Directional + }; + + enum Role + { + LightTypeRole = Qt::UserRole, + LightListIndex, + }; + + explicit QgsLightsModel( QObject *parent = nullptr ); + + int rowCount( const QModelIndex &parent ) const override; + QVariant data( const QModelIndex &index, int role ) const override; + bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ) override; + + void setPointLights( const QList &lights ); + void setDirectionalLights( const QList &lights ); + + QList pointLights() const; + QList directionalLights() const; + + void setPointLightSettings( int index, const QgsPointLightSettings &light ); + void setDirectionalLightSettings( int index, const QgsDirectionalLightSettings &light ); + + QModelIndex addPointLight( const QgsPointLightSettings &light ); + QModelIndex addDirectionalLight( const QgsDirectionalLightSettings &light ); + + private: + + QList mPointLights; + QList mDirectionalLights; +}; + /** * Widget for configuration of lights in 3D map scene * \since QGIS 3.6 @@ -32,10 +73,9 @@ class QgsLightsWidget : public QWidget, private Ui::QgsLightsWidget Q_OBJECT public: explicit QgsLightsWidget( QWidget *parent = nullptr ); - ~QgsLightsWidget() override; - void setPointLights( const QList &pointLights ); - void setDirectionalLights( const QList &directionalLights ); + void setLights( const QList &pointLights, + const QList &directionalLights ); QList pointLights(); QList directionalLights(); @@ -43,27 +83,26 @@ class QgsLightsWidget : public QWidget, private Ui::QgsLightsWidget signals: void directionalLightsCountChanged( int count ); private slots: - void onCurrentLightChanged( int index ); + void selectedLightChanged( const QItemSelection &selected, const QItemSelection &deselected ); void updateCurrentLightParameters(); void onAddLight(); void onRemoveLight(); - void onCurrentDirectionalLightChanged( int index ); void updateCurrentDirectionalLightParameters(); void onAddDirectionalLight(); - void onRemoveDirectionalLight(); void setAzimuthAltitude(); void onDirectionChange(); private: - void updateLightsList(); - void updateDirectionalLightsList(); + + void showSettingsForPointLight( const QgsPointLightSettings &settings ); + void showSettingsForDirectionalLight( const QgsDirectionalLightSettings &settings ); private: - QList mPointLights; - QList mDirectionalLights; double mDirectionX = 0; double mDirectionY = -1; double mDirectionZ = 0; + QgsLightsModel *mLightsModel = nullptr; }; + #endif // QGSLIGHTSWIDGET_H diff --git a/src/ui/3d/map3dconfigwidget.ui b/src/ui/3d/map3dconfigwidget.ui index cb5de24f5cd..8f74098d072 100644 --- a/src/ui/3d/map3dconfigwidget.ui +++ b/src/ui/3d/map3dconfigwidget.ui @@ -179,7 +179,7 @@ - 0 + 1 @@ -205,7 +205,7 @@ 0 0 - 705 + 703 604 @@ -393,8 +393,8 @@ 0 0 - 705 - 620 + 703 + 604 @@ -477,8 +477,8 @@ 0 0 - 705 - 620 + 151 + 47 @@ -567,8 +567,8 @@ 0 0 - 705 - 620 + 175 + 132 @@ -667,8 +667,8 @@ 0 0 - 705 - 620 + 304 + 330 diff --git a/src/ui/3d/qgslightswidget.ui b/src/ui/3d/qgslightswidget.ui index 347e6f1558b..af93d76db82 100644 --- a/src/ui/3d/qgslightswidget.ui +++ b/src/ui/3d/qgslightswidget.ui @@ -6,7 +6,7 @@ 0 0 - 400 + 425 633 @@ -15,430 +15,36 @@ - - - 1 + + + 0 - - - Point lights - - - - - - - - - - - ... - - - - - - - ... - - - - + + + + + + + 0 + + + + + ... + + + QToolButton::InstantPopup + + - - - - - - Z - - - - - - - 1 - - - -9999999.000000000000000 - - - 9999999.000000000000000 - - - - - - - <html><head/><body><p>A<span style=" vertical-align:sub;">2</span></p></body></html> - - - - - - - 1 - - - 999999.000000000000000 - - - - - - - <html><head/><body><p>A<span style=" vertical-align:sub;">0</span></p></body></html> - - - - - - - 1 - - - -9999999.000000000000000 - - - 9999999.000000000000000 - - - - - - - Y - - - - - - - 1 - - - -9999999.000000000000000 - - - 9999999.000000000000000 - - - - - - - - 0 - 0 - - - - - 120 - 0 - - - - - - - - 9.000000000000000 - - - 0.100000000000000 - - - - - - - 9.000000000000000 - - - 0.100000000000000 - - - - - - - 9.000000000000000 - - - 0.100000000000000 - - - - - - - Intensity - - - - - - - <html><head/><body><p>A<span style=" vertical-align:sub;">1</span></p></body></html> - - - - - - - Color - - - - - - - X - - - - - - - <html><head/><body><p>Attenuation (A<span style=" vertical-align:sub;">0</span>+A<span style=" vertical-align:sub;">1</span>*D+A<span style=" vertical-align:sub;">2</span>*D<span style=" vertical-align:super;">2</span>)</p></body></html> - - - - - - - - - - Directional lights - - - - - - - - Intensity - - - - - - - 11 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Azimuth - - - - - - - ° - - - 360.000000000000000 - - - - - - - - - - 0 - - - 0 - - - 0 - - - true - - - 10.000000000000000 - - - true - - - - - - - Altitude - - - - - - - ° - - - -90.000000000000000 - - - 90.000000000000000 - - - - - - - -90 - - - 90 - - - true - - - Qt::Vertical - - - QSlider::NoTicks - - - 2 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 1 - - - 999999.000000000000000 - - - - - - - Color - - - - - - - - 0 - 0 - - - - - 120 - 0 - - - - - - - - Light Direction - - - - - - - 0 - - - - - Y - - - - - - - -- - - - - - - - Z - - - - - - - X - - - - - - - -- - - - - - - - -- - - - - - - - - - + + ... - + Qt::Vertical @@ -451,16 +57,417 @@ - - - - - + + + + + + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + - ... + Z + + + + 1 + + + -9999999.000000000000000 + + + 9999999.000000000000000 + + + + + + + <html><head/><body><p>A<span style=" vertical-align:sub;">2</span></p></body></html> + + + + + + + 1 + + + 999999.000000000000000 + + + + + + + <html><head/><body><p>A<span style=" vertical-align:sub;">0</span></p></body></html> + + + + + + + 1 + + + -9999999.000000000000000 + + + 9999999.000000000000000 + + + + + + + Y + + + + + + + 1 + + + -9999999.000000000000000 + + + 9999999.000000000000000 + + + + + + + + 0 + 0 + + + + + 120 + 0 + + + + + + + + 9.000000000000000 + + + 0.100000000000000 + + + + + + + 9.000000000000000 + + + 0.100000000000000 + + + + + + + 9.000000000000000 + + + 0.100000000000000 + + + + + + + Intensity + + + + + + + <html><head/><body><p>A<span style=" vertical-align:sub;">1</span></p></body></html> + + + + + + + Color + + + + + + + X + + + + + + + <html><head/><body><p>Attenuation (A<span style=" vertical-align:sub;">0</span>+A<span style=" vertical-align:sub;">1</span>&times;D+A<span style=" vertical-align:sub;">2</span>&times;D<span style=" vertical-align:super;">2</span>)</p></body></html> + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Intensity + + + + + + + 11 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Azimuth + + + + + + + ° + + + 360.000000000000000 + + + + + + + + + + 0 + + + 0 + + + 0 + + + true + + + 10.000000000000000 + + + true + + + + + + + Altitude + + + + + + + ° + + + -90.000000000000000 + + + 90.000000000000000 + + + + + + + -90 + + + 90 + + + true + + + Qt::Vertical + + + QSlider::NoTicks + + + 2 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 1 + + + 999999.000000000000000 + + + + + + + Color + + + + + + + + 0 + 0 + + + + + 120 + 0 + + + + + + + + Light Direction + + + + + + + 0 + + + + + Y + + + + + + + -- + + + + + + + Z + + + + + + + X + + + + + + + -- + + + + + + + -- + + + + + @@ -481,10 +488,6 @@ - tabWidget - cboLights - btnAddLight - btnRemoveLight spinPositionX spinPositionY spinPositionZ @@ -493,9 +496,6 @@ spinA0 spinA1 spinA2 - cboDirectionalLights - btnAddDirectionalLight - btnRemoveDirectionalLight btnDirectionalColor spinDirectionalIntensity