mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add copyObject to PdmObjectHandle
New syntax to copy an object
auto curveCopy = curve->copyObject<RimSummaryCurve>();
Previous deprecated syntax
RimColorLegend* customLegend = dynamic_cast<RimColorLegend*>(
standardLegend->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
This commit is contained in:
@@ -146,10 +146,8 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
|
||||
{
|
||||
for ( auto measuredDepth : m_ui->locationConfig()->locations() )
|
||||
{
|
||||
RimModeledWellPath* newModeledWellPath = dynamic_cast<RimModeledWellPath*>(
|
||||
sourceLateral->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
auto nameOfNewWell = RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( parentWellPath );
|
||||
auto newModeledWellPath = sourceLateral->copyObject<RimModeledWellPath>();
|
||||
auto nameOfNewWell = RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( parentWellPath );
|
||||
newModeledWellPath->setName( nameOfNewWell );
|
||||
|
||||
newModeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( measuredDepth );
|
||||
|
||||
@@ -148,10 +148,8 @@ RimModeledWellPath* RicPasteModeledWellPathFeature::duplicateAndInitializeWellPa
|
||||
|
||||
auto wpc = RimTools::wellPathCollection();
|
||||
|
||||
auto* destinationWellPath = dynamic_cast<RimModeledWellPath*>(
|
||||
sourceWellPath->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
QString name = sourceWellPath->name() + "(copy)";
|
||||
auto* destinationWellPath = sourceWellPath->copyObject<RimModeledWellPath>();
|
||||
QString name = sourceWellPath->name() + "(copy)";
|
||||
destinationWellPath->setName( name );
|
||||
|
||||
wpc->addWellPath( destinationWellPath );
|
||||
|
||||
Reference in New Issue
Block a user