QGIS API Documentation 4.1.0-Master (31622b25bb0)
Loading...
Searching...
No Matches
QgsSimpleLineMaterialSettings Class Reference

Basic shading material used for rendering simple lines as solid line components. More...

#include <qgssimplelinematerialsettings.h>

Inheritance diagram for QgsSimpleLineMaterialSettings:

Public Member Functions

 QgsSimpleLineMaterialSettings ()=default
QColor ambient () const
 Returns the ambient color component.
QColor averageColor () const override
 Returns an approximate color representing the blended material color.
QgsSimpleLineMaterialSettingsclone () const override
 Clones the material settings.
bool equals (const QgsAbstractMaterialSettings *other) const override
 Returns true if this settings exactly matches an other settings.
bool operator== (const QgsSimpleLineMaterialSettings &other) const
void readXml (const QDomElement &elem, const QgsReadWriteContext &context) override
 Reads settings from a DOM element.
void setAmbient (const QColor &ambient)
 Sets the ambient color component.
void setColorsFromBase (const QColor &baseColor) override
 Decomposes a base color into the material's color components, and sets the material's color accordingly.
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 QgsSimpleLineMaterialSettings.
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
}
 Data definable properties. More...

Detailed Description

Basic shading material used for rendering simple lines as solid line components.

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 3.16

Definition at line 37 of file qgssimplelinematerialsettings.h.

Constructor & Destructor Documentation

◆ QgsSimpleLineMaterialSettings()

QgsSimpleLineMaterialSettings::QgsSimpleLineMaterialSettings ( )
default

Member Function Documentation

◆ ambient()

QColor QgsSimpleLineMaterialSettings::ambient ( ) const
inline

Returns the ambient color component.

See also
setAmbient()

Definition at line 62 of file qgssimplelinematerialsettings.h.

◆ averageColor()

QColor QgsSimpleLineMaterialSettings::averageColor ( ) const
overridevirtual

Returns an approximate color representing the blended material color.

Since this material contains only a single color, this function simply returns ambient().

See also
ambient()
Since
QGIS 4.2

Implements QgsAbstractMaterialSettings.

Definition at line 82 of file qgssimplelinematerialsettings.cpp.

◆ clone()

QgsSimpleLineMaterialSettings * QgsSimpleLineMaterialSettings::clone ( ) const
overridevirtual

Clones the material settings.

Caller takes ownership of the returned object.

Implements QgsAbstractMaterialSettings.

Definition at line 54 of file qgssimplelinematerialsettings.cpp.

◆ create()

QgsAbstractMaterialSettings * QgsSimpleLineMaterialSettings::create ( )
static

Returns a new instance of QgsSimpleLineMaterialSettings.

Definition at line 49 of file qgssimplelinematerialsettings.cpp.

◆ equals()

bool QgsSimpleLineMaterialSettings::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 qgssimplelinematerialsettings.cpp.

◆ operator==()

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

Definition at line 101 of file qgssimplelinematerialsettings.h.

◆ readXml()

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

Reads settings from a DOM element.

Reimplemented from QgsAbstractMaterialSettings.

Definition at line 68 of file qgssimplelinematerialsettings.cpp.

◆ setAmbient()

void QgsSimpleLineMaterialSettings::setAmbient ( const QColor & ambient)
inline

Sets the ambient color component.

See also
ambient()

Definition at line 69 of file qgssimplelinematerialsettings.h.

◆ setColorsFromBase()

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

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

Since this material contains only a single color, this function is equivalent to calling setAmbient(baseColor).

Parameters
baseColorThe color to decompose
See also
setAmbient()
Since
QGIS 4.2

Implements QgsAbstractMaterialSettings.

Definition at line 87 of file qgssimplelinematerialsettings.cpp.

◆ supportsTechnique()

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

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

Definition at line 30 of file qgssimplelinematerialsettings.cpp.

◆ type()

QString QgsSimpleLineMaterialSettings::type ( ) const
overridevirtual

Returns the unique type name for the material.

Implements QgsAbstractMaterialSettings.

Definition at line 25 of file qgssimplelinematerialsettings.cpp.

◆ writeXml()

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

Writes settings to a DOM element.

Reimplemented from QgsAbstractMaterialSettings.

Definition at line 75 of file qgssimplelinematerialsettings.cpp.


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