Skip to content
Permalink
Browse files

Add new 3d rendering technique enum value for TrianglesFromModel

  • Loading branch information
nyalldawson committed Nov 13, 2020
1 parent 9225441 commit 6224ea9b1c5e42eb2f3709fae51f86863b8f0282
@@ -11,5 +11,7 @@
QgsAbstractMaterialSettings.Points.__doc__ = "Point based rendering, requires point data"
QgsAbstractMaterialSettings.TrianglesWithFixedTexture = QgsMaterialSettingsRenderingTechnique.TrianglesWithFixedTexture
QgsAbstractMaterialSettings.TrianglesWithFixedTexture.__doc__ = "Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering)"
QgsMaterialSettingsRenderingTechnique.__doc__ = 'Material rendering techniques\n\n.. versionadded:: 3.16\n\n' + '* ``Triangles``: ' + QgsMaterialSettingsRenderingTechnique.Triangles.__doc__ + '\n' + '* ``Lines``: ' + QgsMaterialSettingsRenderingTechnique.Lines.__doc__ + '\n' + '* ``InstancedPoints``: ' + QgsMaterialSettingsRenderingTechnique.InstancedPoints.__doc__ + '\n' + '* ``Points``: ' + QgsMaterialSettingsRenderingTechnique.Points.__doc__ + '\n' + '* ``TrianglesWithFixedTexture``: ' + QgsMaterialSettingsRenderingTechnique.TrianglesWithFixedTexture.__doc__
QgsAbstractMaterialSettings.TrianglesFromModel = QgsMaterialSettingsRenderingTechnique.TrianglesFromModel
QgsAbstractMaterialSettings.TrianglesFromModel.__doc__ = "Triangle based rendering, using a model object source"
QgsMaterialSettingsRenderingTechnique.__doc__ = 'Material rendering techniques\n\n.. versionadded:: 3.16\n\n' + '* ``Triangles``: ' + QgsMaterialSettingsRenderingTechnique.Triangles.__doc__ + '\n' + '* ``Lines``: ' + QgsMaterialSettingsRenderingTechnique.Lines.__doc__ + '\n' + '* ``InstancedPoints``: ' + QgsMaterialSettingsRenderingTechnique.InstancedPoints.__doc__ + '\n' + '* ``Points``: ' + QgsMaterialSettingsRenderingTechnique.Points.__doc__ + '\n' + '* ``TrianglesWithFixedTexture``: ' + QgsMaterialSettingsRenderingTechnique.TrianglesWithFixedTexture.__doc__ + '\n' + '* ``TrianglesFromModel``: ' + QgsMaterialSettingsRenderingTechnique.TrianglesFromModel.__doc__
# --
@@ -18,6 +18,7 @@ enum class QgsMaterialSettingsRenderingTechnique
InstancedPoints,
Points,
TrianglesWithFixedTexture,
TrianglesFromModel,
};


@@ -47,6 +47,7 @@ enum class QgsMaterialSettingsRenderingTechnique SIP_MONKEYPATCH_SCOPEENUM_UNNES
InstancedPoints, //!< Instanced based rendering, requiring triangles and point data
Points, //!< Point based rendering, requires point data
TrianglesWithFixedTexture, //!< Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering)
TrianglesFromModel, //!< Triangle based rendering, using a model object source
};


@@ -42,6 +42,7 @@ bool QgsGoochMaterialSettings::supportsTechnique( QgsMaterialSettingsRenderingTe
{
case QgsMaterialSettingsRenderingTechnique::Triangles:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
return true;

case QgsMaterialSettingsRenderingTechnique::Lines:
@@ -94,6 +95,7 @@ Qt3DRender::QMaterial *QgsGoochMaterialSettings::toMaterial( QgsMaterialSettings
{
case QgsMaterialSettingsRenderingTechnique::Triangles:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
{
if ( dataDefinedProperties().hasActiveProperties() )
return dataDefinedMaterial();
@@ -43,6 +43,7 @@ bool QgsPhongMaterialSettings::supportsTechnique( QgsMaterialSettingsRenderingTe
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
return true;

case QgsMaterialSettingsRenderingTechnique::Lines:
@@ -90,6 +91,7 @@ Qt3DRender::QMaterial *QgsPhongMaterialSettings::toMaterial( QgsMaterialSettings
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
{
if ( dataDefinedProperties().hasActiveProperties() )
return dataDefinedMaterial();
@@ -41,6 +41,7 @@ bool QgsPhongTexturedMaterialSettings::supportsTechnique( QgsMaterialSettingsRen

case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Lines:
return false;
@@ -118,6 +119,7 @@ Qt3DRender::QMaterial *QgsPhongTexturedMaterialSettings::toMaterial( QgsMaterial
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
{
bool fitsInCache = false;
QImage textureSourceImage = QgsApplication::imageCache()->pathAsImage( mDiffuseTexturePath, QSize(), true, 1.0, fitsInCache );
@@ -38,6 +38,7 @@ bool QgsSimpleLineMaterialSettings::supportsTechnique( QgsMaterialSettingsRender
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
return false;
}
return false;
@@ -71,6 +72,7 @@ Qt3DRender::QMaterial *QgsSimpleLineMaterialSettings::toMaterial( QgsMaterialSet
case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
case QgsMaterialSettingsRenderingTechnique::Points:
case QgsMaterialSettingsRenderingTechnique::TrianglesWithFixedTexture:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
return nullptr;

case QgsMaterialSettingsRenderingTechnique::Lines:
@@ -45,6 +45,7 @@ void QgsPhongMaterialWidget::setTechnique( QgsMaterialSettingsRenderingTechnique
switch ( technique )
{
case QgsMaterialSettingsRenderingTechnique::Triangles:
case QgsMaterialSettingsRenderingTechnique::TrianglesFromModel:
{
lblDiffuse->setVisible( true );
btnDiffuse->setVisible( true );

0 comments on commit 6224ea9

Please sign in to comment.
You can’t perform that action at this time.