16#ifndef QGSABSTRACTMATERIALSETTINGS_H
17#define QGSABSTRACTMATERIALSETTINGS_H
23#include <Qt3DRender/qmaterial.h>
32#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
105 bool mIsSelected =
false;
107 QColor mSelectedColor;
126 if ( sipCpp->type() == QLatin1String(
"gooch" ) )
128 sipType = sipType_QgsGoochMaterialSettings;
130 else if ( sipCpp->type() == QLatin1String(
"phong" ) )
132 sipType = sipType_QgsPhongMaterialSettings;
134 else if ( sipCpp->type() ==
"phongtextured" )
136 sipType = sipType_QgsPhongTexturedMaterialSettings;
138 else if ( sipCpp->type() ==
"simpleline" )
140 sipType = sipType_QgsSimpleLineMaterialSettings;
142 else if ( sipCpp->type() ==
"null" )
144 sipType = sipType_QgsNullMaterialSettings;
160 virtual QString
type()
const = 0;
227#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
228 virtual void applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry,
int vertexCount,
const QByteArray &dataDefinedBytes )
const;
230 virtual void applyDataDefinedToGeometry( Qt3DCore::QGeometry *geometry,
int vertexCount,
const QByteArray &dataDefinedBytes )
const;
239 virtual QByteArray dataDefinedVertexColorsAsByte(
const QgsExpressionContext &expressionContext )
const;
251 void initPropertyDefinitions()
const;
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
virtual QgsAbstractMaterialSettings * clone() const =0
Clones the material settings.
virtual int dataDefinedByteStride() const
Returns byte stride of the data defined colors,used to fill the vertex colors data defined buffer for...
virtual Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QMaterial object representing the material settings.
virtual ~QgsAbstractMaterialSettings()=default
virtual QString type() const =0
Returns the unique type name for the material.
virtual void addParametersToEffect(Qt3DRender::QEffect *effect) const =0
Adds parameters from the material to a destination effect.
Property
Data definable properties.
@ Ambient
Ambient color (phong material)
@ Warm
Warm color (gooch material)
@ Cool
Cool color (gooch material)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QColor selectionColor() const
Returns the color for representing materials in a selected state.
void setIsSelected(bool isSelected)
Sets whether the material should represent a selected state.
void setSelectionColor(const QColor &color)
Sets the color for representing materials in a selected state.
bool isSelected() const
Returns true if the material should represent a selected state.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
The class is used as a container of context for various read/write operations on other objects.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.
@ Points
Point based rendering, requires point data.
@ Triangles
Triangle based rendering (default)
@ TrianglesFromModel
Triangle based rendering, using a model object source.
@ Lines
Line based rendering, requires line data.
@ TrianglesDataDefined
Triangle based rendering with possibility of datadefined color.
@ InstancedPoints
Instanced based rendering, requiring triangles and point data.
@ TrianglesWithFixedTexture
Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering)
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.