Skip to content

Commit

Permalink
Use clang-tidy modernize-use-default-member-init to modernize initial…
Browse files Browse the repository at this point in the history
…izers
  • Loading branch information
nyalldawson committed Nov 11, 2017
1 parent 8c6e029 commit 871f713
Show file tree
Hide file tree
Showing 32 changed files with 86 additions and 167 deletions.
3 changes: 3 additions & 0 deletions python/core/geometry/qgsabstractgeometry.sip
Expand Up @@ -646,6 +646,9 @@ class QgsVertexIterator
%End
public:
QgsVertexIterator();
%Docstring
Constructor for QgsVertexIterator
%End

QgsVertexIterator( const QgsAbstractGeometry *geometry );
%Docstring
Expand Down
7 changes: 0 additions & 7 deletions src/3d/chunks/qgschunklist_p.cpp
Expand Up @@ -19,13 +19,6 @@

///@cond PRIVATE

QgsChunkList::QgsChunkList()
: mHead( nullptr )
, mTail( nullptr )
, mCount( 0 )
{
}

int QgsChunkList::trueCount() const
{
int len = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/3d/chunks/qgschunklist_p.h
Expand Up @@ -64,7 +64,8 @@ struct QgsChunkListEntry
class QgsChunkList
{
public:
QgsChunkList();
//! Constructor for QgsChunkList
QgsChunkList() = default;

//! Counts the real number of entries by walking the list (for debugging purposes only)
int trueCount() const;
Expand Down Expand Up @@ -99,7 +100,7 @@ class QgsChunkList
private:
QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr;
int mCount;
int mCount = 0;
};

/// @endcond
Expand Down
1 change: 0 additions & 1 deletion src/3d/qgs3dmapscene.cpp
Expand Up @@ -42,7 +42,6 @@
Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, Qt3DExtras::QForwardRenderer *defaultFrameGraph, Qt3DRender::QRenderSettings *renderSettings, Qt3DRender::QCamera *camera, const QRect &viewportRect, Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent )
, mMap( map )
, mTerrain( nullptr )
, mForwardRenderer( defaultFrameGraph )
{

Expand Down
17 changes: 0 additions & 17 deletions src/3d/qgs3dmapsettings.cpp
Expand Up @@ -26,23 +26,6 @@
#include "qgssymbollayerutils.h"
#include "qgsrasterlayer.h"


Qgs3DMapSettings::Qgs3DMapSettings()
: mOriginX( 0 )
, mOriginY( 0 )
, mOriginZ( 0 )
, mBackgroundColor( Qt::black )
, mTerrainVerticalScale( 1 )
, mMapTileResolution( 512 )
, mMaxTerrainScreenError( 3.f )
, mMaxTerrainGroundError( 1.f )
, mShowTerrainBoundingBoxes( false )
, mShowTerrainTileInfo( false )
, mShowLabels( false )
, mSkyboxEnabled( false )
{
}

Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
: QObject()
, mOriginX( other.mOriginX )
Expand Down
35 changes: 21 additions & 14 deletions src/3d/qgs3dmapsettings.h
Expand Up @@ -47,7 +47,9 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
{
Q_OBJECT
public:
Qgs3DMapSettings();

//! Constructor for Qgs3DMapSettings
Qgs3DMapSettings() = default;
//! Copy constructor
Qgs3DMapSettings( const Qgs3DMapSettings &other );
~Qgs3DMapSettings();
Expand Down Expand Up @@ -206,23 +208,28 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
void showLabelsChanged();

private:
double mOriginX, mOriginY, mOriginZ; //!< Coordinates in map CRS at which our 3D world has origin (0,0,0)
//! X coordinate in map CRS at which our 3D world has origin (0,0,0)
double mOriginX = 0;
//! Y coordinate in map CRS at which our 3D world has origin (0,0,0)
double mOriginY = 0;
//! Z coordinate in map CRS at which our 3D world has origin (0,0,0)
double mOriginZ = 0;
QgsCoordinateReferenceSystem mCrs; //!< Destination coordinate system of the world
QColor mBackgroundColor; //!< Background color of the scene
QColor mSelectionColor; //!< Color to be used for selected map features
double mTerrainVerticalScale; //!< Multiplier of terrain heights to make the terrain shape more pronounced
QColor mBackgroundColor = Qt::black; //!< Background color of the scene
QColor mSelectionColor; //!< Color to be used for selected map features
double mTerrainVerticalScale = 1; //!< Multiplier of terrain heights to make the terrain shape more pronounced
std::unique_ptr<QgsTerrainGenerator> mTerrainGenerator; //!< Implementation of the terrain generation
int mMapTileResolution; //!< Size of map textures of tiles in pixels (width/height)
float mMaxTerrainScreenError; //!< Maximum allowed terrain error in pixels (determines when tiles are switched to more detailed ones)
float mMaxTerrainGroundError; //!< Maximum allowed horizontal map error in map units (determines how many zoom levels will be used)
bool mShowTerrainBoundingBoxes; //!< Whether to show bounding boxes of entities - useful for debugging
bool mShowTerrainTileInfo; //!< Whether to draw extra information about terrain tiles to the textures - useful for debugging
bool mShowLabels; //!< Whether to display labels on terrain tiles
int mMapTileResolution = 512; //!< Size of map textures of tiles in pixels (width/height)
float mMaxTerrainScreenError = 3.f; //!< Maximum allowed terrain error in pixels (determines when tiles are switched to more detailed ones)
float mMaxTerrainGroundError = 1.f; //!< Maximum allowed horizontal map error in map units (determines how many zoom levels will be used)
bool mShowTerrainBoundingBoxes = false; //!< Whether to show bounding boxes of entities - useful for debugging
bool mShowTerrainTileInfo = false; //!< Whether to draw extra information about terrain tiles to the textures - useful for debugging
bool mShowLabels = false; //!< Whether to display labels on terrain tiles
QList<QgsMapLayerRef> mLayers; //!< Layers to be rendered
QList<QgsAbstract3DRenderer *> mRenderers; //!< Extra stuff to render as 3D object
bool mSkyboxEnabled; //!< Whether to render skybox
QString mSkyboxFileBase; //!< Base part of the files with skybox textures
QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures
bool mSkyboxEnabled = false; //!< Whether to render skybox
QString mSkyboxFileBase; //!< Base part of the files with skybox textures
QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures
};


Expand Down
5 changes: 0 additions & 5 deletions src/3d/qgsaabb.cpp
Expand Up @@ -15,11 +15,6 @@

#include "qgsaabb.h"

QgsAABB::QgsAABB()
: xMin( 0 ), yMin( 0 ), zMin( 0 ), xMax( 0 ), yMax( 0 ), zMax( 0 )
{
}

QgsAABB::QgsAABB( float xMin, float yMin, float zMin, float xMax, float yMax, float zMax )
: xMin( xMin ), yMin( yMin ), zMin( zMin ), xMax( xMax ), yMax( yMax ), zMax( zMax )
{
Expand Down
10 changes: 7 additions & 3 deletions src/3d/qgsaabb.h
Expand Up @@ -31,7 +31,7 @@ class _3D_EXPORT QgsAABB
{
public:
//! Constructs bounding box with null coordinates
QgsAABB();
QgsAABB() = default;

//! Constructs bounding box
QgsAABB( float xMin, float yMin, float zMin, float xMax, float yMax, float zMax );
Expand Down Expand Up @@ -72,8 +72,12 @@ class _3D_EXPORT QgsAABB
//! Returns a list of pairs of vertices (useful for display of bounding boxes)
QList<QVector3D> verticesForLines() const;

float xMin, yMin, zMin;
float xMax, yMax, zMax;
float xMin = 0.0f;
float yMin = 0.0f;
float zMin = 0.0f;
float xMax = 0.0f;
float yMax = 0.0f;
float zMax = 0.0f;
};

#endif // QGSAABB_H
1 change: 0 additions & 1 deletion src/3d/qgscameracontroller.cpp
Expand Up @@ -23,7 +23,6 @@

QgsCameraController::QgsCameraController( Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent )
, mLastPressedHeight( 0 )
, mMouseDevice( new Qt3DInput::QMouseDevice() )
, mKeyboardDevice( new Qt3DInput::QKeyboardDevice() )
, mMouseHandler( new Qt3DInput::QMouseHandler )
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgscameracontroller.h
Expand Up @@ -76,7 +76,7 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity
//! used for computation of translation when dragging mouse
QRect mViewport;
//! height of terrain when mouse button was last pressed - for camera control
float mLastPressedHeight;
float mLastPressedHeight = 0;

struct CameraData
{
Expand Down
3 changes: 1 addition & 2 deletions src/3d/qgsphongmaterialsettings.h
Expand Up @@ -35,7 +35,6 @@ class _3D_EXPORT 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 ) )
, mShininess( 0.0f )
{
}

Expand Down Expand Up @@ -66,7 +65,7 @@ class _3D_EXPORT QgsPhongMaterialSettings
QColor mAmbient;
QColor mDiffuse;
QColor mSpecular;
float mShininess;
float mShininess = 0.0f;
};


Expand Down
4 changes: 0 additions & 4 deletions src/3d/qgstessellatedpolygongeometry.cpp
Expand Up @@ -27,11 +27,7 @@

QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry( QNode *parent )
: Qt3DRender::QGeometry( parent )
, mPositionAttribute( nullptr )
, mNormalAttribute( nullptr )
{
mWithNormals = true;

mVertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );

QgsTessellator tmpTess( 0, 0, mWithNormals );
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgstessellatedpolygongeometry.h
Expand Up @@ -51,7 +51,7 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
Qt3DRender::QAttribute *mNormalAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;

bool mWithNormals;
bool mWithNormals = true;
};

#endif // QGSTESSELLATEDPOLYGONGEOMETRY_H
7 changes: 0 additions & 7 deletions src/3d/qgstilingscheme.cpp
Expand Up @@ -17,13 +17,6 @@

#include "qgsrectangle.h"


QgsTilingScheme::QgsTilingScheme()
: mMapOrigin()
, mBaseTileSide( 0 )
{
}

QgsTilingScheme::QgsTilingScheme( const QgsRectangle &fullExtent, const QgsCoordinateReferenceSystem &crs )
: mCrs( crs )
{
Expand Down
4 changes: 2 additions & 2 deletions src/3d/qgstilingscheme.h
Expand Up @@ -33,7 +33,7 @@ class _3D_EXPORT QgsTilingScheme
{
public:
//! Creates invalid tiling scheme
QgsTilingScheme();
QgsTilingScheme() = default;

//! Creates tiling scheme where level 0 tile is centered at the full extent and the full extent completely fits into the level 0 tile
QgsTilingScheme( const QgsRectangle &fullExtent, const QgsCoordinateReferenceSystem &crs );
Expand All @@ -54,7 +54,7 @@ class _3D_EXPORT QgsTilingScheme

private:
QgsPointXY mMapOrigin; //!< Origin point in map coordinates: (0,0) in the tiling scheme
double mBaseTileSide; //!< Length of tile side at zoom level 0 in map coordinates
double mBaseTileSide = 0; //!< Length of tile side at zoom level 0 in map coordinates
QgsCoordinateReferenceSystem mCrs; //!< CRS of the coordinates

};
Expand Down
10 changes: 0 additions & 10 deletions src/3d/symbols/qgsline3dsymbol.cpp
Expand Up @@ -15,16 +15,6 @@

#include "qgsline3dsymbol.h"

QgsLine3DSymbol::QgsLine3DSymbol()
: mAltClamping( AltClampRelative )
, mAltBinding( AltBindCentroid )
, mWidth( 2 )
, mHeight( 0 )
, mExtrusionHeight( 0 )
{

}

QgsAbstract3DSymbol *QgsLine3DSymbol::clone() const
{
return new QgsLine3DSymbol( *this );
Expand Down
17 changes: 10 additions & 7 deletions src/3d/symbols/qgsline3dsymbol.h
Expand Up @@ -31,7 +31,8 @@
class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol
{
public:
QgsLine3DSymbol();
//! Constructor for QgsLine3DSymbol
QgsLine3DSymbol() = default;

QString type() const override { return "line"; }
QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
Expand Down Expand Up @@ -70,12 +71,14 @@ class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol
void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }

private:
AltitudeClamping mAltClamping; //! how to handle altitude of vector features
AltitudeBinding mAltBinding; //! how to handle clamping of vertices of individual features

float mWidth; //!< Line width (horizontally)
float mHeight; //!< Base height of polygons
float mExtrusionHeight; //!< How much to extrude (0 means no walls)
//! how to handle altitude of vector features
AltitudeClamping mAltClamping = AltClampRelative;
//! how to handle clamping of vertices of individual features
AltitudeBinding mAltBinding = AltBindCentroid;

float mWidth = 2.0f; //!< Line width (horizontally)
float mHeight = 0.0f; //!< Base height of polygons
float mExtrusionHeight = 0.0f; //!< How much to extrude (0 means no walls)
QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects
};

Expand Down
6 changes: 0 additions & 6 deletions src/3d/symbols/qgspoint3dsymbol.cpp
Expand Up @@ -18,12 +18,6 @@
#include "qgsreadwritecontext.h"
#include "qgsxmlutils.h"


QgsPoint3DSymbol::QgsPoint3DSymbol()
: mAltClamping( AltClampRelative )
{
}

QgsAbstract3DSymbol *QgsPoint3DSymbol::clone() const
{
return new QgsPoint3DSymbol( *this );
Expand Down
6 changes: 4 additions & 2 deletions src/3d/symbols/qgspoint3dsymbol.h
Expand Up @@ -32,7 +32,8 @@
class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol
{
public:
QgsPoint3DSymbol();
//! Constructor for QgsPoint3DSymbol.
QgsPoint3DSymbol() = default;

QString type() const override { return "point"; }
QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
Expand Down Expand Up @@ -84,7 +85,8 @@ class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol
void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; }

private:
AltitudeClamping mAltClamping; //! how to handle altitude of vector features
//! how to handle altitude of vector features
AltitudeClamping mAltClamping = AltClampRelative;

QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects
Shape mShape = Cylinder; //!< What kind of shape to use
Expand Down
8 changes: 0 additions & 8 deletions src/3d/symbols/qgspolygon3dsymbol.cpp
Expand Up @@ -15,14 +15,6 @@

#include "qgspolygon3dsymbol.h"

QgsPolygon3DSymbol::QgsPolygon3DSymbol()
: mAltClamping( AltClampRelative )
, mAltBinding( AltBindCentroid )
, mHeight( 0 )
, mExtrusionHeight( 0 )
{
}

QgsAbstract3DSymbol *QgsPolygon3DSymbol::clone() const
{
return new QgsPolygon3DSymbol( *this );
Expand Down
13 changes: 8 additions & 5 deletions src/3d/symbols/qgspolygon3dsymbol.h
Expand Up @@ -31,7 +31,8 @@
class _3D_EXPORT QgsPolygon3DSymbol : public QgsAbstract3DSymbol
{
public:
QgsPolygon3DSymbol();
//! Constructor for QgsPolygon3DSymbol
QgsPolygon3DSymbol() = default;

QString type() const override { return "polygon"; }
QgsAbstract3DSymbol *clone() const override SIP_FACTORY;
Expand Down Expand Up @@ -65,11 +66,13 @@ class _3D_EXPORT QgsPolygon3DSymbol : public QgsAbstract3DSymbol
void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; }

private:
AltitudeClamping mAltClamping; //! how to handle altitude of vector features
AltitudeBinding mAltBinding; //! how to handle clamping of vertices of individual features
//! how to handle altitude of vector features
AltitudeClamping mAltClamping = AltClampRelative;
//! how to handle clamping of vertices of individual features
AltitudeBinding mAltBinding = AltBindCentroid;

float mHeight; //!< Base height of polygons
float mExtrusionHeight; //!< How much to extrude (0 means no walls)
float mHeight = 0.0f; //!< Base height of polygons
float mExtrusionHeight = 0.0f; //!< How much to extrude (0 means no walls)
QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects
};

Expand Down
8 changes: 0 additions & 8 deletions src/3d/terrain/qgsdemterraingenerator.cpp
Expand Up @@ -19,14 +19,6 @@

#include "qgsrasterlayer.h"



QgsDemTerrainGenerator::QgsDemTerrainGenerator()
: mResolution( 16 )
, mSkirtHeight( 10.f )
{
}

QgsDemTerrainGenerator::~QgsDemTerrainGenerator()
{
delete mHeightMapGenerator;
Expand Down

0 comments on commit 871f713

Please sign in to comment.