QGIS API Documentation 4.1.0-Master (01362494303)
Loading...
Searching...
No Matches
Qgs3D Class Reference

A singleton class containing various registries and other global members related to 3D classes. More...

#include <qgs3d.h>

Public Member Functions

 Qgs3D (const Qgs3D &other)=delete
 ~Qgs3D ()
Qgs3Doperator= (const Qgs3D &other)=delete

Static Public Member Functions

static void addMaterialParametersToEffect (Qt3DRender::QEffect *effect, const QgsAbstractMaterialSettings *settings, const QgsMaterialContext &materialContext)
 Adds parameters from the material settings to a destination effect.
static void applyMaterialDataDefinedToGeometry (const QgsAbstractMaterialSettings *settings, Qt3DCore::QGeometry *geometry, int vertexCount, const QByteArray &dataDefinedBytes)
 Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer that will be used by the shader.
static const QgsAbstractMaterial3DHandlerhandlerForMaterialSettings (const QgsAbstractMaterialSettings *settings)
 Returns the handler to use for a material settings.
static void initialize ()
 Initializes the 3D framework.
static Qgs3Dinstance ()
 Returns a pointer to the singleton instance.
static int materialDataDefinedByteStride (const QgsAbstractMaterialSettings *settings)
 Returns byte stride of the data defined colors,used to fill the vertex colors data defined buffer for rendering.
static QByteArray materialDataDefinedVertexColorsAsByte (const QgsAbstractMaterialSettings *settings, const QgsExpressionContext &expressionContext)
 Returns byte array corresponding to the data defined colors depending of the expressionContext, used to fill the specific vertex buffer used for rendering the geometry.
static QgsMaterialRegistrymaterialRegistry ()
 Returns the material registry, used for managing 3D materials.
static Qgs3DTerrainRegistryterrainRegistry ()
 Returns the terrain registry, used for managing 3D terrains.
static QgsMaterialtoMaterial (const QgsAbstractMaterialSettings *settings, Qgis::MaterialRenderingTechnique technique, const QgsMaterialContext &context)
 Creates a new QgsMaterial object representing the material settings.
static QMap< QString, QString > toMaterialExportParameters (const QgsAbstractMaterialSettings *settings)
 Returns the parameters to be exported to .mtl file.

Detailed Description

A singleton class containing various registries and other global members related to 3D classes.

Since
QGIS 3.16

Definition at line 52 of file qgs3d.h.

Constructor & Destructor Documentation

◆ Qgs3D()

Qgs3D::Qgs3D ( const Qgs3D & other)
delete

◆ ~Qgs3D()

Qgs3D::~Qgs3D ( )

Definition at line 56 of file qgs3d.cpp.

Member Function Documentation

◆ addMaterialParametersToEffect()

void Qgs3D::addMaterialParametersToEffect ( Qt3DRender::QEffect * effect,
const QgsAbstractMaterialSettings * settings,
const QgsMaterialContext & materialContext )
static

Adds parameters from the material settings to a destination effect.

Since
QGIS 4.2

Definition at line 159 of file qgs3d.cpp.

◆ applyMaterialDataDefinedToGeometry()

void Qgs3D::applyMaterialDataDefinedToGeometry ( const QgsAbstractMaterialSettings * settings,
Qt3DCore::QGeometry * geometry,
int vertexCount,
const QByteArray & dataDefinedBytes )
static

Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer that will be used by the shader.

Since
QGIS 4.2

Definition at line 167 of file qgs3d.cpp.

◆ handlerForMaterialSettings()

const QgsAbstractMaterial3DHandler * Qgs3D::handlerForMaterialSettings ( const QgsAbstractMaterialSettings * settings)
static

Returns the handler to use for a material settings.

Definition at line 124 of file qgs3d.cpp.

◆ initialize()

void Qgs3D::initialize ( )
static

Initializes the 3D framework.

Definition at line 67 of file qgs3d.cpp.

◆ instance()

Qgs3D * Qgs3D::instance ( )
static

Returns a pointer to the singleton instance.

Definition at line 50 of file qgs3d.cpp.

◆ materialDataDefinedByteStride()

int Qgs3D::materialDataDefinedByteStride ( const QgsAbstractMaterialSettings * settings)
static

Returns byte stride of the data defined colors,used to fill the vertex colors data defined buffer for rendering.

Since
QGIS 4.2

Definition at line 184 of file qgs3d.cpp.

◆ materialDataDefinedVertexColorsAsByte()

QByteArray Qgs3D::materialDataDefinedVertexColorsAsByte ( const QgsAbstractMaterialSettings * settings,
const QgsExpressionContext & expressionContext )
static

Returns byte array corresponding to the data defined colors depending of the expressionContext, used to fill the specific vertex buffer used for rendering the geometry.

Since
QGIS 4.2

Definition at line 175 of file qgs3d.cpp.

◆ materialRegistry()

QgsMaterialRegistry * Qgs3D::materialRegistry ( )
static

Returns the material registry, used for managing 3D materials.

Definition at line 114 of file qgs3d.cpp.

◆ operator=()

Qgs3D & Qgs3D::operator= ( const Qgs3D & other)
delete

◆ terrainRegistry()

Qgs3DTerrainRegistry * Qgs3D::terrainRegistry ( )
static

Returns the terrain registry, used for managing 3D terrains.

Definition at line 119 of file qgs3d.cpp.

◆ toMaterial()

QgsMaterial * Qgs3D::toMaterial ( const QgsAbstractMaterialSettings * settings,
Qgis::MaterialRenderingTechnique technique,
const QgsMaterialContext & context )
static

Creates a new QgsMaterial object representing the material settings.

The technique argument specifies the rendering technique which will be used with the returned material.

Since
QGIS 4.2

Definition at line 141 of file qgs3d.cpp.

◆ toMaterialExportParameters()

QMap< QString, QString > Qgs3D::toMaterialExportParameters ( const QgsAbstractMaterialSettings * settings)
static

Returns the parameters to be exported to .mtl file.

Since
QGIS 4.2

Definition at line 150 of file qgs3d.cpp.


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