Skip to content
Permalink
Browse files

fix mesh 3D level of detail slide bar

  • Loading branch information
vcloarec authored and nyalldawson committed Mar 29, 2021
1 parent 34735aa commit 5cf8578b74092f42f4f4f95f2d185fe6badbd158
Showing with 16 additions and 11 deletions.
  1. +4 −5 src/app/3d/qgsmesh3dsymbolwidget.cpp
  2. +12 −6 src/ui/3d/qgsmesh3dpropswidget.ui
@@ -81,7 +81,7 @@ void QgsMesh3dSymbolWidget::setSymbol( const QgsMesh3DSymbol *symbol )
mGroupBoxWireframe->setChecked( symbol->wireframeEnabled() );
mColorButtonWireframe->setColor( symbol->wireframeLineColor() );
mSpinBoxWireframeLineWidth->setValue( symbol->wireframeLineWidth() );
if ( mLayer )
if ( mLayer && mLayer->meshSimplificationSettings().isEnabled() )
mLodSlider->setValue( mLayer->triangularMeshLevelOfDetailCount() - symbol->levelOfDetailIndex() - 1 );
else
mLodSlider->setValue( mLodSlider->maximum() );
@@ -128,16 +128,15 @@ void QgsMesh3dSymbolWidget::setLayer( QgsMeshLayer *meshLayer, bool updateSymbol

if ( meshLayer && meshLayer->meshSimplificationSettings().isEnabled() )
{
mLodSlider->setVisible( true );
mLabelLod->setVisible( true );
mLodSlider->setEnabled( true );
int lodCount = meshLayer->triangularMeshLevelOfDetailCount();
mLodSlider->setTickInterval( 1 );
mLodSlider->setMaximum( lodCount - 1 );
}
else
{
mLodSlider->setVisible( false );
mLabelLod->setVisible( false );
mLodSlider->setValue( mLodSlider->maximum() );
mLodSlider->setEnabled( false );
}

if ( !updateSymbol )
@@ -103,6 +103,12 @@
</item>
<item row="2" column="1" colspan="2">
<widget class="QSlider" name="mLodSlider">
<property name="toolTip">
<string>Need mesh simplification</string>
</property>
<property name="value">
<number>99</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -406,6 +412,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsColorRampShaderWidget</class>
<extends>QWidget</extends>
<header>raster/qgscolorrampshaderwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
@@ -423,12 +435,6 @@
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorRampShaderWidget</class>
<extends>QWidget</extends>
<header>raster/qgscolorrampshaderwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mChkSmoothTriangles</tabstop>

0 comments on commit 5cf8578

Please sign in to comment.