ezEngine  Release 25.03
ezAbstractObjectGraph Class Reference

Public Types

using FilterFunction = ezDelegate< bool(const ezAbstractObjectNode *, const ezAbstractObjectNode::Property *)>
 

Public Member Functions

void Clear ()
 
ezAbstractObjectNodeClone (ezAbstractObjectGraph &ref_cloneTarget, const ezAbstractObjectNode *pRootNode=nullptr, FilterFunction filter=FilterFunction()) const
 
ezStringView RegisterString (ezStringView sString)
 
const ezAbstractObjectNodeGetNode (const ezUuid &guid) const
 
ezAbstractObjectNodeGetNode (const ezUuid &guid)
 
const ezAbstractObjectNodeGetNodeByName (ezStringView sName) const
 
ezAbstractObjectNodeGetNodeByName (ezStringView sName)
 
ezAbstractObjectNodeAddNode (const ezUuid &guid, ezStringView sType, ezUInt32 uiTypeVersion, ezStringView sNodeName={})
 
void RemoveNode (const ezUuid &guid)
 
const ezMap< ezUuid, ezAbstractObjectNode * > & GetAllNodes () const
 
ezMap< ezUuid, ezAbstractObjectNode * > & GetAllNodes ()
 
void ReMapNodeGuids (const ezUuid &seedGuid, bool bRemapInverse=false)
 Remaps all node guids by adding the given seed, or if bRemapInverse is true, by subtracting it/ This is mostly used to remap prefab instance graphs to their prefab template graph.
 
void ReMapNodeGuidsToMatchGraph (ezAbstractObjectNode *pRoot, const ezAbstractObjectGraph &rhsGraph, const ezAbstractObjectNode *pRhsRoot)
 Tries to remap the guids of this graph to those in rhsGraph by walking in both down the hierarchy, starting at root and rhsRoot. More...
 
void FindTransitiveHull (const ezUuid &rootGuid, ezSet< ezUuid > &out_reachableNodes) const
 Finds everything accessible by the given root node.
 
void PruneGraph (const ezUuid &rootGuid)
 Deletes everything not accessible by the given root node.
 
void ModifyNodeViaNativeCounterpart (ezAbstractObjectNode *pRootNode, ezDelegate< void(void *, const ezRTTI *)> callback)
 Allows for a given node to be modified as a native object. Once the callback exits any changes to the sub-hierarchy of the given root node will be written back to the node objects.
 
ezAbstractObjectNodeCopyNodeIntoGraph (const ezAbstractObjectNode *pNode)
 Allows to copy a node from another graph into this graph.
 
ezAbstractObjectNodeCopyNodeIntoGraph (const ezAbstractObjectNode *pNode, FilterFunction &ref_filter)
 
void CreateDiffWithBaseGraph (const ezAbstractObjectGraph &base, ezDeque< ezAbstractGraphDiffOperation > &out_diffResult) const
 
void ApplyDiff (ezDeque< ezAbstractGraphDiffOperation > &ref_diff)
 
void MergeDiffs (const ezDeque< ezAbstractGraphDiffOperation > &lhs, const ezDeque< ezAbstractGraphDiffOperation > &rhs, ezDeque< ezAbstractGraphDiffOperation > &ref_out) const
 

Member Function Documentation

◆ ReMapNodeGuidsToMatchGraph()

void ezAbstractObjectGraph::ReMapNodeGuidsToMatchGraph ( ezAbstractObjectNode pRoot,
const ezAbstractObjectGraph rhsGraph,
const ezAbstractObjectNode pRhsRoot 
)

Tries to remap the guids of this graph to those in rhsGraph by walking in both down the hierarchy, starting at root and rhsRoot.

Note that in case of array properties the remapping assumes element indices to be equal on both sides which will cause all moves inside the arrays to be lost as there is no way of recovering this information without an equality criteria. This function is mostly used to remap a graph from a native object to a graph from ezDocumentObjects to allow applying native side changes to the original ezDocumentObject hierarchy using diffs.


The documentation for this class was generated from the following files: