QGIS API Documentation 4.3.0-Master (18b5e825726)
Loading...
Searching...
No Matches
QgsUnlitMaterialSettings Class Reference

Basic shading material used for rendering solid color, unlit objects. More...

#include <qgsunlitmaterialsettings.h>

Inheritance diagram for QgsUnlitMaterialSettings:

Public Member Functions

 QgsUnlitMaterialSettings ()=default
QColor averageColor () const override
 Returns an approximate color representing the blended material color.
QgsUnlitMaterialSettingsclone () const override
 Clones the material settings.
QColor color () const
 Returns the material color.
bool equals (const QgsAbstractMaterialSettings *other) const override
 Returns true if this settings exactly matches an other settings.
bool operator== (const QgsUnlitMaterialSettings &other) const
void readXml (const QDomElement &elem, const QgsReadWriteContext &context) override
 Reads settings from a DOM element.
void setColor (const QColor &color)
 Sets the material's color.
void setColorsFromBase (const QColor &baseColor) override
 Decomposes a base color into the material's color components, and sets the material's colors accordingly.
QSet< QgsAbstractMaterialSettings::PropertysupportedProperties () const override
 Returns the set of data-defined properties supported by this material.
QString type () const override
 Returns the unique type name for the material.
void writeXml (QDomElement &elem, const QgsReadWriteContext &context) const override
 Writes settings to a DOM element.
Public Member Functions inherited from QgsAbstractMaterialSettings
virtual ~QgsAbstractMaterialSettings ()=default
QgsPropertyCollection dataDefinedProperties () const
 Returns the symbol material property collection, used for data defined overrides.
const QgsPropertiesDefinitionpropertyDefinitions () const
 Returns a reference to the material properties definition, used for data defined overrides.
virtual bool requiresTangents () const
 Returns true if the material requires tangents generated during triangulation.
virtual bool requiresTextureCoordinates () const
 Returns true if the material requires texture coordinates to be generated during triangulation.
void setDataDefinedProperties (const QgsPropertyCollection &collection)
 Sets the material property collection, used for data defined overrides.

Static Public Member Functions

static QgsAbstractMaterialSettingscreate ()
 Returns a new instance of QgsUnlitMaterialSettings.
static bool supportsTechnique (Qgis::MaterialRenderingTechnique technique)
 Returns true if the specified technique is supported by the material.

Additional Inherited Members

Public Types inherited from QgsAbstractMaterialSettings
enum class  Property : int {
  Diffuse , Ambient , Warm , Cool ,
  Specular , BaseColor , EmissionColor , TextureScale ,
  TextureRotation , TextureOffset
}
 Data definable properties. More...

Detailed Description

Basic shading material used for rendering solid color, unlit objects.

Unlit objects are flat shaded, with no interaction with lights in the scene.

Warning
This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.
Since
QGIS 4.4

Definition at line 38 of file qgsunlitmaterialsettings.h.

Constructor & Destructor Documentation

◆ QgsUnlitMaterialSettings()

QgsUnlitMaterialSettings::QgsUnlitMaterialSettings ( )
default

Member Function Documentation

◆ averageColor()

QColor QgsUnlitMaterialSettings::averageColor ( ) const
overridevirtual

Returns an approximate color representing the blended material color.

Since
QGIS 4.2

Implements QgsAbstractMaterialSettings.

Definition at line 87 of file qgsunlitmaterialsettings.cpp.

◆ clone()

QgsUnlitMaterialSettings * QgsUnlitMaterialSettings::clone ( ) const
overridevirtual

Clones the material settings.

Caller takes ownership of the returned object.

Implements QgsAbstractMaterialSettings.

Definition at line 54 of file qgsunlitmaterialsettings.cpp.

◆ color()

QColor QgsUnlitMaterialSettings::color ( ) const
inline

Returns the material color.

See also
setColor()

Definition at line 64 of file qgsunlitmaterialsettings.h.

◆ create()

QgsAbstractMaterialSettings * QgsUnlitMaterialSettings::create ( )
static

Returns a new instance of QgsUnlitMaterialSettings.

Definition at line 49 of file qgsunlitmaterialsettings.cpp.

◆ equals()

bool QgsUnlitMaterialSettings::equals ( const QgsAbstractMaterialSettings * other) const
overridevirtual

Returns true if this settings exactly matches an other settings.

Since
QGIS 3.42

Implements QgsAbstractMaterialSettings.

Definition at line 59 of file qgsunlitmaterialsettings.cpp.

◆ operator==()

bool QgsUnlitMaterialSettings::operator== ( const QgsUnlitMaterialSettings & other) const
inline

Definition at line 80 of file qgsunlitmaterialsettings.h.

◆ readXml()

void QgsUnlitMaterialSettings::readXml ( const QDomElement & element,
const QgsReadWriteContext &  )
overridevirtual

Reads settings from a DOM element.

Reimplemented from QgsAbstractMaterialSettings.

Definition at line 73 of file qgsunlitmaterialsettings.cpp.

◆ setColor()

void QgsUnlitMaterialSettings::setColor ( const QColor & color)
inline

Sets the material's color.

See also
color()

Definition at line 71 of file qgsunlitmaterialsettings.h.

◆ setColorsFromBase()

void QgsUnlitMaterialSettings::setColorsFromBase ( const QColor & baseColor)
overridevirtual

Decomposes a base color into the material's color components, and sets the material's colors accordingly.

Parameters
baseColorThe color to decompose
Since
QGIS 4.2

Implements QgsAbstractMaterialSettings.

Definition at line 92 of file qgsunlitmaterialsettings.cpp.

◆ supportedProperties()

QSet< QgsAbstractMaterialSettings::Property > QgsUnlitMaterialSettings::supportedProperties ( ) const
overridevirtual

Returns the set of data-defined properties supported by this material.

Since
QGIS 4.2

Reimplemented from QgsAbstractMaterialSettings.

Definition at line 68 of file qgsunlitmaterialsettings.cpp.

◆ supportsTechnique()

bool QgsUnlitMaterialSettings::supportsTechnique ( Qgis::MaterialRenderingTechnique technique)
static

Returns true if the specified technique is supported by the material.

Definition at line 30 of file qgsunlitmaterialsettings.cpp.

◆ type()

QString QgsUnlitMaterialSettings::type ( ) const
overridevirtual

Returns the unique type name for the material.

Implements QgsAbstractMaterialSettings.

Definition at line 25 of file qgsunlitmaterialsettings.cpp.

◆ writeXml()

void QgsUnlitMaterialSettings::writeXml ( QDomElement & element,
const QgsReadWriteContext &  ) const
overridevirtual

Writes settings to a DOM element.

Reimplemented from QgsAbstractMaterialSettings.

Definition at line 80 of file qgsunlitmaterialsettings.cpp.


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