mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
fix color ramp shader settings for 3d mesh rendering
This commit is contained in:
parent
9b4a824e27
commit
ec59d3b801
@ -81,7 +81,7 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
|
||||
QgsMeshTerrainGenerator *meshTerrain = static_cast<QgsMeshTerrainGenerator *>( terrainGen );
|
||||
cboTerrainLayer->setFilters( QgsMapLayerProxyModel::MeshLayer );
|
||||
cboTerrainLayer->setLayer( meshTerrain->meshLayer() );
|
||||
mMeshSymbolWidget->setLayer( meshTerrain->meshLayer() );
|
||||
mMeshSymbolWidget->setLayer( meshTerrain->meshLayer(), false );
|
||||
mMeshSymbolWidget->setSymbol( meshTerrain->symbol() );
|
||||
spinTerrainScale->setValue( meshTerrain->symbol().verticaleScale() );
|
||||
}
|
||||
@ -277,14 +277,13 @@ void Qgs3DMapConfigWidget::onTerrainLayerChanged()
|
||||
QgsMeshLayer *meshLayer = qobject_cast<QgsMeshLayer *>( cboTerrainLayer->currentLayer() );
|
||||
if ( meshLayer )
|
||||
{
|
||||
QgsMeshLayer *oldLayer = mMeshSymbolWidget->meshLayer();
|
||||
|
||||
mMeshSymbolWidget->setLayer( meshLayer, false );
|
||||
if ( mMeshSymbolWidget->symbol().colorRampShader().colorRampItemList().count() == 0 )
|
||||
{
|
||||
if ( oldLayer != meshLayer )
|
||||
mMeshSymbolWidget->reloadColorRampShaderMinMax();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Qgs3DMapConfigWidget::updateMaxZoomLevel()
|
||||
|
@ -63,6 +63,8 @@ void QgsMesh3dSymbolWidget::setSymbol( const QgsMesh3DSymbol &symbol )
|
||||
mComboBoxTextureType->setCurrentIndex( symbol.renderingStyle() );
|
||||
mMeshSingleColorButton->setColor( symbol.singleMeshColor() );
|
||||
mColorRampShaderWidget->setFromShader( symbol.colorRampShader() );
|
||||
mColorRampShaderWidget->setMinimumMaximumAndClassify( symbol.colorRampShader().minimumValue(),
|
||||
symbol.colorRampShader().maximumValue() );
|
||||
|
||||
setColorRampMinMax( symbol.colorRampShader().minimumValue(), symbol.colorRampShader().maximumValue() );
|
||||
}
|
||||
@ -90,6 +92,8 @@ void QgsMesh3dSymbolWidget::setLayer( QgsMeshLayer *meshLayer, bool updateSymbol
|
||||
reloadColorRampShaderMinMax(); //As the symbol is new, the Color ramp shader needs to be initialized with min max value
|
||||
}
|
||||
|
||||
QgsMeshLayer *QgsMesh3dSymbolWidget::meshLayer() const {return mLayer;}
|
||||
|
||||
double QgsMesh3dSymbolWidget::lineEditValue( const QLineEdit *lineEdit ) const
|
||||
{
|
||||
if ( lineEdit->text().isEmpty() )
|
||||
|
@ -34,6 +34,7 @@ class QgsMesh3dSymbolWidget : public QWidget, private Ui::QgsMesh3dPropsWidget
|
||||
QgsMesh3DSymbol symbol() const;
|
||||
|
||||
void setLayer( QgsMeshLayer *meshLayer, bool updateSymbol = true );
|
||||
QgsMeshLayer *meshLayer() const;
|
||||
void setSymbol( const QgsMesh3DSymbol &symbol );
|
||||
|
||||
void enableVerticalSetting( bool isEnable );
|
||||
|
Loading…
x
Reference in New Issue
Block a user