NDEVR
API Documentation
ScenePaintDevice

A QPaintDevice that 'paints' the widgets by turning them into 3D Model objects inside a model hierarchy. More...

Collaboration diagram for ScenePaintDevice:
[legend]

Public Member Functions

 ScenePaintDevice (Model &model)
 Constructs a scene paint device rooted at the given model.
void drawWidget (QWidget *widget, QPainter &painter, QPoint offset, uint04 depth)
 Draws a QWidget into the 3D scene hierarchy.
ScenePaintEnginescenePaintEngine ()
 Retrieves the underlying scene paint engine.
void setDevicePixelRatio (int ratio)
 Sets the device pixel ratio.
void setDevicePixelRatioScaled (int ratio)
 Sets the scaled device pixel ratio.
void setDPI (int dpi)
 Sets the DPI for both axes.
void setDPIX (int dpi)
 Sets the horizontal DPI.
void setDPIY (int dpi)
 Sets the vertical DPI.
void setPhysicalDPI (int dpi_x, int dpi_y)
 Sets the physical DPI for the paint device.
void setRoot (Model &model)
 Sets the root model for painting.

Protected Attributes

int m_device_pixel_ratio = 1
 The device pixel ratio.
int m_device_pixel_ratio_scaled = 1
 The scaled device pixel ratio.
Vector< 2, int > m_dpi = {1024, 1024}
 Logical DPI for both axes.
Time m_last_update_update
 Timestamp of the last update.
ScenePaintEnginem_paint_engine
 The underlying paint engine.
Vector< 2, int > m_physical_dpi = { 1024, 1024 }
 Physical DPI for both axes.
QWidget * m_widget = nullptr
 The widget being painted.

Detailed Description

A QPaintDevice that 'paints' the widgets by turning them into 3D Model objects inside a model hierarchy.


Definition at line 23 of file ScenePaintEngine.h.

Constructor & Destructor Documentation

◆ ScenePaintDevice()

ScenePaintDevice::ScenePaintDevice ( Model & model)

Constructs a scene paint device rooted at the given model.

Parameters
[in]modelThe root model to paint into.

Member Function Documentation

◆ drawWidget()

void ScenePaintDevice::drawWidget ( QWidget * widget,
QPainter & painter,
QPoint offset,
uint04 depth )

Draws a QWidget into the 3D scene hierarchy.

Parameters
[in]widgetThe widget to draw.
[in]painterThe painter used for rendering.
[in]offsetThe position offset for the widget.
[in]depthThe depth level of the widget in the hierarchy.

◆ scenePaintEngine()

ScenePaintEngine * ScenePaintDevice::scenePaintEngine ( )
inline

Retrieves the underlying scene paint engine.

Returns
A pointer to the ScenePaintEngine.

Definition at line 73 of file ScenePaintEngine.h.

References m_paint_engine.

◆ setDevicePixelRatio()

void ScenePaintDevice::setDevicePixelRatio ( int ratio)
inline

Sets the device pixel ratio.

Parameters
[in]ratioThe pixel ratio.

Definition at line 48 of file ScenePaintEngine.h.

References m_device_pixel_ratio.

◆ setDevicePixelRatioScaled()

void ScenePaintDevice::setDevicePixelRatioScaled ( int ratio)
inline

Sets the scaled device pixel ratio.

Parameters
[in]ratioThe scaled pixel ratio.

Definition at line 53 of file ScenePaintEngine.h.

References m_device_pixel_ratio_scaled.

◆ setDPI()

void ScenePaintDevice::setDPI ( int dpi)
inline

Sets the DPI for both axes.

Parameters
[in]dpiThe DPI value.

Definition at line 58 of file ScenePaintEngine.h.

References m_dpi.

◆ setDPIX()

void ScenePaintDevice::setDPIX ( int dpi)
inline

Sets the horizontal DPI.

Parameters
[in]dpiThe horizontal DPI value.

Definition at line 63 of file ScenePaintEngine.h.

References m_dpi.

◆ setDPIY()

void ScenePaintDevice::setDPIY ( int dpi)
inline

Sets the vertical DPI.

Parameters
[in]dpiThe vertical DPI value.

Definition at line 68 of file ScenePaintEngine.h.

References m_dpi.

◆ setPhysicalDPI()

void ScenePaintDevice::setPhysicalDPI ( int dpi_x,
int dpi_y )
inline

Sets the physical DPI for the paint device.

Parameters
[in]dpi_xHorizontal DPI.
[in]dpi_yVertical DPI.

Definition at line 43 of file ScenePaintEngine.h.

References m_physical_dpi.

◆ setRoot()

void ScenePaintDevice::setRoot ( Model & model)

Sets the root model for painting.

Parameters
[in]modelThe new root model.

The documentation for this class was generated from the following file: