![]() |
XII Release 0.1.0
|
Classes | |
struct | PasteInfo |
Public Member Functions | |
xiiDocument (xiiStringView sPath, xiiDocumentObjectManager *pDocumentObjectManagerImpl) | |
Document State Functions | |
bool | IsModified () const |
bool | IsReadOnly () const |
const xiiUuid | GetGuid () const |
const xiiDocumentObjectManager * | GetObjectManager () const |
xiiDocumentObjectManager * | GetObjectManager () |
xiiSelectionManager * | GetSelectionManager () const |
xiiCommandHistory * | GetCommandHistory () const |
virtual xiiObjectAccessorBase * | GetObjectAccessor () const |
Clipboard Functions | |
virtual void | GetSupportedMimeTypesForPasting (xiiHybridArray< xiiString, 4 > &out_mimeTypes) const |
Whether this document supports pasting the given mime format into it. | |
virtual bool | CopySelectedObjects (xiiAbstractObjectGraph &out_objectGraph, xiiStringBuilder &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 xiiArrayPtr< PasteInfo > &info, const xiiAbstractObjectGraph &objectGraph, bool bAllowPickedPosition, xiiStringView sMimeType) |
Inter Document Communication | |
void | BroadcastInterDocumentMessage (xiiReflectedClass *pMessage, xiiDocument *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 (xiiReflectedClass *pMessage, xiiDocument *pSender) |
Called on all documents when BroadcastInterDocumentMessage() is called. | |
Editing Functionality | |
virtual xiiEditorInputContext * | GetEditorInputContextOverride () |
Allows to return a single input context that currently overrides all others (in priority). | |
Misc Functions | |
virtual void | DeleteSelectedObjects () const |
const xiiSet< xiiString > & | GetUnknownObjectTypes () const |
xiiUInt32 | 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 xiiFormatString &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 xiiResult | ComputeObjectTransformation (const xiiDocumentObject *pObject, xiiTransform &out_result) const |
Tries to compute the position and rotation for an object in the document. Returns XII_SUCCESS if it was possible. | |
virtual xiiManipulatorSearchStrategy | GetManipulatorSearchStrategy () const |
Needed by xiiManipulatorManager to know where to look for the manipulator attributes. | |
![]() | |
virtual const xiiRTTI * | GetDynamicRTTI () const |
bool | IsInstanceOf (const xiiRTTI *pType) const |
Returns whether the type of this instance is of the given type or derived from it. | |
template<typename T> | |
XII_ALWAYS_INLINE bool | IsInstanceOf () const |
Returns whether the type of this instance is of the given type or derived from it. | |
Public Attributes | |
xiiUniquePtr< xiiObjectMetaData< xiiUuid, xiiDocumentObjectMetaData > > | m_DocumentObjectMetaData |
xiiEvent< const xiiDocumentEvent & > | m_EventsOne |
xiiEvent< const xiiObjectAccessorChangeEvent & > | m_ObjectAccessorChangeEvents |
Static Public Attributes | |
static xiiEvent< const xiiDocumentEvent & > | s_EventsAny |
Protected Member Functions | |
void | SetModified (bool b) |
void | SetReadOnly (bool b) |
virtual xiiTaskGroupID | InternalSaveDocument (AfterSaveCallback callback) |
virtual xiiStatus | InternalLoadDocument () |
virtual xiiDocumentInfo * | 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 (xiiAbstractObjectGraph &graph) const |
virtual void | RestoreMetaDataAfterLoading (const xiiAbstractObjectGraph &graph, bool bUndoable) |
virtual void | InitializeAfterLoading (bool bFirstTimeCreation) |
virtual void | InitializeAfterLoadingAndSaving () |
virtual void | BeforeClosing () |
void | SetUnknownObjectTypes (const xiiSet< xiiString > &Types, xiiUInt32 uiInstances) |
Protected Attributes | |
xiiUniquePtr< xiiDocumentObjectManager > | m_pObjectManager |
xiiUniquePtr< xiiCommandHistory > | m_pCommandHistory |
xiiUniquePtr< xiiSelectionManager > | m_pSelectionManager |
xiiUniquePtr< xiiObjectCommandAccessor > | m_pObjectAccessor |
Default object accessor used by every doc. | |
xiiDocumentInfo * | m_pDocumentInfo = nullptr |
const xiiDocumentTypeDescriptor * | m_pTypeDescriptor = nullptr |
Friends | |
class | xiiDocumentManager |
class | xiiCommandHistory |
class | xiiSaveDocumentTask |
class | xiiAfterSaveDocumentTask |
Document Management Functions | |
using | AfterSaveCallback = xiiDelegate<void(xiiDocument*, xiiStatus)> |
xiiStringView | GetDocumentPath () const |
Returns the absolute path to the document. | |
xiiStatus | 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. | |
xiiTaskGroupID | SaveDocumentAsync (AfterSaveCallback callback, bool bForce=false) |
void | DocumentRenamed (xiiStringView sNewDocumentPath) |
xiiStatus | LoadDocument () |
void | EnsureVisible () |
Brings the corresponding window to the front. | |
xiiDocumentManager * | GetDocumentManager () const |
bool | HasWindowBeenRequested () const |
const xiiDocumentTypeDescriptor * | GetDocumentTypeDescriptor () const |
xiiStringView | GetDocumentTypeName () const |
Returns the document's type name. Same as GetDocumentTypeDescriptor()->m_sDocumentTypeName. | |
const xiiDocumentInfo * | GetDocumentInfo () const |
virtual bool | CanEngineProcessBeRestarted () const |
Asks the document whether a restart of the engine process is allowed at this time. | |
static xiiStatus | ReadDocument (xiiStringView sDocumentPath, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pHeader, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pObjects, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pTypes) |
static xiiStatus | ReadAndRegisterTypes (const xiiAbstractObjectGraph &types) |
Main / Sub-Document Functions | |
xiiDocument * | m_pHostDocument = nullptr |
xiiDocument * | 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 xiiDocument * | GetMainDocument () const |
In case this is a sub-document, returns the main document this belongs to. Otherwise 'this' is returned. | |
const xiiDocument * | 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 xiiDocumentObjectStructureEvent::Type::AfterReset. | |
xiiDocument * | GetMainDocument () |
xiiDocument * | 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 (xiiArrayPtr< const xiiDocumentObject * > selection) |
Resets the given objects to their template prefab state, if they have local modifications. | |
virtual void | UnlinkPrefabs (xiiArrayPtr< const xiiDocumentObject * > selection) |
Removes the link between a prefab instance and its template, turning the instance into a regular object. | |
virtual xiiStatus | CreatePrefabDocumentFromSelection (xiiStringView sFile, const xiiRTTI *pRootType, xiiDelegate< void(xiiAbstractObjectNode *)> adjustGraphNodeCB={}, xiiDelegate< void(xiiDocumentObject *)> adjustNewNodesCB={}, xiiDelegate< void(xiiAbstractObjectGraph &graph, xiiDynamicArray< xiiAbstractObjectNode * > &graphRootNodes)> finalizeGraphCB={}) |
virtual xiiStatus | CreatePrefabDocument (xiiStringView sFile, xiiArrayPtr< const xiiDocumentObject * > rootObjects, const xiiUuid &invPrefabSeed, xiiUuid &out_newDocumentGuid, xiiDelegate< void(xiiAbstractObjectNode *)> adjustGraphNodeCB={}, bool bKeepOpen=false, xiiDelegate< void(xiiAbstractObjectGraph &graph, xiiDynamicArray< xiiAbstractObjectNode * > &graphRootNodes)> finalizeGraphCB={}) |
virtual xiiUuid | ReplaceByPrefab (const xiiDocumentObject *pRootObject, xiiStringView sPrefabFile, const xiiUuid &prefabAsset, const xiiUuid &prefabSeed, bool bEnginePrefab) |
virtual xiiUuid | RevertPrefab (const xiiDocumentObject *pObject) |
virtual void | UpdatePrefabsRecursive (xiiDocumentObject *pObject) |
virtual void | UpdatePrefabObject (xiiDocumentObject *pObject, const xiiUuid &PrefabAsset, const xiiUuid &PrefabSeed, xiiStringView sBasePrefab) |
Additional Inherited Members | |
![]() | |
static const xiiRTTI * | 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 xiiSceneDocument.
|
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 xiiSceneDocument.
|
virtual |
Tries to compute the position and rotation for an object in the document. Returns XII_SUCCESS if it was possible.
Reimplemented in xiiGameObjectDocument.
|
inlinevirtual |
Creates the abstract graph of data to be copied and returns the mime type for the clipboard to identify the data.
Reimplemented in xiiAnimationGraphAssetDocument, xiiMaterialAssetDocument, xiiRenderPipelineAssetDocument, xiiSceneDocument, xiiStateMachineAssetDocument, and xiiVisualScriptClassAssetDocument.
|
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 xiiGameObjectDocument.
|
inlinevirtual |
Needed by xiiManipulatorManager to know where to look for the manipulator attributes.
Override this function for document types that use manipulators. The xiiManipulatorManager will assert that the document type doesn't return 'None' once it is in use.
Reimplemented in xiiPropertyAnimAssetDocument, xiiSceneDocument, and xiiSkeletonAssetDocument.
|
inlinevirtual |
Whether this document supports pasting the given mime format into it.
Reimplemented in xiiAnimationGraphAssetDocument, xiiMaterialAssetDocument, xiiRenderPipelineAssetDocument, xiiSceneDocument, xiiStateMachineAssetDocument, and xiiVisualScriptClassAssetDocument.
|
inlineprotectedvirtual |
A hook to execute additional code after SUCCESSFULLY saving a document. E.g. manual asset transform can be done here.
Reimplemented in xiiAssetDocument.
|
protectedvirtual |
Reimplemented in xiiAssetDocument, and xiiScene2Document.
|
inlinevirtual |
Called on all documents when BroadcastInterDocumentMessage() is called.
Use the RTTI information to identify whether the message is of interest.
Reimplemented in xiiSceneDocument.
|
virtual |
Reimplemented in xiiSceneDocument.
|
virtual |
Removes the link between a prefab instance and its template, turning the instance into a regular object.
Reimplemented in xiiSceneDocument.
|
virtual |
Updates ALL prefabs in the document with the latest changes. Merges the current prefab templates with the instances in the document.
Reimplemented in xiiSceneDocument.