Reduce memory use for summary address object

* Use one common variable for object name, use three ints
* Move enums to separate file
* Refactor use of enums
* Move implementation to cpp
* Refactor includes
This commit is contained in:
Magne Sjaastad
2023-08-21 07:12:08 +02:00
committed by GitHub
parent 1b886c1a1e
commit 96b3bef878
70 changed files with 1252 additions and 1038 deletions

View File

@@ -2311,28 +2311,28 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
auto newCurveDef = curveDef;
auto curveAdr = newCurveDef.summaryAddress();
std::string objectIdentifierString;
if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_WELL ) &&
if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL ) )
{
objectIdentifierString = curveAdr.wellName();
curveAdr.setWellName( droppedName );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_GROUP ) &&
else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::GROUP ) )
{
objectIdentifierString = curveAdr.groupName();
curveAdr.setGroupName( droppedName );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_NETWORK ) &&
else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::NETWORK ) )
{
objectIdentifierString = curveAdr.networkName();
curveAdr.setNetworkName( droppedName );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_REGION ) &&
else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) )
{
objectIdentifierString = std::to_string( curveAdr.regionNumber() );
@@ -2342,7 +2342,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
curveAdr.setRegion( droppedRegion );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT ) &&
else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT ) )
{
objectIdentifierString = std::to_string( curveAdr.wellSegmentNumber() );
@@ -2804,7 +2804,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
{
sumCases.push_back( curve->summaryCaseX() );
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID )
{
addresses.push_back( curve->summaryAddressX() );
}