Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::ViewportContextRequestsInterface Class Referenceabstract

#include <ViewportContextBus.h>

Inherited by AZ::RPI::ViewportContextManager.

Classes

struct  CreationParameters
 Parameters for creating a ViewportContext. More...
 

Public Member Functions

 AZ_RTTI (ViewportContextRequestsInterface, "{FDB82F02-7021-433B-AAD3-25B97EC69962}")
 
virtual AZ::Name GetDefaultViewportContextName () const =0
 Gets the name of the default, primary ViewportContext, for common single-viewport scenarios.
 
virtual ViewportContextPtr GetDefaultViewportContext () const =0
 Get the ViewportConext which has default ViewportContext name.
 
virtual ViewportContextPtr CreateViewportContext (const Name &contextName, const CreationParameters &params)=0
 
virtual ViewportContextPtr GetViewportContextByName (const Name &contextName) const =0
 Gets the ViewportContext registered to the given name, if any.
 
virtual ViewportContextPtr GetViewportContextById (AzFramework::ViewportId id) const =0
 Gets the registered ViewportContext with the corresponding ID, if any.
 
virtual ViewportContextPtr GetViewportContextByScene (const Scene *scene) const =0
 
virtual void RenameViewportContext (ViewportContextPtr viewportContext, const Name &newContextName)=0
 
virtual void EnumerateViewportContexts (AZStd::function< void(ViewportContextPtr)> visitorFunction)=0
 Enumerates all registered ViewportContexts, calling visitorFunction once for each registered viewport.
 
virtual void PushViewGroup (const Name &contextName, ViewGroupPtr viewGroup)=0
 
virtual bool PopViewGroup (const Name &contextName, ViewGroupPtr viewGroup)=0
 
virtual ViewGroupPtr GetCurrentViewGroup (const Name &contextName)=0
 

Detailed Description

Manages ViewportContexts, which can be created and looked up by name. Contexts are mapped to a stack of default Views which can be used to push camera state to an arbitrary ViewportContext.

All methods are thread-safe, but the underlying ViewportContext may not be.

Member Function Documentation

◆ CreateViewportContext()

virtual ViewportContextPtr AZ::RPI::ViewportContextRequestsInterface::CreateViewportContext ( const Name &  contextName,
const CreationParameters params 
)
pure virtual

Creates a ViewportContext and registers it by name. There may only be one context registered to a given name at any time. The ViewportContext will be automatically assigned a View from the stack registered to this context name. The ViewportContextManager does not take ownership of this ViewportContext, its lifecycle is the responsibility of the caller. ViewportContexts shall automatically unregister when they are destroyed.

Implemented in AZ::RPI::ViewportContextManager.

◆ EnumerateViewportContexts()

virtual void AZ::RPI::ViewportContextRequestsInterface::EnumerateViewportContexts ( AZStd::function< void(ViewportContextPtr)>  visitorFunction)
pure virtual

Enumerates all registered ViewportContexts, calling visitorFunction once for each registered viewport.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetCurrentViewGroup()

virtual ViewGroupPtr AZ::RPI::ViewportContextRequestsInterface::GetCurrentViewGroup ( const Name &  contextName)
pure virtual

Gets the view group currently registered to a given context, assuming the context exists. This will be null if there is no registered ViewportContext and no view groups have been pushed for this context name.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetDefaultViewportContext()

virtual ViewportContextPtr AZ::RPI::ViewportContextRequestsInterface::GetDefaultViewportContext ( ) const
pure virtual

Get the ViewportConext which has default ViewportContext name.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetDefaultViewportContextName()

virtual AZ::Name AZ::RPI::ViewportContextRequestsInterface::GetDefaultViewportContextName ( ) const
pure virtual

Gets the name of the default, primary ViewportContext, for common single-viewport scenarios.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetViewportContextById()

virtual ViewportContextPtr AZ::RPI::ViewportContextRequestsInterface::GetViewportContextById ( AzFramework::ViewportId  id) const
pure virtual

Gets the registered ViewportContext with the corresponding ID, if any.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetViewportContextByName()

virtual ViewportContextPtr AZ::RPI::ViewportContextRequestsInterface::GetViewportContextByName ( const Name &  contextName) const
pure virtual

Gets the ViewportContext registered to the given name, if any.

Implemented in AZ::RPI::ViewportContextManager.

◆ GetViewportContextByScene()

virtual ViewportContextPtr AZ::RPI::ViewportContextRequestsInterface::GetViewportContextByScene ( const Scene scene) const
pure virtual

Gets the registered ViewportContext with matching RPI::Scene, if any. This function will return the first result.

Implemented in AZ::RPI::ViewportContextManager.

◆ PopViewGroup()

virtual bool AZ::RPI::ViewportContextRequestsInterface::PopViewGroup ( const Name &  contextName,
ViewGroupPtr  viewGroup 
)
pure virtual

Pops a view group off the stack for a given context name. A view group manages all stereoscopic and non-stereoscopic views. Returns true if the camera was successfully removed or false if the view wasn't removed, either because it wasn't found within any existing view groups or its removal was not allowed.

Note
The default camera's view group for a given viewport may not be removed from the view stack. You must push an additional camera view groups to override the default view group instead.

Implemented in AZ::RPI::ViewportContextManager.

◆ PushViewGroup()

virtual void AZ::RPI::ViewportContextRequestsInterface::PushViewGroup ( const Name &  contextName,
ViewGroupPtr  viewGroup 
)
pure virtual

Pushes a view group to the stack for a given context name. A view group manages all stereoscopic and non-stereoscopic views. The Views within a View Group must be declared a camera by having the View::UsageFlags::UsageCamera usage flag set. This View Group will be registered as the context's pipeline's default view group until the top of the camera stack changes.

Implemented in AZ::RPI::ViewportContextManager.

◆ RenameViewportContext()

virtual void AZ::RPI::ViewportContextRequestsInterface::RenameViewportContext ( ViewportContextPtr  viewportContext,
const Name &  newContextName 
)
pure virtual

Maps a ViewportContext to a new name, inheriting the View stack (if any) registered to that context name. This can be used to switch "default" viewports by registering a viewport with the default ViewportContext name but note that only one ViewportContext can be mapped to a context name at a time.

Implemented in AZ::RPI::ViewportContextManager.


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