NDEVR
API Documentation
CameraManager

Forward declaration of the skybox environment rendering class. More...

Collaboration diagram for CameraManager:
[legend]

Public Member Functions

 CameraManager ()
 Synchronizes positional offset between linked cameras.
 ~CameraManager ()
 Destroys the CameraManager and releases all managed resources.
void addCamera (DynamicPointer< Camera > camera)
 Adds an existing camera to this manager.
void addCameraModel (const UUID &camera, const Model &object)
 Associates a model with a camera for visibility or rendering purposes.
void addKeyController (UUID camera, UUID id, KeyControllerBase *actions)
 Adds a key controller to a specific camera.
void addKeyController (UUID id, KeyControllerBase *actions)
 Adds a global key controller that applies to all cameras.
void addMouseController (UUID camera, UUID id, MouseControllerBase *actions)
 Adds a mouse controller to a specific camera.
void addMouseController (UUID id, MouseControllerBase *actions)
 Adds a global mouse controller that applies to all cameras.
void addMouseCursor (UUID id, const StringView &cursor)
 Adds a mouse cursor style to the global cursor stack.
void addViewportLayout (const ViewportLayout &layout)
 Pushes a viewport layout onto the layout stack and activates it.
uint04 cameraCount () const
 Returns the total number of managed cameras.
Buffer< UUIDcameraIDs () const
 Returns the UUIDs of all managed cameras.
void clearAll ()
 Removes all cameras, controllers, skyboxes, and layouts from the manager.
DynamicPointer< CameracreateCamera (Model &parent, ViewportFormat format, DesignObjectLookup *lookup)
 Creates a new camera under the given parent model with the specified viewport format.
RGBColor defaultCameraBackgroundColor () const
 Returns the default camera background color based on the current theme.
void deleteCamera (UUID id, bool delete_model=true)
 Deletes a camera by UUID and optionally removes its associated model.
void delinkCameraOrientation (UUID a, UUID b)
 Removes the orientation link between two cameras.
DynamicPointer< CameragetCamera (UUID id) const
 Retrieves a camera by its UUID.
const DynamicPointer< Camera > & getCameraFromIndex (uint04 id)
 Retrieves a camera by its sequential index.
const ConstPointer< Camera > & getCameraFromIndex (uint04 id) const
 Retrieves a camera by its sequential index (const overload).
SkyboxgetSkybox (UUID camera_id) const
 Retrieves the skybox assigned to a camera.
bool hasCamera (UUID id) const
 Checks whether a camera with the given ID is managed by this manager.
const DynamicPointer< KeyController > & keyController (UUID id)
 Retrieves the key controller associated with the given ID.
void linkCameraOrientation (UUID a, UUID b)
 Links the orientation of two cameras so they rotate together.
const DynamicPointer< MouseController > & mouseController (UUID id)
 Retrieves the mouse controller associated with the given ID.
void removeKeyController (UUID camera, UUID id)
 Removes a key controller from a specific camera.
void removeKeyController (UUID id)
 Removes a global key controller.
void removeMouseController (UUID camera, UUID id)
 Removes a mouse controller from a specific camera.
void removeMouseController (UUID id)
 Removes a global mouse controller.
void removeMouseCursor (UUID id)
 Removes a mouse cursor style from the global cursor stack.
void removeViewportLayout (const UUID &id)
 Removes a viewport layout from the stack by its UUID.
void saveLayout ()
 Saves the current viewport layout configuration.
void selectCamera (UUID camera)
 Sets the specified camera as the currently active (selected) camera.
DynamicPointer< CameraselectedCamera () const
 Returns the currently selected (active) camera.
void setCameraShowEnvironment (bool show_grid)
 Enables or disables environment (skybox/background) display for all managed cameras.
void setCameraShowGrid (bool show_grid)
 Enables or disables grid display for all managed cameras.
void setDefaultLayoutTheme (ViewportLayoutTheme theme)
 Sets the default viewport layout theme used when creating new layouts.
void setSkybox (UUID camera, Skybox *skybox)
 Sets the skybox for a specific camera.
void setThemeCameraBackgroundColor (const RGBColor &color)
 Sets the fallback background color used when a camera has no explicitly assigned color.
const DynamicPointer< SnapsManager > & snapsManager ()
 Returns a mutable pointer to the snap manager.
const ConstPointer< SnapsManager > & snapsManager () const
 Returns a const pointer to the snap manager.
void update (const Time &time, DesignObjectLookup *lookup)
 Updates all managed cameras and controllers for the current frame.
void updateCamera (const ViewportFormat &format)
 Updates an existing camera to match the given viewport format.
void updateCameraBackgrounds ()
 Refreshes the background color of all managed cameras based on current settings.
void updateViewportLayout (const ViewportLayout &layout)
 Updates an existing viewport layout with new settings.
uint04 userCameraCount () const
 Returns the number of user-created cameras (excludes internal cameras).
Buffer< UUIDuserCameraIDs () const
 Returns the UUIDs of all user-created cameras.
Buffer< DynamicPointer< Camera > > userCameras () const
 Returns all user-created cameras.

Public Attributes

Resource< bool > camera_show_environment
 Whether the environment (skybox) is displayed in camera viewports.
Resource< bool > camera_show_grid
 Whether the grid is displayed in camera viewports.
Resource< ViewportLayoutcurrent_layout
 The currently active viewport layout.

Detailed Description

Forward declaration of the skybox environment rendering class.


Used to store or create Cameras or Viewports as well as manage interactions between them

Definition at line 121 of file CameraManager.h.

Constructor & Destructor Documentation

◆ CameraManager()

CameraManager::CameraManager ( )

Synchronizes positional offset between linked cameras.

Constructs the CameraManager with default state.

Member Function Documentation

◆ addCamera()

void CameraManager::addCamera ( DynamicPointer< Camera > camera)

Adds an existing camera to this manager.

Parameters
[in]cameraThe camera to add.

◆ addCameraModel()

void CameraManager::addCameraModel ( const UUID & camera,
const Model & object )

Associates a model with a camera for visibility or rendering purposes.

Parameters
[in]cameraThe UUID of the camera.
[in]objectThe model to associate with the camera.

◆ addKeyController() [1/2]

void CameraManager::addKeyController ( UUID camera,
UUID id,
KeyControllerBase * actions )

Adds a key controller to a specific camera.

Parameters
[in]cameraThe UUID of the camera.
[in]idThe UUID identifying the key controller.
[in]actionsThe key controller actions to register.

◆ addKeyController() [2/2]

void CameraManager::addKeyController ( UUID id,
KeyControllerBase * actions )

Adds a global key controller that applies to all cameras.

Parameters
[in]idThe UUID identifying the key controller.
[in]actionsThe key controller actions to register.

◆ addMouseController() [1/2]

void CameraManager::addMouseController ( UUID camera,
UUID id,
MouseControllerBase * actions )

Adds a mouse controller to a specific camera.

Parameters
[in]cameraThe UUID of the camera.
[in]idThe UUID identifying the mouse controller.
[in]actionsThe mouse controller actions to register.

◆ addMouseController() [2/2]

void CameraManager::addMouseController ( UUID id,
MouseControllerBase * actions )

Adds a global mouse controller that applies to all cameras.

Parameters
[in]idThe UUID identifying the mouse controller.
[in]actionsThe mouse controller actions to register.

◆ addMouseCursor()

void CameraManager::addMouseCursor ( UUID id,
const StringView & cursor )

Adds a mouse cursor style to the global cursor stack.

Parameters
[in]idThe UUID identifying this cursor entry.
[in]cursorThe cursor name or resource identifier.

◆ addViewportLayout()

void CameraManager::addViewportLayout ( const ViewportLayout & layout)

Pushes a viewport layout onto the layout stack and activates it.

Parameters
[in]layoutThe viewport layout to add.

◆ cameraCount()

uint04 CameraManager::cameraCount ( ) const
inline

Returns the total number of managed cameras.

Returns
The number of cameras.

Definition at line 215 of file CameraManager.h.

◆ cameraIDs()

Buffer< UUID > CameraManager::cameraIDs ( ) const

Returns the UUIDs of all managed cameras.

Returns
A buffer of all camera UUIDs.

◆ createCamera()

DynamicPointer< Camera > CameraManager::createCamera ( Model & parent,
ViewportFormat format,
DesignObjectLookup * lookup )

Creates a new camera under the given parent model with the specified viewport format.

Parameters
[in]parentThe parent model to attach the camera to.
[in]formatThe viewport format describing the camera layout.
[in]lookupThe design object lookup context.
Returns
A pointer to the newly created Camera.

◆ defaultCameraBackgroundColor()

RGBColor CameraManager::defaultCameraBackgroundColor ( ) const

Returns the default camera background color based on the current theme.

Returns
The default background color.

◆ deleteCamera()

void CameraManager::deleteCamera ( UUID id,
bool delete_model = true )

Deletes a camera by UUID and optionally removes its associated model.

Parameters
[in]idThe UUID of the camera to delete.
[in]delete_modelWhether to also delete the camera's model (default true).

◆ delinkCameraOrientation()

void CameraManager::delinkCameraOrientation ( UUID a,
UUID b )

Removes the orientation link between two cameras.

Parameters
[in]aThe UUID of the first camera.
[in]bThe UUID of the second camera.

◆ getCamera()

DynamicPointer< Camera > CameraManager::getCamera ( UUID id) const
inline

Retrieves a camera by its UUID.

Parameters
[in]idThe UUID of the camera to retrieve.
Returns
A pointer to the Camera, or an empty pointer if not found.

Definition at line 204 of file CameraManager.h.

◆ getCameraFromIndex() [1/2]

const DynamicPointer< Camera > & CameraManager::getCameraFromIndex ( uint04 id)
inline

Retrieves a camera by its sequential index.

Parameters
[in]idThe zero-based index of the camera.
Returns
A reference to the camera pointer at the given index.

Definition at line 275 of file CameraManager.h.

◆ getCameraFromIndex() [2/2]

const ConstPointer< Camera > & CameraManager::getCameraFromIndex ( uint04 id) const
inline

Retrieves a camera by its sequential index (const overload).

Parameters
[in]idThe zero-based index of the camera.
Returns
A const reference to the camera pointer at the given index.

Definition at line 284 of file CameraManager.h.

◆ getSkybox()

Skybox * CameraManager::getSkybox ( UUID camera_id) const

Retrieves the skybox assigned to a camera.

Parameters
[in]camera_idThe UUID of the camera.
Returns
A pointer to the Skybox, or nullptr if none is assigned.

◆ hasCamera()

bool CameraManager::hasCamera ( UUID id) const

Checks whether a camera with the given ID is managed by this manager.

Parameters
[in]idThe UUID to check.
Returns
True if a camera with the given ID exists, false otherwise.

◆ keyController()

const DynamicPointer< KeyController > & CameraManager::keyController ( UUID id)
inline

Retrieves the key controller associated with the given ID.

Parameters
[in]idThe UUID of the key controller.
Returns
A reference to the key controller pointer.

Definition at line 176 of file CameraManager.h.

◆ linkCameraOrientation()

void CameraManager::linkCameraOrientation ( UUID a,
UUID b )

Links the orientation of two cameras so they rotate together.

Parameters
[in]aThe UUID of the first camera.
[in]bThe UUID of the second camera.

◆ mouseController()

const DynamicPointer< MouseController > & CameraManager::mouseController ( UUID id)
inline

Retrieves the mouse controller associated with the given ID.

Parameters
[in]idThe UUID of the mouse controller.
Returns
A reference to the mouse controller pointer.

Definition at line 167 of file CameraManager.h.

◆ removeKeyController() [1/2]

void CameraManager::removeKeyController ( UUID camera,
UUID id )

Removes a key controller from a specific camera.

Parameters
[in]cameraThe UUID of the camera.
[in]idThe UUID of the key controller to remove.

◆ removeKeyController() [2/2]

void CameraManager::removeKeyController ( UUID id)

Removes a global key controller.

Parameters
[in]idThe UUID of the key controller to remove.

◆ removeMouseController() [1/2]

void CameraManager::removeMouseController ( UUID camera,
UUID id )

Removes a mouse controller from a specific camera.

Parameters
[in]cameraThe UUID of the camera.
[in]idThe UUID of the mouse controller to remove.

◆ removeMouseController() [2/2]

void CameraManager::removeMouseController ( UUID id)

Removes a global mouse controller.

Parameters
[in]idThe UUID of the mouse controller to remove.

◆ removeMouseCursor()

void CameraManager::removeMouseCursor ( UUID id)

Removes a mouse cursor style from the global cursor stack.

Parameters
[in]idThe UUID of the cursor entry to remove.

◆ removeViewportLayout()

void CameraManager::removeViewportLayout ( const UUID & id)

Removes a viewport layout from the stack by its UUID.

Parameters
[in]idThe UUID of the layout to remove.

◆ selectCamera()

void CameraManager::selectCamera ( UUID camera)

Sets the specified camera as the currently active (selected) camera.

Parameters
[in]cameraThe UUID of the camera to select.

◆ selectedCamera()

DynamicPointer< Camera > CameraManager::selectedCamera ( ) const

Returns the currently selected (active) camera.

Returns
A pointer to the selected Camera.

◆ setCameraShowEnvironment()

void CameraManager::setCameraShowEnvironment ( bool show_grid)

Enables or disables environment (skybox/background) display for all managed cameras.

Parameters
[in]show_gridWhether to show the environment.

◆ setCameraShowGrid()

void CameraManager::setCameraShowGrid ( bool show_grid)

Enables or disables grid display for all managed cameras.

Parameters
[in]show_gridWhether to show the grid.

◆ setDefaultLayoutTheme()

void CameraManager::setDefaultLayoutTheme ( ViewportLayoutTheme theme)

Sets the default viewport layout theme used when creating new layouts.

Parameters
[in]themeThe layout theme to use as default.

◆ setSkybox()

void CameraManager::setSkybox ( UUID camera,
Skybox * skybox )

Sets the skybox for a specific camera.

Parameters
[in]cameraThe UUID of the camera.
[in]skyboxThe skybox to assign.

◆ setThemeCameraBackgroundColor()

void CameraManager::setThemeCameraBackgroundColor ( const RGBColor & color)

Sets the fallback background color used when a camera has no explicitly assigned color.

Parameters
[in]colorThe background color to use as the theme default.

◆ snapsManager() [1/2]

const DynamicPointer< SnapsManager > & CameraManager::snapsManager ( )
inline

Returns a mutable pointer to the snap manager.

Returns
A reference to the SnapsManager pointer.

Definition at line 152 of file CameraManager.h.

◆ snapsManager() [2/2]

const ConstPointer< SnapsManager > & CameraManager::snapsManager ( ) const
inline

Returns a const pointer to the snap manager.

Returns
A const reference to the SnapsManager pointer.

Definition at line 144 of file CameraManager.h.

◆ update()

void CameraManager::update ( const Time & time,
DesignObjectLookup * lookup )

Updates all managed cameras and controllers for the current frame.

Parameters
[in]timeThe current timestamp.
[in]lookupThe design object lookup context used for scene queries.

◆ updateCamera()

void CameraManager::updateCamera ( const ViewportFormat & format)

Updates an existing camera to match the given viewport format.

Parameters
[in]formatThe viewport format to apply.

◆ updateViewportLayout()

void CameraManager::updateViewportLayout ( const ViewportLayout & layout)

Updates an existing viewport layout with new settings.

Parameters
[in]layoutThe viewport layout containing updated settings.

◆ userCameraCount()

uint04 CameraManager::userCameraCount ( ) const

Returns the number of user-created cameras (excludes internal cameras).

Returns
The number of user cameras.

◆ userCameraIDs()

Buffer< UUID > CameraManager::userCameraIDs ( ) const

Returns the UUIDs of all user-created cameras.

Returns
A buffer of user camera UUIDs.

◆ userCameras()

Buffer< DynamicPointer< Camera > > CameraManager::userCameras ( ) const

Returns all user-created cameras.

Returns
A buffer of pointers to user cameras.

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