34#include <NDEVR/WindowInstance.h>
35#include <NDEVR/QTModelManager.h>
36#include <NDEVR/WindowContainer.h>
41#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
42#include <QVulkanWindow>
43 typedef QVulkanWindow GraphicsWindowBase;
45 typedef QWindow GraphicsWindowBase;
61 friend class QTGraphicsWidget;
62 friend class RenderThread;
151 void graphicsUpdate();
152 bool event(QEvent *event)
override;
154 void createMouseListener();
158#if NDEVR_SUPPORTS_THREADING
178 class GlobalGraphicsWidgetEventFilter;
223#if !NDEVR_SPECIAL_GRAPHICS_WINDOW
224 GlobalGraphicsWidgetEventFilter* m_filter;
Simple version of ResourceListener which allows for a simple function callback that will be executed ...
A thread that executes a user-provided callback function concurrently.
The equivelent of std::vector but with a bit more control.
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.
A Window used to render 3D graphics.
QBackingStore * m_backing_store
Fallback backing store for the window.
void onFocusChanged(UUID focus, bool focussed)
Handles a focus change.
QImage getImage() const
Returns the last rendered frame as a QImage.
bool m_initiation_failure
Whether initialization failed.
QRect m_last_render_size
The size used for the last render.
void requestContextMenu(const QPoint &pos)
Emitted to request a context menu display.
void mouseInScreenSignal(bool mouse_in_screen)
Emitted when the mouse enters or leaves the window.
void contextMenu(const QPoint &pos)
Shows a context menu at the given position.
void updateFallbackStore()
Updates the fallback backing store for the window.
void onSelectionChanged(Buffer< UUID > selection, bool selected)
Handles a selection change.
QPointF m_touch_begin_point
Starting point of a touch gesture.
void setOverrideMaterial(UUID material)
Sets a material override for the renderer.
void onClearAll()
Handles a clear-all event from the scene.
virtual void initialize()
Initializes the graphics context and renderer.
bool m_is_size_valid
Whether the current window size is valid.
virtual void setModelManager(QTModelManager *manager)
Sets the model manager for this window.
~QTGraphicsWindow()
Destructor.
QTModelManager * m_manager
The model manager.
void setAnimating(bool animating)
Sets whether the window continuously animates.
virtual bool visible() const override
Checks whether the window is visible.
const DynamicPointer< GraphicsDevice > & device() const
Returns the graphics device.
QTimer * m_touch_context_timer
Timer for long-press touch context menu.
bool m_animating
Whether continuous animation is active.
virtual bool shouldExit() const override
Checks whether the window should exit.
void resizeEvent(QResizeEvent *resize_event) override
Handles window resize events.
bool m_instance_valid
Whether the graphics instance is valid.
bool m_touch_alternate
Alternate touch mode flag.
QTimer * m_fps_timer
Timer driving FPS-limited rendering.
QTGraphicsWindow(const DynamicPointer< GraphicsDevice > &device, QWindow *parent, Qt::WindowFlags flags)
Constructs the graphics window.
void renderShowing()
Emitted when the render window is first shown.
void setCamera(const DynamicPointer< Camera > &camera) override
Sets the camera for rendering.
QTResourceListener * m_mouse_manager_listener
Listener for mouse manager changes.
void finishFrame(GraphicsUpdateArguments &args) override
Called after a frame is finished for post-processing.
bool m_is_init
Whether the window has been initialized.
void pause(const TimeSpan &span)
Pauses rendering for a duration.
bool m_has_valid_khr
Whether a valid Vulkan surface (KHR) exists.
DynamicPointer< GraphicsDevice > m_device
The graphics device.
void exposeEvent(QExposeEvent *e) override
Handles expose events to trigger rendering.
Renderer * m_render
The renderer for this window.
void onSelectedSignal(Buffer< UUID > selected)
Emitted when objects are selected.
void renderSlot()
Slot that triggers a render pass.
void setSize(const Vector< 2, uint04 > &size) final override
Sets the viewport size.
void updateSize()
Updates the internal size from the window geometry.
virtual void makeCurrent()
Makes this window's graphics context current (no-op by default).
void hideContextMenuSignal()
Emitted to hide the context menu.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Represents a color in the RGB space with optional alpha transparency.
An object that renders a specific Camera object, typically run on a different thread than the main UI...
Stores a time span, or difference between two times, with an optional start time.
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.
bool event(QEvent *event) override
Handles show/hide events and forwards all events to the optional event forwarder.
WindowContainer(QWidget *parent=nullptr)
Constructs a WindowContainer with an optional parent.
virtual ConstPointer< Camera > camera() const
Returns a const pointer to the current camera.
WindowInstance()
Default constructor.
The primary namespace for the NDEVR SDK.