![]() |
NDEVR
API Documentation
|
Contains core information about a Viewport. More...
Public Member Functions | |
| 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. | |
| virtual void | finishFrame (GraphicsUpdateArguments &args) |
| Called at the end of a frame to perform any finalization work. | |
| virtual uint04 | getGrabImageSize () |
| Returns the size for image grabbing operations. | |
| KeyController & | getKeyController () |
| Returns the keyboard controller associated with this window. | |
| MouseController & | getMouseController () |
| Returns the mouse controller associated with this window. | |
| virtual void * | getSurface ()=0 |
| Returns a platform-specific pointer to the rendering surface. | |
| 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. | |
| virtual void | setCamera (const DynamicPointer< Camera > &camera) |
| Sets the camera associated with this window. | |
| 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 | setSize (const Vector< 2, uint04 > &size) |
| Sets the logical size of the window. | |
| virtual bool | shouldExit () const |
| Returns whether this window should exit or close. | |
| virtual void | updateInstance () |
| Called to update the window instance state. | |
| virtual bool | visible () const |
| Returns whether this window is currently visible. | |
Protected Member Functions | |
| void | setExposed (bool exposed) |
| Sets whether the window surface is currently exposed (visible and ready for rendering). | |
Protected Attributes | |
| 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. | |
Contains core information about a Viewport.
WindowInstance represents a renderable window surface that manages a Camera, input events, and display properties such as size and device pixel ratio. Subclasses provide platform-specific surface implementations.
Definition at line 55 of file WindowInstance.h.
| WindowInstance::WindowInstance | ( | ) |
Default constructor.
Initializes the window instance with default values.
| WindowInstance::WindowInstance | ( | const DynamicPointer< Camera > & | camera, |
| DesignObjectLookup * | lookup ) |
Constructs a WindowInstance with a given camera and design object lookup.
| [in] | camera | The camera to associate with this window. |
| [in] | lookup | The design object lookup used for scene queries. |
References camera().
|
inline |
Registers a callback to be invoked when a keyboard event occurs.
| [in] | key_event | The callback function to add. |
Definition at line 98 of file WindowInstance.h.
References m_key_events.
|
inline |
Registers a callback to be invoked when a mouse event occurs.
| [in] | mouse_event | The callback function to add. |
Definition at line 95 of file WindowInstance.h.
References m_mouse_events.
|
inlinevirtual |
Returns a reference to the dynamic camera pointer.
Definition at line 128 of file WindowInstance.h.
References m_camera.
|
inlinevirtual |
Returns a const pointer to the current camera.
Definition at line 125 of file WindowInstance.h.
References m_camera.
Referenced by WindowInstance(), QModelViewCapture::setCamera(), QTGraphicsWindow::setCamera(), and setCamera().
| void WindowInstance::createEvent | ( | const KeyEvent & | event | ) |
Dispatches a keyboard event to all registered keyboard event callbacks.
| [in] | event | The key event to dispatch. |
| void WindowInstance::createEvent | ( | const MouseEvent & | event | ) |
Dispatches a mouse event to all registered mouse event callbacks.
| [in] | event | The mouse event to dispatch. |
|
inline |
Returns the current device pixel ratio.
Definition at line 143 of file WindowInstance.h.
References m_device_pixel_ratio.
|
inlinevirtual |
Called at the end of a frame to perform any finalization work.
| [in] | args | The graphics update arguments for the current frame. |
Reimplemented in GLESGraphicsWindow, QModelViewCapture, and QTGraphicsWindow.
Definition at line 119 of file WindowInstance.h.
|
inlinevirtual |
Returns the size for image grabbing operations.
Reimplemented in QModelViewCapture.
Definition at line 116 of file WindowInstance.h.
| KeyController & WindowInstance::getKeyController | ( | ) |
Returns the keyboard controller associated with this window.
| MouseController & WindowInstance::getMouseController | ( | ) |
Returns the mouse controller associated with this window.
|
pure virtual |
Returns a platform-specific pointer to the rendering surface.
Implemented in GLESGraphicsWindow, QModelViewCapture, and XRCameraView.
|
inline |
Returns the timestamp of the last surface update.
Definition at line 112 of file WindowInstance.h.
References m_surface_update_time.
|
inline |
Returns a pointer that can be used as a lock identifier for this instance.
Definition at line 131 of file WindowInstance.h.
Returns the logical (device-independent) size of the window.
Definition at line 80 of file WindowInstance.h.
References m_size.
Returns the size of the window in physical pixels, accounting for the device pixel ratio.
Definition at line 77 of file WindowInstance.h.
References Vector< t_dims, t_type >::as(), m_device_pixel_ratio, and m_size.
|
inlinevirtual |
Returns the reference size in physical pixels, accounting for the device pixel ratio.
Definition at line 86 of file WindowInstance.h.
References m_device_pixel_ratio, and m_reference_size.
|
inlinevirtual |
Returns the reference size used for scaling calculations.
Definition at line 83 of file WindowInstance.h.
References m_reference_size.
|
virtual |
Sets the camera associated with this window.
| [in] | camera | The new camera to use for rendering. |
Reimplemented in QModelViewCapture, and QTGraphicsWindow.
References camera().
|
inline |
Sets the device pixel ratio (physical pixels per logical pixel).
| [in] | ratio | The device pixel ratio to set. |
Definition at line 140 of file WindowInstance.h.
References m_device_pixel_ratio.
|
protected |
Sets whether the window surface is currently exposed (visible and ready for rendering).
| [in] | exposed | True if the window is exposed, false otherwise. |
|
inline |
Sets the design object lookup used for scene queries.
| [in] | lookup | The DesignObjectLookup to associate with this window. |
Definition at line 74 of file WindowInstance.h.
References m_lookup.
|
virtual |
Sets the reference size used for scaling calculations.
| [in] | size | The new reference size in logical units. |
Sets the logical size of the window.
| [in] | size | The new logical dimensions. |
Reimplemented in QModelViewCapture, and QTGraphicsWindow.
Referenced by QModelViewCapture::setSize().
|
inlinevirtual |
Returns whether this window should exit or close.
Reimplemented in QModelViewCapture, and QTGraphicsWindow.
Definition at line 104 of file WindowInstance.h.
|
inlinevirtual |
Called to update the window instance state.
Override to provide custom update logic.
Reimplemented in GLESGraphicsWindow.
Definition at line 109 of file WindowInstance.h.
|
inlinevirtual |
Returns whether this window is currently visible.
Reimplemented in QTGraphicsWindow.
Definition at line 101 of file WindowInstance.h.