Skip to content

Commit 06c9401

Browse files
committedMar 10, 2019
[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)
1 parent bb7ac8f commit 06c9401

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎src/3d/symbols/qgspolygon3dsymbol_p.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,21 @@ Qt3DRender::QGeometryRenderer *QgsPolygon3DSymbolEntityNode::renderer( const Qgs
209209
extrusionHeightPerPolygon.append( extrusionHeight );
210210
}
211211
}
212+
else if ( const QgsGeometryCollection *gc = qgsgeometry_cast< const QgsGeometryCollection *>( g ) )
213+
{
214+
for ( int i = 0; i < gc->numGeometries(); ++i )
215+
{
216+
const QgsAbstractGeometry *g2 = gc->geometryN( i );
217+
if ( QgsWkbTypes::flatType( g2->wkbType() ) != QgsWkbTypes::Polygon )
218+
continue;
219+
QgsPolygon *polyClone = static_cast< const QgsPolygon *>( g2 )->clone();
220+
Qgs3DUtils::clampAltitudes( polyClone, symbol.altitudeClamping(), symbol.altitudeBinding(), height, map );
221+
polygons.append( polyClone );
222+
fids.append( f.id() );
223+
if ( hasDDExtrusion )
224+
extrusionHeightPerPolygon.append( extrusionHeight );
225+
}
226+
}
212227
else
213228
qDebug() << "not a polygon";
214229
}

0 commit comments

Comments
 (0)
Please sign in to comment.