34#include "NDEVRGraphics/Headers/GraphicsPipeline.h"
35#include "NDEVRGraphics/Headers/GraphicsUpdateArguments.h"
36#include "Design/Headers/DesignObjectUpdateTarget.h"
37#include "Base/Headers/ConcurrentOperation.h"
38#include "Base/Headers/Thread.h"
51 friend class CheckoutLock;
139 RLock _checkout(
const UUID&
id,
bool wait_until_ready);
140 void checkin(
const UUID&
id);
141 bool renderNeedsUpdate()
const;
180 checkout.m_id = Constant<UUID>::Invalid;
The equivelent of std::vector but with a bit more control.
Used by Viewports to signal they are rendering and we should not be performing an Update.
RLock m_lock
The read lock held during checkout.
GraphicsUpdater * m_updater
The owning updater.
~CheckoutLock()
Destructor.
UUID m_id
The checked-out camera UUID.
bool isCheckedOut()
Checks whether this lock holds a valid checkout.
CheckoutLock(GraphicsUpdater *updater, bool wait_until_ready, UUID id=Constant< UUID >::Invalid)
Constructs a checkout lock for a renderer.
CheckoutLock(const CheckoutLock &checkout)=delete
Non-copyable.
CheckoutLock(CheckoutLock &&checkout)
Move constructor.
A core class where all Design Objects including models, materials, and geometries are stored.
An object that will be called to update each time the lookup is updated.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Provides consistent interface to handle errors through the throw expression.
A GraphicsPipeline is a set of resources that are chained together to correctly render something.
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
Options that are used for performing an update on a Graphics Engine call.
Responsible for updating resources or layouts of data in-between calls to render.
Time lastUpdateTime() const
Returns the last time an update was performed.
void removeManager(const UUID &id)
Removes a registered renderer.
void removePipeline(GraphicsPipeline *pipline)
Removes a graphics pipeline from the update list.
GraphicsUpdateArguments m_args
Current graphics update arguments.
DynamicPointer< GraphicsDevice > m_device
The graphics device used for rendering.
static GraphicsUpdater * DefaultUpdater(DesignObjectLookup *lookup, LogPtr log, DynamicPointer< GraphicsDevice > device)
Returns or creates the default updater singleton.
void addPipeline(GraphicsPipeline *pipline)
Adds a graphics pipeline to the update list.
Time m_last_update_time
Last time a full update was performed.
void update(GraphicsUpdateArguments &args)
Performs an update using the provided arguments.
Buffer< GraphicsPipeline * > m_pipelines
Registered graphics pipelines.
void addManager(const UUID &id, Renderer *renderer)
Registers a renderer for a given camera ID.
GraphicsUpdateArguments & args()
Returns the current graphics update arguments.
void setLog(LogPtr log)
Sets the log for graphics update operations.
Dictionary< UUID, Renderer * > m_renderers
Registered renderers keyed by camera UUID.
GraphicsUpdater(DesignObjectLookup *lookup, const DynamicPointer< GraphicsDevice > &device, LogPtr log=LogPtr())
Constructs the updater for a design lookup and graphics device.
volatile uint04 m_total_checked_out_count
Number of currently checked-out renderers.
const DynamicPointer< GraphicsDevice > & device() const
Returns the graphics device.
void setExceptionCallback(const std::function< void(const Exception &)> &callback)
Sets a callback invoked when a graphics exception occurs.
void update(DesignObjectLookup *lookup, Time time) override
Performs a full update cycle for all graphics resources.
std::function< void(const Exception &)> m_exception_callback
Callback for graphics exceptions.
void update()
Performs an update using the internal arguments.
bool m_grab_setup
Whether the updater is in image-grab mode.
Dictionary< UUID, bool > needs_update
Per-renderer update flags.
void setIsGrabSetup(bool grab_setup)
Sets whether this updater is configured for image grab mode.
CheckoutLock checkout(const UUID &id, bool wait_until_ready)
Checks out a renderer, blocking until available.
void setLookup(DesignObjectLookup *lookup)
Sets the design object lookup.
~GraphicsUpdater()
Destructor.
bool hasManager(const UUID &id)
Checks whether a renderer is registered for the given ID.
void recreate()
Triggers a full pipeline recreation.
CheckoutLock tryCheckout(const UUID &id, bool wait_until_ready)
Attempts a non-blocking checkout of a renderer.
std::mutex m_critical_section
Mutex for thread-safe access.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Used to lock a particular variable for reading.
An object that renders a specific Camera object, typically run on a different thread than the main UI...
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...
Used to lock a particular variable for writing.
The primary namespace for the NDEVR SDK.
static constexpr bool IsValid(const Angle< t_type > &value)
Checks whether the given Angle holds a valid value.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...