Skip to content

Commit

Permalink
[FEATURE] Add rule-based 3D renderer
Browse files Browse the repository at this point in the history
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 5d05d46
Show file tree
Hide file tree
Showing 5 changed files with 786 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SET(QGIS_3D_SRCS
qgsphongmaterialsettings.cpp
qgspointlightsettings.cpp
qgsraycastingutils_p.cpp
qgsrulebased3drenderer.cpp
qgstessellatedpolygongeometry.cpp
qgstilingscheme.cpp
qgsvectorlayer3drenderer.cpp
Expand Down Expand Up @@ -101,6 +102,7 @@ SET(QGIS_3D_HDRS
qgsphongmaterialsettings.h
qgspointlightsettings.h
qgsraycastingutils_p.h
qgsrulebased3drenderer.h
qgstessellatedpolygongeometry.h
qgstilingscheme.h
qgsvectorlayer3drenderer.h
Expand Down
5 changes: 5 additions & 0 deletions src/3d/qgs3dmapscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ) );
Expand Down
Loading

0 comments on commit 5d05d46

Please sign in to comment.