Move findActiveTargetsAroundInsertionPoint to base class

This commit is contained in:
Magne Sjaastad
2024-02-08 10:07:42 +01:00
parent d0a9b7cd0b
commit dc1e675b37
6 changed files with 75 additions and 58 deletions

View File

@@ -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 };
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -60,8 +60,6 @@ public:
void appendTarget( const cvf::Vec3d& defaultPos = cvf::Vec3d::ZERO );
std::pair<RimPolylineTarget*, RimPolylineTarget*> findActiveTargetsAroundInsertionPoint( const RimPolylineTarget* targetToInsertBefore );
void enablePicking( bool enable );
protected: