3#include <NDEVR/GraphicsDevice.h>
4#include <NDEVR/QModelViewCapture.h>
5#include <NDEVR/QCustomImage.h>
6#include <NDEVR/CaptureInfo.h>
7#include <NDEVR/WindowInstance.h>
48 friend class QModelViewCaptureThread;
109 Renderer* getRenderer() {
return m_render; };
111 UUID m_current_request_id = Constant<UUID>::Invalid;
112 UUID m_material_preview_model;
115 std::function<void(
const CaptureCache&)> m_capture_cache_callback;
119#if NDEVR_SUPPORTS_THREADING
122 bool m_initiation_failure;
124 std::function<void(
const QImage& image)> m_callback;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Options that are used for performing an update on a Graphics Engine call.
virtual void removeCaptureRequest(const ConstPointer< CaptureRequest > &request)
Removes a capture request from the queue.
uint04 searchCache(const CaptureInfo &info) const
Searches the cache for a matching capture.
DynamicPointer< GraphicsDevice > m_device
The graphics device.
virtual void addCaptureRequest(const ConstPointer< CaptureRequest > &request)
Adds a capture request to the queue.
virtual void runCaptureRequest(const ConstPointer< CaptureRequest > &request)
Executes a capture request immediately.
Buffer< ConstPointer< CaptureRequest > > m_initial_requests
Queued capture requests.
QTModelManager * m_manager
The model manager.
QCaptureManager(const DynamicPointer< GraphicsDevice > &device, QTModelManager *manager, uint04 size)
Constructs the capture manager with a pool of capture frames.
uint04 getAvailableFrame() const
Returns the index of an available capture frame slot.
virtual bool isCached(const CaptureInfo &info) const
Checks whether a capture result is in the cache.
virtual ~QCaptureManager()
Destructor.
Buffer< QModelViewCapture * > m_capture_frames
Pool of capture frame objects.
void addToCache(const CaptureCache &cache)
Adds a capture result to the cache.
Buffer< CaptureCache > m_capture_cache
Cache of completed captures.
uint04 takeAvailableFrame() const
Takes the next available capture frame slot.
An Image implementation that wraps a QImage, bridging the NDEVR Image interface with Qt.
void addRequest(const ConstPointer< CaptureRequest > &request)
Adds a capture request to the queue.
Resource< bool > is_running
Whether the capture system is running.
uint04 requestSize() const
Returns the number of pending capture requests.
virtual void initialize()
Initializes the capture context and renderer.
bool update()
Performs an update cycle, processing pending capture requests.
virtual ~QModelViewCapture()
Destructor.
void setSize(const Vector< 2, uint04 > &size) final override
Sets the logical size of the window.
virtual bool shouldExit() const override
Checks whether the capture should exit.
void setCacheCallback(const std::function< void(const CaptureCache &)> &function)
Sets a callback invoked when a capture is cached.
void finishFrame(GraphicsUpdateArguments &args) override
Called after a frame is finished for post-processing.
QImage getModelImage(const CaptureInfo &info)
Synchronously captures an image for the given parameters.
void requestModelImage(const ConstPointer< CaptureRequest > &request)
Queues a model image capture request.
uint04 getGrabImageSize() final override
Returns the number of image grabs supported per frame.
virtual void * getSurface() override
Returns a platform-specific pointer to the rendering surface.
QModelViewCapture(const DynamicPointer< GraphicsDevice > &device, QTModelManager *manager)
Constructs the model view capture.
void executeRequest(const ConstPointer< CaptureRequest > &request)
Immediately executes a capture request.
void setupMaterialModel()
Sets up the material preview model.
void setCamera(const DynamicPointer< Camera > &camera) override
Sets the camera for capture.
void removeRequest(const ConstPointer< CaptureRequest > &request)
Removes a capture request from the queue.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
An object that renders a specific Camera object, typically run on a different thread than the main UI...
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
The default thread class for executing concurrent sequences in 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...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
virtual void setSize(const Vector< 2, uint04 > &size)
Sets the logical size of the window.
virtual ConstPointer< Camera > camera() const
Returns a const pointer to the current camera.
WindowInstance()
Default constructor.
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...
Stores information about a screenshot.
CaptureCache()
Default constructor.
CaptureCache(const CaptureInfo &info, const Time &n_time, const QImage &n_image)
Constructs a cache entry from capture info, timestamp, and image.
QImage image
The captured image.
Time time
Timestamp when the capture was taken.
Information relating to capturing a 3D view into a 2D raster image.
RGBColor background
The background color for the captured image.
bool auto_crop
Whether to automatically crop empty space from the captured image.
bool orthographic
Whether to use orthographic projection instead of perspective.
SnapLocation snap
The snap location for camera positioning.
UUID target_object
The UUID of the primary object to focus on.
Buffer< UUID > included_objects
Additional objects to include in the capture.
fltp08 reference_size
The reference size used for scaling the view.
Vector< 2, uint04 > size
The output image dimensions in pixels.