QGIS API Documentation 4.1.0-Master (9af12b5a203)
Loading...
Searching...
No Matches
Qgs3DSymbolUtils Class Reference

Miscellaneous utility functions used in 3D code for symbols. More...

#include <qgs3dsymbolutils.h>

Static Public Member Functions

static bool copyVectorSymbolMaterial (const QgsAbstract3DSymbol *fromSymbol, QgsAbstract3DSymbol *toSymbol)
 Copies the material properties of a vector 3D symbol from one symbol to another.
static bool setVectorSymbolBaseColor (QgsAbstract3DSymbol *symbol, const QColor &baseColor)
 Sets the base color of the material settings associated with a 3D vector symbol.
static QColor vectorSymbolAverageColor (const QgsAbstract3DSymbol *symbol)
 Computes an approximate color from a 3D vector symbol.
static QIcon vectorSymbolPreviewIcon (const QgsAbstract3DSymbol *symbol, const QSize &size, const QgsScreenProperties &screen, int padding)
 Returns an icon preview for a 3D vector symbol.

Detailed Description

Miscellaneous utility functions used in 3D code for symbols.

Note
Not available in Python bindings
Since
QGIS 4.2

Definition at line 35 of file qgs3dsymbolutils.h.

Member Function Documentation

◆ copyVectorSymbolMaterial()

bool Qgs3DSymbolUtils::copyVectorSymbolMaterial ( const QgsAbstract3DSymbol * fromSymbol,
QgsAbstract3DSymbol * toSymbol )
static

Copies the material properties of a vector 3D symbol from one symbol to another.

Parameters
fromSymbolSource 3D symbol from which the material properties are copied.
toSymbolDestination 3D symbol to which the material properties are applied.
Returns
true if the material properties were successfully copied, false otherwise.

Definition at line 248 of file qgs3dsymbolutils.cpp.

◆ setVectorSymbolBaseColor()

bool Qgs3DSymbolUtils::setVectorSymbolBaseColor ( QgsAbstract3DSymbol * symbol,
const QColor & baseColor )
static

Sets the base color of the material settings associated with a 3D vector symbol.

Parameters
symbol3D symbol whose material settings will be modified.
baseColorBase color to apply to the symbol's material settings.
Returns
true if the material's base color was successfully set, false otherwise.

Definition at line 226 of file qgs3dsymbolutils.cpp.

◆ vectorSymbolAverageColor()

QColor Qgs3DSymbolUtils::vectorSymbolAverageColor ( const QgsAbstract3DSymbol * symbol)
static

Computes an approximate color from a 3D vector symbol.

Extracts a representative color from the symbol's material settings, accounting for its specific shading model (Phong, Gooch, etc.).

Parameters
symbolThe 3D symbol to extract the color from.
Returns
A QColor representing the symbol's average appearance, or a default color if the symbol type is not supported.

Definition at line 32 of file qgs3dsymbolutils.cpp.

◆ vectorSymbolPreviewIcon()

QIcon Qgs3DSymbolUtils::vectorSymbolPreviewIcon ( const QgsAbstract3DSymbol * symbol,
const QSize & size,
const QgsScreenProperties & screen,
int padding )
static

Returns an icon preview for a 3D vector symbol.

Parameters
symbol3D symbol to generate the preview for.
sizeTarget pixmap size.
screenDestination screen properties used to determine DPI and device pixel ratio.
paddingSpace between icon edge and symbol.
Returns
An icon containing a preview of the symbol.
Note
For line and circle symbols, the size of the drawn icon depends on the symbol's parameters.

Definition at line 54 of file qgs3dsymbolutils.cpp.


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