mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8522 Summary Plot: handle plot axis deletion.
This commit is contained in:
@@ -95,6 +95,8 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
m_annotations.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
updateOptionSensitivity();
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -2091,6 +2091,16 @@ RiuPlotAxis RimEnsembleCurveSet::axisY() const
|
||||
return RiuPlotAxis::defaultLeft();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::setAxisY( RiuPlotAxis plotAxis )
|
||||
{
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plot );
|
||||
m_plotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -167,6 +167,9 @@ public:
|
||||
|
||||
std::vector<cvf::Color3f> generateColorsForCases( const std::vector<RimSummaryCase*>& summaryCases ) const;
|
||||
|
||||
RiuPlotAxis axisY() const;
|
||||
void setAxisY( RiuPlotAxis plotAxis );
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
|
||||
@@ -192,8 +195,7 @@ private:
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
void updatePlotAxis();
|
||||
RiuPlotAxis axisY() const;
|
||||
void updatePlotAxis();
|
||||
|
||||
QString createAutoName() const;
|
||||
|
||||
|
||||
@@ -2457,3 +2457,33 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* curve )
|
||||
|
||||
curve->setLeftOrRightAxisY( newPlotAxis );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
||||
{
|
||||
if ( childArray == &m_axisProperties )
|
||||
{
|
||||
for ( caf::PdmObjectHandle* reffingObj : referringObjects )
|
||||
{
|
||||
RimSummaryCurve* curve = dynamic_cast<RimSummaryCurve*>( reffingObj );
|
||||
RimEnsembleCurveSet* curveSet = dynamic_cast<RimEnsembleCurveSet*>( reffingObj );
|
||||
if ( curve )
|
||||
{
|
||||
curve->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() );
|
||||
}
|
||||
else if ( curveSet )
|
||||
{
|
||||
curveSet->setAxisY( RiuPlotAxis::defaultLeft() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( plotWidget() )
|
||||
{
|
||||
updateAxes();
|
||||
plotWidget()->scheduleReplot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,8 +220,11 @@ protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
|
||||
void updateStackedCurveData();
|
||||
void updateStackedCurveDataForAxis( RiuPlotAxis plotAxis );
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
void updateStackedCurveData();
|
||||
void updateStackedCurveDataForAxis( RiuPlotAxis plotAxis );
|
||||
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
Reference in New Issue
Block a user