Skip to content

Commit

Permalink
Merge pull request #5491 from m-kuhn/dropV2
Browse files Browse the repository at this point in the history
Drop V2 suffix on all geometry classes
  • Loading branch information
m-kuhn committed Oct 30, 2017
2 parents 86d170b + d2c1011 commit 1d21072
Show file tree
Hide file tree
Showing 171 changed files with 1,226 additions and 1,208 deletions.
31 changes: 23 additions & 8 deletions doc/api_break.dox
Expand Up @@ -64,8 +64,9 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<caption id="renamed_classes">Renamed classes</caption>
<tr><th>API 2.x<th>API 3.X
<tr><td>QgisGui<td>QgsGuiUtils
<tr><td>QgsAttributeAction<td>QgsActionManager
<tr><td>QgsAbstractGeometryV2<td>QgsAbstractGeometry
<tr><td>QgsArcProperter<td>QgsStrategy
<tr><td>QgsAttributeAction<td>QgsActionManager
<tr><td>QgsCategorizedSymbolRendererV2<td>QgsCategorizedSymbolRenderer
<tr><td>QgsCategorizedSymbolRendererV2Model<td>QgsCategorizedSymbolRendererModel
<tr><td>QgsCategorizedSymbolRendererV2ViewStyle<td>QgsCategorizedSymbolRendererViewStyle
Expand All @@ -86,6 +87,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsCurveV2<td>QgsCurve
<tr><td>QgsDbFilterProxyModel<td>QgsDatabaseFilterProxyModel
<tr><td>QgsDiagramRendererV2<td>QgsDiagramRenderer
<tr><td>QgsDistanceArcProperter<td>QgsDistanceStrategy
<tr><td>QgsDoubleBoxBarStyle<td>QgsDoubleBoxScaleBarRenderer
<tr><td>QgsEditorWidgetV2<td>QgsEditorWidget
<tr><td>QgsEllipseSymbolLayerV2<td>QgsEllipseSymbolLayer
Expand All @@ -104,6 +106,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsGraduatedSymbolRendererV2Model<td>QgsGraduatedSymbolRendererModel
<tr><td>QgsGraduatedSymbolRendererV2ViewStyle<td>QgsGraduatedSymbolRendererViewStyle
<tr><td>QgsGraduatedSymbolRendererV2Widget<td>QgsGraduatedSymbolRendererWidget
<tr><td>QgsGraphArc<td>QgsGraphEdge
<tr><td>QgsJSONExporter<td>QgsJsonExporter
<tr><td>QgsJSONUtils<td>QgsJsonUtils
<tr><td>QgsLabelingEngineV2<td>QgsLabelingEngine
Expand All @@ -118,11 +121,21 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsMarkerSymbolV2<td>QgsMarkerSymbol
<tr><td>QgsMultiCurveV2<td>QgsMultiCurve
<tr><td>QgsMultiLineStringV2<td>QgsMultiLineString
<tr><td>QgsMultiPoint<td>QgsMultiPointXY
<tr><td>QgsMultiPointV2<td>QgsMultiPoint
<tr><td>QgsMultiPolygon<td>QgsPolygonXY
<tr><td>QgsMultiPolygonV2<td>QgsPolygon
<tr><td>QgsMultiPolyline<td>QgsPolylineXY
<tr><td>QgsMultiPolylineV2<td>QgsPolyline
<tr><td>QgsMultiSurfaceV2<td>QgsMultiSurface
<tr><td>QgsNumericScaleBarStyle<td>QgsNumericScaleBarRenderer
<tr><td>QgsPointV2<td>QgsPoint
<tr><td>QgsPoint<td>QgsPointXY
<tr><td>QgsPointSequenceV2<td>QgsPointSequence
<tr><td>QgsPointV2<td>QgsPoint
<tr><td>QgsPolygon<td>QgsPolygonXY
<tr><td>QgsPolygonV2<td>QgsPolygon
<tr><td>QgsPolyline<td>QgsPolylineXY
<tr><td>QgsPolylineV2<td>QgsPolyline
<tr><td>QgsProperty<td>QgsProjectProperty
<tr><td>QgsPropertyKey<td>QgsProjectPropertyKey
<tr><td>QgsPropertyValue<td>QgsProjectPropertyValue
Expand Down Expand Up @@ -175,6 +188,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsSymbolLayerV2Utils<td>QgsSymbolLayerUtils
<tr><td>QgsSymbolLayerV2Widget<td>QgsSymbolLayerWidget
<tr><td>QgsSymbolLevelsV2Dialog<td>QgsSymbolLevelsDialog
<tr><td>QgsSymbolV2<td>QgsSymbol
<tr><td>QgsSymbolV2LegendNode<td>QgsSymbolLegendNode
<tr><td>QgsSymbolV2LevelItem<td>QgsSymbolLevelItem
<tr><td>QgsSymbolV2RenderContext<td>QgsSymbolRenderContext
Expand All @@ -196,10 +210,6 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsVectorRandomColorRampV2<td>QgsLimitedRandomColorRamp
<tr><td>QgsVectorRandomColorRampV2Dialog<td>QgsLimitedRandomColorRampDialog
<tr><td>QgsVectorRandomColorRampV2DialogBase<td>QgsLimitedRandomColorRampDialogBase
<tr><td>QgsSymbolV2<td>QgsSymbol
<tr><td>QgsArcProperter<td>QgsStrategy
<tr><td>QgsDistanceArcProperter<td>QgsDistanceStrategy
<tr><td>QgsGraphArc<td>QgsGraphEdge
</table>

<table>
Expand Down Expand Up @@ -1301,8 +1311,8 @@ method if the geometry is not being modified.
empty geometry collection)
- wkbSize() and asWkb() has been replaced by exportToWkb(). WKB representation is no longer cached within QgsGeometry
- asGeos() has been replaced by exportToGeos(). GEOS representation is no longer cached within QgsGeometry
- int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPoints
- int addPart( const QList<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPointsV2
- int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPointsXY
- int addPart( const QList<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPoints
- static bool compare( const QgsPolyline& p1, const QgsPolyline& p2, double epsilon ) has been renamed to comparePolylines
- static bool compare( const QgsPolygon& p1, const QgsPolygon& p2, double epsilon ) has been renamed to comparePolygons
- static bool compare( const QgsMultiPolygon& p1, const QgsMultiPolygon& p2, double epsilon ) has been renamed to compareMultiPolygons
Expand All @@ -1314,6 +1324,11 @@ empty geometry collection)
- fromPolyline() now requires a list of QgsPoint objects, instead of QgsPointXY 2d points. A new method fromPolylineXY was
added which uses the old list of 2d QgsPointXY objects. Using the newer method with QgsPoint is greatly preferred, as it
maintains Z or M dimensions from the input points and is more efficient.
- fromPoint() was renamed to fromPointXY()
- fromMultiPoint() was renamed to fromMultiPointXY()
- fromMultiPolyline() was renamed to fromMultiPolylineXY()
- fromPolygon() was renamed to fromPolygonXY()
- fromMultiPolygon() was renamed to fromMultiPolygonXY()


QgsGeometryAnalyzer {#qgis_api_break_3_0_QgsGeometryAnalyzer}
Expand Down
16 changes: 8 additions & 8 deletions python/core/geometry/qgsabstractgeometry.sip
Expand Up @@ -35,16 +35,16 @@ class QgsAbstractGeometry
sipType = sipType_QgsCompoundCurve;
else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
sipType = sipType_QgsTriangle;
else if ( qgsgeometry_cast<QgsPolygonV2 *>( sipCpp ) != nullptr )
sipType = sipType_QgsPolygonV2;
else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
sipType = sipType_QgsPolygon;
else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
sipType = sipType_QgsCurvePolygon;
else if ( qgsgeometry_cast<QgsMultiPointV2 *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiPointV2;
else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiPoint;
else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiLineString;
else if ( qgsgeometry_cast<QgsMultiPolygonV2 *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiPolygonV2;
else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiPolygon;
else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
sipType = sipType_QgsMultiSurface;
else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
Expand Down Expand Up @@ -396,8 +396,8 @@ Returns the centroid of the geometry
virtual QgsAbstractGeometry *toCurveType() const = 0 /Factory/;
%Docstring
Returns the geometry converted to the more generic curve type.
E.g. QgsLineString -> QgsCompoundCurve, QgsPolygonV2 -> QgsCurvePolygon,
QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygonV2 -> QgsMultiSurface
E.g. QgsLineString -> QgsCompoundCurve, QgsPolygon -> QgsCurvePolygon,
QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygon -> QgsMultiSurface
:return: the converted geometry. Caller takes ownership
:rtype: QgsAbstractGeometry
%End
Expand Down
6 changes: 3 additions & 3 deletions python/core/geometry/qgscurvepolygon.sip
Expand Up @@ -61,7 +61,7 @@ class QgsCurvePolygon: QgsSurface

virtual double perimeter() const;

virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;
virtual QgsPolygon *surfaceToPolygon() const /Factory/;

virtual QgsAbstractGeometry *boundary() const /Factory/;

Expand All @@ -81,13 +81,13 @@ class QgsCurvePolygon: QgsSurface
:rtype: QgsCurve
%End

virtual QgsPolygonV2 *toPolygon( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
virtual QgsPolygon *toPolygon( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
%Docstring
Returns a new polygon geometry corresponding to a segmentized approximation
of the curve.
\param tolerance segmentation tolerance
\param toleranceType maximum segmentation angle or maximum difference between approximation and curve*
:rtype: QgsPolygonV2
:rtype: QgsPolygon
%End

virtual void setExteriorRing( QgsCurve *ring /Transfer/ );
Expand Down
8 changes: 4 additions & 4 deletions python/core/geometry/qgsellipse.sip
Expand Up @@ -202,11 +202,11 @@ The circumference of the ellipse using first approximation of Ramanujan.
:rtype: QgsPointSequence
%End

virtual QgsPolygonV2 *toPolygon( unsigned int segments = 36 ) const /Factory/;
virtual QgsPolygon *toPolygon( unsigned int segments = 36 ) const /Factory/;
%Docstring
Returns a segmented polygon.
\param segments Number of segments used to segment geometry.
:rtype: QgsPolygonV2
:rtype: QgsPolygon
%End

virtual QgsLineString *toLineString( unsigned int segments = 36 ) const /Factory/;
Expand All @@ -216,10 +216,10 @@ The circumference of the ellipse using first approximation of Ramanujan.
:rtype: QgsLineString
%End

virtual QgsPolygonV2 *orientedBoundingBox() const /Factory/;
virtual QgsPolygon *orientedBoundingBox() const /Factory/;
%Docstring
Returns the oriented minimal bounding box for the ellipse.
:rtype: QgsPolygonV2
:rtype: QgsPolygon
%End

virtual QgsRectangle boundingBox() const;
Expand Down
74 changes: 37 additions & 37 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -19,13 +19,13 @@ typedef QVector<QgsPointXY> QgsPolylineXY;

typedef QVector<QgsPoint> QgsPolyline;

typedef QVector<QVector<QgsPointXY>> QgsPolygon;
typedef QVector<QVector<QgsPointXY>> QgsPolygonXY;

typedef QVector<QgsPointXY> QgsMultiPoint;
typedef QVector<QgsPointXY> QgsMultiPointXY;

typedef QVector<QVector<QgsPointXY>> QgsMultiPolyline;
typedef QVector<QVector<QgsPointXY>> QgsMultiPolylineXY;

typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygon;
typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygonXY;



Expand Down Expand Up @@ -145,14 +145,14 @@ Copy constructor will prompt a deep copy of the object
Creates a new geometry from a WKT string
:rtype: QgsGeometry
%End
static QgsGeometry fromPoint( const QgsPointXY &point );
static QgsGeometry fromPointXY( const QgsPointXY &point );
%Docstring
Creates a new geometry from a QgsPointXY object
:rtype: QgsGeometry
%End
static QgsGeometry fromMultiPoint( const QgsMultiPoint &multipoint );
static QgsGeometry fromMultiPointXY( const QgsMultiPointXY &multipoint );
%Docstring
Creates a new geometry from a QgsMultiPoint object
Creates a new geometry from a QgsMultiPointXY object
:rtype: QgsGeometry
%End

Expand Down Expand Up @@ -184,17 +184,17 @@ Creates a new geometry from a QgsMultiPoint object
:rtype: QgsGeometry
%End

static QgsGeometry fromMultiPolyline( const QgsMultiPolyline &multiline );
static QgsGeometry fromMultiPolylineXY( const QgsMultiPolylineXY &multiline );
%Docstring
Creates a new geometry from a QgsMultiPolyline object
Creates a new geometry from a QgsMultiPolylineXY object
:rtype: QgsGeometry
%End
static QgsGeometry fromPolygon( const QgsPolygon &polygon );
static QgsGeometry fromPolygonXY( const QgsPolygonXY &polygon );
%Docstring
Creates a new geometry from a QgsPolygon
:rtype: QgsGeometry
%End
static QgsGeometry fromMultiPolygon( const QgsMultiPolygon &multipoly );
static QgsGeometry fromMultiPolygonXY( const QgsMultiPolygonXY &multipoly );
%Docstring
Creates a new geometry from a QgsMultiPolygon
:rtype: QgsGeometry
Expand Down Expand Up @@ -519,7 +519,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
:rtype: OperationResult
%End

OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPoints/;
OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPointsXY/;
%Docstring
Adds a new part to a the geometry.
\param points points describing part to add
Expand All @@ -528,7 +528,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
:rtype: OperationResult
%End

OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPointsV2/;
OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPoints/;
%Docstring
Adds a new part to a the geometry.
\param points points describing part to add
Expand Down Expand Up @@ -1144,32 +1144,32 @@ Returns an extruded version of this geometry.
:rtype: QgsPolylineXY
%End

QgsPolygon asPolygon() const;
QgsPolygonXY asPolygon() const;
%Docstring
Returns contents of the geometry as a polygon
if wkbType is WKBPolygon, otherwise an empty list
:rtype: QgsPolygon
:rtype: QgsPolygonXY
%End

QgsMultiPoint asMultiPoint() const;
QgsMultiPointXY asMultiPoint() const;
%Docstring
Returns contents of the geometry as a multi point
if wkbType is WKBMultiPoint, otherwise an empty list
:rtype: QgsMultiPoint
:rtype: QgsMultiPointXY
%End

QgsMultiPolyline asMultiPolyline() const;
QgsMultiPolylineXY asMultiPolyline() const;
%Docstring
Returns contents of the geometry as a multi linestring
if wkbType is WKBMultiLineString, otherwise an empty list
:rtype: QgsMultiPolyline
:rtype: QgsMultiPolylineXY
%End

QgsMultiPolygon asMultiPolygon() const;
QgsMultiPolygonXY asMultiPolygon() const;
%Docstring
Returns contents of the geometry as a multi polygon
if wkbType is WKBMultiPolygon, otherwise an empty list
:rtype: QgsMultiPolygon
:rtype: QgsMultiPolygonXY
%End

QList<QgsGeometry> asGeometryCollection() const;
Expand Down Expand Up @@ -1430,20 +1430,20 @@ Returns an extruded version of this geometry.
:rtype: QgsPolylineXY
%End

static QgsPolygon createPolygonFromQPolygonF( const QPolygonF &polygon ) /Factory/;
static QgsPolygonXY createPolygonFromQPolygonF( const QPolygonF &polygon ) /Factory/;
%Docstring
Creates a QgsPolygon from a QPolygonF.
Creates a QgsPolygonXYfrom a QPolygonF.
\param polygon source polygon
:return: QgsPolygon
.. seealso:: createPolylineFromQPolygonF
:rtype: QgsPolygon
:rtype: QgsPolygonXY
%End


static bool compare( PyObject *obj1, PyObject *obj2, double epsilon = 4 * DBL_EPSILON );
%Docstring
Compares two geometry objects for equality within a specified tolerance.
The objects can be of type QgsPolylineXY, QgsPolygon or QgsMultiPolygon.
The objects can be of type QgsPolylineXY, QgsPolygonXYor QgsMultiPolygon.
The 2 types should match.
\param p1 first geometry object
\param p2 second geometry object
Expand Down Expand Up @@ -1507,10 +1507,10 @@ Returns an extruded version of this geometry.
sipCanConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
sipCanConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
{
QgsPolygon *p0;
QgsPolygon *p1;
p0 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
p1 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
QgsPolygonXY *p0;
QgsPolygonXY *p1;
p0 = reinterpret_cast<QgsPolygonXY *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
p1 = reinterpret_cast<QgsPolygonXY *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
if ( sipIsErr )
{
sipReleaseType( p0, sipType_QVector_0600QVector_0100QgsPointXY, state0 );
Expand All @@ -1534,10 +1534,10 @@ Returns an extruded version of this geometry.
sipCanConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
sipCanConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
{
QgsMultiPolygon *p0;
QgsMultiPolygon *p1;
p0 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
p1 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
QgsMultiPolygonXY *p0;
QgsMultiPolygonXY *p1;
p0 = reinterpret_cast<QgsMultiPolygonXY *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
p1 = reinterpret_cast<QgsMultiPolygonXY *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
if ( sipIsErr )
{
sipReleaseType( p0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state0 );
Expand Down Expand Up @@ -1581,16 +1581,16 @@ Returns an extruded version of this geometry.

static void convertPointList( const QList<QgsPointXY> &input, QgsPointSequence &output );
%Docstring
Upgrades a point list from QgsPointXY to QgsPointV2
Upgrades a point list from QgsPointXY to QgsPoint
\param input list of QgsPointXY objects to be upgraded
\param output destination for list of points converted to QgsPointV2
\param output destination for list of points converted to QgsPoint
%End

static void convertPointList( const QgsPointSequence &input, QList<QgsPointXY> &output );
%Docstring
Downgrades a point list from QgsPoint to QgsPoint
Downgrades a point list from QgsPoint to QgsPointXY
\param input list of QgsPoint objects to be downgraded
\param output destination for list of points converted to QgsPoint
\param output destination for list of points converted to QgsPointXY
%End

operator QVariant() const;
Expand Down

0 comments on commit 1d21072

Please sign in to comment.