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 authored and GitHub committed 2024-06-14 17:18:28 +02:00
1 parent 7efefbb93a
commit a0ebb6e496
46 files changed
+126 -131

No files matched your search

@@ -159,8 +159,7 @@ void RimSummaryMultiPlotCollection::duplicatePlot( RimSummaryMultiPlot* plotToDu
{
if ( !plotToDuplicate ) return;
auto plotCopy = dynamic_cast<RimSummaryMultiPlot*>( plotToDuplicate->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto plotCopy = plotToDuplicate->copyObject<RimSummaryMultiPlot>();
addSummaryMultiPlot( plotCopy );
plotCopy->resolveReferencesRecursively();