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

@@ -63,8 +63,7 @@ void RicAddStoredFlowCharacteristicsPlotFeature::onActionTriggered( bool isCheck
RimFlowCharacteristicsPlot* sourceObject =
dynamic_cast<RimFlowCharacteristicsPlot*>( caf::SelectionManager::instance()->selectedItem() );
RimFlowCharacteristicsPlot* flowCharacteristicsPlot =
dynamic_cast<RimFlowCharacteristicsPlot*>( sourceObject->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto flowCharacteristicsPlot = sourceObject->copyObject<RimFlowCharacteristicsPlot>();
CVF_ASSERT( flowCharacteristicsPlot );
flowPlotColl->addFlowCharacteristicsPlotToStoredPlots( flowCharacteristicsPlot );