Skip to content
Permalink
Browse files

[FEATURE] Add rule-based 3D renderer

Next to the "simple" vector layer 3D renderer that uses a single symbol
for all features, this new renderer allows definition of hierarchy
of rules with 3D symbols to define how a layer is rendered in 3D view,
similar to how 2D rule-based rendering or labeling works.

This commit does not add any GUI support yet.
  • Loading branch information
wonder-sk committed Jan 17, 2019
1 parent 2d56345 commit 5d05d467d64f4ae1ed46471087aa3c05e1762fa1
Showing with 786 additions and 0 deletions.
  1. +2 −0 src/3d/CMakeLists.txt
  2. +5 −0 src/3d/qgs3dmapscene.cpp
  3. +470 −0 src/3d/qgsrulebased3drenderer.cpp
  4. +307 −0 src/3d/qgsrulebased3drenderer.h
  5. +2 −0 src/app/qgisapp.cpp
@@ -15,6 +15,7 @@ SET(QGIS_3D_SRCS
qgsphongmaterialsettings.cpp
qgspointlightsettings.cpp
qgsraycastingutils_p.cpp
qgsrulebased3drenderer.cpp
qgstessellatedpolygongeometry.cpp
qgstilingscheme.cpp
qgsvectorlayer3drenderer.cpp
@@ -101,6 +102,7 @@ SET(QGIS_3D_HDRS
qgsphongmaterialsettings.h
qgspointlightsettings.h
qgsraycastingutils_p.h
qgsrulebased3drenderer.h
qgstessellatedpolygongeometry.h
qgstilingscheme.h
qgsvectorlayer3drenderer.h
@@ -43,6 +43,7 @@
#include "qgschunknode_p.h"
#include "qgsmeshlayer.h"
#include "qgsmeshlayer3drenderer.h"
#include "qgsrulebased3drenderer.h"
#include "qgsterrainentity_p.h"
#include "qgsterraingenerator.h"
#include "qgstessellatedpolygongeometry.h"
@@ -539,6 +540,10 @@ void Qgs3DMapScene::addLayerEntity( QgsMapLayer *layer )
{
static_cast<QgsVectorLayer3DRenderer *>( renderer )->setLayer( static_cast<QgsVectorLayer *>( layer ) );
}
else if ( layer->type() == QgsMapLayer::VectorLayer && renderer->type() == QLatin1String( "rulebased" ) )
{
static_cast<QgsRuleBased3DRenderer *>( renderer )->setLayer( static_cast<QgsVectorLayer *>( layer ) );
}
else if ( layer->type() == QgsMapLayer::MeshLayer && renderer->type() == QLatin1String( "mesh" ) )
{
static_cast<QgsMeshLayer3DRenderer *>( renderer )->setLayer( static_cast<QgsMeshLayer *>( layer ) );

0 comments on commit 5d05d46

Please sign in to comment.
You can’t perform that action at this time.