mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9369 Curve Probing: Show data from other curves in tooltip text
Optionally show data from other curves in tooltip text when hoovering over a curve point
This commit is contained in:
@@ -142,8 +142,6 @@ QString RimRftTopologyCurve::createCurveAutoName()
|
||||
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) text += "Tubing";
|
||||
}
|
||||
|
||||
text += QString( " (%1)" ).arg( m_segmentBranchIndex() );
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
@@ -166,16 +164,7 @@ void RimRftTopologyCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
curveDataGroup->add( &m_segmentBranchType );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
||||
nameGroup->setCollapsedByDefault();
|
||||
nameGroup->add( &m_showLegend );
|
||||
RimPlotCurve::curveNameUiOrdering( *nameGroup );
|
||||
RimStackablePlotCurve::defaultUiOrdering( uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -187,7 +176,7 @@ QList<caf::PdmOptionItemInfo> RimRftTopologyCurve::calculateValueOptions( const
|
||||
{
|
||||
if ( !m_summaryCase ) return {};
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
QList<caf::PdmOptionItemInfo> options = RimWellLogCurve::calculateValueOptions( fieldNeedingOptions );
|
||||
|
||||
auto reader = m_summaryCase->rftReader();
|
||||
|
||||
@@ -323,6 +312,14 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRftTopologyCurve::setAdditionalDataSources( const std::vector<RimPlotCurve*>& additionalDataSources )
|
||||
{
|
||||
m_additionalDataSources.setValue( additionalDataSources );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -74,4 +74,7 @@ private:
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
|
||||
|
||||
caf::PdmField<bool> m_isPackerCurve;
|
||||
|
||||
public:
|
||||
void setAdditionalDataSources( const std::vector<RimPlotCurve*>& additionalDataSources );
|
||||
};
|
||||
|
||||
@@ -295,6 +295,31 @@ void RimWellLogCurve::setOverrideCurveData( const std::vector<double>&
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellLogCurve::closestYValueForX( double xValue ) const
|
||||
{
|
||||
if ( m_curveData.isNull() ) return std::numeric_limits<double>::infinity();
|
||||
|
||||
auto depths = m_curveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
|
||||
auto values = m_curveData->propertyValues();
|
||||
|
||||
if ( depths.empty() || values.empty() ) return std::numeric_limits<double>::infinity();
|
||||
|
||||
auto it = std::upper_bound( depths.begin(), depths.end(), xValue );
|
||||
if ( it == depths.begin() ) return values.front();
|
||||
if ( it == depths.end() ) return values.back();
|
||||
|
||||
auto index = std::distance( depths.begin(), it - 1 );
|
||||
|
||||
double firstDistance = std::abs( xValue - depths[index] );
|
||||
double secondDistance = std::abs( xValue - depths[index + 1] );
|
||||
|
||||
if ( firstDistance < secondDistance ) return values[index];
|
||||
return values[index + 1];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,6 +61,8 @@ public:
|
||||
const std::vector<double>& depthValues,
|
||||
const RiaCurveDataTools::CurveIntervals& curveIntervals );
|
||||
|
||||
double closestYValueForX( double xValue ) const override;
|
||||
|
||||
protected:
|
||||
void updateZoomInParentPlot() override;
|
||||
void updateLegendsInPlot() override;
|
||||
|
||||
@@ -787,19 +787,11 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
curveDataGroup->add( &m_timeStep );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
||||
nameGroup->setCollapsedByDefault();
|
||||
nameGroup->add( &m_showLegend );
|
||||
RimPlotCurve::curveNameUiOrdering( *nameGroup );
|
||||
RimStackablePlotCurve::defaultUiOrdering( uiOrdering );
|
||||
|
||||
if ( m_namingMethod == RiaDefines::ObjectNamingMethod::AUTO )
|
||||
{
|
||||
auto nameGroup = uiOrdering.findGroup( RiaDefines::curveNameGroupName() );
|
||||
nameGroup->add( &m_addWellNameToCurveName );
|
||||
nameGroup->add( &m_addCaseNameToCurveName );
|
||||
nameGroup->add( &m_addPropertyToCurveName );
|
||||
|
||||
@@ -337,15 +337,7 @@ void RimWellLogFileCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
curveDataGroup->add( &m_wellLogFile );
|
||||
curveDataGroup->add( &m_wellLogChannelName );
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
||||
nameGroup->add( &m_showLegend );
|
||||
RimPlotCurve::curveNameUiOrdering( *nameGroup );
|
||||
RimStackablePlotCurve::defaultUiOrdering( uiOrdering );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -806,15 +806,7 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
curveDataGroup->add( &m_curveColorByPhase );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
||||
nameGroup->add( &m_showLegend );
|
||||
RimPlotCurve::curveNameUiOrdering( *nameGroup );
|
||||
RimStackablePlotCurve::defaultUiOrdering( uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user