Plasma Engine  2.0
Loading...
Searching...
No Matches
PrefabUtils.h
1#pragma once
2
3#include <Foundation/Serialization/AbstractObjectGraph.h>
4#include <ToolsFoundation/Document/Document.h>
5#include <ToolsFoundation/Object/ObjectMetaData.h>
6#include <ToolsFoundation/ToolsFoundationDLL.h>
7
9
10class PL_TOOLSFOUNDATION_DLL plPrefabUtils
11{
12public:
14 static void LoadGraph(plAbstractObjectGraph& out_graph, plStringView sGraph);
15
16 static plAbstractObjectNode* GetFirstRootNode(plAbstractObjectGraph& ref_graph);
17
18 static void GetRootNodes(plAbstractObjectGraph& ref_graph, plHybridArray<plAbstractObjectNode*, 4>& out_nodes);
19
20 static plUuid GetPrefabRoot(const plDocumentObject* pObject, const plObjectMetaData<plUuid, plDocumentObjectMetaData>& documentObjectMetaData, plInt32* pDepth = nullptr);
21
22 static plVariant GetDefaultValue(
23 const plAbstractObjectGraph& graph, const plUuid& objectGuid, plStringView sProperty, plVariant index = plVariant(), bool* pValueFound = nullptr);
24
25 static void WriteDiff(const plDeque<plAbstractGraphDiffOperation>& mergedDiff, plStringBuilder& out_sText);
26
28 static void Merge(const plAbstractObjectGraph& baseGraph, const plAbstractObjectGraph& leftGraph, const plAbstractObjectGraph& rightGraph,
30
33 static void Merge(plStringView sBase, plStringView sLeft, plDocumentObject* pRight, bool bRightIsNotPartOfPrefab, const plUuid& prefabSeed,
34 plStringBuilder& out_sNewGraph);
35
36 static plString ReadDocumentAsString(plStringView sFile);
37};
Definition AbstractObjectGraph.h:115
Definition AbstractObjectGraph.h:17
Definition Deque.h:270
Definition DocumentObjectBase.h:11
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Stores meta data for document objects that is not part of the object itself. E.g. editor-only states ...
Definition ObjectMetaData.h:16
Definition PrefabUtils.h:11
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44