Skip to content

Commit fde8a03

Browse files
committedNov 13, 2018
Review/test fixes
1 parent 3c66749 commit fde8a03

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed
 

‎src/3d/qgs3dmapsettings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
4242
, mShowTerrainBoundingBoxes( other.mShowTerrainBoundingBoxes )
4343
, mShowTerrainTileInfo( other.mShowTerrainTileInfo )
4444
, mShowCameraViewCenter( other.mShowCameraViewCenter )
45+
, mShowLabels( other.mShowLabels )
46+
, mPointLights( other.mPointLights )
4547
, mLayers( other.mLayers )
4648
, mSkyboxEnabled( other.mSkyboxEnabled )
4749
, mSkyboxFileBase( other.mSkyboxFileBase )

‎src/3d/qgspointlightsettings.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgspointlightsettings.h
3+
--------------------------------------
4+
Date : November 2018
5+
Copyright : (C) 2018 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSPOINTLIGHTSETTINGS_H
217
#define QGSPOINTLIGHTSETTINGS_H
318

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

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

56+
//! Returns constant attenuation (A_0)
3557
float constantAttenuation() const { return mConstantAttenuation; }
58+
//! Sets constant attenuation (A_0)
3659
void setConstantAttenuation( float value ) { mConstantAttenuation = value; }
3760

61+
//! Returns linear attenuation (A_1)
3862
float linearAttenuation() const { return mLinearAttenuation; }
63+
//! Sets linear attenuation (A_1)
3964
void setLinearAttenuation( float value ) { mLinearAttenuation = value; }
4065

66+
//! Returns quadratic attenuation (A_2)
4167
float quadraticAttenuation() const { return mQuadraticAttenuation; }
68+
//! Sets quadratic attenuation (A_2)
4269
void setQuadraticAttenuation( float value ) { mQuadraticAttenuation = value; }
4370

4471
//! Writes configuration to a new DOM element and returns it

‎src/app/3d/qgs3danimationwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void Qgs3DAnimationWidget::setCameraController( QgsCameraController *cameraContr
6969

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

7474
// initialize GUI from the given animation
7575
cboKeyframe->clear();

‎src/app/3d/qgslightswidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void QgsLightsWidget::onAddLight()
9191
{
9292
if ( mPointLights.count() >= 8 )
9393
{
94-
QMessageBox::warning( this, tr( "Add light" ), tr( "It is not possible to add more than 8 lights to the scene." ) );
94+
QMessageBox::warning( this, tr( "Add Light" ), tr( "It is not possible to add more than 8 lights to the scene." ) );
9595
return;
9696
}
9797

‎src/app/3d/qgslightswidget.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgslightswidget.h
3+
--------------------------------------
4+
Date : November 2018
5+
Copyright : (C) 2018 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSLIGHTSWIDGET_H
217
#define QGSLIGHTSWIDGET_H
318

0 commit comments

Comments
 (0)
Please sign in to comment.