34#include <NDEVR/Camera.h>
35#include <NDEVR/MouseController.h>
36#include <NDEVR/ViewportLayout.h>
37#include <NDEVR/KeyController.h>
38#include <NDEVR/UUID.h>
39#include <NDEVR/Pointer.h>
40#include <NDEVR/Buffer.h>
41#include <NDEVR/Dictionary.h>
56 struct hash<std::pair<UUID, UUID>>
71 size_t operator()(
const std::pair<UUID, UUID>& value)
const
74 return hasher(value.first) ^ hasher(value.second);
88 struct equal_to<std::pair<UUID, UUID>>
104 bool operator()(
const std::pair<UUID, UUID>& x,
const std::pair<UUID, UUID>& y)
const
124 class CameraOrientationSync;
125 class CameraOffsetSync;
146 return m_snap_manager;
154 return m_snap_manager;
169 return m_mouse_controllers.get(
id);
178 return m_key_controllers.get(
id);
206 const auto& camera = m_cameras.find(
id);
207 if (camera != m_cameras.end())
208 return camera.value();
217 return m_cameras.size();
277 return m_index_cameras[id];
286 return m_index_cameras[id];
432 RGBColor m_theme_camera_background_color;
435 UUID m_active_camera;
Simple version of ResourceListener which allows for a simple function callback that will be executed ...
The equivelent of std::vector but with a bit more control.
void addCameraModel(const UUID &camera, const Model &object)
Associates a model with a camera for visibility or rendering purposes.
void delinkCameraOrientation(UUID a, UUID b)
Removes the orientation link between two cameras.
void clearAll()
Removes all cameras, controllers, skyboxes, and layouts from the manager.
~CameraManager()
Destroys the CameraManager and releases all managed resources.
Buffer< UUID > userCameraIDs() const
Returns the UUIDs of all user-created cameras.
DynamicPointer< Camera > getCamera(UUID id) const
Retrieves a camera by its UUID.
Buffer< DynamicPointer< Camera > > userCameras() const
Returns all user-created cameras.
RGBColor defaultCameraBackgroundColor() const
Returns the default camera background color based on the current theme.
void addMouseController(UUID camera, UUID id, MouseControllerBase *actions)
Adds a mouse controller to a specific camera.
void removeKeyController(UUID id)
Removes a global key controller.
void addMouseController(UUID id, MouseControllerBase *actions)
Adds a global mouse controller that applies to all cameras.
DynamicPointer< Camera > createCamera(Model &parent, ViewportFormat format, DesignObjectLookup *lookup)
Creates a new camera under the given parent model with the specified viewport format.
const ConstPointer< SnapsManager > & snapsManager() const
Returns a const pointer to the snap manager.
const DynamicPointer< SnapsManager > & snapsManager()
Returns a mutable pointer to the snap manager.
void updateCamera(const ViewportFormat &format)
Updates an existing camera to match the given viewport format.
void setCameraShowGrid(bool show_grid)
Enables or disables grid display for all managed cameras.
void linkCameraOrientation(UUID a, UUID b)
Links the orientation of two cameras so they rotate together.
Resource< bool > camera_show_grid
Whether the grid is displayed in camera viewports.
void setDefaultLayoutTheme(ViewportLayoutTheme theme)
Sets the default viewport layout theme used when creating new layouts.
DynamicPointer< Camera > selectedCamera() const
Returns the currently selected (active) camera.
void updateViewportLayout(const ViewportLayout &layout)
Updates an existing viewport layout with new settings.
void removeKeyController(UUID camera, UUID id)
Removes a key controller from a specific camera.
void setThemeCameraBackgroundColor(const RGBColor &color)
Sets the fallback background color used when a camera has no explicitly assigned color.
void setSkybox(UUID camera, Skybox *skybox)
Sets the skybox for a specific camera.
Resource< bool > camera_show_environment
Whether the environment (skybox) is displayed in camera viewports.
void selectCamera(UUID camera)
Sets the specified camera as the currently active (selected) camera.
void removeMouseCursor(UUID id)
Removes a mouse cursor style from the global cursor stack.
void update(const Time &time, DesignObjectLookup *lookup)
Updates all managed cameras and controllers for the current frame.
void deleteCamera(UUID id, bool delete_model=true)
Deletes a camera by UUID and optionally removes its associated model.
Skybox * getSkybox(UUID camera_id) const
Retrieves the skybox assigned to a camera.
void setCameraShowEnvironment(bool show_grid)
Enables or disables environment (skybox/background) display for all managed cameras.
void removeMouseController(UUID id)
Removes a global mouse controller.
void addCamera(DynamicPointer< Camera > camera)
Adds an existing camera to this manager.
void saveLayout()
Saves the current viewport layout configuration.
uint04 userCameraCount() const
Returns the number of user-created cameras (excludes internal cameras).
Buffer< UUID > cameraIDs() const
Returns the UUIDs of all managed cameras.
void addKeyController(UUID id, KeyControllerBase *actions)
Adds a global key controller that applies to all cameras.
const ConstPointer< Camera > & getCameraFromIndex(uint04 id) const
Retrieves a camera by its sequential index (const overload).
void addKeyController(UUID camera, UUID id, KeyControllerBase *actions)
Adds a key controller to a specific camera.
const DynamicPointer< KeyController > & keyController(UUID id)
Retrieves the key controller associated with the given ID.
void removeMouseController(UUID camera, UUID id)
Removes a mouse controller from a specific camera.
void addMouseCursor(UUID id, const StringView &cursor)
Adds a mouse cursor style to the global cursor stack.
void updateCameraBackgrounds()
Refreshes the background color of all managed cameras based on current settings.
const DynamicPointer< Camera > & getCameraFromIndex(uint04 id)
Retrieves a camera by its sequential index.
void removeViewportLayout(const UUID &id)
Removes a viewport layout from the stack by its UUID.
uint04 cameraCount() const
Returns the total number of managed cameras.
CameraManager()
Synchronizes positional offset between linked cameras.
const DynamicPointer< MouseController > & mouseController(UUID id)
Retrieves the mouse controller associated with the given ID.
Resource< ViewportLayout > current_layout
The currently active viewport layout.
void addViewportLayout(const ViewportLayout &layout)
Pushes a viewport layout onto the layout stack and activates it.
bool hasCamera(UUID id) const
Checks whether a camera with the given ID is managed by this manager.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Forward declaration for the camera class.
A top-level controller that dispatches key events to registered sub-controllers.
A core class that represents a node on model hierarchy.
A base class for adding functionality to the user mouse inputs.
Contains logic for executing actions based on user mouse inputs.
Represents a color in the RGB space with optional alpha transparency.
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
Contains a 3D box used to render complicated backgrounds for a CameraBackground object.
Forward declaration for the NDEVR string type.
The core String View class for the NDEVR API.
Represents a timestamp with utilities for manipulation and conversion.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Stores information for how to construct a group of viewports such as those in the center 3D panel.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
ViewportLayoutTheme
The potential layouts of multiple viewports within the NDEVR engine.