16#ifndef QGSABSTRACTMATERIALSETTINGS_H
17#define QGSABSTRACTMATERIALSETTINGS_H
27using namespace Qt::StringLiterals;
115 bool mIsSelected =
false;
116 bool mIsHighlighted =
false;
118 QColor mSelectedColor;
134 if ( sipCpp->type() ==
"gooch"_L1 )
136 sipType = sipType_QgsGoochMaterialSettings;
138 else if ( sipCpp->type() ==
"phong"_L1 )
140 sipType = sipType_QgsPhongMaterialSettings;
142 else if ( sipCpp->type() ==
"phongtextured" )
144 sipType = sipType_QgsPhongTexturedMaterialSettings;
146 else if ( sipCpp->type() ==
"simpleline" )
148 sipType = sipType_QgsSimpleLineMaterialSettings;
150 else if ( sipCpp->type() ==
"null" )
152 sipType = sipType_QgsNullMaterialSettings;
167 virtual QString
type()
const = 0;
243 virtual void applyDataDefinedToGeometry( Qt3DCore::QGeometry *geometry,
int vertexCount,
const QByteArray &dataDefinedBytes )
const;
251 virtual QByteArray dataDefinedVertexColorsAsByte(
const QgsExpressionContext &expressionContext )
const;
263 void initPropertyDefinitions()
const;
Abstract base class for material settings.
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
virtual bool equals(const QgsAbstractMaterialSettings *other) const =0
Returns true if this settings exactly matches an other settings.
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
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...
Property
Data definable properties.
virtual void addParametersToEffect(Qt3DRender::QEffect *effect, const QgsMaterialContext &materialContext) const =0
Adds parameters from the material to a destination effect.
virtual ~QgsAbstractMaterialSettings()=default
virtual QString type() const =0
Returns the unique type name for the material.
virtual QgsMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QgsMaterial object representing the material settings.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Context settings for a material.
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.
bool isHighlighted() const
Returns true if the material should represent a highlighted state.
void setIsHighlighted(bool isHighlighted)
Sets whether the material should represent a highlighted state.
Base class for all materials used within QGIS 3D views.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on objects.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques.
@ 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.