Add support for duplicating editable well paths from python

This commit is contained in:
jonjenssen authored and JJ committed 2025-08-04 15:25:05 +02:00
1 parent 84cdfe796c
commit 09f180ee53
6 files changed
+117 -18

No files matched your search

@@ -23,6 +23,7 @@
#include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h"
#include "WellPathCommands/RicDuplicateWellPathFeature.h"
#include "WellPathCommands/RicNewWellPathLateralAtDepthFeature.h"
#include "cafPdmAbstractFieldScriptingCapability.h"
@@ -66,3 +67,32 @@ QString RimcModeledWellPath_appendLateral::classKeywordReturnedType() const
{
return RimModeledWellPath::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimModeledWellPath, RimcModeledWellPath_duplicate, "Duplicate" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcModeledWellPath_duplicate::RimcModeledWellPath_duplicate( caf::PdmObjectHandle* self )
: PdmObjectMethod( self, PdmObjectMethod::NullPointerType::NULL_IS_VALID, PdmObjectMethod::ResultType::PERSISTENT_TRUE )
{
CAF_PDM_InitObject( "Duplicate", "", "", "Duplicate" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimcModeledWellPath_duplicate::execute()
{
auto wellPath = self<RimWellPath>();
return RicDuplicateWellPathFeature::duplicateWellPath( wellPath );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimcModeledWellPath_duplicate::classKeywordReturnedType() const
{
return RimModeledWellPath::classKeywordStatic();
}
@@ -43,3 +43,17 @@ private:
caf::PdmField<double> m_tieInDepth;
caf::PdmField<QString> m_lateralName;
};
//==================================================================================================
///
//==================================================================================================
class RimcModeledWellPath_duplicate : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcModeledWellPath_duplicate( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
};