Add support for summary cross plot curves in summary plots

This commit is contained in:
Magne Sjaastad
2023-09-20 09:48:03 +02:00
parent b87fa0bc74
commit 146412c600
44 changed files with 970 additions and 440 deletions

View File

@@ -92,11 +92,7 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT
RimSummaryDeclineCurve* newCurve = new RimSummaryDeclineCurve();
CVF_ASSERT( newCurve );
newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() );
newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() );
newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() );
newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() );
RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve );
newCurve->setDeclineCurveType( declineCurveType );
@@ -105,6 +101,8 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT
summaryPlot->addCurveAndUpdate( newCurve );
RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve );
newCurve->updateDefaultValues();
newCurve->loadDataAndUpdate( true );
newCurve->updateConnectedEditors();

View File

@@ -78,11 +78,7 @@ RimSummaryRegressionAnalysisCurve*
RimSummaryRegressionAnalysisCurve* newCurve = new RimSummaryRegressionAnalysisCurve();
CVF_ASSERT( newCurve );
newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() );
newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() );
newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() );
newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() );
RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve );
newCurve->setColor( sourceCurve->color() );
newCurve->setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_RECT );
@@ -90,6 +86,8 @@ RimSummaryRegressionAnalysisCurve*
summaryPlot->addCurveAndUpdate( newCurve );
RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve );
newCurve->updateDefaultValues();
newCurve->loadDataAndUpdate( true );
newCurve->updateConnectedEditors();

View File

@@ -45,7 +45,7 @@ CAF_CMD_SOURCE_INIT( RicNewSummaryCrossPlotCurveFeature, "RicNewSummaryCrossPlot
//--------------------------------------------------------------------------------------------------
bool RicNewSummaryCrossPlotCurveFeature::isCommandEnabled() const
{
return ( selectedCrossPlot() );
return ( selectedSummaryPlot() );
}
//--------------------------------------------------------------------------------------------------
@@ -55,24 +55,29 @@ void RicNewSummaryCrossPlotCurveFeature::onActionTriggered( bool isChecked )
{
RimProject* project = RimProject::current();
RimSummaryCrossPlot* plot = selectedCrossPlot();
auto plot = selectedSummaryPlot();
if ( plot )
{
RimSummaryCurve* newCurve = new RimSummaryCurve();
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable( plot->curveCount() );
newCurve->setColor( curveColor );
plot->addCurveAndUpdate( newCurve );
RimSummaryCase* defaultCase = nullptr;
if ( project->activeOilField()->summaryCaseMainCollection()->summaryCaseCount() > 0 )
{
defaultCase = project->activeOilField()->summaryCaseMainCollection()->summaryCase( 0 );
newCurve->setSummaryCaseY( defaultCase );
newCurve->setSummaryAddressY( RifEclipseSummaryAddress::fieldAddress( "FOPT" ) );
newCurve->loadDataAndUpdate( true );
newCurve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR );
newCurve->setSummaryCaseX( defaultCase );
newCurve->setSummaryAddressX( RifEclipseSummaryAddress::fieldAddress( "FGOR" ) );
}
plot->addCurveAndUpdate( newCurve );
newCurve->loadDataAndUpdate( true );
plot->updateConnectedEditors();
RiuPlotMainWindowTools::onObjectAppended( newCurve );
@@ -91,15 +96,8 @@ void RicNewSummaryCrossPlotCurveFeature::setupActionLook( QAction* actionToSetup
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryCrossPlot* RicNewSummaryCrossPlotCurveFeature::selectedCrossPlot() const
RimSummaryPlot* RicNewSummaryCrossPlotCurveFeature::selectedSummaryPlot() const
{
RimSummaryCrossPlot* crossPlot = nullptr;
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
if ( selObj )
{
crossPlot = RiaSummaryTools::parentCrossPlot( selObj );
}
return crossPlot;
return RiaSummaryTools::parentSummaryPlot( selObj );
}

View File

@@ -22,7 +22,7 @@
#include <vector>
class RimSummaryCrossPlot;
class RimSummaryPlot;
//==================================================================================================
///
@@ -37,5 +37,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
RimSummaryCrossPlot* selectedCrossPlot() const;
RimSummaryPlot* selectedSummaryPlot() const;
};

View File

@@ -371,7 +371,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection()
for ( const auto& curve : currentCurvesInPreviewPlot )
{
currentCurveDefs.insert( curve->curveDefinitionY() );
currentCurveDefs.insert( curve->curveDefinition() );
}
{
@@ -385,7 +385,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection()
for ( const auto& curve : currentCurvesInPreviewPlot )
{
RiaSummaryCurveDefinition curveDef = curve->curveDefinitionY();
RiaSummaryCurveDefinition curveDef = curve->curveDefinition();
if ( deleteCurveDefs.count( curveDef ) > 0 ) curvesToDelete.insert( curve );
}
}
@@ -630,7 +630,7 @@ void RicSummaryPlotEditorUi::populateCurveCreator( const RimSummaryPlot& sourceS
for ( const auto& curve : sourceSummaryPlot.summaryCurves() )
{
curveDefs.push_back( curve->curveDefinitionY() );
curveDefs.push_back( curve->curveDefinition() );
// Copy curve object to the preview plot
copyCurveAndAddToPlot( curve, m_previewPlot.get(), true );