Skip to content

Commit 04e12d9

Browse files
committedSep 15, 2017
Rename TerrainBoundsEntity to ChunkBoundsEntity
... since it can be used also for other chunked entities - not just terrain
1 parent 3d0ce5f commit 04e12d9

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed
 

‎src/3d/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
SET(QGIS_3D_SRCS
55
cameracontroller.cpp
6+
chunkboundsentity.cpp
67
chunkedentity.cpp
78
chunklist.cpp
89
chunkloader.cpp
@@ -21,7 +22,6 @@ SET(QGIS_3D_SRCS
2122
#quantizedmeshterraingenerator.cpp
2223
scene.cpp
2324
terrain.cpp
24-
terrainboundsentity.cpp
2525
terrainchunkloader.cpp
2626
terraingenerator.cpp
2727
tessellator.cpp
@@ -55,6 +55,7 @@ QT5_ADD_RESOURCES(QGIS_3D_RCC_SRCS shaders.qrc)
5555
SET(QGIS_3D_HDRS
5656
aabb.h
5757
cameracontroller.h
58+
chunkboundsentity.h
5859
chunkedentity.h
5960
chunklist.h
6061
chunkloader.h
@@ -73,7 +74,6 @@ SET(QGIS_3D_HDRS
7374
#quantizedmeshterraingenerator.h
7475
scene.h
7576
terrain.h
76-
terrainboundsentity.h
7777
terrainchunkloader.h
7878
terraingenerator.h
7979
tessellator.h

‎src/3d/terrainboundsentity.cpp renamed to ‎src/3d/chunkboundsentity.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "terrainboundsentity.h"
1+
#include "chunkboundsentity.h"
22

33
#include <Qt3DRender/QAttribute>
44
#include <Qt3DRender/QBuffer>
@@ -105,7 +105,7 @@ void AABBMesh::setBoxes( const QList<AABB> &bboxes )
105105
// ----------------
106106

107107

108-
TerrainBoundsEntity::TerrainBoundsEntity( Qt3DCore::QNode *parent )
108+
ChunkBoundsEntity::ChunkBoundsEntity( Qt3DCore::QNode *parent )
109109
: Qt3DCore::QEntity( parent )
110110
{
111111
aabbMesh = new AABBMesh;
@@ -116,7 +116,7 @@ TerrainBoundsEntity::TerrainBoundsEntity( Qt3DCore::QNode *parent )
116116
addComponent( bboxesMaterial );
117117
}
118118

119-
void TerrainBoundsEntity::setBoxes( const QList<AABB> &bboxes )
119+
void ChunkBoundsEntity::setBoxes( const QList<AABB> &bboxes )
120120
{
121121
aabbMesh->setBoxes( bboxes );
122122
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#ifndef TERRAINBOUNDSENTITY_H
2-
#define TERRAINBOUNDSENTITY_H
1+
#ifndef CHUNKBOUNDSENTITY_H
2+
#define CHUNKBOUNDSENTITY_H
33

44
#include <Qt3DCore/QEntity>
55

66
class AABB;
77
class AABBMesh;
88

99
//! Draws bounds of axis aligned bounding boxes
10-
class TerrainBoundsEntity : public Qt3DCore::QEntity
10+
class ChunkBoundsEntity : public Qt3DCore::QEntity
1111
{
1212
public:
13-
TerrainBoundsEntity( Qt3DCore::QNode *parent = nullptr );
13+
ChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );
1414

1515
void setBoxes( const QList<AABB> &bboxes );
1616

1717
private:
1818
AABBMesh *aabbMesh;
1919
};
2020

21-
#endif // TERRAINBOUNDSENTITY_H
21+
#endif // CHUNKBOUNDSENTITY_H

‎src/3d/chunkedentity.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#include "chunkedentity.h"
22

3-
#include "chunknode.h"
3+
#include "chunkboundsentity.h"
44
#include "chunklist.h"
55
#include "chunkloader.h"
6-
#include "terrainboundsentity.h"
6+
#include "chunknode.h"
7+
78

89
static float screenSpaceError( float epsilon, float distance, float screenSize, float fov )
910
{
@@ -195,7 +196,7 @@ void ChunkedEntity::setShowBoundingBoxes( bool enabled )
195196

196197
if ( enabled )
197198
{
198-
bboxesEntity = new TerrainBoundsEntity( this );
199+
bboxesEntity = new ChunkBoundsEntity( this );
199200
}
200201
else
201202
{

‎src/3d/chunkedentity.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AABB;
99
class ChunkNode;
1010
class ChunkList;
1111
class ChunkLoaderFactory;
12-
class TerrainBoundsEntity;
12+
class ChunkBoundsEntity;
1313
class LoaderThread;
1414

1515
#include <QVector3D>
@@ -76,7 +76,7 @@ class ChunkedEntity : public Qt3DCore::QEntity
7676
//! max. length for replacement queue
7777
int maxLoadedChunks;
7878

79-
TerrainBoundsEntity *bboxesEntity;
79+
ChunkBoundsEntity *bboxesEntity;
8080

8181
LoaderThread *loaderThread;
8282
QMutex loaderMutex;

0 commit comments

Comments
 (0)
Please sign in to comment.