RFT segment plot adjustments (#9912)

* Delete RFT plot when associated case is deleted
* Rename
* Hide track/curves with no data
This commit is contained in:
Magne Sjaastad
2023-03-06 14:34:22 +01:00
committed by GitHub
parent 8f786fed5d
commit c248c9fb57
32 changed files with 355 additions and 169 deletions

View File

@@ -60,6 +60,8 @@ RimPlotCurve::RimPlotCurve()
CAF_PDM_InitField( &m_showCurve, "Show", true, "Show curve" );
m_showCurve.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_autoCheckStateBasedOnCurveData, "AutoCheckStateBasedOnCurveData", false, "Hide Curve If No Curve Data" );
CAF_PDM_InitFieldNoDefault( &m_curveName, "CurveName", "" );
auto templateText = QString( "%1, %2" ).arg( RiaDefines::namingVariableCase() ).arg( RiaDefines::namingVariableResultName() );
@@ -158,6 +160,10 @@ void RimPlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, co
if ( m_showCurve() ) loadDataAndUpdate( false );
visibilityChanged.send( m_showCurve() );
}
else if ( changedField == &m_autoCheckStateBasedOnCurveData )
{
updateCheckStateBasedOnCurveData();
}
else if ( changedField == &m_curveName )
{
updateCurveNameAndUpdatePlotLegendAndTitle();
@@ -359,7 +365,7 @@ cvf::Color3f RimPlotCurve::color() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::isCurveVisible() const
bool RimPlotCurve::isChecked() const
{
return m_showCurve;
}
@@ -367,9 +373,27 @@ bool RimPlotCurve::isCurveVisible() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setCurveVisibility( bool visible )
void RimPlotCurve::setCheckState( bool isChecked )
{
m_showCurve = visible;
m_showCurve = isChecked;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setAutoCheckStateBasedOnCurveData( bool enable )
{
m_autoCheckStateBasedOnCurveData = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCheckStateBasedOnCurveData()
{
if ( !m_autoCheckStateBasedOnCurveData ) return;
setCheckState( isAnyCurveDataPresent() );
}
//--------------------------------------------------------------------------------------------------
@@ -861,6 +885,14 @@ void RimPlotCurve::updateAxisInPlot( RiuPlotAxis plotAxis )
if ( m_plotCurve ) m_plotCurve->setYAxis( plotAxis );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::isAnyCurveDataPresent() const
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------