Logarithmic curve support and renaming (#8546)

* Add test for both positive and negative numbers
* Remove redundant sample count from parameter list
* Propagate useLogarithmicScale
* Renaming
This commit is contained in:
Magne Sjaastad 2022-02-14 11:49:37 +01:00 committed by GitHub
parent a8a3d3332b
commit 477ae02382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 597 additions and 481 deletions

View File

@ -224,15 +224,15 @@ void RicNewStimPlanModelPlotFeature::createFormationTrack( RimStimPlanModelPlot*
formationTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() );
formationTrack->setFormationCase( eclipseCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE );
formationTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE );
formationTrack->setShowWellPathAttributes( true );
formationTrack->setShowBothSidesOfWell( false );
formationTrack->setWellPathAttributesSource( stimPlanModel->thicknessDirectionWellPath() );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
formationTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() );
formationTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() );
formationTrack->setColSpan( RimPlot::ONE );
formationTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FORMATIONS ) );
formationTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FORMATIONS ) );
formationTrack->setLegendsVisible( true );
}
@ -260,18 +260,18 @@ void RicNewStimPlanModelPlotFeature::createFaciesTrack( RimStimPlanModelPlot* pl
faciesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING );
faciesTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() );
faciesTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() );
faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) );
faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) );
faciesTrack->setLegendsVisible( false );
faciesTrack->setPlotTitleVisible( true );
RimColorLegend* faciesColors = faciesProperties->colorLegend();
if ( faciesColors ) faciesTrack->setColorShadingLegend( faciesColors );
faciesTrack->setVisibleXRange( 0.0, 0.0 );
faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
faciesTrack->setColSpan( RimPlot::ONE );
faciesTrack->setAutoScaleXEnabled( false );
faciesTrack->setVisibleXRange( 0.0, 0.0 );
faciesTrack->setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE );
faciesTrack->setAutoScalePropertyValuesEnabled( false );
faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
faciesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE );
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
@ -320,7 +320,7 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl
RimColorLegend* faciesColors = faciesProperties->colorLegend();
if ( faciesColors ) faciesTrack->setColorShadingLegend( faciesColors );
faciesTrack->setVisibleXRange( 0.0, 0.0 );
faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
faciesTrack->setColSpan( RimPlot::ONE );
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
@ -334,8 +334,8 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl
curve->setAutoNameComponents( false, true, false, false, false );
faciesTrack->addCurve( curve );
faciesTrack->setAutoScaleXEnabled( true );
faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::LAYERS ) );
faciesTrack->setAutoScalePropertyValuesEnabled( true );
faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::LAYERS ) );
curve->loadDataAndUpdate( true );
@ -420,12 +420,12 @@ void RicNewStimPlanModelPlotFeature::createParametersTrack( RimStimPlanModelPlot
colorIndex++;
}
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
plotTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
plotTrack->setShowRegionLabels( true );
plotTrack->setLogarithmicScale( isPlotLogarithmic );
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setAutoScalePropertyValuesEnabled( true );
plotTrack->setMinAndMaxTicksOnly( useMinMaxTicksOnly( propertyTypes[0] ) );
plotTrack->setXAxisTitle( stimPlanModel->unitForProperty( propertyTypes[0] ) );
plotTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( propertyTypes[0] ) );
plotTrack->updateConnectedEditors();
plot->updateConnectedEditors();

View File

@ -220,7 +220,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil
formationTrack->setFormationWellPath( wellPath );
formationTrack->setFormationCase( geoMechCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
formationTrack->setColSpan( RimPlot::ONE );
}
@ -242,8 +242,8 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi
casingShoeTrack->setShowBothSidesOfWell( false );
casingShoeTrack->setAnnotationTransparency( 90 );
casingShoeTrack->setWellPathAttributesSource( wellPath );
casingShoeTrack->setVisibleXRange( 0.0, 0.0 );
casingShoeTrack->setAutoScaleXEnabled( true );
casingShoeTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
casingShoeTrack->setAutoScalePropertyValuesEnabled( true );
casingShoeTrack->loadDataAndUpdate();
}
@ -258,10 +258,10 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
RimWellLogTrack* paramCurvesTrack =
RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "WBS Parameters", plot );
paramCurvesTrack->setColSpan( RimPlot::TWO );
paramCurvesTrack->setVisibleXRange( 0.0, 2.0 );
paramCurvesTrack->setAutoScaleXEnabled( true );
paramCurvesTrack->setVisiblePropertyValueRange( 0.0, 2.0 );
paramCurvesTrack->setAutoScalePropertyValuesEnabled( true );
paramCurvesTrack->setTickIntervals( 1.0, 0.2 );
paramCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
paramCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
paramCurvesTrack->setFormationWellPath( wellPath );
paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setShowRegionLabels( true );
@ -290,7 +290,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
curve->setCustomName( param.name() );
i++;
}
paramCurvesTrack->setAutoScaleXEnabled( true );
paramCurvesTrack->setAutoScalePropertyValuesEnabled( true );
}
//--------------------------------------------------------------------------------------------------
@ -305,11 +305,11 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
"Stability Curves",
plot );
stabilityCurvesTrack->setVisibleXRange( 0.0, 2.5 );
stabilityCurvesTrack->setVisiblePropertyValueRange( 0.0, 2.5 );
stabilityCurvesTrack->setColSpan( RimPlot::THREE );
stabilityCurvesTrack->setAutoScaleXEnabled( true );
stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true );
stabilityCurvesTrack->setTickIntervals( 1.0, 0.2 );
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechCase );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
@ -368,7 +368,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
}
}
stabilityCurvesTrack->setAutoScaleXEnabled( true );
stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true );
}
//--------------------------------------------------------------------------------------------------
@ -426,9 +426,9 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
minValue = cvf::Math::clamp( minValue, 0.0, maxValue - 90.0 );
}
wellPathAnglesTrack->setColSpan( RimPlot::TWO );
wellPathAnglesTrack->setVisibleXRange( minValue, maxValue );
wellPathAnglesTrack->setVisiblePropertyValueRange( minValue, maxValue );
wellPathAnglesTrack->setTickIntervals( 180.0, 45.0 );
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechCase );
wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );

View File

@ -73,7 +73,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
for ( auto track : srcTracks )
{
track->setAutoScaleXEnabled( true );
track->setAutoScalePropertyValuesEnabled( true );
track->updateParentPlotZoom();
track->updateStackedCurveData();
track->updateConnectedEditors();
@ -86,7 +86,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
destTrack->loadDataAndUpdate();
destTrack->updateStackedCurveData();
destTrack->setAutoScaleXEnabled( true );
destTrack->setAutoScalePropertyValuesEnabled( true );
destTrack->updateParentPlotZoom();
destTrack->updateConnectedEditors();
}

View File

@ -136,8 +136,8 @@ private:
void reattachAllCurves() override {}
void updateAxes() override;
void onAxisSelected( int axis, bool toggle ) override;
void setAutoScaleXEnabled( bool enabled ) override {}
void setAutoScaleYEnabled( bool enabled ) override {}
void setAutoScalePropertyValuesEnabled( bool enabled ) override {}
void setAutoScaleDepthValuesEnabled( bool enabled ) override {}
void updateLegend() override{};
QString asciiDataForPlotExport() const override { return ""; }

View File

@ -107,8 +107,8 @@ protected:
RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override;
void reattachAllCurves() override {}
void setAutoScaleXEnabled( bool enabled ) override {}
void setAutoScaleYEnabled( bool enabled ) override {}
void setAutoScalePropertyValuesEnabled( bool enabled ) override {}
void setAutoScaleDepthValuesEnabled( bool enabled ) override {}
void updateLegend() override;
QString asciiDataForPlotExport() const override { return ""; }

View File

@ -481,7 +481,7 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotT
: RimWellLogFile::WELL_FLOW_COND_STANDARD;
QString axisTitle = RimWellPlotTools::flowPlotAxisTitle( condition, unitSet );
plotTrack->setXAxisTitle( axisTitle );
plotTrack->setPropertyValueAxisTitle( axisTitle );
#if 0
if (m_flowDiagSolution)

View File

@ -127,7 +127,7 @@ RiuPlotWidget* RimWellDistributionPlot::plotWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlot::setAutoScaleXEnabled( bool /*enabled*/ )
void RimWellDistributionPlot::setAutoScalePropertyValuesEnabled( bool /*enabled*/ )
{
// cvf::Trace::show("RimWellDistributionPlot::setAutoScaleXEnabled()");
}
@ -135,7 +135,7 @@ void RimWellDistributionPlot::setAutoScaleXEnabled( bool /*enabled*/ )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlot::setAutoScaleYEnabled( bool /*enabled*/ )
void RimWellDistributionPlot::setAutoScaleDepthValuesEnabled( bool /*enabled*/ )
{
// cvf::Trace::show("RimWellDistributionPlot::setAutoScaleYEnabled()");
}

View File

@ -50,8 +50,8 @@ public:
// RimPlot implementations
RiuPlotWidget* plotWidget() override;
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScalePropertyValuesEnabled( bool enabled ) override;
void setAutoScaleDepthValuesEnabled( bool enabled ) override;
void updateAxes() override;
void updateLegend() override;
void updateZoomInParentPlot() override;

View File

@ -300,7 +300,14 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString&
const std::vector<double>& depthValues,
const std::vector<double>& flowRates )
{
this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::DepthUnitType::UNIT_NONE, false );
bool useLogarithmicScale = false;
this->setPropertyValuesAndDepths( flowRates,
depthValues,
depthType,
0.0,
RiaDefines::DepthUnitType::UNIT_NONE,
false,
useLogarithmicScale );
m_curveAutoName = curveName;
}

View File

@ -188,7 +188,7 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack )
if ( m_useStandardConditionCurves )
axisTitle += RimWellPlotTools::flowPlotAxisTitle( RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet );
plotTrack->setXAxisTitle( axisTitle );
plotTrack->setPropertyValueAxisTitle( axisTitle );
#if 0
QString unitText;
@ -685,7 +685,7 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
curveGroupId++;
}
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setAutoScalePropertyValuesEnabled( true );
RimWellLogPlot::onLoadDataAndUpdate();
}
@ -918,7 +918,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( plotTrack )
{
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setAutoScalePropertyValuesEnabled( true );
}
updateZoom();
}
@ -931,7 +931,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( plotTrack )
{
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setAutoScalePropertyValuesEnabled( true );
}
updateZoom();
}

View File

@ -183,8 +183,8 @@ QImage RimGridCrossPlot::snapshotWindowContent()
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::zoomAll()
{
setAutoScaleXEnabled( true );
setAutoScaleYEnabled( true );
setAutoScalePropertyValuesEnabled( true );
setAutoScaleDepthValuesEnabled( true );
updateZoomInParentPlot();
}
@ -338,7 +338,7 @@ void RimGridCrossPlot::detachAllCurves()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::setAutoScaleXEnabled( bool enabled )
void RimGridCrossPlot::setAutoScalePropertyValuesEnabled( bool enabled )
{
m_xAxisProperties->setAutoZoom( enabled );
}
@ -346,7 +346,7 @@ void RimGridCrossPlot::setAutoScaleXEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::setAutoScaleYEnabled( bool enabled )
void RimGridCrossPlot::setAutoScaleDepthValuesEnabled( bool enabled )
{
m_yAxisProperties->setAutoZoom( enabled );
}
@ -457,8 +457,8 @@ void RimGridCrossPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::onPlotZoomed()
{
setAutoScaleXEnabled( false );
setAutoScaleYEnabled( false );
setAutoScalePropertyValuesEnabled( false );
setAutoScaleDepthValuesEnabled( false );
updateZoomFromParentPlot();
}

View File

@ -102,8 +102,8 @@ public:
void updateZoomInParentPlot() override;
void updateZoomFromParentPlot() override;
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScalePropertyValuesEnabled( bool enabled ) override;
void setAutoScaleDepthValuesEnabled( bool enabled ) override;
caf::PdmObject* findPdmObjectFromPlotCurve( const RiuPlotCurve* curve ) const override;
void onAxisSelected( int axis, bool toggle ) override;

View File

@ -57,8 +57,8 @@ void RimGridCrossPlotCurve::setSamples( const std::vector<double>& xValues, cons
if ( xValues.empty() || yValues.empty() || !m_plotCurve ) return;
bool isLogCurve = false;
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve );
bool useLogarithmicScale = false;
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale );
}
//--------------------------------------------------------------------------------------------------

View File

@ -315,7 +315,7 @@ void RimDepthTrackPlot::updateZoom()
for ( RimPlot* plot : plots() )
{
static_cast<RimWellLogTrack*>( plot )->setVisibleYRange( m_minVisibleDepth(), m_maxVisibleDepth() );
static_cast<RimWellLogTrack*>( plot )->setVisibleDepthRange( m_minVisibleDepth(), m_maxVisibleDepth() );
plot->updateZoomInParentPlot();
}
@ -1183,7 +1183,7 @@ void RimDepthTrackPlot::setAutoScaleXEnabled( bool enabled )
{
for ( RimPlot* plot : plots() )
{
plot->setAutoScaleXEnabled( enabled );
plot->setAutoScalePropertyValuesEnabled( enabled );
}
}

View File

@ -408,18 +408,20 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot )
RimSummaryPlot* plot = nullptr;
firstAncestorOrThisOfType( plot );
bool isLogCurve = plot->isLogarithmicScaleEnabled( yAxis() );
bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( yAxis() );
if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE )
{
std::vector<time_t> dateTimes = timeStepValues();
if ( dateTimes.size() > 0 && dateTimes.size() == values.size() )
{
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, useLogarithmicScale );
}
else
{
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(),
std::vector<double>(),
useLogarithmicScale );
}
}
else
@ -435,11 +437,13 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot )
times.push_back( timeScale * day );
}
m_plotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( times, values, useLogarithmicScale );
}
else
{
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(),
std::vector<double>(),
useLogarithmicScale );
}
}

View File

@ -406,7 +406,7 @@ void RimMultiPlot::setAutoScaleXEnabled( bool enabled )
{
for ( RimPlot* plot : plots() )
{
plot->setAutoScaleXEnabled( enabled );
plot->setAutoScalePropertyValuesEnabled( enabled );
}
}
@ -417,7 +417,7 @@ void RimMultiPlot::setAutoScaleYEnabled( bool enabled )
{
for ( RimPlot* plot : plots() )
{
plot->setAutoScaleYEnabled( enabled );
plot->setAutoScaleDepthValuesEnabled( enabled );
}
}

View File

@ -71,8 +71,8 @@ public:
void updateAfterInsertingIntoMultiPlot();
// Pure virtual interface methods
virtual void setAutoScaleXEnabled( bool enabled ) = 0;
virtual void setAutoScaleYEnabled( bool enabled ) = 0;
virtual void setAutoScalePropertyValuesEnabled( bool enabled ) = 0;
virtual void setAutoScaleDepthValuesEnabled( bool enabled ) = 0;
virtual void updateAxes() = 0;
virtual void updateLegend() = 0;

View File

@ -684,11 +684,11 @@ bool RimPlotCurve::hasParentPlot() const
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setSamplesFromXYValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
if ( m_plotCurve )
{
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale );
}
}
@ -697,11 +697,11 @@ void RimPlotCurve::setSamplesFromXYValues( const std::vector<double>& xValues,
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
if ( m_plotCurve )
{
m_plotCurve->setSamplesFromDatesAndYValues( dateTimes, yValues, isLogCurve );
m_plotCurve->setSamplesFromDatesAndYValues( dateTimes, yValues, useLogarithmicScale );
}
}
@ -710,11 +710,11 @@ void RimPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>&
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
if ( m_plotCurve )
{
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, yValues, isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, yValues, useLogarithmicScale );
}
}
@ -724,12 +724,12 @@ void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dat
void RimPlotCurve::setSamplesFromXYErrorValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis )
{
if ( m_plotCurve )
{
m_plotCurve->setSamplesFromXYErrorValues( xValues, yValues, errorValues, isLogCurve, errorAxis );
m_plotCurve->setSamplesFromXYErrorValues( xValues, yValues, errorValues, useLogarithmicScale, errorAxis );
}
}

View File

@ -141,18 +141,20 @@ protected:
void setSamplesFromXYErrorValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS );
void setSamplesFromXYValues( const std::vector<double>& xValues, const std::vector<double>& yValues, bool isLogCurve );
void setSamplesFromXYValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool useLogarithmicScale );
void setSamplesFromDatesAndYValues( const std::vector<QDateTime>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
void setSamplesFromTimeTAndYValues( const std::vector<time_t>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
protected:
// Overridden PDM methods

View File

@ -175,14 +175,14 @@ RiuPlotWidget* RimVfpPlot::plotWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setAutoScaleXEnabled( bool /*enabled*/ )
void RimVfpPlot::setAutoScalePropertyValuesEnabled( bool /*enabled*/ )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setAutoScaleYEnabled( bool /*enabled*/ )
void RimVfpPlot::setAutoScaleDepthValuesEnabled( bool /*enabled*/ )
{
}
@ -573,8 +573,8 @@ void RimVfpPlot::populatePlotWidgetWithPlotData( RiuPlotWidget* plotWidget, cons
symbol->setSize( 6, 6 );
curve->setSymbol( symbol );
bool isLogCurve = false;
curve->setSamplesFromXValuesAndYValues( plotData.xData( idx ), plotData.yData( idx ), isLogCurve );
bool useLogarithmicScale = false;
curve->setSamplesFromXValuesAndYValues( plotData.xData( idx ), plotData.yData( idx ), useLogarithmicScale );
curve->attachToPlot( plotWidget );
curve->showInPlot();
}

View File

@ -48,8 +48,8 @@ public:
// RimPlot implementations
RiuPlotWidget* plotWidget() override;
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScalePropertyValuesEnabled( bool enabled ) override;
void setAutoScaleDepthValuesEnabled( bool enabled ) override;
void updateAxes() override;
void updateLegend() override;
QString asciiDataForPlotExport() const override;

View File

@ -158,7 +158,17 @@ void RimStimPlanModelCurve::performDataExtraction( bool* isUsingPseudoLength )
filterInvalidValuesForLogarithmicScale( values );
}
this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, !performDataSmoothing, xUnits );
// TOOD: Consider rewrite, as RigWellLogCurveData can do logarithmic filtering
bool useLogarithmicScale = false;
this->setPropertyValuesWithMdAndTVD( values,
measuredDepthValues,
tvDepthValues,
rkbDiff,
depthUnit,
!performDataSmoothing,
useLogarithmicScale,
xUnits );
}
}

View File

@ -134,13 +134,13 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot )
RimSummaryPlot* plot = nullptr;
firstAncestorOrThisOfType( plot );
bool isLogCurve = plot->isLogarithmicScaleEnabled( this->yAxis() );
bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( this->yAxis() );
if ( dateTimes.size() > 0 && dateTimes.size() == values.size() )
{
if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE )
{
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, useLogarithmicScale );
}
else
{
@ -156,12 +156,12 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot )
}
}
m_plotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( times, values, useLogarithmicScale );
}
}
else
{
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), useLogarithmicScale );
}
updateZoomInParentPlot();

View File

@ -601,7 +601,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
RimSummaryPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted( plot );
bool isLogCurve = plot->isLogarithmicScaleEnabled( this->axisY() );
bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( this->axisY() );
bool shouldPopulateViewWithEmptyData = false;
@ -627,7 +627,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
this->setSamplesFromXYValues( curveMerger.interpolatedYValuesForAllXValues( 0 ),
curveMerger.interpolatedYValuesForAllXValues( 1 ),
isLogCurve );
useLogarithmicScale );
}
else
{
@ -655,11 +655,11 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( !errValues.empty() )
{
this->setSamplesFromXYErrorValues( timeSteps, curveValuesY, errValues, isLogCurve );
this->setSamplesFromXYErrorValues( timeSteps, curveValuesY, errValues, useLogarithmicScale );
}
else
{
this->setSamplesFromXYValues( timeSteps, curveValuesY, isLogCurve );
this->setSamplesFromXYValues( timeSteps, curveValuesY, useLogarithmicScale );
}
}
else
@ -681,12 +681,14 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
resampledTimeSteps.insert( resampledTimeSteps.begin(), curveTimeStepsY.front() );
resampledValues.insert( resampledValues.begin(), resampledValues.front() );
this->setSamplesFromTimeTAndYValues( resampledTimeSteps, resampledValues, isLogCurve );
this->setSamplesFromTimeTAndYValues( resampledTimeSteps,
resampledValues,
useLogarithmicScale );
}
}
else
{
this->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, isLogCurve );
this->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, useLogarithmicScale );
}
}
}
@ -705,7 +707,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
}
}
this->setSamplesFromXYValues( timeFromSimulationStart, curveValuesY, isLogCurve );
this->setSamplesFromXYValues( timeFromSimulationStart, curveValuesY, useLogarithmicScale );
}
}
else
@ -716,7 +718,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( shouldPopulateViewWithEmptyData )
{
this->setSamplesFromXYValues( std::vector<double>(), std::vector<double>(), isLogCurve );
this->setSamplesFromXYValues( std::vector<double>(), std::vector<double>(), useLogarithmicScale );
}
if ( updateParentPlot && hasParentPlot() )

View File

@ -1134,8 +1134,8 @@ void RimSummaryPlot::removeAllTimeAnnotations()
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::zoomAll()
{
setAutoScaleXEnabled( true );
setAutoScaleYEnabled( true );
setAutoScalePropertyValuesEnabled( true );
setAutoScaleDepthValuesEnabled( true );
updateZoomInParentPlot();
}
@ -1828,8 +1828,8 @@ void RimSummaryPlot::handleDroppedObjects( const std::vector<caf::PdmObjectHandl
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::onPlotZoomed()
{
setAutoScaleXEnabled( false );
setAutoScaleYEnabled( false );
setAutoScalePropertyValuesEnabled( false );
setAutoScaleDepthValuesEnabled( false );
updateZoomFromParentPlot();
}
@ -2243,7 +2243,7 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlot::fieldsToShowInToolbar()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::setAutoScaleXEnabled( bool enabled )
void RimSummaryPlot::setAutoScalePropertyValuesEnabled( bool enabled )
{
for ( auto ap : m_axisProperties )
{
@ -2258,7 +2258,7 @@ void RimSummaryPlot::setAutoScaleXEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::setAutoScaleYEnabled( bool enabled )
void RimSummaryPlot::setAutoScaleDepthValuesEnabled( bool enabled )
{
for ( auto ap : m_axisProperties )
{

View File

@ -161,8 +161,8 @@ public:
virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const;
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScalePropertyValuesEnabled( bool enabled ) override;
void setAutoScaleDepthValuesEnabled( bool enabled ) override;
RiuPlotWidget* plotWidget() override;
void zoomAll() override;
void updateZoomInParentPlot() override;

View File

@ -79,7 +79,7 @@ void Rim3dWellLogRftCurve::curveValuesAndMds( std::vector<double>* values, std::
const RigWellLogCurveData* curveData = m_2dWellLogRftCurve->curveData();
// These values are for a simulation well
*values = curveData->xValues();
*values = curveData->propertyValues();
*measuredDepthValues = curveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
}

View File

@ -150,7 +150,8 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvDepthValues ) );
}
this->setValuesAndDepths( values, validDepths, rkbDiff, depthUnit, false );
bool useLogarithmicScale = false;
this->setPropertyValuesAndDepths( values, validDepths, rkbDiff, depthUnit, false, useLogarithmicScale );
}
}
}

View File

@ -49,7 +49,8 @@ RimWellLogCurve::RimWellLogCurve()
m_curveData = new RigWellLogCurveData;
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
m_curveDataPropertyValueRange =
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
setDeletable( true );
}
@ -72,7 +73,7 @@ void RimWellLogCurve::setDepthUnit( RiaDefines::DepthUnitType depthUnit )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumValue ) const
bool RimWellLogCurve::propertyValueRangeInData( double* minimumValue, double* maximumValue ) const
{
CAF_ASSERT( minimumValue && maximumValue );
@ -81,14 +82,14 @@ bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumVa
return false;
}
if ( m_curveDataXRange.first == -std::numeric_limits<double>::infinity() ||
m_curveDataXRange.second == std::numeric_limits<double>::infinity() )
if ( m_curveDataPropertyValueRange.first == -std::numeric_limits<double>::infinity() ||
m_curveDataPropertyValueRange.second == std::numeric_limits<double>::infinity() )
{
return false;
}
*minimumValue = m_curveDataXRange.first;
*maximumValue = m_curveDataXRange.second;
*minimumValue = m_curveDataPropertyValueRange.first;
*maximumValue = m_curveDataPropertyValueRange.second;
return true;
}
@ -96,7 +97,7 @@ bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumVa
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumValue ) const
bool RimWellLogCurve::depthValueRangeInData( double* minimumValue, double* maximumValue ) const
{
CAF_ASSERT( minimumValue && maximumValue );
@ -116,50 +117,54 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits )
bool useLogarithmicScale,
const QString& propertyUnit )
{
m_curveData->setValuesAndDepths( xValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve );
m_curveData->setXUnits( xUnits );
calculateCurveDataXRange();
m_curveData->setValuesAndDepths( propertyValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale );
m_curveData->setPropertyValueUnit( propertyUnit );
calculateCurveDataPropertyValueRange();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits )
bool useLogarithmicScale,
const QString& propertyUnit )
{
m_curveData->setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve );
m_curveData->setXUnits( xUnits );
calculateCurveDataXRange();
m_curveData->setValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale );
m_curveData->setPropertyValueUnit( propertyUnit );
calculateCurveDataPropertyValueRange();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesWithMdAndTVD( const std::vector<double>& xValues,
void RimWellLogCurve::setPropertyValuesWithMdAndTVD( const std::vector<double>& propertyValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvdMSL,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits )
bool useLogarithmicScale,
const QString& propertyUnit )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
measuredDepths },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
tvdMSL } };
setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve, xUnits );
setPropertyValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit );
}
//--------------------------------------------------------------------------------------------------
@ -214,15 +219,15 @@ QString RimWellLogCurve::wellLogCurveIconName()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setOverrideCurveData( const std::vector<double>& xValues,
void RimWellLogCurve::setOverrideCurveData( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues,
const RiaCurveDataTools::CurveIntervals& curveIntervals )
{
auto minmax_it = std::minmax_element( xValues.begin(), xValues.end() );
this->setOverrideCurveDataXRange( *( minmax_it.first ), *( minmax_it.second ) );
auto minmax_it = std::minmax_element( propertyValues.begin(), propertyValues.end() );
this->setOverrideCurveDataPropertyValueRange( *( minmax_it.first ), *( minmax_it.second ) );
if ( m_plotCurve )
{
m_plotCurve->setSamplesValues( xValues, depthValues );
m_plotCurve->setSamplesValues( propertyValues, depthValues );
m_plotCurve->setLineSegmentStartStopIndices( curveIntervals );
}
}
@ -247,7 +252,7 @@ void RimWellLogCurve::updateZoomInParentPlot()
if ( wellLogTrack )
{
wellLogTrack->setAutoScaleXIfNecessary();
wellLogTrack->setAutoScalePropertyValuesIfNecessary();
RimDepthTrackPlot* wellLogPlot;
wellLogTrack->firstAncestorOrThisOfType( wellLogPlot );
@ -299,24 +304,25 @@ void RimWellLogCurve::updateLegendsInPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setOverrideCurveDataXRange( double minimumValue, double maximumValue )
void RimWellLogCurve::setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue )
{
m_curveDataXRange = std::make_pair( minimumValue, maximumValue );
m_curveDataPropertyValueRange = std::make_pair( minimumValue, maximumValue );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::calculateCurveDataXRange()
void RimWellLogCurve::calculateCurveDataPropertyValueRange()
{
// Invalidate range first
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
for ( double xValue : m_curveData->xValues() )
m_curveDataPropertyValueRange =
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
for ( double xValue : m_curveData->propertyValues() )
{
if ( RiaCurveDataTools::isValidValue( xValue, false ) )
{
m_curveDataXRange.first = std::min( m_curveDataXRange.first, xValue );
m_curveDataXRange.second = std::max( m_curveDataXRange.second, xValue );
m_curveDataPropertyValueRange.first = std::min( m_curveDataPropertyValueRange.first, xValue );
m_curveDataPropertyValueRange.second = std::max( m_curveDataPropertyValueRange.second, xValue );
}
}
}

View File

@ -42,29 +42,34 @@ public:
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
bool xValueRangeInData( double* minimumValue, double* maximumValue ) const;
bool yValueRangeInData( double* minimumValue, double* maximumValue ) const;
bool propertyValueRangeInData( double* minimumValue, double* maximumValue ) const;
bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const;
void setValuesAndDepths( const std::vector<double>& xValues,
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits = RiaWellLogUnitTools<double>::noUnitString() );
void setValuesWithMdAndTVD( const std::vector<double>& xValues,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyValuesWithMdAndTVD( const std::vector<double>& propertyValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits = RiaWellLogUnitTools<double>::noUnitString() );
void setValuesAndDepths( const std::vector<double>& xValues,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
const QString& xUnits = RiaWellLogUnitTools<double>::noUnitString() );
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
const RigWellLogCurveData* curveData() const;
@ -78,7 +83,7 @@ public:
static QString wellLogCurveIconName();
void setOverrideCurveData( const std::vector<double>& xValues,
void setOverrideCurveData( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues,
const RiaCurveDataTools::CurveIntervals& curveIntervals );
@ -87,11 +92,11 @@ public:
protected:
void updateZoomInParentPlot() override;
void updateLegendsInPlot() override;
void setOverrideCurveDataXRange( double minimumValue, double maximumValue );
void calculateCurveDataXRange();
void setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue );
void calculateCurveDataPropertyValueRange();
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
cvf::ref<RigWellLogCurveData> m_curveData;
std::pair<double, double> m_curveDataXRange;
std::pair<double, double> m_curveDataPropertyValueRange;
};

View File

@ -357,24 +357,24 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
isUsingPseudoLength = false;
}
bool isLogCurve = false;
bool useLogarithmicScale = false;
RimWellLogTrack* track = nullptr;
firstAncestorOfType( track );
if ( track )
{
isLogCurve = track->isLogarithmicScale();
useLogarithmicScale = track->isLogarithmicScale();
}
std::vector<double> xPlotValues = curveData()->xPlotValues();
std::vector<double> depthPlotValues = curveData()->depthPlotValues( depthType, displayUnit );
std::vector<double> xPlotValues = curveData()->propertyValuesByIntervals();
std::vector<double> depthPlotValues = curveData()->depthValuesByIntervals( depthType, displayUnit );
CAF_ASSERT( xPlotValues.size() == depthPlotValues.size() );
if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::HORIZONTAL )
m_plotCurve->setSamplesFromXValuesAndYValues( depthPlotValues, xPlotValues, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( depthPlotValues, xPlotValues, useLogarithmicScale );
else
m_plotCurve->setSamplesFromXValuesAndYValues( xPlotValues, depthPlotValues, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( xPlotValues, depthPlotValues, useLogarithmicScale );
m_plotCurve->setLineSegmentStartStopIndices( curveData()->polylineStartStopIndices() );
@ -539,24 +539,35 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
if ( !values.empty() && !measuredDepthValues.empty() )
{
bool useLogarithmicScale = false;
RimWellLogTrack* track = nullptr;
firstAncestorOfType( track );
if ( track )
{
useLogarithmicScale = track->isLogarithmicScale();
}
if ( tvDepthValues.empty() )
{
this->setValuesAndDepths( values,
this->setPropertyValuesAndDepths( values,
measuredDepthValues,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
0.0,
depthUnit,
!performDataSmoothing,
useLogarithmicScale,
xUnits );
}
else
{
this->setValuesWithMdAndTVD( values,
this->setPropertyValuesWithMdAndTVD( values,
measuredDepthValues,
tvDepthValues,
rkbDiff,
depthUnit,
!performDataSmoothing,
useLogarithmicScale,
xUnits );
}
}

View File

@ -150,7 +150,15 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvdRkbValues ) );
}
this->setValuesAndDepths( values, validDepths, rkbDiff, wellLogFile->depthUnit(), false );
bool useLogarithmicScale = false;
RimWellLogTrack* track = nullptr;
firstAncestorOfType( track );
if ( track )
{
useLogarithmicScale = track->isLogarithmicScale();
}
this->setPropertyValuesAndDepths( values, validDepths, rkbDiff, wellLogFile->depthUnit(), false, useLogarithmicScale );
QString errMsg;
if ( wellLogPlot && !this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
@ -188,8 +196,8 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
depthType = wellLogPlot->depthType();
}
m_plotCurve->setSamplesValues( this->curveData()->xPlotValues(),
this->curveData()->depthPlotValues( depthType, displayUnit ) );
m_plotCurve->setSamplesValues( this->curveData()->propertyValuesByIntervals(),
this->curveData()->depthValuesByIntervals( depthType, displayUnit ) );
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
if ( updateParentPlot )

View File

@ -451,12 +451,14 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
rkbDiff = wellPath->wellPathGeometry()->rkbDiff();
}
this->setValuesWithMdAndTVD( values,
bool useLogarithmicScale = false;
this->setPropertyValuesWithMdAndTVD( values,
measuredDepthVector,
tvDepthVector,
rkbDiff,
RiaDefines::fromEclipseUnit( unitSystem ),
false );
false,
useLogarithmicScale );
RiaDefines::DepthUnitType displayUnit = RiaDefines::DepthUnitType::UNIT_METER;
if ( wellLogPlot )
@ -468,21 +470,22 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto xValues = this->curveData()->xPlotValues();
auto yValues = this->curveData()->depthPlotValues( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
bool isLogCurve = false;
auto xValues = this->curveData()->propertyValuesByIntervals();
auto yValues =
this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
{
this->setSamplesFromXYErrorValues( xValues,
yValues,
errors,
isLogCurve,
useLogarithmicScale,
RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS );
}
else
{
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale );
}
RimWellLogTrack* wellLogTrack;
@ -513,22 +516,22 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto xValues = this->curveData()->xPlotValues();
auto xValues = this->curveData()->propertyValuesByIntervals();
auto yValues =
this->curveData()->depthPlotValues( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
bool isLogCurve = false;
this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
{
this->setSamplesFromXYErrorValues( xValues,
yValues,
errors,
isLogCurve,
useLogarithmicScale,
RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS );
}
else
{
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve );
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale );
}
}

View File

@ -119,9 +119,9 @@ void AppEnum<RimWellLogTrack::TrajectoryType>::setUp()
template <>
void AppEnum<RimWellLogTrack::FormationSource>::setUp()
{
addItem( RimWellLogTrack::CASE, "CASE", "Case" );
addItem( RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" );
setDefault( RimWellLogTrack::CASE );
addItem( RimWellLogTrack::FormationSource::CASE, "CASE", "Case" );
addItem( RimWellLogTrack::FormationSource::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" );
setDefault( RimWellLogTrack::FormationSource::CASE );
}
template <>
@ -170,8 +170,8 @@ void AppEnum<RiuPlotAnnotationTool::RegionDisplay>::setUp()
///
//--------------------------------------------------------------------------------------------------
RimWellLogTrack::RimWellLogTrack()
: m_availableXRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT )
, m_availableXRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT )
: m_availablePropertyValueRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT )
, m_availablePropertyValueRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT )
, m_availableDepthRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT )
, m_availableDepthRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT )
@ -187,8 +187,8 @@ RimWellLogTrack::RimWellLogTrack()
auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves );
reorderability->orderChanged.connect( this, &RimWellLogTrack::curveDataChanged );
CAF_PDM_InitField( &m_visibleXRangeMin, "VisibleXRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" );
CAF_PDM_InitField( &m_visibleXRangeMax, "VisibleXRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" );
CAF_PDM_InitField( &m_visiblePropertyValueRangeMin, "VisibleXRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" );
CAF_PDM_InitField( &m_visiblePropertyValueRangeMax, "VisibleXRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" );
CAF_PDM_InitField( &m_visibleDepthRangeMin, "VisibleYRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" );
CAF_PDM_InitField( &m_visibleDepthRangeMax, "VisibleYRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" );
m_visibleDepthRangeMin.uiCapability()->setUiHidden( true );
@ -196,12 +196,12 @@ RimWellLogTrack::RimWellLogTrack()
m_visibleDepthRangeMax.uiCapability()->setUiHidden( true );
m_visibleDepthRangeMax.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_isAutoScaleXEnabled, "AutoScaleX", true, "Auto Scale" );
m_isAutoScaleXEnabled.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_isAutoScalePropertyValuesEnabled, "AutoScaleX", true, "Auto Scale" );
m_isAutoScalePropertyValuesEnabled.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale" );
CAF_PDM_InitFieldNoDefault( &m_xAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" );
CAF_PDM_InitFieldNoDefault( &m_propertyValueAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" );
CAF_PDM_InitField( &m_explicitTickIntervals, "ExplicitTickIntervals", false, "Manually Set Tick Intervals" );
CAF_PDM_InitField( &m_minAndMaxTicksOnly, "MinAndMaxTicksOnly", false, "Show Ticks at Min and Max" );
@ -357,7 +357,7 @@ void RimWellLogTrack::detachAllPlotItems()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::calculateXZoomRange()
void RimWellLogTrack::calculatePropertyValueZoomRange()
{
updateStackedCurveData();
@ -373,7 +373,7 @@ void RimWellLogTrack::calculateXZoomRange()
if ( curve->isCurveVisible() )
{
visibleCurves++;
if ( curve->xValueRangeInData( &minCurveValue, &maxCurveValue ) )
if ( curve->propertyValueRangeInData( &minCurveValue, &maxCurveValue ) )
{
if ( minCurveValue < minValue )
{
@ -399,14 +399,14 @@ void RimWellLogTrack::calculateXZoomRange()
std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickInterval() );
}
m_availableXRangeMin = minValue;
m_availableXRangeMax = maxValue;
m_availablePropertyValueRangeMin = minValue;
m_availablePropertyValueRangeMax = maxValue;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::calculateYZoomRange()
void RimWellLogTrack::calculateDepthZoomRange()
{
double minDepth = HUGE_VAL;
double maxDepth = -HUGE_VAL;
@ -416,7 +416,7 @@ void RimWellLogTrack::calculateYZoomRange()
double minCurveDepth = HUGE_VAL;
double maxCurveDepth = -HUGE_VAL;
if ( curve->isCurveVisible() && curve->yValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
if ( curve->isCurveVisible() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
{
if ( minCurveDepth < minDepth )
{
@ -458,28 +458,28 @@ void RimWellLogTrack::calculateYZoomRange()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateXZoom()
void RimWellLogTrack::updatePropertyValueZoom()
{
if ( !m_plotWidget ) return;
calculateXZoomRange();
calculatePropertyValueZoomRange();
if ( m_isAutoScaleXEnabled )
if ( m_isAutoScalePropertyValuesEnabled )
{
m_visibleXRangeMin = m_availableXRangeMin;
m_visibleXRangeMax = m_availableXRangeMax;
m_visiblePropertyValueRangeMin = m_availablePropertyValueRangeMin;
m_visiblePropertyValueRangeMax = m_availablePropertyValueRangeMax;
if ( !visibleStackedCurves().empty() && !m_isLogarithmicScaleEnabled )
{
// Try to ensure we include the base line whether the values are negative or positive.
m_visibleXRangeMin = std::min( m_visibleXRangeMin(), 0.0 );
m_visibleXRangeMax = std::max( m_visibleXRangeMax(), 0.0 );
m_visiblePropertyValueRangeMin = std::min( m_visiblePropertyValueRangeMin(), 0.0 );
m_visiblePropertyValueRangeMax = std::max( m_visiblePropertyValueRangeMax(), 0.0 );
}
computeAndSetXRangeMinForLogarithmicScale();
computeAndSetPropertyValueRangeMinForLogarithmicScale();
updateEditors();
}
updateXAxisAndGridTickIntervals();
updatePropertyValueAxisAndGridTickIntervals();
// Attribute range. Fixed range where well components are positioned [-1, 1].
// Set an extended range here to allow for some label space.
@ -501,7 +501,7 @@ void RimWellLogTrack::updateXZoom()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateYZoom()
void RimWellLogTrack::updateDepthZoom()
{
if ( !m_plotWidget ) return;
@ -549,32 +549,32 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
if ( !m_explicitTickIntervals() )
{
updateXAxisAndGridTickIntervals();
updatePropertyValueAxisAndGridTickIntervals();
}
}
else if ( changedField == &m_xAxisGridVisibility || changedField == &m_majorTickInterval ||
else if ( changedField == &m_propertyValueAxisGridVisibility || changedField == &m_majorTickInterval ||
changedField == &m_minorTickInterval || changedField == &m_minAndMaxTicksOnly )
{
updateXAxisAndGridTickIntervals();
updatePropertyValueAxisAndGridTickIntervals();
}
else if ( changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax )
else if ( changedField == &m_visiblePropertyValueRangeMin || changedField == &m_visiblePropertyValueRangeMax )
{
bool emptyRange = isEmptyVisibleXRange();
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
m_isAutoScaleXEnabled = false;
m_isAutoScalePropertyValuesEnabled = false;
updateXZoom();
updatePropertyValueZoom();
m_plotWidget->scheduleReplot();
updateEditors();
}
else if ( changedField == &m_isAutoScaleXEnabled )
else if ( changedField == &m_isAutoScalePropertyValuesEnabled )
{
if ( m_isAutoScaleXEnabled() )
if ( m_isAutoScalePropertyValuesEnabled() )
{
updateXZoom();
updatePropertyValueZoom();
m_plotWidget->scheduleReplot();
}
}
@ -587,14 +587,14 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
m_explicitTickIntervals.uiCapability()->setUiHidden( m_isLogarithmicScaleEnabled() );
updateXZoom();
updatePropertyValueZoom();
loadDataAndUpdate();
}
else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay ||
changedField == &m_formationSource || changedField == &m_colorShadingTransparency ||
changedField == &m_colorShadingLegend )
{
if ( changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER )
if ( changedField == &m_formationSource && m_formationSource == FormationSource::WELL_PICK_FILTER )
{
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations( &wellPaths );
@ -749,15 +749,15 @@ void RimWellLogTrack::curveStackingChanged( const caf::SignalEmitter* emitter, b
{
updateStackedCurveData();
m_isAutoScaleXEnabled = true;
updateXZoom();
m_isAutoScalePropertyValuesEnabled = true;
updatePropertyValueZoom();
m_plotWidget->scheduleReplot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateXAxisAndGridTickIntervals()
void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals()
{
if ( !m_plotWidget ) return;
@ -788,16 +788,16 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals()
return std::ceil( value * factor ) / factor;
};
auto div = QwtScaleDiv( m_visibleXRangeMin(), m_visibleXRangeMax() );
auto div = QwtScaleDiv( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
QList<double> majorTicks;
auto min = roundToDigits( m_visibleXRangeMin(), 2, false );
auto max = roundToDigits( m_visibleXRangeMax(), 2, true );
auto min = roundToDigits( m_visiblePropertyValueRangeMin(), 2, false );
auto max = roundToDigits( m_visiblePropertyValueRangeMax(), 2, true );
if ( min == max )
{
min = roundToDigits( m_visibleXRangeMin(), 3, false );
max = roundToDigits( m_visibleXRangeMax(), 3, true );
min = roundToDigits( m_visiblePropertyValueRangeMin(), 3, false );
max = roundToDigits( m_visiblePropertyValueRangeMax(), 3, true );
}
majorTicks.push_back( min );
@ -812,20 +812,20 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals()
m_plotWidget->setMajorAndMinorTickIntervals( getValueAxis(),
m_majorTickInterval(),
m_minorTickInterval(),
m_visibleXRangeMin(),
m_visibleXRangeMax() );
m_visiblePropertyValueRangeMin(),
m_visiblePropertyValueRangeMax() );
}
else
{
int majorTickIntervals = 5;
int minorTickIntervals = 10;
m_plotWidget->setAutoTickIntervalCounts( getValueAxis(), majorTickIntervals, minorTickIntervals );
m_plotWidget->setAxisRange( getValueAxis(), m_visibleXRangeMin, m_visibleXRangeMax );
m_plotWidget->setAxisRange( getValueAxis(), m_visiblePropertyValueRangeMin, m_visiblePropertyValueRangeMax );
}
m_plotWidget->enableGridLines( getValueAxis(),
m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MAJOR,
m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MINOR );
m_propertyValueAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MAJOR,
m_propertyValueAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MINOR );
}
RimDepthTrackPlot* wellLogPlot = nullptr;
@ -887,10 +887,10 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
if ( curveNames.size() == 1 )
{
curveDepths = curveData->depthPlotValues( depthType, depthUnit );
curveDepths = curveData->depthValuesByIntervals( depthType, depthUnit );
}
std::vector<double> xPlotValues = curveData->xPlotValues();
std::vector<double> xPlotValues = curveData->propertyValuesByIntervals();
if ( xPlotValues.empty() )
{
curveNames.pop_back();
@ -907,7 +907,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
foundNonMatchingDepths = true;
}
std::vector<double> depths = curveData->depthPlotValues( depthType, depthUnit );
std::vector<double> depths = curveData->depthValuesByIntervals( depthType, depthUnit );
curveMerger.addCurveData( depths, xPlotValues );
curvesPlotXValues.push_back( xPlotValues );
@ -1011,8 +1011,8 @@ void RimWellLogTrack::updateZoomFromParentPlot()
auto [xIntervalMin, xIntervalMax] = m_plotWidget->axisRange( getValueAxis() );
auto [depthIntervalMin, depthIntervalMax] = m_plotWidget->axisRange( getDepthAxis() );
m_visibleXRangeMin = xIntervalMin;
m_visibleXRangeMax = xIntervalMax;
m_visiblePropertyValueRangeMin = xIntervalMin;
m_visiblePropertyValueRangeMax = xIntervalMax;
m_visibleDepthRangeMin = depthIntervalMin;
m_visibleDepthRangeMax = depthIntervalMax;
}
@ -1037,7 +1037,7 @@ void RimWellLogTrack::onAxisSelected( int axis, bool toggle )
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateAxes()
{
updateXZoom();
updatePropertyValueZoom();
}
//--------------------------------------------------------------------------------------------------
@ -1172,11 +1172,11 @@ void RimWellLogTrack::deleteAllCurves()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::availableXAxisRange( double* minX, double* maxX )
void RimWellLogTrack::availablePropertyValueRange( double* minX, double* maxX )
{
calculateXZoomRange();
*minX = m_availableXRangeMin;
*maxX = m_availableXRangeMax;
calculatePropertyValueZoomRange();
*minX = m_availablePropertyValueRangeMin;
*maxX = m_availablePropertyValueRangeMax;
}
//--------------------------------------------------------------------------------------------------
@ -1184,7 +1184,7 @@ void RimWellLogTrack::availableXAxisRange( double* minX, double* maxX )
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::availableDepthRange( double* minimumDepth, double* maximumDepth )
{
calculateYZoomRange();
calculateDepthZoomRange();
*minimumDepth = m_availableDepthRangeMin;
*maximumDepth = m_availableDepthRangeMax;
}
@ -1192,11 +1192,11 @@ void RimWellLogTrack::availableDepthRange( double* minimumDepth, double* maximum
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::visibleXAxisRange( double* minX, double* maxX )
void RimWellLogTrack::visiblePropertyValueRange( double* minX, double* maxX )
{
CAF_ASSERT( minX && maxX );
*minX = m_visibleXRangeMin;
*maxX = m_visibleXRangeMax;
*minX = m_visiblePropertyValueRangeMin;
*maxX = m_visiblePropertyValueRangeMax;
}
//--------------------------------------------------------------------------------------------------
@ -1214,8 +1214,8 @@ void RimWellLogTrack::visibleDepthRange( double* minDepth, double* maxDepth )
//--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::isEmptyVisibleXRange() const
{
return std::abs( m_visibleXRangeMax() - m_visibleXRangeMin ) <
1.0e-6 * std::max( 1.0, std::max( m_visibleXRangeMax(), m_visibleXRangeMin() ) );
return std::abs( m_visiblePropertyValueRangeMax() - m_visiblePropertyValueRangeMin ) <
1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) );
}
//--------------------------------------------------------------------------------------------------
@ -1228,7 +1228,7 @@ void RimWellLogTrack::onLoadDataAndUpdate()
if ( wellLogPlot && m_plotWidget )
{
m_plotWidget->setAxisTitleText( getValueAxis(), m_xAxisTitle );
m_plotWidget->setAxisTitleText( getValueAxis(), m_propertyValueAxisTitle );
m_plotWidget->setAxisTitleText( getDepthAxis(), wellLogPlot->depthAxisTitle() );
}
@ -1259,16 +1259,16 @@ void RimWellLogTrack::onLoadDataAndUpdate()
this->updateAxisScaleEngine();
this->updateRegionAnnotationsOnPlot();
this->updateXZoom();
this->updatePropertyValueZoom();
}
this->updateXAxisAndGridTickIntervals();
this->updatePropertyValueAxisAndGridTickIntervals();
m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() );
bool emptyRange = isEmptyVisibleXRange();
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
updateLegend();
}
@ -1327,15 +1327,15 @@ void RimWellLogTrack::setAndUpdateSimWellFormationNamesData( RimCase* rimCase, c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAutoScaleXEnabled( bool enabled )
void RimWellLogTrack::setAutoScalePropertyValuesEnabled( bool enabled )
{
m_isAutoScaleXEnabled = enabled;
m_isAutoScalePropertyValuesEnabled = enabled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAutoScaleYEnabled( bool enabled )
void RimWellLogTrack::setAutoScaleDepthValuesEnabled( bool enabled )
{
if ( enabled )
{
@ -1347,41 +1347,42 @@ void RimWellLogTrack::setAutoScaleYEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAutoScaleXIfNecessary()
void RimWellLogTrack::setAutoScalePropertyValuesIfNecessary()
{
// Avoid resetting if visible range has set to empty by user
bool emptyRange = isEmptyVisibleXRange();
if ( !m_isAutoScaleXEnabled && emptyRange ) return;
if ( !m_isAutoScalePropertyValuesEnabled && emptyRange ) return;
const double eps = 1.0e-8;
calculateXZoomRange();
calculatePropertyValueZoomRange();
double maxRange = std::max( m_visibleXRangeMax - m_visibleXRangeMin, m_availableXRangeMax - m_availableXRangeMin );
double maxRange = std::max( m_visiblePropertyValueRangeMax - m_visiblePropertyValueRangeMin,
m_availablePropertyValueRangeMax - m_availablePropertyValueRangeMin );
double maxLow = std::max( m_visibleXRangeMin(), m_availableXRangeMin );
double minHigh = std::min( m_visibleXRangeMax(), m_availableXRangeMax );
double maxLow = std::max( m_visiblePropertyValueRangeMin(), m_availablePropertyValueRangeMin );
double minHigh = std::min( m_visiblePropertyValueRangeMax(), m_availablePropertyValueRangeMax );
double overlap = minHigh - maxLow;
if ( maxRange < eps || overlap < eps * maxRange )
{
setAutoScaleXEnabled( true );
setAutoScalePropertyValuesEnabled( true );
}
updateXZoom();
updatePropertyValueZoom();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setXAxisTitle( const QString& text )
void RimWellLogTrack::setPropertyValueAxisTitle( const QString& text )
{
m_xAxisTitle = text;
m_propertyValueAxisTitle = text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogTrack::yAxisTitle() const
QString RimWellLogTrack::depthAxisTitle() const
{
RimDepthTrackPlot* parent;
this->firstAncestorOrThisOfType( parent );
@ -1581,17 +1582,17 @@ void RimWellLogTrack::updateEditors()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setVisibleXRange( double minValue, double maxValue )
void RimWellLogTrack::setVisiblePropertyValueRange( double minValue, double maxValue )
{
this->setAutoScaleXEnabled( false );
m_visibleXRangeMin = minValue;
m_visibleXRangeMax = maxValue;
this->setAutoScalePropertyValuesEnabled( false );
m_visiblePropertyValueRangeMin = minValue;
m_visiblePropertyValueRangeMax = maxValue;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setVisibleYRange( double minValue, double maxValue )
void RimWellLogTrack::setVisibleDepthRange( double minValue, double maxValue )
{
m_visibleDepthRangeMin = minValue;
m_visibleDepthRangeMax = maxValue;
@ -1602,8 +1603,8 @@ void RimWellLogTrack::setVisibleYRange( double minValue, double maxValue )
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateZoomInParentPlot()
{
updateXZoom();
updateYZoom();
updatePropertyValueZoom();
updateDepthZoom();
m_plotWidget->scheduleReplot();
}
@ -1628,9 +1629,9 @@ void RimWellLogTrack::setMinAndMaxTicksOnly( bool enable )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines )
void RimWellLogTrack::setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines )
{
m_xAxisGridVisibility = gridLines;
m_propertyValueAxisGridVisibility = gridLines;
}
//--------------------------------------------------------------------------------------------------
@ -1799,8 +1800,8 @@ QImage RimWellLogTrack::snapshotWindowContent()
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::zoomAll()
{
setAutoScaleXEnabled( true );
setAutoScaleYEnabled( true );
setAutoScalePropertyValuesEnabled( true );
setAutoScaleDepthValuesEnabled( true );
updateZoomInParentPlot();
}
@ -1852,10 +1853,10 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
}
else
{
m_formationSource = CASE;
m_formationSource = FormationSource::CASE;
}
if ( m_formationSource() == CASE )
if ( m_formationSource() == FormationSource::CASE )
{
annotationGroup->add( &m_formationCase );
@ -1879,7 +1880,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
m_formationBranchIndex );
}
}
else if ( m_formationSource() == WELL_PICK_FILTER )
else if ( m_formationSource() == FormationSource::WELL_PICK_FILTER )
{
annotationGroup->add( &m_formationWellPathForSourceWellPath );
if ( m_formationWellPathForSourceWellPath() )
@ -1922,9 +1923,9 @@ void RimWellLogTrack::initAfterRead()
m_resultDefinition->setEclipseCase( dynamic_cast<RimEclipseCase*>( eclipseCase ) );
}
if ( m_xAxisGridVisibility() == RimWellLogPlot::AXIS_GRID_MINOR )
if ( m_propertyValueAxisGridVisibility() == RimWellLogPlot::AXIS_GRID_MINOR )
{
m_xAxisGridVisibility = RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR;
m_propertyValueAxisGridVisibility = RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR;
}
for ( auto curve : m_curves )
@ -2115,9 +2116,9 @@ void RimWellLogTrack::connectCurveSignals( RimWellLogCurve* curve )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale()
void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
{
if ( m_isAutoScaleXEnabled && m_isLogarithmicScaleEnabled )
if ( m_isAutoScalePropertyValuesEnabled && m_isLogarithmicScaleEnabled )
{
double pos = HUGE_VAL;
double neg = -HUGE_VAL;
@ -2126,13 +2127,15 @@ void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale()
{
if ( m_curves[cIdx]->isCurveVisible() && m_curves[cIdx]->curveData() )
{
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->xPlotValues(), pos, neg );
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(),
pos,
neg );
}
}
if ( pos != HUGE_VAL )
{
m_visibleXRangeMin = pos;
m_visiblePropertyValueRangeMin = pos;
}
}
}
@ -2145,7 +2148,7 @@ void RimWellLogTrack::setLogarithmicScale( bool enable )
m_isLogarithmicScaleEnabled = enable;
updateAxisScaleEngine();
computeAndSetXRangeMinForLogarithmicScale();
computeAndSetPropertyValueRangeMinForLogarithmicScale();
}
//--------------------------------------------------------------------------------------------------
@ -2217,11 +2220,11 @@ void RimWellLogTrack::uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrder
formationGroup->add( &m_regionAnnotationType );
formationGroup->add( &m_regionAnnotationDisplay );
formationGroup->add( &m_formationSource );
if ( m_formationSource == CASE )
if ( m_formationSource == FormationSource::CASE )
{
formationGroup->add( &m_formationCase );
}
if ( m_formationSource == WELL_PICK_FILTER )
if ( m_formationSource == FormationSource::WELL_PICK_FILTER )
{
if ( m_formationWellPathForSourceWellPath() && m_formationWellPathForSourceWellPath()->hasFormations() )
{
@ -2238,9 +2241,9 @@ void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering
{
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "X Axis Settings" );
gridGroup->add( &m_isLogarithmicScaleEnabled );
gridGroup->add( &m_visibleXRangeMin );
gridGroup->add( &m_visibleXRangeMax );
gridGroup->add( &m_xAxisGridVisibility );
gridGroup->add( &m_visiblePropertyValueRangeMin );
gridGroup->add( &m_visiblePropertyValueRangeMax );
gridGroup->add( &m_propertyValueAxisGridVisibility );
gridGroup->add( &m_minAndMaxTicksOnly );
// TODO Revisit if these settings are required
@ -2490,7 +2493,7 @@ void RimWellLogTrack::updateStackedCurveData()
for ( auto curve : stackedCurvesInGroup )
{
auto interpolatedCurveValues = curve->curveData()->calculateResampledCurveData( depthType, allDepthValues );
auto xValues = interpolatedCurveValues->xValues();
auto xValues = interpolatedCurveValues->propertyValues();
for ( size_t i = 0; i < xValues.size(); ++i )
{
if ( xValues[i] != HUGE_VAL )
@ -2500,8 +2503,15 @@ void RimWellLogTrack::updateStackedCurveData()
}
RigWellLogCurveData tempCurveData;
tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, 0.0, displayUnit, false );
auto plotDepthValues = tempCurveData.depthPlotValues( depthType, displayUnit );
tempCurveData.setValuesAndDepths( allStackedValues,
allDepthValues,
depthType,
0.0,
displayUnit,
false,
m_isLogarithmicScaleEnabled );
auto plotDepthValues = tempCurveData.depthValuesByIntervals( depthType, displayUnit );
auto polyLineStartStopIndices = tempCurveData.polylineStartStopIndices();
curve->setOverrideCurveData( allStackedValues, plotDepthValues, polyLineStartStopIndices );
@ -2583,7 +2593,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit();
RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit();
if ( m_formationSource() == WELL_PICK_FILTER )
if ( m_formationSource() == FormationSource::WELL_PICK_FILTER )
{
if ( m_formationWellPathForSourceWellPath == nullptr ) return;
@ -2676,7 +2686,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
if ( geoMechWellLogExtractor )
{
// Attach water and rock base formations
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const std::vector<std::pair<double, double>> waterAndRockIntervals =
@ -2697,7 +2708,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
{ Qt::SolidPattern, Qt::Dense6Pattern } );
}
if ( m_formationSource == CASE && m_plotWidget )
if ( m_formationSource == FormationSource::CASE && m_plotWidget )
{
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
@ -2724,7 +2735,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
&formationNamesToPlot,
&yValues );
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
std::vector<std::pair<double, double>> convertedYValues =
RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
@ -2785,9 +2797,10 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
CurveSamplingPointData curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
// Attach water and rock base formations
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
if ( m_formationSource == CASE )
if ( m_formationSource == FormationSource::CASE )
{
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
@ -2896,7 +2909,8 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, dynamic_cast<RimGeoMechCase*>( geoMechCase ) );
if ( !geoMechWellLogExtractor ) return;
std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
CurveSamplingPointData curveData;
curveData.md = geoMechWellLogExtractor->cellIntersectionMDs();
@ -3098,7 +3112,7 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
attributePlotObject->setParentPlotNoReplot( m_plotWidget->qwtPlot() );
}
}
updateXZoom();
updatePropertyValueZoom();
}
//--------------------------------------------------------------------------------------------------
@ -3127,7 +3141,7 @@ void RimWellLogTrack::doUpdateLayout()
void RimWellLogTrack::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
setAutoScaleXEnabled( true );
setAutoScalePropertyValuesEnabled( true );
updateZoomInParentPlot();
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateWellLogPlotToolBar();

View File

@ -111,8 +111,8 @@ public:
size_t curveIndex( RimWellLogCurve* curve );
size_t curveCount() { return m_curves.size(); }
void setXAxisTitle( const QString& text );
QString yAxisTitle() const;
void setPropertyValueAxisTitle( const QString& text );
QString depthAxisTitle() const;
void setFormationWellPath( RimWellPath* wellPath );
RimWellPath* formationWellPath() const;
@ -139,18 +139,18 @@ public:
bool useBranchDetection );
void setAndUpdateSimWellFormationNamesData( RimCase* rimCase, const QString& simWellName );
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScaleXIfNecessary();
void setAutoScalePropertyValuesEnabled( bool enabled ) override;
void setAutoScaleDepthValuesEnabled( bool enabled ) override;
void setAutoScalePropertyValuesIfNecessary();
void availableXAxisRange( double* minX, double* maxX );
void availablePropertyValueRange( double* minX, double* maxX );
void availableDepthRange( double* minimumDepth, double* maximumDepth );
void visibleXAxisRange( double* minX, double* maxX );
void visiblePropertyValueRange( double* minX, double* maxX );
void visibleDepthRange( double* minimumDepth, double* maximumDepth );
void setVisibleXRange( double minValue, double maxValue );
void setVisibleYRange( double minValue, double maxValue );
void setVisiblePropertyValueRange( double minValue, double maxValue );
void setVisibleDepthRange( double minValue, double maxValue );
void updateZoomInParentPlot() override;
void updateZoomFromParentPlot() override;
@ -161,7 +161,7 @@ public:
void setTickIntervals( double majorTickInterval, double minorTickInterval );
void setMinAndMaxTicksOnly( bool enable );
void setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines );
void setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines );
void setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType );
void setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay );
@ -201,7 +201,7 @@ public:
void uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering );
void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly );
void updateXAxisAndGridTickIntervals();
void updatePropertyValueAxisAndGridTickIntervals();
void updateLegend() override;
@ -244,11 +244,11 @@ private:
void cleanupBeforeClose();
void detachAllPlotItems();
void calculateXZoomRange();
void calculateYZoomRange();
void calculatePropertyValueZoomRange();
void calculateDepthZoomRange();
void updateXZoom();
void updateYZoom();
void updatePropertyValueZoom();
void updateDepthZoom();
RiuPlotAxis getDepthAxis() const;
RiuPlotAxis getValueAxis() const;
@ -272,7 +272,7 @@ private:
caf::PdmFieldHandle* userDescriptionField() override;
void computeAndSetXRangeMinForLogarithmicScale();
void computeAndSetPropertyValueRangeMinForLogarithmicScale();
static void simWellOptionItems( QList<caf::PdmOptionItemInfo>* options, RimCase* eclCase );
@ -308,19 +308,19 @@ private:
bool isEmptyVisibleXRange() const;
private:
QString m_xAxisTitle;
QString m_propertyValueAxisTitle;
caf::PdmField<QString> m_description;
caf::PdmChildArrayField<RimWellLogCurve*> m_curves;
caf::PdmField<double> m_visibleXRangeMin;
caf::PdmField<double> m_visibleXRangeMax;
caf::PdmField<double> m_visiblePropertyValueRangeMin;
caf::PdmField<double> m_visiblePropertyValueRangeMax;
caf::PdmField<double> m_visibleDepthRangeMin;
caf::PdmField<double> m_visibleDepthRangeMax;
caf::PdmField<bool> m_isAutoScaleXEnabled;
caf::PdmField<bool> m_isAutoScalePropertyValuesEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_xAxisGridVisibility;
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_propertyValueAxisGridVisibility;
caf::PdmField<bool> m_explicitTickIntervals;
caf::PdmField<bool> m_minAndMaxTicksOnly;
@ -365,8 +365,8 @@ private:
QPointer<RiuWellLogTrack> m_plotWidget;
std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool;
double m_availableXRangeMin;
double m_availableXRangeMax;
double m_availablePropertyValueRangeMin;
double m_availablePropertyValueRangeMax;
double m_availableDepthRangeMin;
double m_availableDepthRangeMax;
};

View File

@ -89,7 +89,7 @@ void RimWellMeasurementCollection::deleteAllEmptyCurves()
for ( auto curve : measurementCurves )
{
if ( curve->curveData()->xValues().empty() )
if ( curve->curveData()->propertyValues().empty() )
{
RimWellLogTrack* track = nullptr;
curve->firstAncestorOrThisOfTypeAsserted( track );

View File

@ -116,21 +116,25 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
-rigWellPath->interpolatedPointAlongWellPath( measuredDepthValue ).z() );
}
this->setValuesWithMdAndTVD( values,
bool useLogarithmicScale = false;
this->setPropertyValuesWithMdAndTVD( values,
measuredDepthValues,
trueVerticalDepthValues,
m_wellPath->wellPathGeometry()->rkbDiff(),
RiaDefines::DepthUnitType::UNIT_METER,
false );
false,
useLogarithmicScale );
}
else
{
this->setValuesAndDepths( values,
bool useLogarithmicScale = false;
this->setPropertyValuesAndDepths( values,
measuredDepthValues,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
0.0,
RiaDefines::DepthUnitType::UNIT_METER,
false );
false,
useLogarithmicScale );
}
}
@ -156,10 +160,10 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
depthType = wellLogPlot->depthType();
}
bool isLogCurve = false;
m_plotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
this->curveData()->depthPlotValues( depthType, displayUnit ),
isLogCurve );
bool useLogarithmicScale = false;
m_plotCurve->setSamplesFromXValuesAndYValues( this->curveData()->propertyValuesByIntervals(),
this->curveData()->depthValuesByIntervals( depthType, displayUnit ),
useLogarithmicScale );
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
}

View File

@ -74,9 +74,9 @@ RimWellLogTrack* RimcWellLogPlot_newWellLogTrack::createWellLogTrack( RimWellLog
plotTrack->setLegendsVisible( true );
plotTrack->setPlotTitleVisible( true );
plotTrack->setShowWindow( true );
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
plotTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
plotTrack->setShowRegionLabels( true );
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setAutoScalePropertyValuesEnabled( true );
plotTrack->updateConnectedEditors();
wellLogPlot->setShowWindow( true );
wellLogPlot->updateConnectedEditors();

View File

@ -100,9 +100,9 @@ RimWellLogExtractionCurve*
curve->updateConnectedEditors();
wellLogTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
wellLogTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
wellLogTrack->setShowRegionLabels( true );
wellLogTrack->setAutoScaleXEnabled( true );
wellLogTrack->setAutoScalePropertyValuesEnabled( true );
wellLogTrack->updateConnectedEditors();
wellLogTrack->setShowWindow( true );

View File

@ -60,9 +60,9 @@ public:
{
CVF_ASSERT( lasFile );
if ( !m_curveData->xValues().empty() )
if ( !m_curveData->propertyValues().empty() )
{
std::vector<double> wellLogValues = m_curveData->xValues( QString::fromStdString( m_unit ) );
std::vector<double> wellLogValues = m_curveData->propertyValues( QString::fromStdString( m_unit ) );
for ( size_t vIdx = 0; vIdx < wellLogValues.size(); vIdx++ )
{
double value = wellLogValues[vIdx];
@ -119,7 +119,7 @@ public:
{
m_logCurveData.push_back( SingleChannelData( channelName, unit, comment, curveData ) );
for ( double xValue : curveData->xValues() )
for ( double xValue : curveData->propertyValues() )
{
if ( xValue < m_minimumCurveValue )
{
@ -536,7 +536,7 @@ void RigLasFileExporter::appendLasFileDescriptions( const std::vector<RimWellLog
{
curveData = curve->curveData();
}
QString units = curve->curveData()->xUnits();
QString units = curve->curveData()->propertyValueUnit();
if ( convertCurveUnits || units == RiaWellLogUnitTools<double>::barX100UnitString() )
{

View File

@ -31,11 +31,13 @@
///
//--------------------------------------------------------------------------------------------------
RigWellLogCurveData::RigWellLogCurveData()
: m_isExtractionCurve( false )
, m_rkbDiff( 0.0 )
, m_useLogarithmicScale( false )
, m_depthUnit( RiaDefines::DepthUnitType::UNIT_METER )
, m_propertyValueUnitString( RiaWellLogUnitTools<double>::noUnitString() )
{
m_isExtractionCurve = false;
m_rkbDiff = 0.0;
m_depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
m_xUnitString = RiaWellLogUnitTools<double>::noUnitString();
}
//--------------------------------------------------------------------------------------------------
@ -61,14 +63,16 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
bool isExtractionCurve,
bool useLogarithmicScale )
{
CVF_ASSERT( xValues.size() == depths.size() );
m_xValues = xValues;
m_propertyValues = xValues;
m_depths[depthType] = depths;
m_depthUnit = depthUnit;
m_rkbDiff = rkbDiff;
m_useLogarithmicScale = useLogarithmicScale;
// Disable depth value filtering is intended to be used for
// extraction curve data
@ -84,17 +88,19 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>&
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
bool isExtractionCurve,
bool useLogarithmicScale )
{
for ( auto it = depths.begin(); it != depths.end(); ++it )
{
CVF_ASSERT( xValues.size() == it->second.size() );
}
m_xValues = xValues;
m_propertyValues = xValues;
m_depths = depths;
m_depthUnit = depthUnit;
m_rkbDiff = rkbDiff;
m_useLogarithmicScale = useLogarithmicScale;
// Disable depth value filtering is intended to be used for
// extraction curve data
@ -106,43 +112,43 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellLogCurveData::setXUnits( const QString& xUnitString )
void RigWellLogCurveData::setPropertyValueUnit( const QString& propertyValueUnitString )
{
m_xUnitString = xUnitString;
m_propertyValueUnitString = propertyValueUnitString;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::xValues() const
std::vector<double> RigWellLogCurveData::propertyValues() const
{
return m_xValues;
return m_propertyValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::xValues( const QString& units ) const
std::vector<double> RigWellLogCurveData::propertyValues( const QString& units ) const
{
std::vector<double> convertedValues;
if ( units != m_xUnitString &&
if ( units != m_propertyValueUnitString &&
RiaWellLogUnitTools<double>::convertValues( depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ),
m_xValues,
m_propertyValues,
&convertedValues,
m_xUnitString,
m_propertyValueUnitString,
units ) )
{
return convertedValues;
}
return m_xValues;
return m_propertyValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigWellLogCurveData::xUnits() const
QString RigWellLogCurveData::propertyValueUnit() const
{
return m_xUnitString;
return m_propertyValueUnitString;
}
//--------------------------------------------------------------------------------------------------
@ -212,10 +218,10 @@ std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::xPlotValues() const
std::vector<double> RigWellLogCurveData::propertyValuesByIntervals() const
{
std::vector<double> filteredValues;
RiaCurveDataTools::getValuesByIntervals( m_xValues, m_intervalsOfContinousValidValues, &filteredValues );
RiaCurveDataTools::getValuesByIntervals( m_propertyValues, m_intervalsOfContinousValidValues, &filteredValues );
return filteredValues;
}
@ -223,7 +229,7 @@ std::vector<double> RigWellLogCurveData::xPlotValues() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::depthPlotValues( RiaDefines::DepthTypeEnum depthType,
std::vector<double> RigWellLogCurveData::depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthUnitType destinationDepthUnit ) const
{
std::vector<double> filteredValues;
@ -279,8 +285,8 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
{
double segmentStartMd = mdIt->second[segmentStartIdx];
double segmentEndMd = mdIt->second[segmentStartIdx + 1];
double segmentStartX = m_xValues[segmentStartIdx];
double segmentEndX = m_xValues[segmentStartIdx + 1];
double segmentStartX = m_propertyValues[segmentStartIdx];
double segmentEndX = m_propertyValues[segmentStartIdx + 1];
double segmentStartTvd = 0.0;
double segmentEndTvd = 0.0;
@ -318,7 +324,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths =
{ { RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvDepths },
{ RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths } };
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true );
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale );
}
else
{
@ -327,7 +333,8 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
0.0,
m_depthUnit,
m_isExtractionCurve );
m_isExtractionCurve,
m_useLogarithmicScale );
}
return reSampledData;
@ -346,8 +353,8 @@ void RigWellLogCurveData::interpolateSegment( RiaDefines::DepthTypeEnum resampli
double depth0 = depthIt->second[firstIndex];
double depth1 = depthIt->second[secondIndex];
double x0 = m_xValues[firstIndex];
double x1 = m_xValues[secondIndex];
double x0 = m_propertyValues[firstIndex];
double x1 = m_propertyValues[secondIndex];
double slope = 0.0;
if ( std::fabs( depth1 - depth0 ) > eps )
{
@ -412,7 +419,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
if ( std::fabs( depthIt->second[segmentStartIdx] - depth ) < eps ) // already have this depth point,
// reuse it
{
xValues.push_back( m_xValues[segmentStartIdx] );
xValues.push_back( m_propertyValues[segmentStartIdx] );
// Copy all depth types for this segment
for ( auto depthTypeValuesPair : m_depths )
{
@ -458,7 +465,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
CAF_ASSERT( foundPoint );
}
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true );
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale );
return reSampledData;
}
@ -468,7 +475,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
void RigWellLogCurveData::calculateIntervalsOfContinousValidValues()
{
std::vector<std::pair<size_t, size_t>> intervalsOfValidValues =
RiaCurveDataTools::calculateIntervalsOfValidValues( m_xValues, false );
RiaCurveDataTools::calculateIntervalsOfValidValues( m_propertyValues, m_useLogarithmicScale );
m_intervalsOfContinousValidValues.clear();
@ -557,7 +564,7 @@ bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthTy
double minValue = HUGE_VAL;
double maxValue = -HUGE_VAL;
std::vector<double> depthValues = depthPlotValues( depthType, depthUnit );
std::vector<double> depthValues = depthValuesByIntervals( depthType, depthUnit );
for ( size_t vIdx = 0; vIdx < depthValues.size(); vIdx++ )
{
double value = depthValues[vIdx];

View File

@ -43,22 +43,26 @@ public:
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
void setValuesAndDepths( const std::vector<double>& xValues,
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setValuesAndDepths( const std::vector<double>& xValues,
bool isExtractionCurve,
bool useLogarithmicScale );
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setXUnits( const QString& xUnitString );
bool isExtractionCurve,
bool useLogarithmicScale );
std::vector<double> xValues() const;
std::vector<double> xValues( const QString& units ) const;
QString xUnits() const;
void setPropertyValueUnit( const QString& propertyValueUnitString );
std::vector<double> propertyValues() const;
std::vector<double> propertyValues( const QString& units ) const;
QString propertyValueUnit() const;
std::vector<double> depths( RiaDefines::DepthTypeEnum depthType ) const;
@ -71,8 +75,8 @@ public:
RiaDefines::DepthUnitType depthUnit() const;
std::vector<double> xPlotValues() const;
std::vector<double> depthPlotValues( RiaDefines::DepthTypeEnum depthType,
std::vector<double> propertyValuesByIntervals() const;
std::vector<double> depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::vector<std::pair<size_t, size_t>> polylineStartStopIndices() const;
@ -95,13 +99,14 @@ private:
std::vector<std::pair<size_t, size_t>>* intervals );
private:
std::vector<double> m_xValues;
std::vector<double> m_propertyValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> m_depths;
bool m_isExtractionCurve;
double m_rkbDiff;
bool m_useLogarithmicScale;
std::vector<std::pair<size_t, size_t>> m_intervalsOfContinousValidValues;
RiaDefines::DepthUnitType m_depthUnit;
QString m_xUnitString;
QString m_propertyValueUnitString;
};

View File

@ -18,7 +18,8 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffInvalidValAtEndsOfVector )
values.push_back( 3.0 );
values.push_back( HUGE_VAL );
auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, false );
bool includePositiveValuesOnly = false;
auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly );
EXPECT_EQ( 1, static_cast<int>( valuesIntervals.size() ) );
EXPECT_EQ( 2, static_cast<int>( valuesIntervals[0].first ) );
@ -40,7 +41,8 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffHugeValAtEndsAndInteriorOfVecto
values.push_back( 3.0 );
values.push_back( HUGE_VAL );
auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, false );
bool includePositiveValuesOnly = false;
auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly );
EXPECT_EQ( 2, static_cast<int>( valuesIntervals.size() ) );
EXPECT_EQ( 2, static_cast<int>( valuesIntervals[0].first ) );
@ -48,3 +50,31 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffHugeValAtEndsAndInteriorOfVecto
EXPECT_EQ( 5, static_cast<int>( valuesIntervals[1].first ) );
EXPECT_EQ( 6, static_cast<int>( valuesIntervals[1].second ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RimWellLogExtractionCurveImplTest, PositiveValuesOnly )
{
std::vector<double> values;
values.push_back( HUGE_VAL );
values.push_back( HUGE_VAL );
values.push_back( -1.0 );
values.push_back( 0.0 );
values.push_back( 0.1 );
values.push_back( 0.2 );
values.push_back( -1.0 );
values.push_back( HUGE_VAL );
values.push_back( 2.0 );
values.push_back( 3.0 );
values.push_back( HUGE_VAL );
bool includePositiveValuesOnly = true;
auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly );
EXPECT_EQ( 2, static_cast<int>( valuesIntervals.size() ) );
EXPECT_EQ( 4, static_cast<int>( valuesIntervals[0].first ) );
EXPECT_EQ( 5, static_cast<int>( valuesIntervals[0].second ) );
EXPECT_EQ( 8, static_cast<int>( valuesIntervals[1].first ) );
EXPECT_EQ( 9, static_cast<int>( valuesIntervals[1].second ) );
}

View File

@ -239,8 +239,8 @@ void RiuFlowCharacteristicsPlot::addFlowCapStorageCapCurve( const QDateTime&
RiuQwtPlotCurve* plotCurve =
createEmptyCurve( m_flowCapVsStorageCapPlot, dateTime.toString(), m_dateToColorMap[dateTime] );
bool isLogCurve = false;
plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, isLogCurve );
bool useLogarithmicScale = false;
plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, useLogarithmicScale );
m_flowCapVsStorageCapPlot->replot();
}
@ -254,8 +254,8 @@ void RiuFlowCharacteristicsPlot::addSweepEfficiencyCurve( const QDateTime&
CVF_ASSERT( !m_dateToColorMap.empty() );
RiuQwtPlotCurve* plotCurve = createEmptyCurve( m_sweepEffPlot, dateTime.toString(), m_dateToColorMap[dateTime] );
bool isLogCurve = false;
plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, isLogCurve );
bool useLogarithmicScale = false;
plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, useLogarithmicScale );
m_sweepEffPlot->replot();
}

View File

@ -49,7 +49,7 @@ RiuPlotCurve::~RiuPlotCurve()
//--------------------------------------------------------------------------------------------------
void RiuPlotCurve::setSamplesValues( const std::vector<double>& xValues, const std::vector<double>& yValues )
{
setSamplesInPlot( xValues, yValues, static_cast<int>( xValues.size() ) );
setSamplesInPlot( xValues, yValues );
}
//--------------------------------------------------------------------------------------------------
@ -57,9 +57,9 @@ void RiuPlotCurve::setSamplesValues( const std::vector<double>& xValues, const s
//--------------------------------------------------------------------------------------------------
void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
}
//--------------------------------------------------------------------------------------------------
@ -67,11 +67,11 @@ void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector<double>& x
//--------------------------------------------------------------------------------------------------
void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
auto xValues = RiuPlotCurve::fromQDateTime( dateTimes );
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
}
//--------------------------------------------------------------------------------------------------
@ -79,11 +79,11 @@ void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>&
//--------------------------------------------------------------------------------------------------
void RiuPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
auto xValues = RiuPlotCurve::fromTime_t( dateTimes );
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
}
//--------------------------------------------------------------------------------------------------
@ -123,9 +123,9 @@ void RiuPlotCurve::setBlackAndWhiteLegendIcon( bool blackAndWhite )
//--------------------------------------------------------------------------------------------------
void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool isLogCurve )
bool useLogarithmicScale )
{
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, isLogCurve );
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, useLogarithmicScale );
std::vector<double> validYValues;
std::vector<double> validXValues;
@ -133,7 +133,7 @@ void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector<doubl
RiaCurveDataTools::getValuesByIntervals( yValues, intervalsOfValidValues, &validYValues );
RiaCurveDataTools::getValuesByIntervals( xValues, intervalsOfValidValues, &validXValues );
setSamplesInPlot( validXValues, validYValues, static_cast<int>( validXValues.size() ) );
setSamplesInPlot( validXValues, validYValues );
setLineSegmentStartStopIndices( RiaCurveDataTools::computePolyLineStartStopIndices( intervalsOfValidValues ) );
}
@ -184,7 +184,7 @@ std::vector<double> RiuPlotCurve::fromTime_t( const std::vector<time_t>& timeSte
void RiuPlotCurve::setSamplesFromXYErrorValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis )
{
}

View File

@ -65,21 +65,21 @@ public:
void setSamplesFromXValuesAndYValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
void setSamplesFromDatesAndYValues( const std::vector<QDateTime>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
void setSamplesFromTimeTAndYValues( const std::vector<time_t>& dateTimes,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
virtual void setSamplesFromXYErrorValues(
const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS );
void setLineSegmentStartStopIndices( const std::vector<std::pair<size_t, size_t>>& lineSegmentStartStopIndices );
@ -130,13 +130,12 @@ public:
virtual RiuPlotCurveSymbol* createSymbol( RiuPlotCurveSymbol::PointSymbolEnum symbol ) const = 0;
protected:
virtual void
setSamplesInPlot( const std::vector<double>& xValues, const std::vector<double>& yValues, int numSamples ) = 0;
virtual void setSamplesInPlot( const std::vector<double>& xValues, const std::vector<double>& yValues ) = 0;
private:
void computeValidIntervalsAndSetCurveData( const std::vector<double>& xValues,
const std::vector<double>& yValues,
bool isLogCurve );
bool useLogarithmicScale );
protected:
float m_symbolSkipPixelDistance;

View File

@ -179,22 +179,18 @@ void RiuQtChartsPlotCurve::showInPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQtChartsPlotCurve::setSamplesInPlot( const std::vector<double>& xValues,
const std::vector<double>& yValues,
int numValues )
void RiuQtChartsPlotCurve::setSamplesInPlot( const std::vector<double>& xValues, const std::vector<double>& yValues )
{
if ( !isQtChartObjectsPresent() ) return;
CAF_ASSERT( xValues.size() == yValues.size() );
CAF_ASSERT( numValues <= static_cast<int>( xValues.size() ) );
CAF_ASSERT( numValues >= 0 );
QtCharts::QLineSeries* line = lineSeries();
QtCharts::QScatterSeries* scatter = scatterSeries();
line->clear();
scatter->clear();
for ( int i = 0; i < numValues; i++ )
for ( int i = 0; i < static_cast<int>( xValues.size() ); i++ )
{
line->append( xValues[i], yValues[i] );
scatter->append( xValues[i], yValues[i] );

View File

@ -78,7 +78,7 @@ public:
RiuPlotCurveSymbol* createSymbol( RiuPlotCurveSymbol::PointSymbolEnum symbol ) const override;
private:
void setSamplesInPlot( const std::vector<double>&, const std::vector<double>&, int ) override;
void setSamplesInPlot( const std::vector<double>&, const std::vector<double>& ) override;
bool isQtChartObjectsPresent() const;
QtCharts::QLineSeries* lineSeries() const;

View File

@ -337,9 +337,11 @@ void RiuQwtPlotCurve::showInPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotCurve::setSamplesInPlot( const std::vector<double>& xValues, const std::vector<double>& yValues, int numValues )
void RiuQwtPlotCurve::setSamplesInPlot( const std::vector<double>& xValues, const std::vector<double>& yValues )
{
setSamples( xValues.data(), yValues.data(), numValues );
CAF_ASSERT( xValues.size() == yValues.size() );
setSamples( xValues.data(), yValues.data(), static_cast<int>( xValues.size() ) );
}
//--------------------------------------------------------------------------------------------------
@ -415,13 +417,13 @@ std::pair<double, double> RiuQwtPlotCurve::yDataRange() const
void RiuQwtPlotCurve::setSamplesFromXYErrorValues( const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis )
{
CVF_ASSERT( xValues.size() == yValues.size() );
CVF_ASSERT( xValues.size() == errorValues.size() );
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, isLogCurve );
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, useLogarithmicScale );
std::vector<double> filteredYValues;
std::vector<double> filteredXValues;
@ -454,7 +456,7 @@ void RiuQwtPlotCurve::setSamplesFromXYErrorValues( const std::vector<double>&
}
}
setSamplesInPlot( filteredXValues, filteredYValues, static_cast<int>( filteredXValues.size() ) );
setSamplesInPlot( filteredXValues, filteredYValues );
setLineSegmentStartStopIndices( intervalsOfValidValues );

View File

@ -71,7 +71,7 @@ public:
const std::vector<double>& xValues,
const std::vector<double>& yValues,
const std::vector<double>& errorValues,
bool isLogCurve,
bool useLogarithmicScale,
RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS ) override;
void setXAxis( RiuPlotAxis axis ) override;
@ -97,7 +97,7 @@ protected:
int from,
int to ) const override;
void setSamplesInPlot( const std::vector<double>&, const std::vector<double>&, int ) override;
void setSamplesInPlot( const std::vector<double>&, const std::vector<double>& ) override;
QwtPlotIntervalCurve* m_qwtCurveErrorBars;
bool m_showErrorBars;