Skip to content
Permalink
Browse files

[Globe] Port for QgsGeometry::constGet API changes

  • Loading branch information
manisandro committed Oct 31, 2017
1 parent 192d6f9 commit 8b7fd5428f2d3eb6f4377a57f1f34f51fda3a951
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/plugins/globe/featuresource/qgsglobefeatureutils.h
@@ -92,22 +92,22 @@ class QgsGlobeFeatureUtils
std::cout << "srid = " << srid << std::endl;
#endif

switch ( QgsWkbTypes::flatType( geom.geometry()->wkbType() ) )
switch ( QgsWkbTypes::flatType( geom.constGet()->wkbType() ) )
{
case QgsWkbTypes::Point:
{
osgEarth::Features::PointSet *pointSet = new osgEarth::Features::PointSet();
pointSet->push_back( pointFromQgsPoint( *static_cast<QgsPoint *>( geom.geometry() ) ) );
pointSet->push_back( pointFromQgsPoint( *static_cast<const QgsPoint *>( geom.constGet() ) ) );
return pointSet;
}

case QgsWkbTypes::MultiPoint:
{
osgEarth::Features::PointSet *pointSet = new osgEarth::Features::PointSet();
QgsMultiPoint *multiPoint = static_cast<QgsMultiPoint *>( geom.geometry() );
const QgsMultiPoint *multiPoint = static_cast<const QgsMultiPoint *>( geom.constGet() );
for ( int i = 0, n = multiPoint->numGeometries(); i < n; ++i )
{
pointSet->push_back( pointFromQgsPoint( *static_cast<QgsPoint *>( multiPoint->geometryN( i ) ) ) );
pointSet->push_back( pointFromQgsPoint( *static_cast<const QgsPoint *>( multiPoint->geometryN( i ) ) ) );
}
return pointSet;
}
@@ -116,33 +116,33 @@ class QgsGlobeFeatureUtils
case QgsWkbTypes::CircularString:
case QgsWkbTypes::CompoundCurve:
{
return lineStringFromQgsLineString( static_cast<QgsLineString *>( geom.geometry() ) );
return lineStringFromQgsLineString( static_cast<const QgsLineString *>( geom.constGet() ) );
}

case QgsWkbTypes::MultiLineString:
{
osgEarth::Features::MultiGeometry *multiGeometry = new osgEarth::Features::MultiGeometry();
QgsMultiLineString *multiLineString = static_cast<QgsMultiLineString *>( geom.geometry() );
const QgsMultiLineString *multiLineString = static_cast<const QgsMultiLineString *>( geom.constGet() );
for ( int i = 0, n = multiLineString->numGeometries(); i < n; ++i )
{
multiGeometry->getComponents().push_back( lineStringFromQgsLineString( static_cast<QgsLineString *>( multiLineString->geometryN( i ) ) ) );
multiGeometry->getComponents().push_back( lineStringFromQgsLineString( static_cast<const QgsLineString *>( multiLineString->geometryN( i ) ) ) );
}
return multiGeometry;
}

case QgsWkbTypes::Polygon:
case QgsWkbTypes::CurvePolygon:
{
return polygonFromQgsPolygon( static_cast<QgsPolygon *>( geom.geometry() ) );
return polygonFromQgsPolygon( static_cast<const QgsPolygon *>( geom.constGet() ) );
}

case QgsWkbTypes::MultiPolygon:
{
osgEarth::Features::MultiGeometry *multiGeometry = new osgEarth::Features::MultiGeometry();
QgsMultiPolygon *multiPolygon = static_cast<QgsMultiPolygon *>( geom.geometry() );
const QgsMultiPolygon *multiPolygon = static_cast<const QgsMultiPolygon *>( geom.constGet() );
for ( int i = 0, n = multiPolygon->numGeometries(); i < n; ++i )
{
multiGeometry->getComponents().push_back( polygonFromQgsPolygon( static_cast<QgsPolygon *>( multiPolygon->geometryN( i ) ) ) );
multiGeometry->getComponents().push_back( polygonFromQgsPolygon( static_cast<const QgsPolygon *>( multiPolygon->geometryN( i ) ) ) );
}
return multiGeometry;
}

0 comments on commit 8b7fd54

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