30using namespace Qt::StringLiterals;
37 qDeleteAll( mMetadata );
42 if ( !mMetadata.empty() )
64 u
"metalroughtextured"_s,
65 QObject::tr(
"Physically Based with Textures" ),
76 if ( !metadata || mMetadata.contains( metadata->
type() ) )
79 mMetadata[metadata->
type()] = metadata;
80 mMaterialsOrder << metadata->
type();
86 if ( !mMetadata.contains( type ) )
89 return std::unique_ptr< QgsAbstractMaterialSettings >( mMetadata[type]->create() );
94 return mMetadata.value( type );
100 for (
const QString &material : mMaterialsOrder )
102 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.