Class: QgsGoochMaterialSettings¶
Basic shading material used for rendering based on the Phong shading model with three color components: ambient, diffuse and specular.
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.
Added in version 3.16.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Abstract base class for material settings. |
Abstract Methods
Returns an approximate color representing the blended material color. |
|
Decomposes an average color into Gooch material components, and sets the material colors accordingly. |
Methods
Returns the alpha value |
|
Returns the beta value |
|
Returns cool color component |
|
Returns diffuse color component |
|
Sets alpha value |
|
Sets beta value |
|
Sets cool color component |
|
Sets diffuse color component |
|
Sets shininess of the surface |
|
Sets specular color component |
|
Sets warm color component |
|
Returns shininess of the surface |
|
Returns specular color component |
|
Returns warm color component |
Static Methods
Returns a new instance of QgsGoochMaterialSettings. |
|
Returns |
- class qgis.core.QgsGoochMaterialSettings[source]¶
Bases:
QgsAbstractMaterialSettings- abstract averageColor(self) QColor[source]¶
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.
See also
See also
See also
See also
Added in version 4.2.
- Return type:
QColor
- static create() QgsAbstractMaterialSettings | None[source]¶
Returns a new instance of QgsGoochMaterialSettings.
- Return type:
- abstract setColorsFromBase(self, baseColor: QColor | Qt.GlobalColor | int, alpha: float, beta: float)[source]¶
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
- Parameters:
baseColor (Union[QColor, Qt.GlobalColor, int]) – The color to decompose
alpha (float) – The alpha value
beta (float) – The beta value
See also
See also
See also
See also
See also
See also
Added in version 4.2.
setColorsFromBase(self, baseColor: Union[QColor, Qt.GlobalColor, int]) 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()).- Parameters:
baseColor – The color to decompose
See also
See also
See also
See also
Added in version 4.2.
- setCool(self, cool: QColor | Qt.GlobalColor | int)[source]¶
Sets cool color component
- Parameters:
cool (Union[QColor, Qt.GlobalColor, int])
- setDiffuse(self, diffuse: QColor | Qt.GlobalColor | int)[source]¶
Sets diffuse color component
- Parameters:
diffuse (Union[QColor, Qt.GlobalColor, int])
- setShininess(self, shininess: float)[source]¶
Sets shininess of the surface
- Parameters:
shininess (float)
- setSpecular(self, specular: QColor | Qt.GlobalColor | int)[source]¶
Sets specular color component
- Parameters:
specular (Union[QColor, Qt.GlobalColor, int])
- setWarm(self, warm: QColor | Qt.GlobalColor | int)[source]¶
Sets warm color component
- Parameters:
warm (Union[QColor, Qt.GlobalColor, int])
- static supportsTechnique(technique: Qgis.MaterialRenderingTechnique) bool[source]¶
Returns
Trueif the specifiedtechniqueis supported by the Gooch material.- Parameters:
technique (Qgis.MaterialRenderingTechnique)
- Return type:
bool