Skip to content

Commit 42f157f

Browse files
committedJan 17, 2019
GUI for rule-based 3D renderer
1 parent 5d05d46 commit 42f157f

11 files changed

+1498
-131
lines changed
 

‎src/3d/qgs3dutils.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include "qgsabstract3dengine.h"
2828
#include "qgsterraingenerator.h"
2929

30+
#include "qgsline3dsymbol.h"
31+
#include "qgspoint3dsymbol.h"
32+
#include "qgspolygon3dsymbol.h"
33+
3034

3135
QImage Qgs3DUtils::captureSceneImage( QgsAbstract3DEngine &engine, Qgs3DMapScene *scene )
3236
{
@@ -374,3 +378,18 @@ QgsVector3D Qgs3DUtils::transformWorldCoordinates( const QgsVector3D &worldPoint
374378
return mapToWorldCoordinates( mapPoint2, origin2 );
375379
}
376380

381+
QgsAbstract3DSymbol *Qgs3DUtils::symbolForGeometryType( QgsWkbTypes::GeometryType geomType )
382+
{
383+
switch ( geomType )
384+
{
385+
case QgsWkbTypes::PointGeometry:
386+
return new QgsPoint3DSymbol;
387+
case QgsWkbTypes::LineGeometry:
388+
return new QgsLine3DSymbol;
389+
case QgsWkbTypes::PolygonGeometry:
390+
return new QgsPolygon3DSymbol;
391+
default:
392+
return nullptr;
393+
}
394+
}
395+

‎src/3d/qgs3dutils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class QgsLineString;
2222
class QgsPolygon;
2323

2424
class QgsAbstract3DEngine;
25+
class QgsAbstract3DSymbol;
2526
class Qgs3DMapScene;
2627

2728
#include "qgs3dmapsettings.h"
@@ -99,6 +100,8 @@ class _3D_EXPORT Qgs3DUtils
99100
//! Transforms a world point from (origin1, crs1) to (origin2, crs2)
100101
static QgsVector3D transformWorldCoordinates( const QgsVector3D &worldPoint1, const QgsVector3D &origin1, const QgsCoordinateReferenceSystem &crs1, const QgsVector3D &origin2, const QgsCoordinateReferenceSystem &crs2,
101102
const QgsCoordinateTransformContext &context );
103+
104+
static QgsAbstract3DSymbol *symbolForGeometryType( QgsWkbTypes::GeometryType geomType );
102105
};
103106

104107
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.