mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user