Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor code cleanup
  • Loading branch information
nyalldawson committed Jul 10, 2020
1 parent 98327ef commit 402ce03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion python/3d/auto_generated/qgsphongmaterialsettings.sip.in
Expand Up @@ -83,7 +83,7 @@ Sets specular color component
%Docstring
Sets shininess of the surface
%End
void useTexture( bool used );
void setUseTexture( bool used );
%Docstring
Sets whether the diffuse texture will be used
%End
Expand Down
25 changes: 8 additions & 17 deletions src/3d/qgsphongmaterialsettings.h
Expand Up @@ -35,16 +35,7 @@ class QDomElement;
class _3D_EXPORT QgsPhongMaterialSettings
{
public:
QgsPhongMaterialSettings()
: mAmbient( QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) )
, mDiffuse( QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) )
, mSpecular( QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) )
, mIsUsingDiffuseTexture( false )
, mTexturePath( QString() )
, mTextureScale( 1.0f )
, mTextureRotation( 0.0f )
{
}
QgsPhongMaterialSettings() = default;

//! Returns ambient color component
QColor ambient() const { return mAmbient; }
Expand Down Expand Up @@ -78,7 +69,7 @@ class _3D_EXPORT QgsPhongMaterialSettings
//! Sets shininess of the surface
void setShininess( float shininess ) { mShininess = shininess; }
//! Sets whether the diffuse texture will be used
void useTexture( bool used ) { mIsUsingDiffuseTexture = used; }
void setUseTexture( bool used ) { mIsUsingDiffuseTexture = used; }
//! Sets the path of the texture
void setTexturePath( QString texturePath ) { mTexturePath = texturePath; }

Expand Down Expand Up @@ -110,14 +101,14 @@ class _3D_EXPORT QgsPhongMaterialSettings
}

private:
QColor mAmbient;
QColor mDiffuse;
QColor mSpecular;
QColor mAmbient{ QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
QColor mDiffuse{ QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
float mShininess = 0.0f;
bool mIsUsingDiffuseTexture;
bool mIsUsingDiffuseTexture{ false };
QString mTexturePath;
float mTextureScale;
float mTextureRotation;
float mTextureScale{ 1.0f };
float mTextureRotation{ 0.0f };
};


Expand Down

0 comments on commit 402ce03

Please sign in to comment.