![]() |
Plasma Engine
2.0
|
Classes | |
struct | PasteInfo |
Public Member Functions | |
plDocument (plStringView sPath, plDocumentObjectManager *pDocumentObjectManagerImpl) | |
Document State Functions | |
bool | IsModified () const |
bool | IsReadOnly () const |
const plUuid | GetGuid () const |
const plDocumentObjectManager * | GetObjectManager () const |
plDocumentObjectManager * | GetObjectManager () |
plSelectionManager * | GetSelectionManager () const |
plCommandHistory * | GetCommandHistory () const |
virtual plObjectAccessorBase * | GetObjectAccessor () const |
Clipboard Functions | |
virtual void | GetSupportedMimeTypesForPasting (plHybridArray< plString, 4 > &out_mimeTypes) const |
Whether this document supports pasting the given mime format into it. | |
virtual bool | CopySelectedObjects (plAbstractObjectGraph &out_objectGraph, plStringBuilder &out_sMimeType) const |
Creates the abstract graph of data to be copied and returns the mime type for the clipboard to identify the data. | |
virtual bool | Paste (const plArrayPtr< PasteInfo > &info, const plAbstractObjectGraph &objectGraph, bool bAllowPickedPosition, plStringView sMimeType) |
Inter Document Communication | |
void | BroadcastInterDocumentMessage (plReflectedClass *pMessage, plDocument *pSender) |
This will deliver the message to all open documents. The documents may respond, e.g. by modifying the content of the message. | |
virtual void | OnInterDocumentMessage (plReflectedClass *pMessage, plDocument *pSender) |
Called on all documents when BroadcastInterDocumentMessage() is called. | |
Editing Functionality | |
virtual plEditorInputContext * | GetEditorInputContextOverride () |
Allows to return a single input context that currently overrides all others (in priority). | |
Misc Functions | |
virtual void | DeleteSelectedObjects () const |
const plSet< plString > & | GetUnknownObjectTypes () const |
plUInt32 | GetUnknownObjectTypeInstances () const |
void | SetAddToResetFilesList (bool b) |
If disabled, this document will not be put into the recent files list. | |
bool | GetAddToRecentFilesList () const |
Whether this document shall be put into the recent files list. | |
void | ShowDocumentStatus (const plFormatString &msg) const |
Broadcasts a status message event. The window that displays the document may show this in some form, e.g. in the status bar. | |
virtual plResult | ComputeObjectTransformation (const plDocumentObject *pObject, plTransform &out_result) const |
Tries to compute the position and rotation for an object in the document. Returns PL_SUCCESS if it was possible. | |
virtual plManipulatorSearchStrategy | GetManipulatorSearchStrategy () const |
Needed by plManipulatorManager to know where to look for the manipulator attributes. | |
![]() | |
virtual const plRTTI * | GetDynamicRTTI () const |
bool | IsInstanceOf (const plRTTI *pType) const |
Returns whether the type of this instance is of the given type or derived from it. | |
template<typename T > | |
PL_ALWAYS_INLINE bool | IsInstanceOf () const |
Returns whether the type of this instance is of the given type or derived from it. | |
Public Attributes | |
plUniquePtr< plObjectMetaData< plUuid, plDocumentObjectMetaData > > | m_DocumentObjectMetaData |
plEvent< const plDocumentEvent & > | m_EventsOne |
plEvent< const plObjectAccessorChangeEvent & > | m_ObjectAccessorChangeEvents |
Static Public Attributes | |
static plEvent< const plDocumentEvent & > | s_EventsAny |
Protected Member Functions | |
void | SetModified (bool b) |
void | SetReadOnly (bool b) |
virtual plTaskGroupID | InternalSaveDocument (AfterSaveCallback callback) |
virtual plStatus | InternalLoadDocument () |
virtual plDocumentInfo * | CreateDocumentInfo ()=0 |
virtual void | InternalAfterSaveDocument () |
A hook to execute additional code after SUCCESSFULLY saving a document. E.g. manual asset transform can be done here. | |
virtual void | AttachMetaDataBeforeSaving (plAbstractObjectGraph &graph) const |
virtual void | RestoreMetaDataAfterLoading (const plAbstractObjectGraph &graph, bool bUndoable) |
virtual void | InitializeAfterLoading (bool bFirstTimeCreation) |
virtual void | InitializeAfterLoadingAndSaving () |
virtual void | BeforeClosing () |
void | SetUnknownObjectTypes (const plSet< plString > &Types, plUInt32 uiInstances) |
Protected Attributes | |
plUniquePtr< plDocumentObjectManager > | m_pObjectManager |
plUniquePtr< plCommandHistory > | m_pCommandHistory |
plUniquePtr< plSelectionManager > | m_pSelectionManager |
plUniquePtr< plObjectCommandAccessor > | m_pObjectAccessor |
Default object accessor used by every doc. | |
plDocumentInfo * | m_pDocumentInfo = nullptr |
const plDocumentTypeDescriptor * | m_pTypeDescriptor = nullptr |
Friends | |
class | plDocumentManager |
class | plCommandHistory |
class | plSaveDocumentTask |
class | plAfterSaveDocumentTask |
Document Management Functions | |
using | AfterSaveCallback = plDelegate<void(plDocument*, plStatus)> |
plStringView | GetDocumentPath () const |
Returns the absolute path to the document. | |
plStatus | SaveDocument (bool bForce=false) |
Saves the document, if it is modified. If bForce is true, the document will be written, even if it is not considered modified. | |
plTaskGroupID | SaveDocumentAsync (AfterSaveCallback callback, bool bForce=false) |
void | DocumentRenamed (plStringView sNewDocumentPath) |
plStatus | LoadDocument () |
void | EnsureVisible () |
Brings the corresponding window to the front. | |
plDocumentManager * | GetDocumentManager () const |
bool | HasWindowBeenRequested () const |
const plDocumentTypeDescriptor * | GetDocumentTypeDescriptor () const |
plStringView | GetDocumentTypeName () const |
Returns the document's type name. Same as GetDocumentTypeDescriptor()->m_sDocumentTypeName. | |
const plDocumentInfo * | GetDocumentInfo () const |
virtual bool | CanEngineProcessBeRestarted () const |
Asks the document whether a restart of the engine process is allowed at this time. | |
static plStatus | ReadDocument (plStringView sDocumentPath, plUniquePtr< plAbstractObjectGraph > &ref_pHeader, plUniquePtr< plAbstractObjectGraph > &ref_pObjects, plUniquePtr< plAbstractObjectGraph > &ref_pTypes) |
static plStatus | ReadAndRegisterTypes (const plAbstractObjectGraph &types) |
Main / Sub-Document Functions | |
plDocument * | m_pHostDocument = nullptr |
plDocument * | m_pActiveSubDocument = nullptr |
bool | IsMainDocument () const |
Returns whether this document is a main document, i.e. self contained. | |
bool | IsSubDocument () const |
Returns whether this document is a sub-document, i.e. is part of another document. | |
const plDocument * | GetMainDocument () const |
In case this is a sub-document, returns the main document this belongs to. Otherwise 'this' is returned. | |
const plDocument * | GetActiveSubDocument () const |
At any given time, only the active sub-document can be edited. This returns the active sub-document which can also be this document itself. Changes to the active sub-document are generally triggered by plDocumentObjectStructureEvent::Type::AfterReset. | |
plDocument * | GetMainDocument () |
plDocument * | GetActiveSubDocument () |
Prefab Functions | |
virtual bool | ArePrefabsAllowed () const |
Whether the document allows to create prefabs in it. This may note be allowed for prefab documents themselves, to prevent nested prefabs. | |
virtual void | UpdatePrefabs () |
Updates ALL prefabs in the document with the latest changes. Merges the current prefab templates with the instances in the document. | |
void | RevertPrefabs (const plDeque< const plDocumentObject * > &selection) |
Resets the given objects to their template prefab state, if they have local modifications. | |
virtual void | UnlinkPrefabs (const plDeque< const plDocumentObject * > &selection) |
Removes the link between a prefab instance and its template, turning the instance into a regular object. | |
virtual plStatus | CreatePrefabDocumentFromSelection (plStringView sFile, const plRTTI *pRootType, plDelegate< void(plAbstractObjectNode *)> adjustGraphNodeCB={}, plDelegate< void(plDocumentObject *)> adjustNewNodesCB={}, plDelegate< void(plAbstractObjectGraph &graph, plDynamicArray< plAbstractObjectNode * > &graphRootNodes)> finalizeGraphCB={}) |
virtual plStatus | CreatePrefabDocument (plStringView sFile, plArrayPtr< const plDocumentObject * > rootObjects, const plUuid &invPrefabSeed, plUuid &out_newDocumentGuid, plDelegate< void(plAbstractObjectNode *)> adjustGraphNodeCB={}, bool bKeepOpen=false, plDelegate< void(plAbstractObjectGraph &graph, plDynamicArray< plAbstractObjectNode * > &graphRootNodes)> finalizeGraphCB={}) |
virtual plUuid | ReplaceByPrefab (const plDocumentObject *pRootObject, plStringView sPrefabFile, const plUuid &prefabAsset, const plUuid &prefabSeed, bool bEnginePrefab) |
virtual plUuid | RevertPrefab (const plDocumentObject *pObject) |
virtual void | UpdatePrefabsRecursive (plDocumentObject *pObject) |
virtual void | UpdatePrefabObject (plDocumentObject *pObject, const plUuid &PrefabAsset, const plUuid &PrefabSeed, plStringView sBasePrefab) |
Additional Inherited Members | |
![]() | |
static const plRTTI * | GetStaticRTTI () |
|
inlinevirtual |
Whether the document allows to create prefabs in it. This may note be allowed for prefab documents themselves, to prevent nested prefabs.
Reimplemented in plSceneDocument.
|
inlinevirtual |
Asks the document whether a restart of the engine process is allowed at this time.
Documents that are currently interacting with the engine process (active play-the-game mode) should return false. All others should return true. As long as any document returns false, automatic engine process reload is suppressed.
Reimplemented in plSceneDocument.
|
virtual |
Tries to compute the position and rotation for an object in the document. Returns PL_SUCCESS if it was possible.
Reimplemented in plGameObjectDocument, and plParticleEffectAssetDocument.
|
inlinevirtual |
Creates the abstract graph of data to be copied and returns the mime type for the clipboard to identify the data.
Reimplemented in plAnimationGraphAssetDocument, plMaterialAssetDocument, plProcGenGraphAssetDocument, plRenderPipelineAssetDocument, plSceneDocument, plStateMachineAssetDocument, and plVisualScriptClassAssetDocument.
|
inlinevirtual |
Allows to return a single input context that currently overrides all others (in priority).
Used to implement custom tools that need to have priority over selection and camera movement.
Reimplemented in plGameObjectDocument.
|
inlinevirtual |
Needed by plManipulatorManager to know where to look for the manipulator attributes.
Override this function for document types that use manipulators. The plManipulatorManager will assert that the document type doesn't return 'None' once it is in use.
Reimplemented in plPropertyAnimAssetDocument, plSceneDocument, and plSkeletonAssetDocument.
|
inlinevirtual |
Whether this document supports pasting the given mime format into it.
Reimplemented in plAnimationGraphAssetDocument, plMaterialAssetDocument, plProcGenGraphAssetDocument, plRenderPipelineAssetDocument, plSceneDocument, plStateMachineAssetDocument, and plVisualScriptClassAssetDocument.
|
inlineprotectedvirtual |
A hook to execute additional code after SUCCESSFULLY saving a document. E.g. manual asset transform can be done here.
Reimplemented in plAssetDocument.
|
protectedvirtual |
Reimplemented in plAssetDocument, and plScene2Document.
|
inlinevirtual |
Called on all documents when BroadcastInterDocumentMessage() is called.
Use the RTTI information to identify whether the message is of interest.
Reimplemented in plSceneDocument.
|
virtual |
Reimplemented in plSceneDocument.
|
virtual |
Removes the link between a prefab instance and its template, turning the instance into a regular object.
Reimplemented in plSceneDocument.
|
virtual |
Updates ALL prefabs in the document with the latest changes. Merges the current prefab templates with the instances in the document.
Reimplemented in plSceneDocument.