Skip to content
Permalink
Browse files
Address some clazy warnings
  • Loading branch information
nyalldawson committed Oct 16, 2018
1 parent ca427d3 commit 230e3b410adc2dd35fa1632e08b42a53aa62d639
Showing with 390 additions and 369 deletions.
  1. +3 −3 src/3d/CMakeLists.txt
  2. +1 −37 src/3d/chunks/qgschunkboundsentity_p.cpp
  3. +43 −0 src/3d/chunks/qgschunkboundsentity_p.h
  4. +1 −1 src/3d/chunks/qgschunknode_p.cpp
  5. +1 −1 src/3d/chunks/qgschunknode_p.h
  6. +2 −2 src/3d/qgs3dmapscene.cpp
  7. +66 −66 src/3d/qgs3dmapsettings.cpp
  8. +5 −4 src/3d/qgs3dutils.cpp
  9. +1 −1 src/3d/qgsaabb.cpp
  10. +1 −1 src/3d/qgsaabb.h
  11. +1 −1 src/3d/qgscamerapose.cpp
  12. +2 −2 src/3d/qgslayoutitem3dmap.cpp
  13. +1 −1 src/3d/qgsoffscreen3dengine.cpp
  14. +1 −1 src/3d/qgsoffscreen3dengine.h
  15. +8 −8 src/3d/qgsphongmaterialsettings.cpp
  16. +13 −13 src/3d/qgsvectorlayer3drenderer.cpp
  17. +2 −2 src/3d/symbols/qgsline3dsymbol.cpp
  18. +3 −3 src/3d/symbols/qgsline3dsymbol_p.cpp
  19. +2 −2 src/3d/symbols/qgspoint3dsymbol.cpp
  20. +24 −24 src/3d/symbols/qgspoint3dsymbol_p.cpp
  21. +1 −1 src/3d/symbols/qgspoint3dsymbol_p.h
  22. +2 −2 src/3d/symbols/qgspolygon3dsymbol.cpp
  23. +1 −1 src/3d/symbols/qgspolygon3dsymbol_p.cpp
  24. +6 −6 src/3d/terrain/qgsdemterraingenerator.cpp
  25. +6 −21 src/3d/terrain/qgsflatterraingenerator.cpp
  26. +20 −1 src/3d/terrain/qgsflatterraingenerator.h
  27. +3 −3 src/3d/terrain/qgsterraingenerator.cpp
  28. +1 −1 src/3d/terrain/qgsterraintileloader_p.cpp
  29. +2 −0 src/3d/terrain/qgsterraintileloader_p.h
  30. +2 −2 src/analysis/processing/qgsalgorithmimportphotos.cpp
  31. +1 −1 src/analysis/processing/qgsalgorithmrotate.cpp
  32. +2 −2 src/analysis/processing/qgsalgorithmshortestpathlayertopoint.cpp
  33. +2 −2 src/analysis/processing/qgsalgorithmshortestpathpointtolayer.cpp
  34. +1 −1 src/analysis/raster/qgsninecellfilter.cpp
  35. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheck.cpp
  36. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheck.h
  37. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.cpp
  38. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheckregistry.cpp
  39. +2 −1 src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.cpp
  40. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp
  41. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.cpp
  42. +1 −1 src/analysis/vector/qgsgeometrysnappersinglesource.cpp
  43. +22 −22 src/app/3d/qgs3danimationsettings.cpp
  44. +4 −4 src/app/3d/qgs3danimationwidget.cpp
  45. +1 −1 src/app/3d/qgs3dmapconfigwidget.cpp
  46. +8 −2 src/app/3d/qgs3dmaptoolidentify.cpp
  47. +24 −24 src/app/3d/qgspoint3dsymbolwidget.cpp
  48. +4 −4 src/app/3d/qgsvectorlayer3drendererwidget.cpp
  49. +1 −1 src/app/layout/qgslayoutatlaswidget.cpp
  50. +1 −1 src/app/layout/qgslayoutmanagerdialog.cpp
  51. +1 −1 src/app/layout/qgslayoutmapwidget.cpp
  52. +1 −1 src/app/layout/qgsreportsectionmodel.cpp
  53. +8 −8 src/app/locator/qgsinbuiltlocatorfilters.cpp
  54. +1 −1 src/app/main.cpp
  55. +1 −1 src/app/pluginmanager/qgspluginmanager.cpp
  56. +15 −15 src/app/qgisapp.cpp
  57. +1 −1 src/app/qgisapp.h
  58. +16 −16 src/app/qgsappscreenshots.cpp
  59. +7 −7 src/app/qgsattributesformproperties.cpp
  60. +1 −1 src/app/qgsattributesformproperties.h
  61. +1 −1 src/app/qgsdecorationcopyright.cpp
  62. +1 −1 src/app/qgsdecorationcopyrightdialog.cpp
  63. +1 −1 src/app/qgsfeatureaction.cpp
  64. +1 −1 src/app/qgsfeatureaction.h
  65. +1 −1 src/app/qgshandlebadlayers.cpp
  66. +2 −2 src/app/qgsmaptoolidentifyaction.cpp
  67. +4 −4 src/app/qgsmaptooloffsetcurve.cpp
  68. +1 −1 src/app/qgsmaptooloffsetcurve.h
  69. +2 −2 src/app/qgsmaptoolselectionhandler.cpp
  70. +2 −2 src/app/qgsmaptoolselectionhandler.h
  71. +2 −2 src/app/qgsmaptoolselectutils.cpp
  72. +2 −2 src/app/qgsmaptoolselectutils.h
  73. +5 −5 src/app/qgsmaptoolsimplify.cpp
  74. +3 −3 src/app/qgsmaptoolsimplify.h
  75. +1 −1 src/app/qgsnewspatialitelayerdialog.cpp
  76. +2 −2 src/app/vertextool/qgsvertextool.cpp
  77. +2 −2 src/app/vertextool/qgsvertextool.h
@@ -59,17 +59,20 @@ SET(QGIS_3D_MOC_HDRS
qgstessellatedpolygongeometry.h
qgswindow3dengine.h

chunks/qgschunkboundsentity_p.h
chunks/qgschunkedentity_p.h
chunks/qgschunkloader_p.h
chunks/qgschunkqueuejob_p.h

processing/qgs3dalgorithms.h

terrain/qgsdemterraintileloader_p.h
terrain/qgsflatterraingenerator.h
terrain/qgsterrainentity_p.h
terrain/qgsterraintexturegenerator_p.h
terrain/qgsterraintextureimage_p.h
terrain/qgsterraintileentity_p.h
terrain/qgsterraintileloader_p.h
)

QT5_WRAP_CPP(QGIS_3D_MOC_SRCS ${QGIS_3D_MOC_HDRS})
@@ -96,7 +99,6 @@ SET(QGIS_3D_HDRS
qgsvectorlayer3drenderer.h
qgswindow3dengine.h

chunks/qgschunkboundsentity_p.h
chunks/qgschunkedentity_p.h
chunks/qgschunklist_p.h
chunks/qgschunkloader_p.h
@@ -114,13 +116,11 @@ SET(QGIS_3D_HDRS
terrain/qgsdemterraingenerator.h
terrain/qgsdemterraintilegeometry_p.h
terrain/qgsdemterraintileloader_p.h
terrain/qgsflatterraingenerator.h
terrain/qgsterrainentity_p.h
terrain/qgsterraingenerator.h
terrain/qgsterraintexturegenerator_p.h
terrain/qgsterraintextureimage_p.h
terrain/qgsterraintileentity_p.h
terrain/qgsterraintileloader_p.h
#terrain/quantizedmeshgeometry.h
#terrain/quantizedmeshterraingenerator.h
)
@@ -15,37 +15,14 @@

#include "qgschunkboundsentity_p.h"

#include <Qt3DRender/QAttribute>
#include <Qt3DRender/QBuffer>
#include <Qt3DRender/QGeometry>
#include <Qt3DRender/QGeometryRenderer>
#include <Qt3DExtras/QPhongMaterial>

#include "qgsaabb.h"


///@cond PRIVATE

class LineMeshGeometry : public Qt3DRender::QGeometry
{
public:
LineMeshGeometry( Qt3DCore::QNode *parent = nullptr );

int vertexCount()
{
return mVertices.size();
}

void setVertices( QList<QVector3D> vertices );

private:
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
QList<QVector3D> mVertices;

};


LineMeshGeometry::LineMeshGeometry( Qt3DCore::QNode *parent )
: Qt3DRender::QGeometry( parent )
, mPositionAttribute( new Qt3DRender::QAttribute( this ) )
@@ -60,7 +37,7 @@ LineMeshGeometry::LineMeshGeometry( Qt3DCore::QNode *parent )
addAttribute( mPositionAttribute );
}

void LineMeshGeometry::setVertices( QList<QVector3D> vertices )
void LineMeshGeometry::setVertices( const QList<QVector3D> &vertices )
{
QByteArray vertexBufferData;
vertexBufferData.resize( vertices.size() * 3 * sizeof( float ) );
@@ -81,19 +58,6 @@ void LineMeshGeometry::setVertices( QList<QVector3D> vertices )
// ----------------


//! Geometry renderer for axis aligned bounding boxes - draws a box edges as lines
class AABBMesh : public Qt3DRender::QGeometryRenderer
{
public:
AABBMesh( Qt3DCore::QNode *parent = nullptr );

void setBoxes( const QList<QgsAABB> &bboxes );

private:
LineMeshGeometry *mLineMeshGeo = nullptr;
};


AABBMesh::AABBMesh( Qt3DCore::QNode *parent )
: Qt3DRender::QGeometryRenderer( parent )
{
@@ -28,6 +28,10 @@
//

#include <Qt3DCore/QEntity>
#include <Qt3DRender/QAttribute>
#include <Qt3DRender/QGeometry>
#include <QVector3D>
#include <Qt3DRender/QGeometryRenderer>

class QgsAABB;
class AABBMesh;
@@ -40,6 +44,8 @@ class AABBMesh;
*/
class QgsChunkBoundsEntity : public Qt3DCore::QEntity
{
Q_OBJECT

public:
//! Constructs the entity
QgsChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );
@@ -51,6 +57,43 @@ class QgsChunkBoundsEntity : public Qt3DCore::QEntity
AABBMesh *mAabbMesh = nullptr;
};


class LineMeshGeometry : public Qt3DRender::QGeometry
{
Q_OBJECT

public:
LineMeshGeometry( Qt3DCore::QNode *parent = nullptr );

int vertexCount()
{
return mVertices.size();
}

void setVertices( const QList<QVector3D> &vertices );

private:
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
QList<QVector3D> mVertices;

};


//! Geometry renderer for axis aligned bounding boxes - draws a box edges as lines
class AABBMesh : public Qt3DRender::QGeometryRenderer
{
Q_OBJECT

public:
AABBMesh( Qt3DCore::QNode *parent = nullptr );

void setBoxes( const QList<QgsAABB> &bboxes );

private:
LineMeshGeometry *mLineMeshGeo = nullptr;
};

/// @endcond

#endif // QGSCHUNKBOUNDSENTITY_P_H
@@ -54,7 +54,7 @@ QgsChunkNode::~QgsChunkNode()
delete mChildren[i];
}

bool QgsChunkNode::allChildChunksResident( const QTime &currentTime ) const
bool QgsChunkNode::allChildChunksResident( QTime currentTime ) const
{
for ( int i = 0; i < 4; ++i )
{
@@ -121,7 +121,7 @@ class QgsChunkNode
QgsChunkQueueJob *updater() const { return mUpdater; }

//! Returns true if all child chunks are available and thus this node could be swapped to the child nodes
bool allChildChunksResident( const QTime &currentTime ) const;
bool allChildChunksResident( QTime currentTime ) const;

//! make sure that all child nodes are at least skeleton nodes
void ensureAllChildrenExist();
@@ -446,7 +446,7 @@ void Qgs3DMapScene::onLayerEntityPickEvent( Qt3DRender::QPickEvent *event )
// unfortunately we can't access which sub-entity triggered the pick event
// so as a temporary workaround let's just ignore the entity with selection
// and hope the event was the main entity (QTBUG-58206)
if ( geomRenderer->objectName() != "main" )
if ( geomRenderer->objectName() != QLatin1String( "main" ) )
continue;

if ( QgsTessellatedPolygonGeometry *g = qobject_cast<QgsTessellatedPolygonGeometry *>( geomRenderer->geometry() ) )
@@ -510,7 +510,7 @@ void Qgs3DMapScene::addLayerEntity( QgsMapLayer *layer )
// This is a bit of a hack and it should be handled in QgsMapLayer::setRenderer3D() but in qgis_core
// the vector layer 3D renderer class is not available. Maybe we need an intermediate map layer 3D renderer
// class in qgis_core that can be used to handle this case nicely.
if ( layer->type() == QgsMapLayer::VectorLayer && renderer->type() == "vector" )
if ( layer->type() == QgsMapLayer::VectorLayer && renderer->type() == QLatin1String( "vector" ) )
{
static_cast<QgsVectorLayer3DRenderer *>( renderer )->setLayer( static_cast<QgsVectorLayer *>( layer ) );
}

1 comment on commit 230e3b4

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on 230e3b4 Oct 17, 2018

@nyalldawson , just to confirm, I'm able to compile QGIS all the way to this commit (the previous commit 5352629 successfully builds)

Please sign in to comment.