Navigation Menu

Skip to content

Commit

Permalink
Add some missing Q_OBJECT macros
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 5, 2022
1 parent 5f24e46 commit 91f66f6
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 27 deletions.
7 changes: 2 additions & 5 deletions src/3d/mesh/qgsmesh3dentity_p.cpp
Expand Up @@ -20,10 +20,7 @@
#include <Qt3DRender/QGeometryRenderer>

#include "qgsmeshlayer.h"
#include "qgsmapsettings.h"
#include "qgs3dmapsettings.h"
#include "qgsmeshlayerrenderer.h"
#include "qgsterraintextureimage_p.h"
#include "qgsmesh3dmaterial_p.h"


Expand Down Expand Up @@ -85,8 +82,8 @@ QgsMesh3dTerrainTileEntity::QgsMesh3dTerrainTileEntity(
const QgsMesh3DSymbol *symbol,
QgsChunkNodeId nodeId,
Qt3DCore::QNode *parent )
: QgsMesh3dEntity( map, triangularMesh, symbol )
, QgsTerrainTileEntity( nodeId, parent )
: QgsTerrainTileEntity( nodeId, parent )
, QgsMesh3dEntity( map, triangularMesh, symbol )
{}

void QgsMesh3dTerrainTileEntity::buildGeometry()
Expand Down
8 changes: 6 additions & 2 deletions src/3d/mesh/qgsmesh3dentity_p.h
Expand Up @@ -68,8 +68,10 @@ class QgsMesh3dEntity
};

//! Entity that handles rendering of dataset
class QgsMeshDataset3dEntity: public QgsMesh3dEntity, public Qt3DCore::QEntity
class QgsMeshDataset3dEntity: public Qt3DCore::QEntity, public QgsMesh3dEntity
{
Q_OBJECT

public:
//! Constructor
QgsMeshDataset3dEntity( const Qgs3DMapSettings &map,
Expand All @@ -87,8 +89,10 @@ class QgsMeshDataset3dEntity: public QgsMesh3dEntity, public Qt3DCore::QEntity
};

//! Entity that handles rendering of terrain mesh
class QgsMesh3dTerrainTileEntity: public QgsMesh3dEntity, public QgsTerrainTileEntity
class QgsMesh3dTerrainTileEntity: public QgsTerrainTileEntity, public QgsMesh3dEntity
{
Q_OBJECT

public:
QgsMesh3dTerrainTileEntity( const Qgs3DMapSettings &map,
const QgsTriangularMesh &triangularMesh,
Expand Down
2 changes: 2 additions & 0 deletions src/3d/mesh/qgsmesh3dgeometry_p.h
Expand Up @@ -185,6 +185,8 @@ class QgsMeshDataset3dGeometry: public QgsMesh3dGeometry

class QgsMeshDataset3DGeometryBuilder: public QgsMesh3DGeometryBuilder
{
Q_OBJECT

public:
QgsMeshDataset3DGeometryBuilder( const QgsTriangularMesh &mesh,
const QgsMesh &nativeMesh,
Expand Down
32 changes: 12 additions & 20 deletions src/3d/mesh/qgsmesh3dmaterial_p.cpp
Expand Up @@ -99,26 +99,6 @@ class ArrowsTextureGenerator: public Qt3DRender::QTextureImageDataGenerator
};


class ArrowsGridTexture: public Qt3DRender::QAbstractTextureImage
{
public:
ArrowsGridTexture( const QVector<QgsVector> &vectors, const QSize &size, bool fixedSize, double maxVectorLength ):
mVectors( vectors ), mSize( size ), mFixedSize( fixedSize ), mMaxVectorLength( maxVectorLength )
{}

protected:
Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const override
{
return Qt3DRender::QTextureImageDataGeneratorPtr( new ArrowsTextureGenerator( mVectors, mSize, mFixedSize, mMaxVectorLength ) );
}

private:
const QVector<QgsVector> mVectors;
const QSize mSize;
const bool mFixedSize;
const double mMaxVectorLength;
};


QgsMesh3dMaterial::QgsMesh3dMaterial( QgsMeshLayer *layer,
const QgsDateTimeRange &timeRange,
Expand Down Expand Up @@ -280,3 +260,15 @@ void QgsMesh3dMaterial::configureArrows( QgsMeshLayer *layer, const QgsDateTimeR
mTechnique->addParameter( new Qt3DRender::QParameter( "arrowsGridTexture", arrowsGridTexture ) ) ;
mTechnique->addParameter( new Qt3DRender::QParameter( "arrowsMinCorner", QVector2D( minCorner.x() - mOrigin.x(), -minCorner.y() + mOrigin.y() ) ) ) ;
}

ArrowsGridTexture::ArrowsGridTexture( const QVector<QgsVector> &vectors, const QSize &size, bool fixedSize, double maxVectorLength )
: mVectors( vectors )
, mSize( size )
, mFixedSize( fixedSize )
, mMaxVectorLength( maxVectorLength )
{}

Qt3DRender::QTextureImageDataGeneratorPtr ArrowsGridTexture::dataGenerator() const
{
return Qt3DRender::QTextureImageDataGeneratorPtr( new ArrowsTextureGenerator( mVectors, mSize, mFixedSize, mMaxVectorLength ) );
}
21 changes: 21 additions & 0 deletions src/3d/mesh/qgsmesh3dmaterial_p.h
Expand Up @@ -49,6 +49,8 @@ class QgsMeshLayer;
*/
class QgsMesh3dMaterial : public Qt3DRender::QMaterial
{
Q_OBJECT

public:
//! enum used to defined which type of value will be used to render the 3D entity
enum MagnitudeType
Expand Down Expand Up @@ -84,6 +86,25 @@ class QgsMesh3dMaterial : public Qt3DRender::QMaterial
void configureArrows( QgsMeshLayer *layer, const QgsDateTimeRange &timeRange );
};


class ArrowsGridTexture: public Qt3DRender::QAbstractTextureImage
{
Q_OBJECT

public:
ArrowsGridTexture( const QVector<QgsVector> &vectors, const QSize &size, bool fixedSize, double maxVectorLength );

protected:
Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const override;

private:
const QVector<QgsVector> mVectors;
const QSize mSize;
const bool mFixedSize;
const double mMaxVectorLength;
};


///@endcond

#endif // QGSMESH3DMATERIAL_H
2 changes: 2 additions & 0 deletions src/3d/qgs3dsceneexporter.h
Expand Up @@ -54,6 +54,8 @@ class QgsMeshEntity;
*/
class _3D_EXPORT Qgs3DSceneExporter : public Qt3DCore::QEntity
{
Q_OBJECT

public:
//! Constructor
Qgs3DSceneExporter() { }
Expand Down
2 changes: 2 additions & 0 deletions src/3d/qgscolorramptexture.h
Expand Up @@ -59,6 +59,8 @@ class QgsColorRampTextureGenerator: public Qt3DRender::QTextureImageDataGenerato

class QgsColorRampTexture: public Qt3DRender::QAbstractTextureImage
{
Q_OBJECT

public:
QgsColorRampTexture( const QgsColorRampShader &colorRampShader, double verticalScale = 1, Qt3DCore::QNode *parent = nullptr );
// QAbstractTextureImage interface
Expand Down
2 changes: 2 additions & 0 deletions src/3d/qgsimagetexture.h
Expand Up @@ -35,6 +35,8 @@
*/
class _3D_EXPORT QgsImageTexture : public Qt3DRender::QPaintedTextureImage
{
Q_OBJECT

public:
//! Constructor
QgsImageTexture( const QImage &image, Qt3DCore::QNode *parent = nullptr );
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgspointcloudlayerchunkloader_p.h
Expand Up @@ -53,6 +53,8 @@
*/
class QgsPointCloudLayerChunkLoaderFactory : public QgsChunkLoaderFactory
{
Q_OBJECT

public:

/**
Expand Down Expand Up @@ -88,6 +90,8 @@ class QgsPointCloudLayerChunkLoaderFactory : public QgsChunkLoaderFactory
*/
class QgsPointCloudLayerChunkLoader : public QgsChunkLoader
{
Q_OBJECT

public:

/**
Expand Down
2 changes: 2 additions & 0 deletions src/3d/qgspostprocessingentity.h
Expand Up @@ -38,6 +38,8 @@ class QgsShadowRenderingFrameGraph;
*/
class QgsPostprocessingEntity : public Qt3DCore::QEntity
{
Q_OBJECT

public:
//! Constructor
QgsPostprocessingEntity( QgsShadowRenderingFrameGraph *frameGraph, QNode *parent = nullptr );
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgspreviewquad.h
Expand Up @@ -32,6 +32,8 @@
*/
class QgsPreviewQuadMaterial : public Qt3DRender::QMaterial
{
Q_OBJECT

public:
//! Constructor
QgsPreviewQuadMaterial( Qt3DRender::QAbstractTexture *texture, QVector<Qt3DRender::QParameter *> additionalShaderParameters = QVector<Qt3DRender::QParameter *>(), QNode *parent = nullptr );
Expand All @@ -55,6 +57,8 @@ class QgsPreviewQuadMaterial : public Qt3DRender::QMaterial
*/
class QgsPreviewQuad : public Qt3DCore::QEntity
{
Q_OBJECT

public:

/**
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgsrulebasedchunkloader_p.h
Expand Up @@ -55,6 +55,8 @@ namespace Qt3DCore
*/
class QgsRuleBasedChunkLoaderFactory : public QgsQuadtreeChunkLoaderFactory
{
Q_OBJECT

public:
//! Constructs the factory (vl and rootRule must not be null)
QgsRuleBasedChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsRuleBased3DRenderer::Rule *rootRule, int leafLevel, double zMin, double zMax );
Expand All @@ -80,6 +82,8 @@ class QgsRuleBasedChunkLoaderFactory : public QgsQuadtreeChunkLoaderFactory
*/
class QgsRuleBasedChunkLoader : public QgsChunkLoader
{
Q_OBJECT

public:
//! Constructs the loader (factory and node must not be null)
QgsRuleBasedChunkLoader( const QgsRuleBasedChunkLoaderFactory *factory, QgsChunkNode *node );
Expand Down
2 changes: 2 additions & 0 deletions src/3d/qgsshadowrenderingframegraph.h
Expand Up @@ -58,6 +58,8 @@ class QgsPreviewQuad;
*/
class QgsShadowRenderingFrameGraph : public Qt3DCore::QEntity
{
Q_OBJECT

public:
//! Constructor
QgsShadowRenderingFrameGraph( QSurface *surface, QSize s, Qt3DRender::QCamera *mainCamera, Qt3DCore::QEntity *root );
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgsskyboxentity.h
Expand Up @@ -77,6 +77,8 @@ class _3D_EXPORT QgsSkyboxEntity : public Qt3DCore::QEntity
*/
class _3D_EXPORT QgsPanoramicSkyboxEntity : public QgsSkyboxEntity
{
Q_OBJECT

public:
//! Construct a skybox from a panoramic 360 image
QgsPanoramicSkyboxEntity( const QString &texturePath, Qt3DCore::QNode *parent = nullptr );
Expand All @@ -102,6 +104,8 @@ class _3D_EXPORT QgsPanoramicSkyboxEntity : public QgsSkyboxEntity
*/
class _3D_EXPORT QgsCubeFacesSkyboxEntity : public QgsSkyboxEntity
{
Q_OBJECT

public:
//! Constructs a skybox from 6 different images
QgsCubeFacesSkyboxEntity( const QString &posX, const QString &posY, const QString &posZ, const QString &negX, const QString &negY, const QString &negZ, Qt3DCore::QNode *parent = nullptr );
Expand Down
4 changes: 4 additions & 0 deletions src/3d/qgsvectorlayerchunkloader_p.h
Expand Up @@ -57,6 +57,8 @@ namespace Qt3DCore
*/
class QgsVectorLayerChunkLoaderFactory : public QgsQuadtreeChunkLoaderFactory
{
Q_OBJECT

public:
//! Constructs the factory
QgsVectorLayerChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsAbstract3DSymbol *symbol, int leafLevel, double zMin, double zMax );
Expand All @@ -81,6 +83,8 @@ class QgsVectorLayerChunkLoaderFactory : public QgsQuadtreeChunkLoaderFactory
*/
class QgsVectorLayerChunkLoader : public QgsChunkLoader
{
Q_OBJECT

public:
//! Constructs the loader
QgsVectorLayerChunkLoader( const QgsVectorLayerChunkLoaderFactory *factory, QgsChunkNode *node );
Expand Down
8 changes: 8 additions & 0 deletions src/3d/symbols/qgspointcloud3dsymbol_p.h
Expand Up @@ -146,6 +146,8 @@ class QgsClassificationPointCloud3DSymbolHandler : public QgsPointCloud3DSymbolH

class QgsPointCloud3DGeometry: public Qt3DRender::QGeometry
{
Q_OBJECT

public:
QgsPointCloud3DGeometry( Qt3DCore::QNode *parent, const QgsPointCloud3DSymbolHandler::PointData &data, unsigned int byteStride );

Expand All @@ -167,6 +169,8 @@ class QgsPointCloud3DGeometry: public Qt3DRender::QGeometry

class QgsSingleColorPointCloud3DGeometry : public QgsPointCloud3DGeometry
{
Q_OBJECT

public:
QgsSingleColorPointCloud3DGeometry( Qt3DCore::QNode *parent, const QgsPointCloud3DSymbolHandler::PointData &data, unsigned int byteStride );

Expand All @@ -176,6 +180,8 @@ class QgsSingleColorPointCloud3DGeometry : public QgsPointCloud3DGeometry

class QgsColorRampPointCloud3DGeometry : public QgsPointCloud3DGeometry
{
Q_OBJECT

public:
QgsColorRampPointCloud3DGeometry( Qt3DCore::QNode *parent, const QgsPointCloud3DSymbolHandler::PointData &data, unsigned int byteStride );

Expand All @@ -185,6 +191,8 @@ class QgsColorRampPointCloud3DGeometry : public QgsPointCloud3DGeometry

class QgsRGBPointCloud3DGeometry : public QgsPointCloud3DGeometry
{
Q_OBJECT

public:
QgsRGBPointCloud3DGeometry( Qt3DCore::QNode *parent, const QgsPointCloud3DSymbolHandler::PointData &data, unsigned int byteStride );
private:
Expand Down
2 changes: 2 additions & 0 deletions src/3d/terrain/qgsdemterraingenerator.h
Expand Up @@ -40,6 +40,8 @@ class QgsDemHeightMapGenerator;
*/
class _3D_EXPORT QgsDemTerrainGenerator : public QgsTerrainGenerator
{
Q_OBJECT

public:
//! Constructor for QgsDemTerrainGenerator
QgsDemTerrainGenerator() = default;
Expand Down
2 changes: 2 additions & 0 deletions src/3d/terrain/quantizedmeshterraingenerator.h
Expand Up @@ -25,6 +25,8 @@
*/
class QuantizedMeshTerrainGenerator : public QgsTerrainGenerator
{
Q_OBJECT

public:
QuantizedMeshTerrainGenerator();

Expand Down

0 comments on commit 91f66f6

Please sign in to comment.