mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove old polygon annotations. (#11404)
* Remove old polygon annotations from GUI. * Upgrade old annotation objects to new polygon objects on load.
This commit is contained in:
@@ -1207,28 +1207,6 @@ std::vector<RimReachCircleAnnotation*> RimProject::reachCircleAnnotations() cons
|
||||
return annotations;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPolylinesAnnotation*> RimProject::polylineAnnotations() const
|
||||
{
|
||||
std::vector<RimPolylinesAnnotation*> annotations;
|
||||
for ( const auto& oilField : oilFields() )
|
||||
{
|
||||
auto annotationColl = oilField->annotationCollection();
|
||||
for ( const auto& annotation : annotationColl->userDefinedPolylineAnnotations() )
|
||||
{
|
||||
annotations.push_back( annotation );
|
||||
}
|
||||
|
||||
for ( const auto& annotation : annotationColl->polylinesFromFileAnnotations() )
|
||||
{
|
||||
annotations.push_back( annotation );
|
||||
}
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1593,6 +1571,36 @@ void RimProject::transferPathsToGlobalPathList()
|
||||
m_globalPathList = variableMapper.variableTableAsText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimProject::updatedFilePathFromPathId( QString filePath, RiaVariableMapper* pathListMapper /*=nullptr*/ ) const
|
||||
{
|
||||
std::unique_ptr<RiaVariableMapper> internalMapper;
|
||||
|
||||
if ( pathListMapper == nullptr )
|
||||
{
|
||||
internalMapper.reset( new RiaVariableMapper( m_globalPathList ) );
|
||||
pathListMapper = internalMapper.get();
|
||||
}
|
||||
|
||||
QString returnValue = filePath;
|
||||
QString pathIdCandidate = filePath.trimmed();
|
||||
QStringList pathIdComponents = pathIdCandidate.split( RiaVariableMapper::variableToken() );
|
||||
|
||||
if ( pathIdComponents.size() == 3 && pathIdComponents[0].size() == 0 && pathIdComponents[1].size() > 0 && pathIdComponents[2].size() == 0 )
|
||||
{
|
||||
bool isFound = false;
|
||||
QString path = pathListMapper->valueForVariable( pathIdCandidate, &isFound );
|
||||
if ( isFound )
|
||||
{
|
||||
returnValue = path;
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1602,19 +1610,7 @@ void RimProject::distributePathsFromGlobalPathList()
|
||||
|
||||
for ( caf::FilePath* filePath : allFilePaths() )
|
||||
{
|
||||
QString pathIdCandidate = filePath->path().trimmed();
|
||||
QStringList pathIdComponents = pathIdCandidate.split( RiaVariableMapper::variableToken() );
|
||||
|
||||
if ( pathIdComponents.size() == 3 && pathIdComponents[0].size() == 0 && pathIdComponents[1].size() > 0 &&
|
||||
pathIdComponents[2].size() == 0 )
|
||||
{
|
||||
bool isFound = false;
|
||||
QString path = pathListMapper.valueForVariable( pathIdCandidate, &isFound );
|
||||
if ( isFound )
|
||||
{
|
||||
filePath->setPath( path );
|
||||
}
|
||||
}
|
||||
filePath->setPath( updatedFilePathFromPathId( filePath->path(), &pathListMapper ) );
|
||||
}
|
||||
|
||||
for ( auto summaryCase : allSummaryCases() )
|
||||
|
||||
Reference in New Issue
Block a user