Skip to content
Permalink
Browse files

Use clang-tidy modernize-use-default-member-init to modernize initial…

…izers
  • Loading branch information
nyalldawson committed Nov 11, 2017
1 parent 8c6e029 commit 871f71305d3389046b44103e37bb2c1566735a41
@@ -646,6 +646,9 @@ class QgsVertexIterator
%End
public:
QgsVertexIterator();
%Docstring
Constructor for QgsVertexIterator
%End

QgsVertexIterator( const QgsAbstractGeometry *geometry );
%Docstring
@@ -19,13 +19,6 @@

///@cond PRIVATE

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

int QgsChunkList::trueCount() const
{
int len = 0;
@@ -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;
@@ -99,7 +100,7 @@ class QgsChunkList
private:
QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr;
int mCount;
int mCount = 0;
};

/// @endcond
@@ -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 )
{

@@ -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 )
@@ -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();
@@ -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
};


@@ -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 )
{
@@ -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 );
@@ -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
@@ -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 )
@@ -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
{
@@ -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 )
{
}

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


@@ -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 );
@@ -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
@@ -17,13 +17,6 @@

#include "qgsrectangle.h"


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

QgsTilingScheme::QgsTilingScheme( const QgsRectangle &fullExtent, const QgsCoordinateReferenceSystem &crs )
: mCrs( crs )
{
@@ -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 );
@@ -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

};
@@ -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 );
@@ -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;
@@ -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
};

@@ -18,12 +18,6 @@
#include "qgsreadwritecontext.h"
#include "qgsxmlutils.h"


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

QgsAbstract3DSymbol *QgsPoint3DSymbol::clone() const
{
return new QgsPoint3DSymbol( *this );
@@ -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;
@@ -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
@@ -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 );
@@ -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;
@@ -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
};

@@ -19,14 +19,6 @@

#include "qgsrasterlayer.h"



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

QgsDemTerrainGenerator::~QgsDemTerrainGenerator()
{
delete mHeightMapGenerator;

0 comments on commit 871f713

Please sign in to comment.
You can’t perform that action at this time.