mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-22 05:48:13 -06:00
#15063: Histogram: Restore filter and axis scale of pasted curve
Re-run initAfterRead() after resolving references of a pasted curve, and set the axis scale of the destination plot from the binning mode.
This commit is contained in:
1 parent
442854cddd
commit
ca70c57d04
4 files changed
+38
-4
No files matched your search
@@ -620,6 +620,22 @@ void RimHistogramCurve::onZoomAllRequested( const caf::SignalEmitter* emitter )
|
||||
/// linear axis for linear binning. The user stays in control of the axis setting afterwards.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramCurve::onBinningModeChanged( const caf::SignalEmitter* emitter, RigHistogramCalculator::BinningMode binningMode )
|
||||
{
|
||||
applyAxisScaleForBinningMode( binningMode );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramCurve::updateAxisScaleFromBinningMode()
|
||||
{
|
||||
if ( auto source = dataSource() ) applyAxisScaleForBinningMode( source->binningMode() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramCurve::applyAxisScaleForBinningMode( RigHistogramCalculator::BinningMode binningMode )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfType<RimHistogramPlot>();
|
||||
if ( !plot ) return;
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
|
||||
RimHistogramDataSource* dataSource() const;
|
||||
|
||||
void updateAxisScaleFromBinningMode();
|
||||
|
||||
protected:
|
||||
// RimPlotCurve overrides
|
||||
QString createCurveAutoName() override;
|
||||
@@ -90,6 +92,7 @@ protected:
|
||||
void onCumulativeChanged( const caf::SignalEmitter* emitter );
|
||||
void onZoomAllRequested( const caf::SignalEmitter* emitter );
|
||||
void onBinningModeChanged( const caf::SignalEmitter* emitter, RigHistogramCalculator::BinningMode binningMode );
|
||||
void applyAxisScaleForBinningMode( RigHistogramCalculator::BinningMode binningMode );
|
||||
|
||||
void updateCumulativeCurve();
|
||||
void connectReferencedDataSourceSignals();
|
||||
|
||||
@@ -82,8 +82,9 @@ public:
|
||||
virtual bool showCumulativeCurve() const;
|
||||
virtual void setShowCumulativeCurve( bool showCumulativeCurve );
|
||||
|
||||
void setBinningMode( RigHistogramCalculator::BinningMode binningMode );
|
||||
void resetBinRange();
|
||||
void setBinningMode( RigHistogramCalculator::BinningMode binningMode );
|
||||
RigHistogramCalculator::BinningMode binningMode() const;
|
||||
void resetBinRange();
|
||||
|
||||
virtual std::optional<std::pair<double, double>> dataRange() const;
|
||||
|
||||
@@ -127,7 +128,6 @@ protected:
|
||||
|
||||
std::pair<double, double> binRange( double dataMin, double dataMax, double smallestPositiveValue ) const;
|
||||
|
||||
RigHistogramCalculator::BinningMode binningMode() const;
|
||||
RigHistogramCalculator::OutOfRangeHandling outOfRangeHandling() const;
|
||||
bool useUserDefinedBinRange() const;
|
||||
|
||||
|
||||
Reference in new issue
Block a user