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:
Magne Sjaastad
2024-06-14 17:18:28 +02:00
committed by GitHub
parent 7efefbb93a
commit a0ebb6e496
46 changed files with 126 additions and 131 deletions

View File

@@ -157,8 +157,7 @@ void RicAdvancedSnapshotExportFeature::exportMultipleSnapshots( const QString& f
RimGeoMechView* sourceGeoMechView = dynamic_cast<RimGeoMechView*>( sourceView );
if ( geomCase && sourceGeoMechView )
{
RimGeoMechView* copyOfGeoMechView = dynamic_cast<RimGeoMechView*>(
sourceGeoMechView->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto copyOfGeoMechView = sourceGeoMechView->copyObject<RimGeoMechView>();
CVF_ASSERT( copyOfGeoMechView );
geomCase->geoMechViews().push_back( copyOfGeoMechView );