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

@@ -167,6 +167,14 @@ void PdmObjectHandle::prepareForDelete()
m_pointersReferencingMe.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmObjectHandle::addCapability( PdmObjectCapability* capability, bool takeOwnership )
{
m_capabilities.push_back( std::make_pair( capability, takeOwnership ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -181,6 +189,14 @@ void PdmObjectHandle::addField( PdmFieldHandle* field, const QString& keyword )
m_fields.push_back( field );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* PdmObjectHandle::doCopyObject() const
{
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------