Skip to content

Commit

Permalink
Split textured phong material class from basic phong material class
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 3, 2020
1 parent 4d55185 commit b07e0a2
Show file tree
Hide file tree
Showing 24 changed files with 956 additions and 437 deletions.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -883,6 +883,7 @@
<file>themes/default/mIconPhongMaterial.svg</file>
<file>themes/default/mIconGoochMaterial.svg</file>
<file>themes/default/mIconSimpleLineMaterial.svg</file>
<file>themes/default/mIconPhongTexturedMaterial.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
139 changes: 139 additions & 0 deletions images/themes/default/mIconPhongTexturedMaterial.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/3d/3d_auto.sip
Expand Up @@ -14,6 +14,7 @@
%Include auto_generated/materials/qgsgoochmaterialsettings.sip
%Include auto_generated/materials/qgsmaterialregistry.sip
%Include auto_generated/materials/qgsphongmaterialsettings.sip
%Include auto_generated/materials/qgsphongtexturedmaterialsettings.sip
%Include auto_generated/materials/qgssimplelinematerialsettings.sip
%Include auto_generated/symbols/qgsline3dsymbol.sip
%Include auto_generated/symbols/qgspoint3dsymbol.sip
Expand Down
Expand Up @@ -112,18 +112,6 @@ Reads settings from a DOM ``element``
Writes settings to a DOM ``element``
%End

virtual bool requiresTextureCoordinates() const;
%Docstring
Returns true if the material requires texture coordinates to be generated
during triangulation.
%End

virtual float textureRotation() const;
%Docstring
Returns the texture rotation (in degrees), if texture coordinates to be generated
during triangulation.
%End


};

Expand Down
80 changes: 0 additions & 80 deletions python/3d/auto_generated/materials/qgsphongmaterialsettings.sip.in
Expand Up @@ -70,46 +70,6 @@ Returns shininess of the surface
virtual QMap<QString, QString> toExportParameters() const;


bool diffuseTextureEnabled() const;
%Docstring
Returns whether the diffuse texture is used.

.. note::

Diffuse textures will only be used at render time if :py:func:`~QgsPhongMaterialSettings.diffuseTextureEnabled` is ``True``
and a :py:func:`~QgsPhongMaterialSettings.texturePath` is non-empty.

.. seealso:: :py:func:`setDiffuseTextureEnabled`

.. seealso:: :py:func:`texturePath`
%End

QString texturePath() const;
%Docstring
Returns the diffuse texture path.

.. note::

Diffuse textures will only be used at render time if :py:func:`~QgsPhongMaterialSettings.diffuseTextureEnabled` is ``True``
and a :py:func:`~QgsPhongMaterialSettings.texturePath` is non-empty.

.. seealso:: :py:func:`setTexturePath`

.. seealso:: :py:func:`diffuseTextureEnabled`
%End

float textureScale() const;
%Docstring
Returns the texture scale
The texture scale changes the size of the displayed texture in the 3D scene
If the texture scale is less than 1 the texture will be stretched
%End

virtual bool requiresTextureCoordinates() const;

virtual float textureRotation() const;


void setAmbient( const QColor &ambient );
%Docstring
Sets ambient color component
Expand All @@ -125,46 +85,6 @@ Sets specular color component
void setShininess( float shininess );
%Docstring
Sets shininess of the surface
%End

void setDiffuseTextureEnabled( bool used );
%Docstring
Sets whether the diffuse texture is enabled.

.. note::

Diffuse textures will only be used at render time if :py:func:`~QgsPhongMaterialSettings.diffuseTextureEnabled` is ``True``
and a :py:func:`~QgsPhongMaterialSettings.texturePath` is non-empty.

.. seealso:: :py:func:`diffuseTextureEnabled`

.. seealso:: :py:func:`setTexturePath`
%End

void setTexturePath( const QString &path );
%Docstring
Sets the ``path`` of the texture.

.. note::

Diffuse textures will only be used at render time if :py:func:`~QgsPhongMaterialSettings.diffuseTextureEnabled` is ``True``
and a :py:func:`~QgsPhongMaterialSettings.texturePath` is non-empty.

.. seealso:: :py:func:`texturePath`

.. seealso:: :py:func:`setDiffuseTextureEnabled`
%End

void setTextureScale( float scale );
%Docstring
Sets the texture scale
The texture scale changes the size of the displayed texture in the 3D scene
If the texture scale is less than 1 the texture will be stretched
%End

void setTextureRotation( float rotation );
%Docstring
Sets the texture rotation in degrees
%End

virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
Expand Down

0 comments on commit b07e0a2

Please sign in to comment.