Skip to content
Permalink
Browse files

[3d] Fix 3D polygon symbol to work with geometry collection

Some data sources report their geometry type as multi-surface
(a collection of polygons and curve-polygons) and so we should handle
them as well.

(manually backported from 4a554d2)
  • Loading branch information
wonder-sk committed Mar 10, 2019
1 parent bb7ac8f commit 06c9401c06218da25224dfb9b3039dd956265514
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/3d/symbols/qgspolygon3dsymbol_p.cpp
@@ -209,6 +209,21 @@ Qt3DRender::QGeometryRenderer *QgsPolygon3DSymbolEntityNode::renderer( const Qgs
extrusionHeightPerPolygon.append( extrusionHeight );
}
}
else if ( const QgsGeometryCollection *gc = qgsgeometry_cast< const QgsGeometryCollection *>( g ) )
{
for ( int i = 0; i < gc->numGeometries(); ++i )
{
const QgsAbstractGeometry *g2 = gc->geometryN( i );
if ( QgsWkbTypes::flatType( g2->wkbType() ) != QgsWkbTypes::Polygon )
continue;
QgsPolygon *polyClone = static_cast< const QgsPolygon *>( g2 )->clone();
Qgs3DUtils::clampAltitudes( polyClone, symbol.altitudeClamping(), symbol.altitudeBinding(), height, map );
polygons.append( polyClone );
fids.append( f.id() );
if ( hasDDExtrusion )
extrusionHeightPerPolygon.append( extrusionHeight );
}
}
else
qDebug() << "not a polygon";
}

0 comments on commit 06c9401

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