![]() |
XII Release 0.1.0
|
Public Member Functions | |
| xiiColorGradientAssetDocument (xiiStringView sDocumentPath) | |
| void | WriteResource (xiiStreamWriter &inout_stream) const |
| Public Member Functions inherited from xiiSimpleAssetDocument< xiiColorGradientAssetData > | |
| xiiSimpleAssetDocument (xiiStringView sDocumentPath, xiiAssetDocEngineConnection engineConnectionType, bool bEnableDefaultLighting=false) | |
| const xiiColorGradientAssetData * | GetProperties () const |
| xiiDocumentObject * | GetPropertyObject () |
| Public Member Functions inherited from xiiAssetDocument | |
| xiiAssetDocument (xiiStringView sDocumentPath, xiiDocumentObjectManager *pObjectManager, xiiAssetDocEngineConnection engineConnectionType) | |
| EngineStatus | GetEngineStatus () const |
| Returns the current state of the engine process side of this document. | |
| xiiStatus | WaitForEngineStatusLoaded (xiiTime timeout={}) const |
| Waits for GetEngineStatus to return Loaded or returns a failure reason. | |
| virtual xiiVariant | GetCreateEngineMetaData () const |
| Passed into xiiEngineProcessDocumentContext::Initialize on the engine process side. Allows the document to provide additional data to the engine process during context creation. | |
| bool | SendMessageToEngine (xiiEditorEngineDocumentMsg *pMessage) const |
| Sends a message to the corresponding xiiEngineProcessDocumentContext on the engine process. | |
| virtual void | HandleEngineMessage (const xiiEditorEngineDocumentMsg *pMsg) |
| Handles all messages received from the corresponding xiiEngineProcessDocumentContext on the engine process. | |
| xiiEditorEngineConnection * | GetEditorEngineConnection () const |
| Returns the xiiEditorEngineConnection for this document. | |
| void | AddSyncObject (xiiEditorEngineSyncObject *pSync) const |
| Registers a sync object for this document. It will be mirrored to the xiiEngineProcessDocumentContext on the engine process. | |
| void | RemoveSyncObject (xiiEditorEngineSyncObject *pSync) const |
| Removes a previously registered sync object. It will be removed on the engine process side. | |
| xiiEditorEngineSyncObject * | FindSyncObject (const xiiUuid &guid) const |
| Returns the sync object registered under the given guid. | |
| xiiEditorEngineSyncObject * | FindSyncObject (const xiiRTTI *pType) const |
| Returns the first sync object registered with the given type. | |
| void | SyncObjectsToEngine () const |
| Sends messages to sync all sync objects to the engine process side. | |
| void | SendDocumentOpenMessage (bool bOpen) |
| virtual void | SetCommonAssetUiState (xiiCommonAssetUiState::Enum state, double value) |
| virtual double | GetCommonAssetUiState (xiiCommonAssetUiState::Enum state) const |
| Override this to return custom values for a common asset state. | |
| xiiAssetDocumentManager * | GetAssetDocumentManager () const |
| const xiiAssetDocumentInfo * | GetAssetDocumentInfo () const |
| xiiBitflags< xiiAssetDocumentFlags > | GetAssetFlags () const |
| const xiiAssetDocumentTypeDescriptor * | GetAssetDocumentTypeDescriptor () const |
| xiiTransformStatus | TransformAsset (xiiBitflags< xiiTransformFlags > transformFlags, const xiiPlatformProfile *pAssetProfile=nullptr) |
| xiiTransformStatus | CreateThumbnail () |
| xiiUInt16 | GetAssetTypeVersion () const |
| Public Member Functions inherited from xiiDocument | |
| xiiDocument (xiiStringView sPath, xiiDocumentObjectManager *pDocumentObjectManagerImpl) | |
| bool | IsModified () const |
| bool | IsReadOnly () const |
| xiiTime | GetModifiedTime () const |
| Returns when the document was last marked as modified. Invalid if the document is not modified. | |
| const xiiUuid | GetGuid () const |
| const xiiDocumentObjectManager * | GetObjectManager () const |
| xiiDocumentObjectManager * | GetObjectManager () |
| xiiSelectionManager * | GetSelectionManager () const |
| xiiCommandHistory * | GetCommandHistory () const |
| virtual xiiObjectAccessorBase * | GetObjectAccessor () const |
| 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) |
| Pastes objects from the given object graph into the document. | |
| 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) |
| virtual xiiEditorInputContext * | GetEditorInputContextOverride () |
| virtual void | DeleteSelectedObjects () const |
| Deletes all currently selected objects in the document. | |
| const xiiSet< xiiString > & | GetUnknownObjectTypes () const |
| Returns the set of unknown object types encountered during loading. | |
| xiiUInt32 | GetUnknownObjectTypeInstances () const |
| Returns the number of unknown object type instances encountered during loading. | |
| 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 |
| xiiStringView | GetDocumentPath () const |
| Returns the absolute path to the document. | |
| xiiStatus | SaveDocument (bool bForce=false) |
| xiiTaskGroupID | SaveDocumentAsync (AfterSaveCallback callback, bool bForce=false) |
| void | DocumentRenamed (xiiStringView sNewDocumentPath) |
| Updates the document path after a rename operation. | |
| xiiStatus | LoadDocument () |
| Loads the document from disk. | |
| void | EnsureVisible () |
| Brings the corresponding window to the front. | |
| xiiDocumentManager * | GetDocumentManager () const |
| Returns the document manager that owns this document. | |
| 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 |
| 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 () |
| virtual bool | ArePrefabsAllowed () const |
| Whether the document allows to create prefabs in it. This may not 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={}) |
| Creates a prefab document from the current selection. | |
| 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={}) |
| Creates a prefab document from the given root objects. | |
| virtual xiiUuid | ReplaceByPrefab (const xiiDocumentObject *pRootObject, xiiStringView sPrefabFile, const xiiUuid &prefabAsset, const xiiUuid &prefabSeed, bool bEnginePrefab) |
| Replaces the given object by a prefab instance. Returns new guid of replaced object. | |
| virtual xiiUuid | RevertPrefab (const xiiDocumentObject *pObject) |
| Reverts the given object to its prefab state. Returns new guid of reverted object. | |
| Public Member Functions inherited from xiiReflectedClass | |
| 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. | |
Protected Member Functions | |
| virtual xiiTransformStatus | InternalTransformAsset (xiiStreamWriter &stream, xiiStringView sOutputTag, const xiiPlatformProfile *pAssetProfile, const xiiAssetFileHeader &AssetHeader, xiiBitflags< xiiTransformFlags > transformFlags) override |
| virtual xiiTransformStatus | InternalCreateThumbnail (const ThumbnailInfo &ThumbnailInfo) override |
| Override this function to generate a thumbnail. Only called if GetAssetFlags returns xiiAssetDocumentFlags::SupportsThumbnail. | |
| Protected Member Functions inherited from xiiSimpleAssetDocument< xiiColorGradientAssetData > | |
| virtual void | InitializeAfterLoading (bool bFirstTimeCreation) override |
| virtual xiiStatus | InternalLoadDocument () override |
| Internal load implementation. Loads the document from disk. | |
| void | ApplyNativePropertyChangesToObjectManager (bool bForceIndexBasedRemapping=false) |
| virtual xiiDocumentInfo * | CreateDocumentInfo () override |
| Creates the document info structure. Must be implemented by derived classes. | |
| Protected Member Functions inherited from xiiAssetDocument | |
| void | EngineConnectionEventHandler (const xiiEditorEngineProcessConnection::Event &e) |
| void | AddPrefabDependencies (const xiiDocumentObject *pObject, xiiAssetDocumentInfo *pInfo) const |
| Adds all prefab dependencies to the xiiAssetDocumentInfo object. Called automatically by UpdateAssetDocumentInfo(). | |
| void | AddReferences (const xiiDocumentObject *pObject, xiiAssetDocumentInfo *pInfo, bool bInsidePrefab) const |
| xiiTransformStatus | DoTransformAsset (const xiiPlatformProfile *pAssetProfile, xiiBitflags< xiiTransformFlags > transformFlags) |
| xiiUInt64 | GetDocumentHash () const |
| Computes the hash from all document objects. | |
| void | GetChildHash (const xiiDocumentObject *pObject, xiiUInt64 &inout_uiHash) const |
| Computes the hash for one document object and combines it with the given hash. | |
| virtual void | InternalGetMetaDataHash (const xiiDocumentObject *pObject, xiiUInt64 &inout_uiHash) const |
| Computes the hash for transform relevant meta data of the given document object and combines it with the given hash. | |
| virtual xiiTaskGroupID | InternalSaveDocument (AfterSaveCallback callback) override |
| Overrides the base function to call UpdateAssetDocumentInfo() to update the settings hash. | |
| virtual void | InternalAfterSaveDocument () override |
| Implements auto transform on save. | |
| virtual void | InitializeAfterLoadingAndSaving () override |
| xiiString | GetThumbnailFilePath (xiiStringView sSubAssetName=xiiStringView()) const |
| Returns the full path to the jpg file in which the thumbnail for this asset is supposed to be. | |
| void | InvalidateAssetThumbnail (xiiStringView sSubAssetName=xiiStringView()) const |
| Should be called after manually changing the thumbnail, such that the system will reload it. | |
| xiiStatus | RemoteCreateThumbnail (const ThumbnailInfo &thumbnailInfo, xiiArrayPtr< xiiStringView > viewExclusionTags) const |
| Requests the engine side to render a thumbnail, will call SaveThumbnail on success. | |
| xiiStatus | RemoteCreateThumbnail (const ThumbnailInfo &thumbnailInfo) const |
| xiiStatus | SaveThumbnail (const xiiImage &img, const ThumbnailInfo &thumbnailInfo) const |
| Saves the given image as the new thumbnail for the asset. | |
| xiiStatus | SaveThumbnail (const QImage &img, const ThumbnailInfo &thumbnailInfo) const |
| Saves the given image as the new thumbnail for the asset. | |
| void | AppendThumbnailInfo (xiiStringView sThumbnailFile, const ThumbnailInfo &thumbnailInfo) const |
| Appends an asset header containing the thumbnail hash to the file. Each thumbnail is appended by it to check up-to-date state. | |
| virtual void | UpdateAssetDocumentInfo (xiiAssetDocumentInfo *pInfo) const |
| virtual xiiTransformStatus | InternalTransformAsset (xiiStringView sTargetFile, xiiStringView sOutputTag, const xiiPlatformProfile *pAssetProfile, const xiiAssetFileHeader &AssetHeader, xiiBitflags< xiiTransformFlags > transformFlags) |
| xiiStatus | RemoteExport (const xiiAssetFileHeader &header, xiiStringView sOutputTarget) const |
| Protected Member Functions inherited from xiiDocument | |
| void | SetModified (bool b) |
| void | SetReadOnly (bool b) |
| virtual void | AttachMetaDataBeforeSaving (xiiAbstractObjectGraph &graph) const |
| virtual void | RestoreMetaDataAfterLoading (const xiiAbstractObjectGraph &graph, bool bUndoable) |
| virtual void | BeforeClosing () |
| void | SetUnknownObjectTypes (const xiiSet< xiiString > &Types, xiiUInt32 uiInstances) |
| virtual void | UpdatePrefabsRecursive (xiiDocumentObject *pObject) |
| Recursively updates all prefab instances starting from the given object. | |
| virtual void | UpdatePrefabObject (xiiDocumentObject *pObject, const xiiUuid &PrefabAsset, const xiiUuid &PrefabSeed, xiiStringView sBasePrefab) |
Additional Inherited Members | |
| enum class | EngineStatus { Unsupported , Disconnected , Initializing , Failed , Loaded } |
| using | AfterSaveCallback = xiiDelegate<void(xiiDocument*, xiiStatus)> |
| Callback type for asynchronous save operations. | |
| static xiiStatus | ReadDocument (xiiStringView sDocumentPath, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pHeader, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pObjects, xiiUniquePtr< xiiAbstractObjectGraph > &ref_pTypes) |
| Reads a document from disk and parses its header, objects, and types. | |
| static xiiStatus | ReadAndRegisterTypes (const xiiAbstractObjectGraph &types) |
| Reads and registers types from the given object graph. | |
| Static Public Member Functions inherited from xiiNoBase | |
| static const xiiRTTI * | GetStaticRTTI () |
| Public Attributes inherited from xiiAssetDocument | |
| xiiEvent< const xiiEditorEngineDocumentMsg * > | m_ProcessMessageEvent |
| xiiEvent< const xiiCommonAssetUiState & > | m_CommonAssetUiChangeEvent |
| Used to broadcast state change events for common asset states. | |
| Public Attributes inherited from xiiDocument | |
| xiiUniquePtr< xiiObjectMetaData< xiiUuid, xiiDocumentObjectMetaData > > | m_DocumentObjectMetaData |
| Meta data for all document objects. | |
| xiiEvent< const xiiDocumentEvent & > | m_EventsOne |
| Event for document-specific notifications. | |
| xiiEvent< const xiiObjectAccessorChangeEvent & > | m_ObjectAccessorChangeEvents |
| Event for object accessor change notifications. | |
| Static Public Attributes inherited from xiiDocument | |
| static xiiEvent< const xiiDocumentEvent & > | s_EventsAny |
| Static event for notifications across all documents. | |
| Protected Attributes inherited from xiiSimpleAssetDocument< xiiColorGradientAssetData > | |
| xiiDocumentObjectMirror | m_ObjectMirror |
| xiiRttiConverterContext | m_Context |
| xiiEngineViewLightSettings | m_LightSettings |
| Protected Attributes inherited from xiiAssetDocument | |
| xiiUniquePtr< xiiIPCObjectMirrorEditor > | m_pMirror |
| EngineStatus | m_EngineStatus |
| xiiString | m_sEngineFailure |
| xiiAssetDocEngineConnection | m_EngineConnectionType = xiiAssetDocEngineConnection::None |
| xiiEditorEngineConnection * | m_pEngineConnection |
| xiiHashTable< xiiUuid, xiiEditorEngineSyncObject * > | m_AllSyncObjects |
| xiiDeque< xiiEditorEngineSyncObject * > | m_SyncObjects |
| xiiHybridArray< xiiUuid, 32 > | m_DeletedObjects |
| xiiUInt32 | m_uiCommonAssetStateFlags = 0 |
| Protected Attributes inherited from xiiDocument | |
| 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 |
| xiiDocument * | m_pHostDocument = nullptr |
| Pointer to the main document if this is a sub-document, otherwise self. | |
| xiiDocument * | m_pActiveSubDocument = nullptr |
| Pointer to the currently active sub-document. | |
|
overrideprotectedvirtual |
Override this function to generate a thumbnail. Only called if GetAssetFlags returns xiiAssetDocumentFlags::SupportsThumbnail.
Reimplemented from xiiAssetDocument.
|
overrideprotectedvirtual |
Override this and write the transformed file for the given szOutputTag into the given stream.
The stream already contains the xiiAssetFileHeader. This is the function to prefer when the asset can be written directly from the editor process. AssetHeader is already written to the stream, but provided as reference.
| stream | Data stream to write the asset to. |
| szOutputTag | Either empty for the default output or matches one of the tags defined in xiiAssetDocumentInfo::m_Outputs. |
| szPlatform | Platform for which is the output is to be created. Default is 'Default'. |
| AssetHeader | Header already written to the stream, provided for reference. |
| transformFlags | flags that affect the transform process, see xiiTransformFlags. |
Implements xiiAssetDocument.