mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
Move findActiveTargetsAroundInsertionPoint to base class
This commit is contained in:
1 parent
d0a9b7cd0b
commit
dc1e675b37
6 files changed
+75
-58
No files matched your search
@@ -152,31 +152,6 @@ void RimUserDefinedPolylinesAnnotation::deleteTarget( RimPolylineTarget* targetT
|
||||
delete targetToDelete;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<RimPolylineTarget*, RimPolylineTarget*>
|
||||
RimUserDefinedPolylinesAnnotation::findActiveTargetsAroundInsertionPoint( const RimPolylineTarget* targetToInsertBefore )
|
||||
{
|
||||
RimPolylineTarget* before = nullptr;
|
||||
RimPolylineTarget* after = nullptr;
|
||||
|
||||
bool foundTarget = false;
|
||||
for ( const auto& wt : m_targets )
|
||||
{
|
||||
if ( wt == targetToInsertBefore )
|
||||
{
|
||||
foundTarget = true;
|
||||
}
|
||||
|
||||
if ( wt->isEnabled() && !after && foundTarget ) after = wt;
|
||||
|
||||
if ( wt->isEnabled() && !foundTarget ) before = wt;
|
||||
}
|
||||
|
||||
return { before, after };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user