Skip to content

Commit

Permalink
GUI for rule-based 3D renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 17, 2019
1 parent 5d05d46 commit 42f157f
Show file tree
Hide file tree
Showing 11 changed files with 1,498 additions and 131 deletions.
19 changes: 19 additions & 0 deletions src/3d/qgs3dutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "qgsabstract3dengine.h"
#include "qgsterraingenerator.h"

#include "qgsline3dsymbol.h"
#include "qgspoint3dsymbol.h"
#include "qgspolygon3dsymbol.h"


QImage Qgs3DUtils::captureSceneImage( QgsAbstract3DEngine &engine, Qgs3DMapScene *scene )
{
Expand Down Expand Up @@ -374,3 +378,18 @@ QgsVector3D Qgs3DUtils::transformWorldCoordinates( const QgsVector3D &worldPoint
return mapToWorldCoordinates( mapPoint2, origin2 );
}

QgsAbstract3DSymbol *Qgs3DUtils::symbolForGeometryType( QgsWkbTypes::GeometryType geomType )
{
switch ( geomType )
{
case QgsWkbTypes::PointGeometry:
return new QgsPoint3DSymbol;
case QgsWkbTypes::LineGeometry:
return new QgsLine3DSymbol;
case QgsWkbTypes::PolygonGeometry:
return new QgsPolygon3DSymbol;
default:
return nullptr;
}
}

3 changes: 3 additions & 0 deletions src/3d/qgs3dutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class QgsLineString;
class QgsPolygon;

class QgsAbstract3DEngine;
class QgsAbstract3DSymbol;
class Qgs3DMapScene;

#include "qgs3dmapsettings.h"
Expand Down Expand Up @@ -99,6 +100,8 @@ class _3D_EXPORT Qgs3DUtils
//! Transforms a world point from (origin1, crs1) to (origin2, crs2)
static QgsVector3D transformWorldCoordinates( const QgsVector3D &worldPoint1, const QgsVector3D &origin1, const QgsCoordinateReferenceSystem &crs1, const QgsVector3D &origin2, const QgsCoordinateReferenceSystem &crs2,
const QgsCoordinateTransformContext &context );

static QgsAbstract3DSymbol *symbolForGeometryType( QgsWkbTypes::GeometryType geomType );
};

#endif
Expand Down
Loading

0 comments on commit 42f157f

Please sign in to comment.