Skip to content

Commit 870d96e

Browse files
committedSep 15, 2017
Moved 3D symbol class implementations into separate files
1 parent 12a0063 commit 870d96e

28 files changed

+514
-440
lines changed
 

‎src/3d/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# sources
33

44
SET(QGIS_3D_SRCS
5-
abstract3dsymbol.cpp
65
cameracontroller.cpp
76
lineentity.cpp
87
map3d.cpp
@@ -22,6 +21,11 @@ SET(QGIS_3D_SRCS
2221
chunks/chunkloader.cpp
2322
chunks/chunknode.cpp
2423

24+
symbols/qgsabstract3dsymbol.cpp
25+
symbols/qgsline3dsymbol.cpp
26+
symbols/qgspoint3dsymbol.cpp
27+
symbols/qgspolygon3dsymbol.cpp
28+
2529
terrain/demterraingenerator.cpp
2630
terrain/demterraintilegeometry.cpp
2731
terrain/flatterraingenerator.cpp
@@ -64,7 +68,6 @@ QT5_ADD_RESOURCES(QGIS_3D_RCC_SRCS shaders.qrc)
6468

6569
SET(QGIS_3D_HDRS
6670
aabb.h
67-
abstract3dsymbol.h
6871
cameracontroller.h
6972
lineentity.h
7073
map3d.h
@@ -84,6 +87,11 @@ SET(QGIS_3D_HDRS
8487
chunks/chunkloader.h
8588
chunks/chunknode.h
8689

90+
symbols/qgsabstract3dsymbol.h
91+
symbols/qgsline3dsymbol.h
92+
symbols/qgspoint3dsymbol.h
93+
symbols/qgspolygon3dsymbol.h
94+
8795
terrain/demterraingenerator.h
8896
terrain/demterraintilegeometry.h
8997
terrain/flatterraingenerator.h
@@ -99,6 +107,7 @@ SET(QGIS_3D_HDRS
99107
INCLUDE_DIRECTORIES(
100108
${CMAKE_CURRENT_SOURCE_DIR}
101109
${CMAKE_CURRENT_SOURCE_DIR}/chunks
110+
${CMAKE_CURRENT_SOURCE_DIR}/symbols
102111
${CMAKE_CURRENT_SOURCE_DIR}/terrain
103112
${CMAKE_SOURCE_DIR}/src/core/
104113
${CMAKE_SOURCE_DIR}/src/core/geometry

‎src/3d/abstract3dsymbol.cpp

Lines changed: 0 additions & 151 deletions
This file was deleted.

‎src/3d/abstract3dsymbol.h

Lines changed: 0 additions & 86 deletions
This file was deleted.

‎src/3d/lineentity.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "lineentity.h"
22

3-
#include "abstract3dsymbol.h"
3+
#include "qgsline3dsymbol.h"
44
#include "polygongeometry.h"
55
#include "map3d.h"
66
#include "terraingenerator.h"
@@ -11,14 +11,14 @@
1111
#include "qgsgeos.h"
1212

1313

14-
LineEntity::LineEntity( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol, Qt3DCore::QNode *parent )
14+
LineEntity::LineEntity( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol, Qt3DCore::QNode *parent )
1515
: Qt3DCore::QEntity( parent )
1616
{
1717
addEntityForSelectedLines( map, layer, symbol );
1818
addEntityForNotSelectedLines( map, layer, symbol );
1919
}
2020

21-
Qt3DExtras::QPhongMaterial *LineEntity::material( const Line3DSymbol &symbol ) const
21+
Qt3DExtras::QPhongMaterial *LineEntity::material( const QgsLine3DSymbol &symbol ) const
2222
{
2323
Qt3DExtras::QPhongMaterial *material = new Qt3DExtras::QPhongMaterial;
2424

@@ -30,7 +30,7 @@ Qt3DExtras::QPhongMaterial *LineEntity::material( const Line3DSymbol &symbol ) c
3030
return material;
3131
}
3232

33-
void LineEntity::addEntityForSelectedLines( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol )
33+
void LineEntity::addEntityForSelectedLines( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol )
3434
{
3535
// build the default material
3636
Qt3DExtras::QPhongMaterial *mat = material( symbol );
@@ -50,7 +50,7 @@ void LineEntity::addEntityForSelectedLines( const Map3D &map, QgsVectorLayer *la
5050
entity->setParent( this );
5151
}
5252

53-
void LineEntity::addEntityForNotSelectedLines( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol )
53+
void LineEntity::addEntityForNotSelectedLines( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol )
5454
{
5555
// build the default material
5656
Qt3DExtras::QPhongMaterial *mat = material( symbol );
@@ -69,13 +69,13 @@ void LineEntity::addEntityForNotSelectedLines( const Map3D &map, QgsVectorLayer
6969
entity->setParent( this );
7070
}
7171

72-
LineEntityNode::LineEntityNode( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent )
72+
LineEntityNode::LineEntityNode( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent )
7373
: Qt3DCore::QEntity( parent )
7474
{
7575
addComponent( renderer( map, symbol, layer, req ) );
7676
}
7777

78-
Qt3DRender::QGeometryRenderer *LineEntityNode::renderer( const Map3D &map, const Line3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request )
78+
Qt3DRender::QGeometryRenderer *LineEntityNode::renderer( const Map3D &map, const QgsLine3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request )
7979
{
8080
QgsPointXY origin( map.originX, map.originY );
8181

‎src/3d/lineentity.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class Map3D;
99
class PolygonGeometry;
10-
class Line3DSymbol;
10+
class QgsLine3DSymbol;
1111

1212
class QgsVectorLayer;
1313
class QgsFeatureRequest;
@@ -17,22 +17,22 @@ class QgsFeatureRequest;
1717
class LineEntity : public Qt3DCore::QEntity
1818
{
1919
public:
20-
LineEntity( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol, Qt3DCore::QNode *parent = nullptr );
20+
LineEntity( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol, Qt3DCore::QNode *parent = nullptr );
2121

2222
private:
23-
void addEntityForSelectedLines( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol );
24-
void addEntityForNotSelectedLines( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol );
23+
void addEntityForSelectedLines( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol );
24+
void addEntityForNotSelectedLines( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol );
2525

26-
Qt3DExtras::QPhongMaterial *material( const Line3DSymbol &symbol ) const;
26+
Qt3DExtras::QPhongMaterial *material( const QgsLine3DSymbol &symbol ) const;
2727
};
2828

2929
class LineEntityNode : public Qt3DCore::QEntity
3030
{
3131
public:
32-
LineEntityNode( const Map3D &map, QgsVectorLayer *layer, const Line3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent = nullptr );
32+
LineEntityNode( const Map3D &map, QgsVectorLayer *layer, const QgsLine3DSymbol &symbol, const QgsFeatureRequest &req, Qt3DCore::QNode *parent = nullptr );
3333

3434
private:
35-
Qt3DRender::QGeometryRenderer *renderer( const Map3D &map, const Line3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &req );
35+
Qt3DRender::QGeometryRenderer *renderer( const Map3D &map, const QgsLine3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &req );
3636

3737
PolygonGeometry *mGeometry;
3838
};

0 commit comments

Comments
 (0)
Please sign in to comment.