Plasma Engine  2.0
Loading...
Searching...
No Matches
plAbstractObjectGraph Class Reference

Public Types

using FilterFunction = plDelegate<bool(const plAbstractObjectNode*, const plAbstractObjectNode::Property*)>
 

Public Member Functions

void Clear ()
 
plAbstractObjectNodeClone (plAbstractObjectGraph &ref_cloneTarget, const plAbstractObjectNode *pRootNode=nullptr, FilterFunction filter=FilterFunction()) const
 
plStringView RegisterString (plStringView sString)
 
const plAbstractObjectNodeGetNode (const plUuid &guid) const
 
plAbstractObjectNodeGetNode (const plUuid &guid)
 
const plAbstractObjectNodeGetNodeByName (plStringView sName) const
 
plAbstractObjectNodeGetNodeByName (plStringView sName)
 
plAbstractObjectNodeAddNode (const plUuid &guid, plStringView sType, plUInt32 uiTypeVersion, plStringView sNodeName={})
 
void RemoveNode (const plUuid &guid)
 
const plMap< plUuid, plAbstractObjectNode * > & GetAllNodes () const
 
plMap< plUuid, plAbstractObjectNode * > & GetAllNodes ()
 
void ReMapNodeGuids (const plUuid &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 (plAbstractObjectNode *pRoot, const plAbstractObjectGraph &rhsGraph, const plAbstractObjectNode *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.
 
void FindTransitiveHull (const plUuid &rootGuid, plSet< plUuid > &out_reachableNodes) const
 Finds everything accessible by the given root node.
 
void PruneGraph (const plUuid &rootGuid)
 Deletes everything not accessible by the given root node.
 
void ModifyNodeViaNativeCounterpart (plAbstractObjectNode *pRootNode, plDelegate< void(void *, const plRTTI *)> 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.
 
plAbstractObjectNodeCopyNodeIntoGraph (const plAbstractObjectNode *pNode)
 Allows to copy a node from another graph into this graph.
 
plAbstractObjectNodeCopyNodeIntoGraph (const plAbstractObjectNode *pNode, FilterFunction &ref_filter)
 
void CreateDiffWithBaseGraph (const plAbstractObjectGraph &base, plDeque< plAbstractGraphDiffOperation > &out_diffResult) const
 
void ApplyDiff (plDeque< plAbstractGraphDiffOperation > &ref_diff)
 
void MergeDiffs (const plDeque< plAbstractGraphDiffOperation > &lhs, const plDeque< plAbstractGraphDiffOperation > &rhs, plDeque< plAbstractGraphDiffOperation > &ref_out) const
 

Member Function Documentation

◆ ReMapNodeGuidsToMatchGraph()

void plAbstractObjectGraph::ReMapNodeGuidsToMatchGraph ( plAbstractObjectNode * pRoot,
const plAbstractObjectGraph & rhsGraph,
const plAbstractObjectNode * 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 plDocumentObjects to allow applying native side changes to the original plDocumentObject hierarchy using diffs.


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