diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp index 69b73bd1cd..f864f55675 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp @@ -31,19 +31,17 @@ #include "RimEclipseView.h" #include "RimGeoMechView.h" #include "RimModeledWellPath.h" -#include "RimWellPath.h" #include "RimWellPathGeometryDef.h" #include "RimWellPathTarget.h" -#include "RiuViewerCommands.h" - #include "RivFemPartGeometryGenerator.h" #include "RivFemPickSourceInfo.h" #include "RivSourceInfo.h" #include "RivWellPathSourceInfo.h" #include "cafDisplayCoordTransform.h" -#include "cafSelectionManager.h" + +#include #include diff --git a/ApplicationLibCode/ProjectDataModel/RimPolylinePickerInterface.cpp b/ApplicationLibCode/ProjectDataModel/RimPolylinePickerInterface.cpp new file mode 100644 index 0000000000..8c04d6124c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimPolylinePickerInterface.cpp @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2024 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimPolylinePickerInterface.h" + +#include "RimPolylineTarget.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimPolylinePickerInterface::scalingFactorForTarget() const +{ + return 1.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair + RimPolylinePickerInterface::findActiveTargetsAroundInsertionPoint( const RimPolylineTarget* targetToInsertBefore ) +{ + auto targets = activeTargets(); + + RimPolylineTarget* before = nullptr; + RimPolylineTarget* after = nullptr; + + bool foundTarget = false; + for ( const auto& wt : targets ) + { + if ( wt == targetToInsertBefore ) + { + foundTarget = true; + } + + if ( !after && foundTarget ) after = wt; + + if ( !foundTarget ) before = wt; + } + + return { before, after }; +}