QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
3d
materials
qgssimplelinematerialsettings.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssimplelinematerialsettings.h
3
--------------------------------------
4
Date : August 2020
5
Copyright : (C) 2020 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
17
#ifndef QGSSIMPLELINEMATERIALSETTINGS_H
18
#define QGSSIMPLELINEMATERIALSETTINGS_H
19
20
#include "qgis_core.h"
21
#include "
qgsabstractmaterialsettings.h
"
22
23
#include <QColor>
24
25
class
QgsMaterial
;
26
class
QDomElement;
27
37
class
CORE_EXPORT
QgsSimpleLineMaterialSettings
:
public
QgsAbstractMaterialSettings
38
{
39
public
:
40
QgsSimpleLineMaterialSettings
() =
default
;
41
42
QString
type
()
const override
;
43
47
static
bool
supportsTechnique
(
Qgis::MaterialRenderingTechnique
technique );
48
52
static
std::unique_ptr<QgsAbstractMaterialSettings>
create
();
53
54
QgsSimpleLineMaterialSettings
*
clone
() const override
SIP_FACTORY
;
55
bool
equals
( const
QgsAbstractMaterialSettings
*other ) const override;
56
QSet<
QgsAbstractMaterialSettings
::
Property
>
supportedProperties
() const override;
57
63
QColor
ambient
()
const
{
return
mAmbient; }
64
70
void
setAmbient
(
const
QColor &
ambient
) { mAmbient =
ambient
; }
71
82
QColor
averageColor
()
const override
;
83
96
void
setColorsFromBase
(
const
QColor &baseColor )
override
;
97
98
void
readXml
(
const
QDomElement &elem,
const
QgsReadWriteContext
&context )
override
;
99
void
writeXml
( QDomElement &elem,
const
QgsReadWriteContext
&context )
const override
;
100
101
// TODO c++20 - replace with = default
102
bool
operator==
(
const
QgsSimpleLineMaterialSettings
&other )
const
{
return
mAmbient == other.mAmbient &&
dataDefinedProperties
() == other.
dataDefinedProperties
(); }
103
104
private
:
105
QColor mAmbient { QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
106
};
107
108
109
#endif
// QGSSIMPLELINEMATERIALSETTINGS_H
Qgis::MaterialRenderingTechnique
MaterialRenderingTechnique
Material rendering techniques.
Definition
qgis.h:4453
QgsAbstractMaterialSettings
Abstract base class for material settings.
Definition
qgsabstractmaterialsettings.h:42
QgsAbstractMaterialSettings::writeXml
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
Definition
qgsabstractmaterialsettings.cpp:31
QgsAbstractMaterialSettings::readXml
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
Definition
qgsabstractmaterialsettings.cpp:24
QgsAbstractMaterialSettings::clone
virtual QgsAbstractMaterialSettings * clone() const =0
Clones the material settings.
QgsAbstractMaterialSettings::Property
Property
Data definable properties.
Definition
qgsabstractmaterialsettings.h:131
QgsAbstractMaterialSettings::averageColor
virtual QColor averageColor() const =0
Returns an approximate color representing the blended material color.
QgsAbstractMaterialSettings::type
virtual QString type() const =0
Returns the unique type name for the material.
QgsAbstractMaterialSettings::setColorsFromBase
virtual void setColorsFromBase(const QColor &baseColor)=0
Decomposes a base color into the material's color components, and sets the material's colors accordin...
QgsAbstractMaterialSettings::dataDefinedProperties
QgsPropertyCollection dataDefinedProperties() const
Returns the symbol material property collection, used for data defined overrides.
Definition
qgsabstractmaterialsettings.cpp:59
QgsMaterial
Base class for all materials used within QGIS 3D views.
Definition
qgsmaterial.h:40
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsSimpleLineMaterialSettings::supportsTechnique
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
Definition
qgssimplelinematerialsettings.cpp:30
QgsSimpleLineMaterialSettings::operator==
bool operator==(const QgsSimpleLineMaterialSettings &other) const
Definition
qgssimplelinematerialsettings.h:102
QgsSimpleLineMaterialSettings::setAmbient
void setAmbient(const QColor &ambient)
Sets the ambient color component.
Definition
qgssimplelinematerialsettings.h:70
QgsSimpleLineMaterialSettings::create
static std::unique_ptr< QgsAbstractMaterialSettings > create()
Returns a new instance of QgsSimpleLineMaterialSettings.
Definition
qgssimplelinematerialsettings.cpp:49
QgsSimpleLineMaterialSettings::QgsSimpleLineMaterialSettings
QgsSimpleLineMaterialSettings()=default
QgsSimpleLineMaterialSettings::supportedProperties
QSet< QgsAbstractMaterialSettings::Property > supportedProperties() const override
Returns the set of data-defined properties supported by this material.
Definition
qgssimplelinematerialsettings.cpp:68
QgsSimpleLineMaterialSettings::ambient
QColor ambient() const
Returns the ambient color component.
Definition
qgssimplelinematerialsettings.h:63
QgsSimpleLineMaterialSettings::equals
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
Definition
qgssimplelinematerialsettings.cpp:59
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsabstractmaterialsettings.h
Generated on
for QGIS API Documentation by
1.17.0