30using namespace Qt::StringLiterals;
37 qDeleteAll( mMetadata );
42 if ( !mMetadata.empty() )
52 u
"metalroughtextured"_s,
53 QObject::tr(
"Physically Based (with textures)" ),
78 if ( !metadata || mMetadata.contains( metadata->
type() ) )
81 mMetadata[metadata->
type()] = metadata;
82 mMaterialsOrder << metadata->
type();
88 if ( !mMetadata.contains( type ) )
91 return std::unique_ptr< QgsAbstractMaterialSettings >( mMetadata[type]->create() );
96 return mMetadata.value( type );
102 for (
const QString &material : mMaterialsOrder )
104 if ( mMetadata.value( material ) )
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Gooch material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsGoochMaterialSettings.
bool addMaterialSettingsType(QgsMaterialSettingsAbstractMetadata *metadata)
Registers a new material settings type. Takes ownership of the metadata instance.
QgsMaterialSettingsAbstractMetadata * materialSettingsMetadata(const QString &type) const
Returns metadata for specified material settings type. Returns nullptr if not found.
bool populate()
Populates the registry with standard material types.
std::unique_ptr< QgsAbstractMaterialSettings > createMaterialSettings(const QString &type) const
Creates a new instance of the material settings of the specified type.
QStringList materialSettingsTypes() const
Returns a list of all available material settings types.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsMetalRoughTexturedMaterialSettings.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the metal rough material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsNullMaterialSettings.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongMaterialSettings.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongTexturedMaterialSettings.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsSimpleLineMaterialSettings.