Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Various fixes to dropping V2 suffix
- Loading branch information
|
@@ -8,7 +8,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
class QgsMultiPointV2: QgsGeometryCollection |
|
|
class QgsMultiPoint: QgsGeometryCollection |
|
|
{ |
|
|
%Docstring |
|
|
Multi point geometry collection. |
|
|
|
@@ -8,7 +8,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
class QgsMultiPolygonV2: QgsMultiSurface |
|
|
class QgsMultiPolygon: QgsMultiSurface |
|
|
{ |
|
|
%Docstring |
|
|
Multi polygon geometry collection. |
|
|
|
@@ -9,7 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
class QgsPolygonV2: QgsCurvePolygon |
|
|
class QgsPolygon: QgsCurvePolygon |
|
|
{ |
|
|
%Docstring |
|
|
Polygon geometry type. |
|
|
|
@@ -9,7 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
class QgsTriangle : QgsPolygonV2 |
|
|
class QgsTriangle : QgsPolygon |
|
|
{ |
|
|
%Docstring |
|
|
Triangle geometry type. |
|
|
|
@@ -116,7 +116,7 @@ QgsLineString *QgsMapToolAddRectangle::rectangleToLinestring( const bool isOrien |
|
|
|
|
|
QgsPolygon *QgsMapToolAddRectangle::rectangleToPolygon( const bool isOriented ) const |
|
|
{ |
|
|
std::unique_ptr<QgsPolygonV2> polygon( new QgsPolygon() ); |
|
|
std::unique_ptr<QgsPolygon> polygon( new QgsPolygon() ); |
|
|
if ( mRectangle.isEmpty() ) |
|
|
{ |
|
|
return polygon.release(); |
|
|
|
@@ -274,7 +274,7 @@ void QgsMapToolCircle2TangentsPoint::radiusSpinBoxChanged( int radius ) |
|
|
mRubberBands.clear(); |
|
|
if ( mPoints.size() == 4 ) |
|
|
{ |
|
|
std::unique_ptr<QgsMultiPolygonV2> rb( new QgsMultiPolygon() ); |
|
|
std::unique_ptr<QgsMultiPolygon> rb( new QgsMultiPolygon() ); |
|
|
for ( int i = 0; i < mCenters.size(); ++i ) |
|
|
{ |
|
|
std::unique_ptr<QgsGeometryRubberBand> tempRB( createGeometryRubberBand( QgsWkbTypes::PointGeometry, true ) ); |
|
|
|
@@ -212,7 +212,7 @@ QgsPointSequence QgsEllipse::points( unsigned int segments ) const |
|
|
|
|
|
QgsPolygon *QgsEllipse::toPolygon( unsigned int segments ) const |
|
|
{ |
|
|
std::unique_ptr<QgsPolygonV2> polygon( new QgsPolygon() ); |
|
|
std::unique_ptr<QgsPolygon> polygon( new QgsPolygon() ); |
|
|
if ( segments < 3 ) |
|
|
{ |
|
|
return polygon.release(); |
|
@@ -280,7 +280,7 @@ QString QgsEllipse::toString( int pointPrecision, int axisPrecision, int azimuth |
|
|
|
|
|
QgsPolygon *QgsEllipse::orientedBoundingBox() const |
|
|
{ |
|
|
std::unique_ptr<QgsPolygonV2> ombb( new QgsPolygon() ); |
|
|
std::unique_ptr<QgsPolygon> ombb( new QgsPolygon() ); |
|
|
if ( isEmpty() ) |
|
|
{ |
|
|
return ombb.release(); |
|
|
|
@@ -2771,7 +2771,7 @@ std::unique_ptr<QgsLineString> QgsGeometry::smoothLine( const QgsLineString &lin |
|
|
return smoothCurve( line, iterations, offset, squareDistThreshold, maxAngleRads, false ); |
|
|
} |
|
|
|
|
|
std::unique_ptr<QgsPolygonV2> QgsGeometry::smoothPolygon( const QgsPolygon &polygon, const unsigned int iterations, const double offset, double minimumDistance, double maxAngle ) const |
|
|
std::unique_ptr<QgsPolygon> QgsGeometry::smoothPolygon( const QgsPolygon &polygon, const unsigned int iterations, const double offset, double minimumDistance, double maxAngle ) const |
|
|
{ |
|
|
double maxAngleRads = maxAngle * M_PI / 180.0; |
|
|
double squareDistThreshold = minimumDistance > 0 ? minimumDistance * minimumDistance : -1; |
|
|
|
@@ -299,7 +299,7 @@ bool QgsGeometryCollection::fromWkb( QgsConstWkbPtr &wkbPtr ) |
|
|
|
|
|
bool QgsGeometryCollection::fromWkt( const QString &wkt ) |
|
|
{ |
|
|
return fromCollectionWkt( wkt, QList<QgsAbstractGeometry *>() << new QgsPoint << new QgsLineString << new QgsPolygonV2 |
|
|
return fromCollectionWkt( wkt, QList<QgsAbstractGeometry *>() << new QgsPoint << new QgsLineString << new QgsPolygon |
|
|
<< new QgsCircularString << new QgsCompoundCurve |
|
|
<< new QgsCurvePolygon |
|
|
<< new QgsMultiPoint << new QgsMultiLineString |
|
|
|
@@ -137,7 +137,7 @@ std::unique_ptr< QgsAbstractGeometry > QgsGeometryFactory::fromPoint( const QgsP |
|
|
return qgis::make_unique< QgsPoint >( point.x(), point.y() ); |
|
|
} |
|
|
|
|
|
std::unique_ptr<QgsMultiPointV2> QgsGeometryFactory::fromMultiPoint( const QgsMultiPointXY &multipoint ) |
|
|
std::unique_ptr<QgsMultiPoint> QgsGeometryFactory::fromMultiPoint( const QgsMultiPointXY &multipoint ) |
|
|
{ |
|
|
std::unique_ptr< QgsMultiPoint > mp = qgis::make_unique< QgsMultiPoint >(); |
|
|
QgsMultiPointXY::const_iterator ptIt = multipoint.constBegin(); |
|
@@ -164,7 +164,7 @@ std::unique_ptr<QgsMultiLineString> QgsGeometryFactory::fromMultiPolyline( const |
|
|
return mLine; |
|
|
} |
|
|
|
|
|
std::unique_ptr<QgsPolygonV2> QgsGeometryFactory::fromPolygon( const QgsPolygonXY &polygon ) |
|
|
std::unique_ptr<QgsPolygon> QgsGeometryFactory::fromPolygon( const QgsPolygonXY &polygon ) |
|
|
{ |
|
|
std::unique_ptr< QgsPolygon > poly = qgis::make_unique< QgsPolygon >(); |
|
|
|
|
|
|
@@ -67,15 +67,15 @@ class CORE_EXPORT QgsGeometryFactory |
|
|
//! Construct geometry from a point |
|
|
static std::unique_ptr< QgsAbstractGeometry > fromPoint( const QgsPointXY &point ); |
|
|
//! Construct geometry from a multipoint |
|
|
static std::unique_ptr<QgsMultiPointV2> fromMultiPoint( const QgsMultiPointXY &multipoint ); |
|
|
static std::unique_ptr<QgsMultiPoint> fromMultiPoint( const QgsMultiPointXY &multipoint ); |
|
|
//! Construct geometry from a polyline |
|
|
static std::unique_ptr< QgsAbstractGeometry > fromPolyline( const QgsPolylineXY &polyline ); |
|
|
//! Construct geometry from a multipolyline |
|
|
static std::unique_ptr<QgsMultiLineString> fromMultiPolyline( const QgsMultiPolylineXY &multiline ); |
|
|
//! Construct geometry from a polygon |
|
|
static std::unique_ptr<QgsPolygonV2> fromPolygon( const QgsPolygonXY &polygon ); |
|
|
static std::unique_ptr<QgsPolygon> fromPolygon( const QgsPolygonXY &polygon ); |
|
|
//! Construct geometry from a multipolygon |
|
|
static std::unique_ptr<QgsMultiPolygonV2> fromMultiPolygon( const QgsMultiPolygonXY &multipoly ); |
|
|
static std::unique_ptr<QgsMultiPolygon> fromMultiPolygon( const QgsMultiPolygonXY &multipoly ); |
|
|
//! Return empty geometry from wkb type |
|
|
static std::unique_ptr< QgsAbstractGeometry > geomFromWkbType( QgsWkbTypes::Type t ); |
|
|
|
|
|
|
@@ -1109,7 +1109,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos |
|
|
return nullptr; |
|
|
} |
|
|
|
|
|
std::unique_ptr<QgsPolygonV2> QgsGeos::fromGeosPolygon( const GEOSGeometry *geos ) |
|
|
std::unique_ptr<QgsPolygon> QgsGeos::fromGeosPolygon( const GEOSGeometry *geos ) |
|
|
{ |
|
|
if ( GEOSGeomTypeId_r( geosinit.ctxt, geos ) != GEOS_POLYGON ) |
|
|
{ |
|
|
|
@@ -59,7 +59,7 @@ QgsGeometry QgsInternalGeometryEngine::extrude( double x, double y ) const |
|
|
linesToProcess << static_cast<QgsLineString *>( curve->segmentize() ); |
|
|
} |
|
|
|
|
|
std::unique_ptr<QgsMultiPolygonV2> multipolygon( linesToProcess.size() > 1 ? new QgsMultiPolygon() : nullptr ); |
|
|
std::unique_ptr<QgsMultiPolygon> multipolygon( linesToProcess.size() > 1 ? new QgsMultiPolygon() : nullptr ); |
|
|
QgsPolygon *polygon = nullptr; |
|
|
|
|
|
if ( !linesToProcess.empty() ) |
|
|
|
@@ -38,7 +38,7 @@ QgsMultiPoint *QgsMultiPoint::createEmptyWithSameType() const |
|
|
|
|
|
QgsMultiPoint *QgsMultiPoint::clone() const |
|
|
{ |
|
|
return new QgsMultiPointV2( *this ); |
|
|
return new QgsMultiPoint( *this ); |
|
|
} |
|
|
|
|
|
QgsMultiPoint *QgsMultiPoint::toCurveType() const |
|
|
|
@@ -22,11 +22,11 @@ email : marco.hugentobler at sourcepole dot com |
|
|
|
|
|
/** |
|
|
* \ingroup core |
|
|
* \class QgsMultiPointV2 |
|
|
* \class QgsMultiPoint |
|
|
* \brief Multi point geometry collection. |
|
|
* \since QGIS 2.10 |
|
|
*/ |
|
|
class CORE_EXPORT QgsMultiPointV2: public QgsGeometryCollection |
|
|
class CORE_EXPORT QgsMultiPoint: public QgsGeometryCollection |
|
|
{ |
|
|
public: |
|
|
QgsMultiPoint(); |
|
|
|
@@ -47,12 +47,12 @@ QgsMultiPolygon *QgsMultiPolygon::createEmptyWithSameType() const |
|
|
|
|
|
QgsMultiPolygon *QgsMultiPolygon::clone() const |
|
|
{ |
|
|
return new QgsMultiPolygonV2( *this ); |
|
|
return new QgsMultiPolygon( *this ); |
|
|
} |
|
|
|
|
|
bool QgsMultiPolygon::fromWkt( const QString &wkt ) |
|
|
{ |
|
|
return fromCollectionWkt( wkt, QList<QgsAbstractGeometry *>() << new QgsPolygonV2, QStringLiteral( "Polygon" ) ); |
|
|
return fromCollectionWkt( wkt, QList<QgsAbstractGeometry *>() << new QgsPolygon, QStringLiteral( "Polygon" ) ); |
|
|
} |
|
|
|
|
|
QDomElement QgsMultiPolygon::asGML2( QDomDocument &doc, int precision, const QString &ns ) const |
|
|
|
@@ -22,11 +22,11 @@ email : marco.hugentobler at sourcepole dot com |
|
|
|
|
|
/** |
|
|
* \ingroup core |
|
|
* \class QgsMultiPolygonV2 |
|
|
* \class QgsMultiPolygon |
|
|
* \brief Multi polygon geometry collection. |
|
|
* \since QGIS 2.10 |
|
|
*/ |
|
|
class CORE_EXPORT QgsMultiPolygonV2: public QgsMultiSurface |
|
|
class CORE_EXPORT QgsMultiPolygon: public QgsMultiSurface |
|
|
{ |
|
|
public: |
|
|
QgsMultiPolygon(); |
|
|
|
@@ -41,7 +41,7 @@ QgsPolygon *QgsPolygon::createEmptyWithSameType() const |
|
|
|
|
|
QgsPolygon *QgsPolygon::clone() const |
|
|
{ |
|
|
return new QgsPolygonV2( *this ); |
|
|
return new QgsPolygon( *this ); |
|
|
} |
|
|
|
|
|
void QgsPolygon::clear() |
|
|
|
@@ -24,11 +24,11 @@ |
|
|
|
|
|
/** |
|
|
* \ingroup core |
|
|
* \class QgsPolygonV2 |
|
|
* \class QgsPolygon |
|
|
* \brief Polygon geometry type. |
|
|
* \since QGIS 2.10 |
|
|
*/ |
|
|
class CORE_EXPORT QgsPolygonV2: public QgsCurvePolygon |
|
|
class CORE_EXPORT QgsPolygon: public QgsCurvePolygon |
|
|
{ |
|
|
public: |
|
|
QgsPolygon(); |
|
|
|
@@ -180,7 +180,7 @@ QgsPointSequence QgsRegularPolygon::points() const |
|
|
|
|
|
QgsPolygon *QgsRegularPolygon::toPolygon() const |
|
|
{ |
|
|
std::unique_ptr<QgsPolygonV2> polygon( new QgsPolygon() ); |
|
|
std::unique_ptr<QgsPolygon> polygon( new QgsPolygon() ); |
|
|
if ( isEmpty() ) |
|
|
{ |
|
|
return polygon.release(); |
|
|
|
@@ -30,7 +30,7 @@ |
|
|
* \brief Triangle geometry type. |
|
|
* \since QGIS 3.0 |
|
|
*/ |
|
|
class CORE_EXPORT QgsTriangle : public QgsPolygonV2 |
|
|
class CORE_EXPORT QgsTriangle : public QgsPolygon |
|
|
{ |
|
|
public: |
|
|
QgsTriangle(); |
|
|
|
@@ -268,7 +268,7 @@ QgsGeometry QgsMapToPixelSimplifier::simplifyGeometry( |
|
|
else if ( flatType == QgsWkbTypes::Polygon ) |
|
|
{ |
|
|
const QgsPolygon &srcPolygon = dynamic_cast<const QgsPolygon &>( geometry ); |
|
|
std::unique_ptr<QgsPolygonV2> polygon( new QgsPolygon() ); |
|
|
std::unique_ptr<QgsPolygon> polygon( new QgsPolygon() ); |
|
|
polygon->setExteriorRing( qgsgeometry_cast<QgsCurve *>( simplifyGeometry( simplifyFlags, simplifyAlgorithm, srcPolygon.exteriorRing()->wkbType(), *srcPolygon.exteriorRing(), envelope, map2pixelTol, true ).constGet()->clone() ) ); |
|
|
for ( int i = 0; i < srcPolygon.numInteriorRings(); ++i ) |
|
|
{ |
|
|
|
|
|
|
|
testCreateEmptyWithSameType<QgsMultiLineString>(); |
|
|
|
|
|
qDebug( "createEmptyWithSameType(): QgsMultiPointV2" ); |
|
|
testCreateEmptyWithSameType<QgsMultiPointV2>(); |
|
|
testCreateEmptyWithSameType<QgsMultiPoint>(); |
|
|
|
|
|
qDebug( "createEmptyWithSameType(): QgsMultiSurface" ); |
|
|
testCreateEmptyWithSameType<QgsMultiSurface>(); |
|
|
|
|
testCreateEmptyWithSameType<QgsCurvePolygon>(); |
|
|
|
|
|
qDebug( "createEmptyWithSameType(): QgsPolygonV2" ); |
|
|
testCreateEmptyWithSameType<QgsPolygonV2>(); |
|
|
testCreateEmptyWithSameType<QgsPolygon>(); |
|
|
|
|
|
qDebug( "createEmptyWithSameType(): QgsTriangle" ); |
|
|
testCreateEmptyWithSameType<QgsTriangle>(); |