QGIS API Documentation 3.41.0-Master (3291e9ff48b)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
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:
Inheritance graph
[legend]

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 124 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 620 of file qgsgeometrypaintdevice.cpp.

Member Function Documentation

◆ geometry()

const QgsAbstractGeometry & QgsGeometryPaintDevice::geometry ( ) const

Returns the rendered geometry.

Definition at line 688 of file qgsgeometrypaintdevice.cpp.

◆ metric()

int QgsGeometryPaintDevice::metric ( PaintDeviceMetric  metric) const
override

Definition at line 642 of file qgsgeometrypaintdevice.cpp.

◆ paintEngine()

QPaintEngine * QgsGeometryPaintDevice::paintEngine ( ) const
override

Definition at line 637 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 693 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 631 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 625 of file qgsgeometrypaintdevice.cpp.


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