Skip to content

Commit

Permalink
Merge pull request qgis#58879 from m-kuhn/install-3d-headers
Browse files Browse the repository at this point in the history
Install 3D headers
  • Loading branch information
m-kuhn authored Sep 30, 2024
2 parents 6f3e33e + 4a0d2a3 commit d4d7684
Show file tree
Hide file tree
Showing 41 changed files with 161 additions and 134 deletions.
27 changes: 14 additions & 13 deletions src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ set(QGIS_3D_SRCS
qgsvirtualpointcloudentity_p.cpp

chunks/qgschunkboundsentity_p.cpp
chunks/qgschunkedentity_p.cpp
chunks/qgschunkedentity.cpp
chunks/qgschunklist_p.cpp
chunks/qgschunkloader_p.cpp
chunks/qgschunknode_p.cpp
chunks/qgschunkqueuejob_p.cpp
chunks/qgschunkloader.cpp
chunks/qgschunknode.cpp
chunks/qgschunkqueuejob.cpp

lights/qgsdirectionallightsettings.cpp
lights/qgslightsource.cpp
Expand Down Expand Up @@ -102,11 +102,11 @@ set(QGIS_3D_SRCS
terrain/qgsonlineterraingenerator.cpp
terrain/qgsquantizedmeshterraingenerator.cpp
terrain/qgsterraindownloader.cpp
terrain/qgsterrainentity_p.cpp
terrain/qgsterrainentity.cpp
terrain/qgsterraingenerator.cpp
terrain/qgsterraintexturegenerator_p.cpp
terrain/qgsterraintextureimage_p.cpp
terrain/qgsterraintileloader_p.cpp
terrain/qgsterraintileloader.cpp

mesh/qgsmesh3dgeometry_p.cpp
mesh/qgsmesh3dentity_p.cpp
Expand All @@ -124,6 +124,7 @@ set(QGIS_3D_HDRS
qgs3dmapsettings.h
qgs3dmaptool.h
qgs3drendercontext.h
qgs3dmapsceneentity.h
qgs3dsceneexporter.h
qgs3dtypes.h
qgs3dutils.h
Expand Down Expand Up @@ -189,10 +190,13 @@ set(QGIS_3D_HDRS
terrain/qgsquantizedmeshterraingenerator.h
terrain/qgsterraindownloader.h
terrain/qgsterraingenerator.h
terrain/qgsterraintileloader_p.h
terrain/qgsterraintileloader.h
terrain/qgsterrainentity.h

chunks/qgschunkloader_p.h
chunks/qgschunkqueuejob_p.h
chunks/qgschunkloader.h
chunks/qgschunkqueuejob.h
chunks/qgschunknode.h
chunks/qgschunkedentity.h

mesh/qgsmeshterraingenerator.h
)
Expand All @@ -202,11 +206,8 @@ set(QGIS_3D_PRIVATE_HDRS
qgsvectorlayerchunkloader_p.h
qgspointcloudlayerchunkloader_p.h
qgsvirtualpointcloudentity_p.h
qgs3dmapsceneentity_p.h
chunks/qgschunkboundsentity_p.h
chunks/qgschunkedentity_p.h
chunks/qgschunklist_p.h
chunks/qgschunknode_p.h
symbols/qgsline3dsymbol_p.h
symbols/qgslinematerial_p.h
symbols/qgslinevertexdata_p.h
Expand All @@ -215,13 +216,13 @@ set(QGIS_3D_PRIVATE_HDRS
symbols/qgspointcloud3dsymbol_p.h
terrain/qgsdemterraintilegeometry_p.h
terrain/qgsdemterraintileloader_p.h
terrain/qgsterrainentity_p.h
terrain/qgsterraintexturegenerator_p.h
terrain/qgsterraintextureimage_p.h
terrain/qgsterraintileentity_p.h
mesh/qgsmesh3dentity_p.h
mesh/qgsmesh3dgeometry_p.h
mesh/qgsmesh3dmaterial_p.h
mesh/qgsmeshterraintileloader_p.h
qgscolorramptexture.h
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkedentity_p.cpp
qgschunkedentity.cpp
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,16 +13,16 @@
* *
***************************************************************************/

#include "qgschunkedentity_p.h"
#include "qgschunkedentity.h"

#include <QElapsedTimer>
#include <QVector4D>

#include "qgs3dutils.h"
#include "qgschunkboundsentity_p.h"
#include "qgschunklist_p.h"
#include "qgschunkloader_p.h"
#include "qgschunknode_p.h"
#include "qgschunkloader.h"
#include "qgschunknode.h"

#include "qgseventtracing.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkedentity_p.h
qgschunkedentity.h
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#ifndef QGSCHUNKEDENTITY_P_H
#define QGSCHUNKEDENTITY_P_H
#ifndef QGSCHUNKEDENTITY_H
#define QGSCHUNKEDENTITY_H

///@cond PRIVATE

Expand All @@ -27,7 +27,7 @@
// version without notice, or even be removed.
//

#include "qgs3dmapsceneentity_p.h"
#include "qgs3dmapsceneentity.h"
#include <numeric>

#define SIP_NO_FILE
Expand All @@ -52,7 +52,7 @@ namespace QgsRayCastingUtils

#include <QTime>

#include "qgschunknode_p.h"
#include "qgschunknode.h"


/**
Expand Down Expand Up @@ -171,4 +171,4 @@ class QgsChunkedEntity : public Qgs3DMapSceneEntity

/// @endcond

#endif // QGSCHUNKEDENTITY_P_H
#endif // QGSCHUNKEDENTITY_H
2 changes: 1 addition & 1 deletion src/3d/chunks/qgschunklist_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "qgschunklist_p.h"

#include "qgschunknode_p.h"
#include "qgschunknode.h"

///@cond PRIVATE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkloader_p.cpp
qgschunkloader.cpp
--------------------------------------
Date : October 2020
Copyright : (C) 2020 by Martin Dobias
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#include "qgschunkloader_p.h"
#include "qgschunknode_p.h"
#include "qgschunkloader.h"
#include "qgschunknode.h"

#include <QVector>
///@cond PRIVATE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkloader_p.h
qgschunkloader.h
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#ifndef QGSCHUNKLOADER_P_H
#define QGSCHUNKLOADER_P_H
#ifndef QGSCHUNKLOADER_H
#define QGSCHUNKLOADER_H

///@cond PRIVATE

Expand All @@ -27,7 +27,7 @@
// version without notice, or even be removed.
//

#include "qgschunkqueuejob_p.h"
#include "qgschunkqueuejob.h"

#define SIP_NO_FILE

Expand Down Expand Up @@ -142,4 +142,4 @@ class _3D_EXPORT QgsQuadtreeChunkLoaderFactory : public QgsChunkLoaderFactory

/// @endcond

#endif // QGSCHUNKLOADER_P_H
#endif // QGSCHUNKLOADER_H
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunknode_p.cpp
qgschunknode.cpp
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,11 +13,11 @@
* *
***************************************************************************/

#include "qgschunknode_p.h"
#include "qgschunknode.h"

#include "qgschunkedentity_p.h" // for ChunkLoader destructor
#include "qgschunkedentity.h" // for ChunkLoader destructor
#include "qgschunklist_p.h"
#include "qgschunkloader_p.h"
#include "qgschunkloader.h"
#include <Qt3DCore/QEntity>

///@cond PRIVATE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunknode_p.h
qgschunknode.h
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#ifndef QGSCHUNKNODE_P_H
#define QGSCHUNKNODE_P_H
#ifndef QGSCHUNKNODE_H
#define QGSCHUNKNODE_H

///@cond PRIVATE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkqueuejob_p.cpp
qgschunkqueuejob.cpp
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,7 +13,7 @@
* *
***************************************************************************/

#include "qgschunkqueuejob_p.h"
#include "qgschunkqueuejob.h"

///@cond PRIVATE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgschunkqueuejob_p.h
qgschunkqueuejob.h
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#ifndef QGSCHUNKQUEUEJOB_P_H
#define QGSCHUNKQUEUEJOB_P_H
#ifndef QGSCHUNKQUEUEJOB_H
#define QGSCHUNKQUEUEJOB_H

///@cond PRIVATE

Expand Down Expand Up @@ -101,4 +101,4 @@ class QgsChunkQueueJobFactory

/// @endcond

#endif // QGSCHUNKQUEUEJOB_P_H
#endif // QGSCHUNKQUEUEJOB_H
3 changes: 2 additions & 1 deletion src/3d/mesh/qgsmeshterraingenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
***************************************************************************/

#include "qgsmeshterraingenerator.h"
#include "qgsmeshterraintileloader_p.h"

#include <Qt3DRender/QMaterial>

#include "qgsmesh3dentity_p.h"
#include "qgsmeshlayer.h"
#include "qgsmeshlayer3drenderer.h"
#include "qgsterrainentity_p.h"
#include "qgsterrainentity.h"
#include "qgsmeshlayerutils.h"
#include "qgs3dmapsettings.h"
#include "qgs3drendercontext.h"
Expand Down
24 changes: 0 additions & 24 deletions src/3d/mesh/qgsmeshterraingenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,9 @@
#include "qgsmeshlayer.h"
#include "qgstriangularmesh.h"
#include "qgsterraingenerator.h"
#include "qgsterraintileloader_p.h"

#define SIP_NO_FILE

///@cond PRIVATE

//! Chunk loader for mesh terrain implementation
class QgsMeshTerrainTileLoader: public QgsTerrainTileLoader
{
Q_OBJECT
public:
//! Construct the loader for a node
QgsMeshTerrainTileLoader( QgsTerrainEntity *terrain,
QgsChunkNode *node,
const QgsTriangularMesh &triangularMesh,
const QgsMesh3DSymbol *symbol );

//! Create the 3D entity and returns it
Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;

private:
QgsTriangularMesh mTriangularMesh;
std::unique_ptr< QgsMesh3DSymbol > mSymbol;
};

///@endcond

/**
* \ingroup 3d
* \brief Implementation of terrain generator that uses the Z values of a mesh layer to build a terrain
Expand Down
50 changes: 50 additions & 0 deletions src/3d/mesh/qgsmeshterraintileloader_p.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/***************************************************************************
qgsmeshterraintileloader_p.h
-------------------------
begin : September 2024
copyright : (C) 2024 by Matthias Kuhn
email : [email protected]
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSMESHTERRAINTILELOADER_H
#define QGSMESHTERRAINTILELOADER_H

#include "qgsmesh3dsymbol.h"
#include "qgstriangularmesh.h"
#include "qgsterraintileloader.h"

#define SIP_NO_FILE

///@cond PRIVATE

//! Chunk loader for mesh terrain implementation
class QgsMeshTerrainTileLoader: public QgsTerrainTileLoader
{
Q_OBJECT
public:
//! Construct the loader for a node
QgsMeshTerrainTileLoader( QgsTerrainEntity *terrain,
QgsChunkNode *node,
const QgsTriangularMesh &triangularMesh,
const QgsMesh3DSymbol *symbol );

//! Create the 3D entity and returns it
Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;

private:
QgsTriangularMesh mTriangularMesh;
std::unique_ptr< QgsMesh3DSymbol > mSymbol;
};

///@endcond

#endif
Loading

0 comments on commit d4d7684

Please sign in to comment.