Plasma Engine  2.0
Loading...
Searching...
No Matches
ProcGenGraphAsset.h
1#pragma once
2
3#include <EditorFramework/Assets/AssetDocument.h>
4#include <EditorPluginProcGen/ProcGenGraphAsset/ProcGenNodes.h>
5
6class plPin;
7
9{
10 PL_ADD_DYNAMIC_REFLECTION(plProcGenGraphAssetDocument, plAssetDocument);
11
12public:
14
15 void SetDebugPin(const plPin* pDebugPin);
16
17 plStatus WriteAsset(plStreamWriter& inout_stream, const plPlatformProfile* pAssetProfile, bool bAllowDebug) const;
18
19protected:
20 virtual void UpdateAssetDocumentInfo(plAssetDocumentInfo* pInfo) const override;
21 virtual plTransformStatus InternalTransformAsset(plStreamWriter& stream, plStringView sOutputTag, const plPlatformProfile* pAssetProfile,
22 const plAssetFileHeader& AssetHeader, plBitflags<plTransformFlags> transformFlags) override;
23
24 virtual void GetSupportedMimeTypesForPasting(plHybridArray<plString, 4>& out_MimeTypes) const override;
25 virtual bool CopySelectedObjects(plAbstractObjectGraph& out_objectGraph, plStringBuilder& out_MimeType) const override;
26 virtual bool Paste(
27 const plArrayPtr<PasteInfo>& info, const plAbstractObjectGraph& objectGraph, bool bAllowPickedPosition, plStringView sMimeType) override;
28
29 virtual void AttachMetaDataBeforeSaving(plAbstractObjectGraph& graph) const override;
30 virtual void RestoreMetaDataAfterLoading(const plAbstractObjectGraph& graph, bool bUndoable) override;
31
32 void GetAllOutputNodes(plDynamicArray<const plDocumentObject*>& placementNodes, plDynamicArray<const plDocumentObject*>& vertexColorNodes) const;
33
34private:
35 friend class plProcGenAction;
36
37 virtual void InternalGetMetaDataHash(const plDocumentObject* pObject, plUInt64& inout_uiHash) const override;
38
39 struct GenerateContext;
40
41 plExpressionAST::Node* GenerateExpressionAST(const plDocumentObject* outputNode, const char* szOutputName, GenerateContext& context, plExpressionAST& out_Ast) const;
42 plExpressionAST::Node* GenerateDebugExpressionAST(GenerateContext& context, plExpressionAST& out_Ast) const;
43
44 void DumpSelectedOutput(bool bAst, bool bDisassembly) const;
45
46 void CreateDebugNode();
47
48 const plPin* m_pDebugPin = nullptr;
50};
Definition AbstractObjectGraph.h:115
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition AssetDocument.h:42
Definition AssetDocumentInfo.h:7
Simple class to handle asset file headers (the very first bytes in all transformed asset files)
Definition AssetFileHeader.h:8
Definition DocumentObjectBase.h:11
Definition DynamicArray.h:81
Definition ExpressionAST.h:9
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition DocumentNodeManager.h:59
Definition PlatformProfile.h:25
Definition ProcGenActions.h:23
Definition ProcGenGraphAsset.h:9
virtual void UpdateAssetDocumentInfo(plAssetDocumentInfo *pInfo) const override
Override this to add custom data (e.g. additional file dependencies) to the info struct.
Definition ProcGenGraphAsset.cpp:245
virtual plTransformStatus InternalTransformAsset(plStreamWriter &stream, plStringView sOutputTag, const plPlatformProfile *pAssetProfile, const plAssetFileHeader &AssetHeader, plBitflags< plTransformFlags > transformFlags) override
Override this and write the transformed file for the given szOutputTag into the given stream.
Definition ProcGenGraphAsset.cpp:288
virtual void GetSupportedMimeTypesForPasting(plHybridArray< plString, 4 > &out_MimeTypes) const override
Whether this document supports pasting the given mime format into it.
Definition ProcGenGraphAsset.cpp:295
virtual bool CopySelectedObjects(plAbstractObjectGraph &out_objectGraph, plStringBuilder &out_MimeType) const override
Creates the abstract graph of data to be copied and returns the mime type for the clipboard to identi...
Definition ProcGenGraphAsset.cpp:300
virtual void InternalGetMetaDataHash(const plDocumentObject *pObject, plUInt64 &inout_uiHash) const override
Computes the hash for transform relevant meta data of the given document object and combines it with ...
Definition ProcGenGraphAsset.cpp:354
Interface for binary out (write) streams.
Definition Stream.h:107
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
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Definition ExpressionAST.h:195
An plResult with an additional message for the reason of failure.
Definition Status.h:12
Definition Declarations.h:114