31using namespace Qt::StringLiterals;
35 return mCreateFunc ? mCreateFunc().release() :
nullptr;
43 qDeleteAll( mMetadata );
48 if ( !mMetadata.empty() )
58 u
"metalroughtextured"_s,
59 QObject::tr(
"Physically Based (with textures)" ),
87 if ( !metadata || mMetadata.contains( metadata->
type() ) )
90 mMetadata[metadata->
type()] = metadata;
91 mMaterialsOrder << metadata->
type();
97 if ( !mMetadata.contains( type ) )
100 return std::unique_ptr< QgsAbstractMaterialSettings >( mMetadata[type]->create() );
105 return mMetadata.value( type );
111 for (
const QString &material : mMaterialsOrder )
113 if ( mMetadata.value( material ) )
Abstract base class for material settings.
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 std::unique_ptr< 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 std::unique_ptr< 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 bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
static std::unique_ptr< QgsAbstractMaterialSettings > create()
Returns a new instance of QgsNullMaterialSettings.
static std::unique_ptr< 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 bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
static std::unique_ptr< 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 std::unique_ptr< QgsAbstractMaterialSettings > create()
Returns a new instance of QgsSimpleLineMaterialSettings.
static std::unique_ptr< QgsAbstractMaterialSettings > create()
Returns a new instance of QgsUnlitMaterialSettings.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.