QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsGeometryPaintDevice Class Reference

A paint device which converts everything renderer to a QgsGeometry representation of the rendered shapes. More...

#include <qgsgeometrypaintdevice.h>

Inheritance diagram for QgsGeometryPaintDevice:

Public Member Functions

 QgsGeometryPaintDevice (bool usePathStroker=false)
 Constructor for QgsGeometryPaintDevice.
const QgsAbstractGeometrygeometry () const
 Returns the rendered geometry.
int metric (PaintDeviceMetric metric) const override
QPaintEngine * paintEngine () const override
void setSimplificationTolerance (double tolerance)
 Sets a simplification tolerance (in painter units) to use for on-the-fly simplification of geometries while rendering.
void setStrokedPathSegments (int segments)
 Sets the number of segments to use when drawing stroked paths with a rounded pen.

Static Public Member Functions

static QgsGeometry painterPathToGeometry (const QPainterPath &path)
 Converts a painter path to a QgsGeometry.

Detailed Description

A paint device which converts everything renderer to a QgsGeometry representation of the rendered shapes.

Since
QGIS 3.38

Definition at line 123 of file qgsgeometrypaintdevice.h.

Constructor & Destructor Documentation

◆ QgsGeometryPaintDevice()

QgsGeometryPaintDevice::QgsGeometryPaintDevice ( bool usePathStroker = false)

Constructor for QgsGeometryPaintDevice.

If usePathStroker is true, rendered paths will be converted using a stroke respecting the QPainter pen configuration.

Definition at line 586 of file qgsgeometrypaintdevice.cpp.

Member Function Documentation

◆ geometry()

const QgsAbstractGeometry & QgsGeometryPaintDevice::geometry ( ) const

Returns the rendered geometry.

Definition at line 654 of file qgsgeometrypaintdevice.cpp.

◆ metric()

int QgsGeometryPaintDevice::metric ( PaintDeviceMetric metric) const
override

Definition at line 608 of file qgsgeometrypaintdevice.cpp.

◆ paintEngine()

QPaintEngine * QgsGeometryPaintDevice::paintEngine ( ) const
override

Definition at line 603 of file qgsgeometrypaintdevice.cpp.

◆ painterPathToGeometry()

QgsGeometry QgsGeometryPaintDevice::painterPathToGeometry ( const QPainterPath & path)
static

Converts a painter path to a QgsGeometry.

Since
QGIS 3.38.1

Definition at line 659 of file qgsgeometrypaintdevice.cpp.

◆ setSimplificationTolerance()

void QgsGeometryPaintDevice::setSimplificationTolerance ( double tolerance)

Sets a simplification tolerance (in painter units) to use for on-the-fly simplification of geometries while rendering.

This will result in simpler, generalised paths.

Set tolerance to 0 to disable simplification. (No simplification is the default behavior).

Definition at line 597 of file qgsgeometrypaintdevice.cpp.

◆ setStrokedPathSegments()

void QgsGeometryPaintDevice::setStrokedPathSegments ( int segments)

Sets the number of segments to use when drawing stroked paths with a rounded pen.

The default is 8 segments, a smaller number will result in simpler paths.

Definition at line 591 of file qgsgeometrypaintdevice.cpp.


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