Skip to content

Commit

Permalink
Review/test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Nov 13, 2018
1 parent 3c66749 commit fde8a03
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/3d/qgs3dmapsettings.cpp
Expand Up @@ -42,6 +42,8 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mShowTerrainBoundingBoxes( other.mShowTerrainBoundingBoxes )
, mShowTerrainTileInfo( other.mShowTerrainTileInfo )
, mShowCameraViewCenter( other.mShowCameraViewCenter )
, mShowLabels( other.mShowLabels )
, mPointLights( other.mPointLights )
, mLayers( other.mLayers )
, mSkyboxEnabled( other.mSkyboxEnabled )
, mSkyboxFileBase( other.mSkyboxFileBase )
Expand Down
29 changes: 28 additions & 1 deletion src/3d/qgspointlightsettings.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgspointlightsettings.h
--------------------------------------
Date : November 2018
Copyright : (C) 2018 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSPOINTLIGHTSETTINGS_H
#define QGSPOINTLIGHTSETTINGS_H

Expand All @@ -10,6 +25,12 @@ class QDomElement;
/**
* \ingroup 3d
* Definition of a point light in a 3D map scene
*
* Total light at the distance D from a point light with intensity I
* is (I / TA) where TA is total attenuation which is calculated as
* (A_0 + A_1 * D + A_2 * D^2). The terms A_0, A_1 and A_2 stand for
* constant, linear and quadratic attenuation.
*
* \since QGIS 3.6
*/
class QgsPointLightSettings
Expand All @@ -25,20 +46,26 @@ class QgsPointLightSettings
//! Returns color of the light
QColor color() const { return mColor; }
//! Sets color of the light
void setColor( const QColor &c ) { mColor = c; }
void setColor( const QColor &color ) { mColor = color; }

//! Returns intensity of the light
float intensity() const { return mIntensity; }
//! Sets intensity of the light
void setIntensity( float intensity ) { mIntensity = intensity; }

//! Returns constant attenuation (A_0)
float constantAttenuation() const { return mConstantAttenuation; }
//! Sets constant attenuation (A_0)
void setConstantAttenuation( float value ) { mConstantAttenuation = value; }

//! Returns linear attenuation (A_1)
float linearAttenuation() const { return mLinearAttenuation; }
//! Sets linear attenuation (A_1)
void setLinearAttenuation( float value ) { mLinearAttenuation = value; }

//! Returns quadratic attenuation (A_2)
float quadraticAttenuation() const { return mQuadraticAttenuation; }
//! Sets quadratic attenuation (A_2)
void setQuadraticAttenuation( float value ) { mQuadraticAttenuation = value; }

//! Writes configuration to a new DOM element and returns it
Expand Down
2 changes: 1 addition & 1 deletion src/app/3d/qgs3danimationwidget.cpp
Expand Up @@ -69,7 +69,7 @@ void Qgs3DAnimationWidget::setCameraController( QgsCameraController *cameraContr

void Qgs3DAnimationWidget::setAnimation( const Qgs3DAnimationSettings &animSettings )
{
cboInterpolation->setCurrentIndex( animSettings.easingCurve().type() );
whileBlocking( cboInterpolation )->setCurrentIndex( animSettings.easingCurve().type() );

// initialize GUI from the given animation
cboKeyframe->clear();
Expand Down
2 changes: 1 addition & 1 deletion src/app/3d/qgslightswidget.cpp
Expand Up @@ -91,7 +91,7 @@ void QgsLightsWidget::onAddLight()
{
if ( mPointLights.count() >= 8 )
{
QMessageBox::warning( this, tr( "Add light" ), tr( "It is not possible to add more than 8 lights to the scene." ) );
QMessageBox::warning( this, tr( "Add Light" ), tr( "It is not possible to add more than 8 lights to the scene." ) );
return;
}

Expand Down
15 changes: 15 additions & 0 deletions src/app/3d/qgslightswidget.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgslightswidget.h
--------------------------------------
Date : November 2018
Copyright : (C) 2018 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSLIGHTSWIDGET_H
#define QGSLIGHTSWIDGET_H

Expand Down

0 comments on commit fde8a03

Please sign in to comment.