XII Release 0.1.0
Loading...
Searching...
No Matches
xiiSceneContext Class Reference
Inheritance diagram for xiiSceneContext:
[legend]

Public Member Functions

virtual void HandleMessage (const xiiEditorEngineDocumentMsg *pMsg) override
 
const xiiDeque< xiiGameObjectHandle > & GetSelection () const
 
const xiiDeque< xiiGameObjectHandle > & GetSelectionWithChildren () const
 
bool GetRenderSelectionOverlay () const
 
bool GetRenderShapeIcons () const
 
bool GetRenderSelectionBoxes () const
 
float GetGridDensity () const
 
bool IsGridInGlobalSpace () const
 
xiiTransform GetGridTransform () const
 
xiiGameStateBaseGetGameState () const
 
bool IsPlayTheGameActive () const
 
xiiUInt32 RegisterLayer (xiiLayerContext *pLayer)
 
void UnregisterLayer (xiiLayerContext *pLayer)
 
void AddLayerIndexTag (const xiiEntityMsgToEngine &msg, xiiWorldRttiConverterContext &ref_context, const xiiTag &layerTag)
 
const xiiArrayPtr< const xiiTagGetInvisibleLayerTags () const
 
xiiEngineProcessDocumentContextGetActiveDocumentContext ()
 
const xiiEngineProcessDocumentContextGetActiveDocumentContext () const
 
xiiWorldRttiConverterContextGetActiveContext ()
 
const xiiWorldRttiConverterContextGetActiveContext () const
 
xiiWorldRttiConverterContextGetContextForLayer (const xiiUuid &layerGuid)
 
xiiArrayPtr< xiiWorldRttiConverterContext * > GetAllContexts ()
 
- Public Member Functions inherited from xiiEngineProcessDocumentContext
 xiiEngineProcessDocumentContext (xiiBitflags< xiiEngineProcessDocumentContextFlags > flags)
 
virtual void Initialize (const xiiUuid &documentGuid, const xiiVariant &metaData, xiiEngineProcessCommunicationChannel *pIPC, xiiStringView sDocumentType)
 
void Deinitialize ()
 
xiiStringView GetDocumentType () const
 Returns the document type for which this context was created. Useful in case a context may be used for multiple document types.
 
void SendProcessMessage (xiiProcessMessage *pMsg=nullptr)
 
xiiBoundingBoxSphere GetWorldBounds (xiiWorld *pWorld)
 
void ProcessEditorEngineSyncObjectMsg (const xiiEditorEngineSyncObjectMsg &msg)
 
const xiiUuidGetDocumentGuid () const
 
virtual void Reset ()
 
void ClearExistingObjects ()
 
virtual xiiWorldRttiConverterContextGetContext ()
 
virtual const xiiWorldRttiConverterContextGetContext () const
 
xiiWorldGetWorld () const
 
- Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTIGetDynamicRTTI () 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 void OnInitialize () override
 
virtual void OnDeinitialize () override
 
virtual xiiEngineProcessViewContextCreateViewContext () override
 Needs to be implemented to create a view context used for windows and thumbnails rendering.
 
virtual void DestroyViewContext (xiiEngineProcessViewContext *pContext) override
 Needs to be implemented to destroy the view context created in CreateViewContext.
 
virtual xiiStatus ExportDocument (const xiiExportDocumentMsgToEngine *pMsg) override
 Exports to current document resource to file. Make sure to write xiiAssetFileHeader at the start of it.
 
void ExportExposedParameters (const xiiWorldWriter &ww, xiiDeferredFileWriter &file) const
 
virtual bool UpdateThumbnailViewContext (xiiEngineProcessViewContext *pThumbnailViewContext) override
 Overwrite this function to apply the thumbnail render settings to the given context.
 
virtual void OnThumbnailViewContextCreated () override
 Called after a thumbnail context was created. Allows to insert code before the thumbnail is generated.
 
virtual void OnDestroyThumbnailViewContext () override
 Called before a thumbnail context is destroyed. Used for cleanup of what was done in OnThumbnailViewContextCreated()
 
virtual void UpdateDocumentContext () override
 A tick functions that allows each document context to do processing that continues over multiple frames and can't be handled in HandleMessage directly.
 
virtual xiiGameObjectHandle ResolveStringToGameObjectHandle (const void *pString, xiiComponentHandle hThis, xiiStringView sProperty) const override
 Tries to resolve a 'reference' (given in pData) to a xiiGameObject.
 
- Protected Member Functions inherited from xiiEngineProcessDocumentContext
virtual bool PendingOperationInProgress () const
 Should return true if this context has any operation in progress like thumbnail rendering and thus needs to continue rendering even if no new messages from the editor come in.
 
void UpdateSyncObjects ()
 
void CreateThumbnailViewContext (const xiiCreateThumbnailMsgToEngine *pMsg)
 Creates the thumbnail view context. It uses 'CreateViewContext' in combination with an off-screen render target.
 
void DestroyThumbnailViewContext ()
 Once a thumbnail is successfully rendered, the thumbnail view context is destroyed again.
 
virtual void OnThumbnailViewContextRequested ()
 Called before a thumbnail context is created.
 
void SetTagOnObject (const xiiUuid &object, const char *szTag, bool bSet, bool recursive)
 Sets or removes the given tag on the object and optionally all children.
 
void SetTagRecursive (xiiGameObject *pObject, const xiiTag &tag)
 Sets the given tag on the object and all children.
 
void ClearTagRecursive (xiiGameObject *pObject, const xiiTag &tag)
 Clears the given tag on the object and all children.
 
const xiiEngineProcessViewContextGetViewContext (xiiUInt32 uiView) const
 

Additional Inherited Members

- Static Public Member Functions inherited from xiiEngineProcessDocumentContext
static xiiEngineProcessDocumentContextGetDocumentContext (xiiUuid guid)
 
static void AddDocumentContext (xiiUuid guid, const xiiVariant &metaData, xiiEngineProcessDocumentContext *pView, xiiEngineProcessCommunicationChannel *pIPC, xiiStringView sDocumentType)
 
static bool PendingOperationsInProgress ()
 
static void UpdateDocumentContexts ()
 
static void DestroyDocumentContext (xiiUuid guid)
 
- Static Public Member Functions inherited from xiiNoBase
static const xiiRTTIGetStaticRTTI ()
 
- Public Attributes inherited from xiiEngineProcessDocumentContext
xiiIPCObjectMirrorEngine m_Mirror
 
xiiWorldRttiConverterContext m_Context
 
- Protected Attributes inherited from xiiEngineProcessDocumentContext
xiiWorldm_pWorld = nullptr
 
xiiBitflags< xiiEngineProcessDocumentContextFlagsm_Flags
 
xiiUuid m_DocumentGuid
 
xiiVariant m_MetaData
 
xiiEngineProcessCommunicationChannelm_pIPC = nullptr
 
xiiHybridArray< xiiEngineProcessViewContext *, 4 > m_ViewContexts
 
xiiMap< xiiUuid, xiiEditorEngineSyncObject * > m_SyncObjects
 

Member Function Documentation

◆ CreateViewContext()

xiiEngineProcessViewContext * xiiSceneContext::CreateViewContext ( )
overrideprotectedvirtual

Needs to be implemented to create a view context used for windows and thumbnails rendering.

Implements xiiEngineProcessDocumentContext.

◆ DestroyViewContext()

void xiiSceneContext::DestroyViewContext ( xiiEngineProcessViewContext * pContext)
overrideprotectedvirtual

Needs to be implemented to destroy the view context created in CreateViewContext.

Implements xiiEngineProcessDocumentContext.

◆ ExportDocument()

xiiStatus xiiSceneContext::ExportDocument ( const xiiExportDocumentMsgToEngine * pMsg)
overrideprotectedvirtual

Exports to current document resource to file. Make sure to write xiiAssetFileHeader at the start of it.

Reimplemented from xiiEngineProcessDocumentContext.

◆ HandleMessage()

void xiiSceneContext::HandleMessage ( const xiiEditorEngineDocumentMsg * pMsg)
overridevirtual

Reimplemented from xiiEngineProcessDocumentContext.

◆ OnDeinitialize()

void xiiSceneContext::OnDeinitialize ( )
overrideprotectedvirtual

Reimplemented from xiiEngineProcessDocumentContext.

◆ OnDestroyThumbnailViewContext()

void xiiSceneContext::OnDestroyThumbnailViewContext ( )
overrideprotectedvirtual

Called before a thumbnail context is destroyed. Used for cleanup of what was done in OnThumbnailViewContextCreated()

Reimplemented from xiiEngineProcessDocumentContext.

◆ OnInitialize()

void xiiSceneContext::OnInitialize ( )
overrideprotectedvirtual

Reimplemented from xiiEngineProcessDocumentContext.

◆ OnThumbnailViewContextCreated()

void xiiSceneContext::OnThumbnailViewContextCreated ( )
overrideprotectedvirtual

Called after a thumbnail context was created. Allows to insert code before the thumbnail is generated.

Reimplemented from xiiEngineProcessDocumentContext.

◆ ResolveStringToGameObjectHandle()

xiiGameObjectHandle xiiSceneContext::ResolveStringToGameObjectHandle ( const void * pData,
xiiComponentHandle hThis,
xiiStringView sComponentProperty ) const
overrideprotectedvirtual

Tries to resolve a 'reference' (given in pData) to a xiiGameObject.

Tries to resolve a 'reference' (given in pData) to a xiiGameObject. hThis is the 'owner' of the reference and szComponentProperty is the name of the reference property in that component.

There are two different use cases:

1) hThis is invalid and szComponentProperty is null:

This is used by xiiPrefabReferenceComponent::SerializeComponent() to check whether a string represents a game object reference. It may be any arbitrary string and thus must not assert. In this case a reference is always a stringyfied GUID. Since this is only used for scene export, only the lookup shall be done and nothing else.

2) hThis and szComponentProperty represent a valid component+property combination:

This is called at edit time whenever a reference property is queried, which also happens whenever a reference is modified. In this case we need to maintain two maps: one that know which object references which other objects one that knows by which other objects an object is referenced These are needed to fix up references during undo/redo when objects get deleted and recreated. Ie. when an object that has references or is referenced gets deleted and then undo restores it, the references should appear as well.

Reimplemented from xiiEngineProcessDocumentContext.

◆ UpdateDocumentContext()

void xiiSceneContext::UpdateDocumentContext ( )
overrideprotectedvirtual

A tick functions that allows each document context to do processing that continues over multiple frames and can't be handled in HandleMessage directly.

Make sure to call the base implementation when overwriting as this handles the thumbnail rendering that takes multiple frames to complete.

Todo
Support depth pitch.

Reimplemented from xiiEngineProcessDocumentContext.

◆ UpdateThumbnailViewContext()

bool xiiSceneContext::UpdateThumbnailViewContext ( xiiEngineProcessViewContext * pThumbnailViewContext)
overrideprotectedvirtual

Overwrite this function to apply the thumbnail render settings to the given context.

Return false if you need more frames to be rendered to setup everything correctly. If true is returned for 'ThumbnailConvergenceFramesTarget' frames in a row the thumbnail image is taken. This is to allow e.g. camera updates after more resources have been streamed in. The frame counter will start over to count to 'ThumbnailConvergenceFramesTarget' when a new resource is being loaded to make sure we do not make an image of half-streamed in data.

Reimplemented from xiiEngineProcessDocumentContext.


The documentation for this class was generated from the following files: