Skip to content

Commit

Permalink
load min max and classify automatically when the selected attribute i…
Browse files Browse the repository at this point in the history
…s changed
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Jan 21, 2021
1 parent 8901574 commit 07ee1eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/app/3d/qgspointcloud3dsymbolwidget.cpp
Expand Up @@ -75,12 +75,9 @@ QgsPointCloud3DSymbolWidget::QgsPointCloud3DSymbolWidget( QgsPointCloudLayer *la
mGreenAttributeComboBox->setLayer( layer );
mBlueAttributeComboBox->setLayer( layer );

connect( mRedAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged,
this, &QgsPointCloud3DSymbolWidget::redAttributeChanged );
connect( mGreenAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged,
this, &QgsPointCloud3DSymbolWidget::greenAttributeChanged );
connect( mBlueAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged,
this, &QgsPointCloud3DSymbolWidget::blueAttributeChanged );
connect( mRedAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged, this, &QgsPointCloud3DSymbolWidget::redAttributeChanged );
connect( mGreenAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged, this, &QgsPointCloud3DSymbolWidget::greenAttributeChanged );
connect( mBlueAttributeComboBox, &QgsPointCloudAttributeComboBox::attributeChanged, this, &QgsPointCloud3DSymbolWidget::blueAttributeChanged );
connect( mContrastEnhancementAlgorithmComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPointCloud3DSymbolWidget::emitChangedSignal );

// set nice initial values
Expand All @@ -100,8 +97,7 @@ QgsPointCloud3DSymbolWidget::QgsPointCloud3DSymbolWidget( QgsPointCloudLayer *la
connect( mScalarRecalculateMinMaxButton, &QPushButton::clicked, this, &QgsPointCloud3DSymbolWidget::setMinMaxFromLayer );
connect( mColorRampShaderWidget, &QgsColorRampShaderWidget::widgetChanged, this, &QgsPointCloud3DSymbolWidget::emitChangedSignal );
connect( mSingleColorBtn, &QgsColorButton::colorChanged, this, &QgsPointCloud3DSymbolWidget::emitChangedSignal );
connect( mRenderingParameterComboBox, &QgsPointCloudAttributeComboBox::attributeChanged,
this, &QgsPointCloud3DSymbolWidget::rampAttributeChanged );
connect( mRenderingParameterComboBox, &QgsPointCloudAttributeComboBox::attributeChanged, this, &QgsPointCloud3DSymbolWidget::rampAttributeChanged );
connect( mColorRampShaderMinEdit, qgis::overload<double>::of( &QDoubleSpinBox::valueChanged ), this, &QgsPointCloud3DSymbolWidget::minMaxChanged );
connect( mColorRampShaderMaxEdit, qgis::overload<double>::of( &QDoubleSpinBox::valueChanged ), this, &QgsPointCloud3DSymbolWidget::minMaxChanged );

Expand Down Expand Up @@ -476,6 +472,7 @@ void QgsPointCloud3DSymbolWidget::rampAttributeChanged()
mProviderMax = mProviderMax * zScale + zOffset;
}
}
setMinMaxFromLayer();
mScalarRecalculateMinMaxButton->setEnabled( !std::isnan( mProviderMin ) && !std::isnan( mProviderMax ) );
emitChangedSignal();
}
Expand Down
Expand Up @@ -117,6 +117,7 @@ void QgsPointCloudAttributeByRampRendererWidget::attributeChanged()
}

}
setMinMaxFromLayer();
mScalarRecalculateMinMaxButton->setEnabled( !std::isnan( mProviderMin ) && !std::isnan( mProviderMax ) );
emitWidgetChanged();
}
Expand Down

0 comments on commit 07ee1eb

Please sign in to comment.