|
QGIS API Documentation 4.1.0-Master (d6fb7a379fb)
|
Basic shading material used for rendering based on the Phong shading model with three color components: ambient, diffuse and specular. More...
#include <qgsgoochmaterialsettings.h>

Public Member Functions | |
| QgsGoochMaterialSettings ()=default | |
| double | alpha () const |
| Returns the alpha value. | |
| QColor | averageColor () const override |
| Returns an approximate color representing the blended material color. | |
| double | beta () const |
| Returns the beta value. | |
| QgsGoochMaterialSettings * | clone () const override |
| Clones the material settings. | |
| QColor | cool () const |
| Returns cool color component. | |
| QColor | diffuse () const |
| Returns diffuse color component. | |
| bool | equals (const QgsAbstractMaterialSettings *other) const override |
Returns true if this settings exactly matches an other settings. | |
| bool | operator== (const QgsGoochMaterialSettings &other) const |
| void | readXml (const QDomElement &elem, const QgsReadWriteContext &context) override |
| Reads settings from a DOM element. | |
| void | setAlpha (double alpha) |
| Sets alpha value. | |
| void | setBeta (double beta) |
| Sets beta value. | |
| void | setColorsFromBase (const QColor &baseColor) override |
| Decomposes an average color into Gooch material components, and sets the material colors accordingly. | |
| void | setColorsFromBase (const QColor &baseColor, double alpha, double beta) |
| Decomposes an average color into Gooch material components, and sets the material colors accordingly. | |
| void | setCool (const QColor &cool) |
| Sets cool color component. | |
| void | setDiffuse (const QColor &diffuse) |
| Sets diffuse color component. | |
| void | setShininess (double shininess) |
| Sets shininess of the surface. | |
| void | setSpecular (const QColor &specular) |
| Sets specular color component. | |
| void | setWarm (const QColor &warm) |
| Sets warm color component. | |
| double | shininess () const |
| Returns shininess of the surface. | |
| QColor | specular () const |
| Returns specular color component. | |
| QString | type () const override |
| Returns the unique type name for the material. | |
| QColor | warm () const |
| Returns warm color component. | |
| 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 QgsPropertiesDefinition & | propertyDefinitions () 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 QgsAbstractMaterialSettings * | create () |
| Returns a new instance of QgsGoochMaterialSettings. | |
| static bool | supportsTechnique (Qgis::MaterialRenderingTechnique technique) |
Returns true if the specified technique is supported by the Gooch material. | |
Additional Inherited Members | |
| Public Types inherited from QgsAbstractMaterialSettings | |
| enum class | Property : int { Diffuse , Ambient , Warm , Cool , Specular , BaseColor , EmissionColor } |
| Data definable properties. More... | |
Basic shading material used for rendering based on the Phong shading model with three color components: ambient, diffuse and specular.
Definition at line 37 of file qgsgoochmaterialsettings.h.
|
default |
|
inline |
Returns the alpha value.
Definition at line 71 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Returns an approximate color representing the blended material color.
This function calculates a weighted average of the cool, warm, diffuse, and specular color components to produce a single representative color.
Implements QgsAbstractMaterialSettings.
Definition at line 68 of file qgsgoochmaterialsettings.cpp.
|
inline |
Returns the beta value.
Definition at line 74 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Clones the material settings.
Caller takes ownership of the returned object.
Implements QgsAbstractMaterialSettings.
Definition at line 54 of file qgsgoochmaterialsettings.cpp.
|
inline |
Returns cool color component.
Definition at line 61 of file qgsgoochmaterialsettings.h.
|
static |
Returns a new instance of QgsGoochMaterialSettings.
Definition at line 30 of file qgsgoochmaterialsettings.cpp.
|
inline |
Returns diffuse color component.
Definition at line 64 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Returns true if this settings exactly matches an other settings.
Implements QgsAbstractMaterialSettings.
Definition at line 59 of file qgsgoochmaterialsettings.cpp.
|
inline |
Definition at line 152 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Reads settings from a DOM element.
Reimplemented from QgsAbstractMaterialSettings.
Definition at line 118 of file qgsgoochmaterialsettings.cpp.
|
inline |
Sets alpha value.
Definition at line 90 of file qgsgoochmaterialsettings.h.
|
inline |
Sets beta value.
Definition at line 93 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Decomposes an average color into Gooch material components, and sets the material colors accordingly.
Sets warm, cool, diffuse and specular colors from the input color. This is equivalent to calling setColorsFromBase with the existing alpha and beta parameters: setColorsFromBase(baseColor, alpha(), beta()).
| baseColor | The color to decompose |
Implements QgsAbstractMaterialSettings.
Definition at line 113 of file qgsgoochmaterialsettings.cpp.
| void QgsGoochMaterialSettings::setColorsFromBase | ( | const QColor & | baseColor, |
| double | alpha, | ||
| double | beta ) |
Decomposes an average color into Gooch material components, and sets the material colors accordingly.
Sets warm, cool, diffuse and specular colors from the input color. It also sets the alpha and beta parameters
| baseColor | The color to decompose |
| alpha | The alpha value |
| beta | The beta value |
Definition at line 84 of file qgsgoochmaterialsettings.cpp.
|
inline |
Sets cool color component.
Definition at line 80 of file qgsgoochmaterialsettings.h.
|
inline |
Sets diffuse color component.
Definition at line 83 of file qgsgoochmaterialsettings.h.
|
inline |
Sets shininess of the surface.
Definition at line 87 of file qgsgoochmaterialsettings.h.
|
inline |
Sets specular color component.
Definition at line 85 of file qgsgoochmaterialsettings.h.
|
inline |
Sets warm color component.
Definition at line 77 of file qgsgoochmaterialsettings.h.
|
inline |
Returns shininess of the surface.
Definition at line 68 of file qgsgoochmaterialsettings.h.
|
inline |
Returns specular color component.
Definition at line 66 of file qgsgoochmaterialsettings.h.
|
static |
Returns true if the specified technique is supported by the Gooch material.
Definition at line 35 of file qgsgoochmaterialsettings.cpp.
|
overridevirtual |
Returns the unique type name for the material.
Implements QgsAbstractMaterialSettings.
Definition at line 25 of file qgsgoochmaterialsettings.cpp.
|
inline |
Returns warm color component.
Definition at line 58 of file qgsgoochmaterialsettings.h.
|
overridevirtual |
Writes settings to a DOM element.
Reimplemented from QgsAbstractMaterialSettings.
Definition at line 131 of file qgsgoochmaterialsettings.cpp.