Skip to content

Commit

Permalink
Qgs-ification of classes for chunked rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 26, 2017
1 parent 2a08a7f commit 894db92
Show file tree
Hide file tree
Showing 29 changed files with 436 additions and 343 deletions.
27 changes: 15 additions & 12 deletions src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ SET(QGIS_3D_SRCS
qgstilingscheme.cpp
qgsvectorlayer3drenderer.cpp

chunks/chunkboundsentity.cpp
chunks/chunkedentity.cpp
chunks/chunklist.cpp
chunks/chunkloader.cpp
chunks/chunknode.cpp
chunks/qgschunkboundsentity_p.cpp
chunks/qgschunkedentity_p.cpp
chunks/qgschunklist_p.cpp
chunks/qgschunkloader_p.cpp
chunks/qgschunknode_p.cpp
chunks/qgschunkqueuejob_p.cpp

symbols/qgsabstract3dsymbol.cpp
symbols/qgsline3dsymbol.cpp
Expand Down Expand Up @@ -52,8 +53,9 @@ SET(QGIS_3D_MOC_HDRS
qgs3dmapsettings.h
qgscameracontroller.h

chunks/chunkedentity.h
chunks/chunkloader.h
chunks/qgschunkedentity_p.h
chunks/qgschunkloader_p.h
chunks/qgschunkqueuejob_p.h

terrain/qgsdemterraintileloader_p.h
terrain/qgsdemterraintilegeometry_p.h
Expand Down Expand Up @@ -83,11 +85,12 @@ SET(QGIS_3D_HDRS
qgstilingscheme.h
qgsvectorlayer3drenderer.h

chunks/chunkboundsentity.h
chunks/chunkedentity.h
chunks/chunklist.h
chunks/chunkloader.h
chunks/chunknode.h
chunks/qgschunkboundsentity_p.h
chunks/qgschunkedentity_p.h
chunks/qgschunklist_p.h
chunks/qgschunkloader_p.h
chunks/qgschunknode_p.h
chunks/qgschunkqueuejob_p.h

symbols/qgsabstract3dsymbol.h
symbols/qgsline3dsymbol.h
Expand Down
30 changes: 0 additions & 30 deletions src/3d/chunks/chunkboundsentity.h

This file was deleted.

22 changes: 0 additions & 22 deletions src/3d/chunks/chunkloader.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "chunkboundsentity.h"
#include "qgschunkboundsentity_p.h"

#include <Qt3DRender/QAttribute>
#include <Qt3DRender/QBuffer>
Expand Down Expand Up @@ -110,7 +110,7 @@ void AABBMesh::setBoxes( const QList<AABB> &bboxes )
// ----------------


ChunkBoundsEntity::ChunkBoundsEntity( Qt3DCore::QNode *parent )
QgsChunkBoundsEntity::QgsChunkBoundsEntity( Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent )
{
aabbMesh = new AABBMesh;
Expand All @@ -121,7 +121,7 @@ ChunkBoundsEntity::ChunkBoundsEntity( Qt3DCore::QNode *parent )
addComponent( bboxesMaterial );
}

void ChunkBoundsEntity::setBoxes( const QList<AABB> &bboxes )
void QgsChunkBoundsEntity::setBoxes( const QList<AABB> &bboxes )
{
aabbMesh->setBoxes( bboxes );
}
Expand Down
40 changes: 40 additions & 0 deletions src/3d/chunks/qgschunkboundsentity_p.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef QGSCHUNKBOUNDSENTITY_P_H
#define QGSCHUNKBOUNDSENTITY_P_H

///@cond PRIVATE

//
// W A R N I N G
// -------------
//
// This file is not part of the QGIS API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//

#include <Qt3DCore/QEntity>

class AABB;
class AABBMesh;


/** \ingroup 3d
* Draws bounds of axis aligned bounding boxes
* \since QGIS 3.0
*/
class QgsChunkBoundsEntity : public Qt3DCore::QEntity
{
public:
//! Constructs the entity
QgsChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );

//! Sets a list of bounding boxes to be rendered by the entity
void setBoxes( const QList<AABB> &bboxes );

private:
AABBMesh *aabbMesh;
};

/// @endcond

#endif // QGSCHUNKBOUNDSENTITY_P_H
Loading

0 comments on commit 894db92

Please sign in to comment.