![]() |
NDEVR
API Documentation
|
Used to capture a 2D image of a DesignObjectLookup from a specific perspective. More...
Public Member Functions | |
| QModelViewCapture (const DynamicPointer< GraphicsDevice > &device, QTModelManager *manager) | |
| Constructs the model view capture. | |
| virtual | ~QModelViewCapture () |
| Destructor. | |
| void | addRequest (const ConstPointer< CaptureRequest > &request) |
| Adds a capture request to the queue. | |
| void | executeRequest (const ConstPointer< CaptureRequest > &request) |
| Immediately executes a capture request. | |
| void | finishFrame (GraphicsUpdateArguments &args) override |
| Called after a frame is finished for post-processing. | |
| uint04 | getGrabImageSize () final override |
| Returns the number of image grabs supported per frame. | |
| QImage | getModelImage (const CaptureInfo &info) |
| Synchronously captures an image for the given parameters. | |
| virtual void * | getSurface () override |
| Returns a platform-specific pointer to the rendering surface. | |
| virtual void | initialize () |
| Initializes the capture context and renderer. | |
| void | removeRequest (const ConstPointer< CaptureRequest > &request) |
| Removes a capture request from the queue. | |
| void | requestModelImage (const ConstPointer< CaptureRequest > &request) |
| Queues a model image capture request. | |
| uint04 | requestSize () const |
| Returns the number of pending capture requests. | |
| void | setCacheCallback (const std::function< void(const CaptureCache &)> &function) |
| Sets a callback invoked when a capture is cached. | |
| void | setCamera (const DynamicPointer< Camera > &camera) override |
| Sets the camera for capture. | |
| void | setSize (const Vector< 2, uint04 > &size) final override |
| Sets the logical size of the window. | |
| void | setupMaterialModel () |
| Sets up the material preview model. | |
| virtual bool | shouldExit () const override |
| Checks whether the capture should exit. | |
| bool | update () |
| Performs an update cycle, processing pending capture requests. | |
| Public Member Functions inherited from WindowInstance | |
| WindowInstance () | |
| Default constructor. | |
| WindowInstance (const DynamicPointer< Camera > &camera, DesignObjectLookup *lookup) | |
| Constructs a WindowInstance with a given camera and design object lookup. | |
| ~WindowInstance () | |
| Destructor. | |
| void | addKeyboardEvent (const std::function< void(KeyEvent)> &key_event) |
| Registers a callback to be invoked when a keyboard event occurs. | |
| void | addMouseEvent (const std::function< void(MouseEvent)> &mouse_event) |
| Registers a callback to be invoked when a mouse event occurs. | |
| virtual const DynamicPointer< Camera > & | camera () |
| Returns a reference to the dynamic camera pointer. | |
| virtual ConstPointer< Camera > | camera () const |
| Returns a const pointer to the current camera. | |
| void | createEvent (const KeyEvent &event) |
| Dispatches a keyboard event to all registered keyboard event callbacks. | |
| void | createEvent (const MouseEvent &event) |
| Dispatches a mouse event to all registered mouse event callbacks. | |
| fltp08 | devicePixelRatio () const |
| Returns the current device pixel ratio. | |
| KeyController & | getKeyController () |
| Returns the keyboard controller associated with this window. | |
| MouseController & | getMouseController () |
| Returns the mouse controller associated with this window. | |
| Time | getSurfaceUpdateTime () const |
| Returns the timestamp of the last surface update. | |
| const void * | lockptr () const |
| Returns a pointer that can be used as a lock identifier for this instance. | |
| virtual Vector< 2, uint04 > | logicalSize () const |
| Returns the logical (device-independent) size of the window. | |
| virtual Vector< 2, uint04 > | pixelSize () const |
| Returns the size of the window in physical pixels, accounting for the device pixel ratio. | |
| virtual fltp08 | referencePixelSize () |
| Returns the reference size in physical pixels, accounting for the device pixel ratio. | |
| virtual fltp08 | referenceSize () |
| Returns the reference size used for scaling calculations. | |
| void | setDevicePixelRatio (const fltp08 ratio) |
| Sets the device pixel ratio (physical pixels per logical pixel). | |
| void | setLookup (DesignObjectLookup *lookup) |
| Sets the design object lookup used for scene queries. | |
| virtual void | setReferenceSize (fltp08 size) |
| Sets the reference size used for scaling calculations. | |
| virtual void | updateInstance () |
| Called to update the window instance state. | |
| virtual bool | visible () const |
| Returns whether this window is currently visible. | |
Public Attributes | |
| Resource< bool > | is_running |
| Whether the capture system is running. | |
Additional Inherited Members | |
| Protected Member Functions inherited from WindowInstance | |
| void | setExposed (bool exposed) |
| Sets whether the window surface is currently exposed (visible and ready for rendering). | |
| Protected Attributes inherited from WindowInstance | |
| DynamicPointer< Camera > | m_camera |
| The camera used for rendering in this window. | |
| fltp08 | m_device_pixel_ratio |
| Ratio of physical pixels to logical pixels. | |
| bool | m_is_exposed = false |
| Whether the window surface is currently exposed. | |
| Buffer< std::function< void(KeyEvent)> > | m_key_events |
| Registered keyboard event callbacks. | |
| DesignObjectLookup * | m_lookup |
| Pointer to the design object lookup for scene queries. | |
| Buffer< std::function< void(MouseEvent)> > | m_mouse_events |
| Registered mouse event callbacks. | |
| fltp08 | m_reference_size |
| Reference size used for scaling calculations. | |
| Vector< 2, uint04 > | m_size |
| Logical size of the window. | |
| Time | m_surface_update_time |
| Timestamp of the last surface update. | |
Used to capture a 2D image of a DesignObjectLookup from a specific perspective.
Definition at line 45 of file ModelViewCapture.h.
|
explicit |
Constructs the model view capture.
| [in] | device | The graphics device. |
| [in] | manager | The model manager. |
| void QModelViewCapture::addRequest | ( | const ConstPointer< CaptureRequest > & | request | ) |
Adds a capture request to the queue.
| [in] | request | The capture request. |
| void QModelViewCapture::executeRequest | ( | const ConstPointer< CaptureRequest > & | request | ) |
Immediately executes a capture request.
| [in] | request | The capture request. |
|
overridevirtual |
Called after a frame is finished for post-processing.
| [in] | args | The update arguments. |
Reimplemented from WindowInstance.
|
inlinefinaloverridevirtual |
Returns the number of image grabs supported per frame.
Reimplemented from WindowInstance.
Definition at line 72 of file ModelViewCapture.h.
| QImage QModelViewCapture::getModelImage | ( | const CaptureInfo & | info | ) |
Synchronously captures an image for the given parameters.
| [in] | info | The capture parameters. |
|
inlineoverridevirtual |
Returns a platform-specific pointer to the rendering surface.
Implements WindowInstance.
Definition at line 65 of file ModelViewCapture.h.
| void QModelViewCapture::removeRequest | ( | const ConstPointer< CaptureRequest > & | request | ) |
Removes a capture request from the queue.
| [in] | request | The capture request. |
| void QModelViewCapture::requestModelImage | ( | const ConstPointer< CaptureRequest > & | request | ) |
Queues a model image capture request.
| [in] | request | The capture request. |
|
inline |
Returns the number of pending capture requests.
Definition at line 92 of file ModelViewCapture.h.
|
inline |
Sets a callback invoked when a capture is cached.
| [in] | function | The callback. |
Definition at line 95 of file ModelViewCapture.h.
|
overridevirtual |
Sets the camera for capture.
| [in] | camera | The camera pointer. |
Reimplemented from WindowInstance.
References WindowInstance::camera().
Sets the logical size of the window.
| [in] | size | The new logical dimensions. |
Reimplemented from WindowInstance.
Definition at line 61 of file ModelViewCapture.h.
References WindowInstance::setSize().
|
overridevirtual |
Checks whether the capture should exit.
Reimplemented from WindowInstance.
| bool QModelViewCapture::update | ( | ) |
Performs an update cycle, processing pending capture requests.