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 );
|
QgsMeshTerrainGenerator *meshTerrain = static_cast<QgsMeshTerrainGenerator *>( terrainGen );
|
||||||
cboTerrainLayer->setFilters( QgsMapLayerProxyModel::MeshLayer );
|
cboTerrainLayer->setFilters( QgsMapLayerProxyModel::MeshLayer );
|
||||||
cboTerrainLayer->setLayer( meshTerrain->meshLayer() );
|
cboTerrainLayer->setLayer( meshTerrain->meshLayer() );
|
||||||
mMeshSymbolWidget->setLayer( meshTerrain->meshLayer() );
|
mMeshSymbolWidget->setLayer( meshTerrain->meshLayer(), false );
|
||||||
mMeshSymbolWidget->setSymbol( meshTerrain->symbol() );
|
mMeshSymbolWidget->setSymbol( meshTerrain->symbol() );
|
||||||
spinTerrainScale->setValue( meshTerrain->symbol().verticaleScale() );
|
spinTerrainScale->setValue( meshTerrain->symbol().verticaleScale() );
|
||||||
}
|
}
|
||||||
@ -277,12 +277,11 @@ void Qgs3DMapConfigWidget::onTerrainLayerChanged()
|
|||||||
QgsMeshLayer *meshLayer = qobject_cast<QgsMeshLayer *>( cboTerrainLayer->currentLayer() );
|
QgsMeshLayer *meshLayer = qobject_cast<QgsMeshLayer *>( cboTerrainLayer->currentLayer() );
|
||||||
if ( meshLayer )
|
if ( meshLayer )
|
||||||
{
|
{
|
||||||
|
QgsMeshLayer *oldLayer = mMeshSymbolWidget->meshLayer();
|
||||||
|
|
||||||
mMeshSymbolWidget->setLayer( meshLayer, false );
|
mMeshSymbolWidget->setLayer( meshLayer, false );
|
||||||
if ( mMeshSymbolWidget->symbol().colorRampShader().colorRampItemList().count() == 0 )
|
if ( oldLayer != meshLayer )
|
||||||
{
|
|
||||||
mMeshSymbolWidget->reloadColorRampShaderMinMax();
|
mMeshSymbolWidget->reloadColorRampShaderMinMax();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,8 @@ void QgsMesh3dSymbolWidget::setSymbol( const QgsMesh3DSymbol &symbol )
|
|||||||
mComboBoxTextureType->setCurrentIndex( symbol.renderingStyle() );
|
mComboBoxTextureType->setCurrentIndex( symbol.renderingStyle() );
|
||||||
mMeshSingleColorButton->setColor( symbol.singleMeshColor() );
|
mMeshSingleColorButton->setColor( symbol.singleMeshColor() );
|
||||||
mColorRampShaderWidget->setFromShader( symbol.colorRampShader() );
|
mColorRampShaderWidget->setFromShader( symbol.colorRampShader() );
|
||||||
|
mColorRampShaderWidget->setMinimumMaximumAndClassify( symbol.colorRampShader().minimumValue(),
|
||||||
|
symbol.colorRampShader().maximumValue() );
|
||||||
|
|
||||||
setColorRampMinMax( 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
|
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
|
double QgsMesh3dSymbolWidget::lineEditValue( const QLineEdit *lineEdit ) const
|
||||||
{
|
{
|
||||||
if ( lineEdit->text().isEmpty() )
|
if ( lineEdit->text().isEmpty() )
|
||||||
|
@ -34,6 +34,7 @@ class QgsMesh3dSymbolWidget : public QWidget, private Ui::QgsMesh3dPropsWidget
|
|||||||
QgsMesh3DSymbol symbol() const;
|
QgsMesh3DSymbol symbol() const;
|
||||||
|
|
||||||
void setLayer( QgsMeshLayer *meshLayer, bool updateSymbol = true );
|
void setLayer( QgsMeshLayer *meshLayer, bool updateSymbol = true );
|
||||||
|
QgsMeshLayer *meshLayer() const;
|
||||||
void setSymbol( const QgsMesh3DSymbol &symbol );
|
void setSymbol( const QgsMesh3DSymbol &symbol );
|
||||||
|
|
||||||
void enableVerticalSetting( bool isEnable );
|
void enableVerticalSetting( bool isEnable );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user