Skip to content
Permalink
Browse files

Add some SIP_THROW( QgsCsException ) annotations

Incomplete, but allows proper QgsCsException catching
for these methods
  • Loading branch information
nyalldawson committed May 22, 2018
1 parent f82b639 commit 6165e4c8d6ab6db45cdbd961902fd7682d44417c
@@ -258,9 +258,7 @@ Returns a GeoJSON representation of the geometry.
%End


virtual void transform( const QgsCoordinateTransform &ct,
QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) = 0;
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException ) = 0;
%Docstring
Transforms the geometry using a coordinate transform

@@ -115,8 +115,8 @@ Sets the circular string's points

virtual void draw( QPainter &p ) const;

virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );

virtual void addToPainterPath( QPainterPath &path ) const;
@@ -110,8 +110,8 @@ Adds a vertex to the end of the geometry.

virtual void draw( QPainter &p ) const;

virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );

virtual void addToPainterPath( QPainterPath &path ) const;
@@ -127,8 +127,8 @@ area will be removed.

virtual void draw( QPainter &p ) const;

virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );


@@ -632,9 +632,7 @@ Translates this geometry by dx, dy, dz and dm.
:return: OperationResult a result code: success or reason of failure
%End

OperationResult transform( const QgsCoordinateTransform &ct,
QgsCoordinateTransform::TransformDirection direction = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
OperationResult transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection direction = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );
%Docstring
Transforms this geometry as described by the coordinate transform ``ct``.

@@ -89,8 +89,8 @@ Removes a geometry from the collection.
:return: true if removal was successful.
%End

virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );


@@ -258,8 +258,8 @@ of the curve.
virtual void draw( QPainter &p ) const;


virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );


@@ -360,8 +360,8 @@ Example:

virtual void draw( QPainter &p ) const;

virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) throw( QgsCsException );

virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );

virtual QgsCoordinateSequence coordinateSequence() const;
@@ -179,7 +179,7 @@ transform coordinates to.
.. seealso:: :py:func:`sourceCrs`
%End

QgsPointXY transform( const QgsPointXY &point, TransformDirection direction = ForwardTransform ) const;
QgsPointXY transform( const QgsPointXY &point, TransformDirection direction = ForwardTransform ) const throw( QgsCsException );
%Docstring
Transform the point from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -204,7 +204,7 @@ otherwise points are transformed from destination to source CRS.
:return: transformed point
%End

QgsRectangle transformBoundingBox( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const;
QgsRectangle transformBoundingBox( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const throw( QgsCsException );
%Docstring
Transforms a rectangle from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -221,7 +221,7 @@ crossing the 180 degree longitude line is required
:return: rectangle in destination CRS
%End

void transformInPlace( double &x, double &y, double &z, TransformDirection direction = ForwardTransform ) const;
void transformInPlace( double &x, double &y, double &z, TransformDirection direction = ForwardTransform ) const throw( QgsCsException );
%Docstring
Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -239,15 +239,15 @@ heights) and must be expressed in its vertical units (generally meters)



void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const;
void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const throw( QgsCsException );
%Docstring
Transforms a polygon to the destination coordinate system.

:param polygon: polygon to transform (occurs in place)
:param direction: transform direction (defaults to forward transformation)
%End

QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const;
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const throw( QgsCsException );
%Docstring
Transforms a rectangle to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -259,7 +259,7 @@ otherwise points are transformed from destination to source CRS.
:return: transformed rectangle
%End

void transformCoords( int numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const;
void transformCoords( int numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const throw( QgsCsException );
%Docstring
Transform an array of coordinates to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -118,7 +118,7 @@ QgsFeatureRequest.destinationCrs() set on the request is respected.
%End


QgsRectangle filterRectToSourceCrs( const QgsCoordinateTransform &transform ) const;
QgsRectangle filterRectToSourceCrs( const QgsCoordinateTransform &transform ) const throw( QgsCsException );
%Docstring
Returns a rectangle representing the original request's :py:func:`QgsFeatureRequest.filterRect()`
If ``transform`` is a valid coordinate transform, the return rectangle will represent
@@ -282,9 +282,7 @@ class CORE_EXPORT QgsAbstractGeometry
* units (generally meters). If false, then z coordinates will not be changed by the
* transform.
*/
virtual void transform( const QgsCoordinateTransform &ct,
QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) = 0;
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException ) = 0;

/**
* Transforms the x and y components of the geometry using a QTransform object \a t.
@@ -104,8 +104,7 @@ class CORE_EXPORT QgsCircularString: public QgsCurve
bool removeDuplicateNodes( double epsilon = 4 * DBL_EPSILON, bool useZValues = false ) override;

void draw( QPainter &p ) const override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;
void addToPainterPath( QPainterPath &path ) const override;
void drawAsPolygon( QPainter &p ) const override;
@@ -97,8 +97,7 @@ class CORE_EXPORT QgsCompoundCurve: public QgsCurve
void addVertex( const QgsPoint &pt );

void draw( QPainter &p ) const override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;
void addToPainterPath( QPainterPath &path ) const override;
void drawAsPolygon( QPainter &p ) const override;
@@ -110,8 +110,7 @@ class CORE_EXPORT QgsCurvePolygon: public QgsSurface
void removeInteriorRings( double minimumAllowedArea = -1 );

void draw( QPainter &p ) const override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;

bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
@@ -660,9 +660,7 @@ class CORE_EXPORT QgsGeometry
*
* \returns OperationResult a result code: success or reason of failure
*/
OperationResult transform( const QgsCoordinateTransform &ct,
QgsCoordinateTransform::TransformDirection direction = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
OperationResult transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection direction = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException );

/**
* Transforms the x and y components of the geometry using a QTransform object \a t.
@@ -90,8 +90,7 @@ class CORE_EXPORT QgsGeometryCollection: public QgsAbstractGeometry
*/
virtual bool removeGeometry( int nr );

void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;

void draw( QPainter &p ) const override;
@@ -222,8 +222,7 @@ class CORE_EXPORT QgsLineString: public QgsCurve

void draw( QPainter &p ) const override;

void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;

void addToPainterPath( QPainterPath &path ) const override;
@@ -402,8 +402,7 @@ class CORE_EXPORT QgsPoint: public QgsAbstractGeometry
QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const override;
QString asJson( int precision = 17 ) const override;
void draw( QPainter &p ) const override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false ) override;
void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) override SIP_THROW( QgsCsException );
void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;
QgsCoordinateSequence coordinateSequence() const override;
int nCoordinates() const override;
@@ -203,7 +203,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param direction transform direction (defaults to ForwardTransform)
* \returns transformed point
*/
QgsPointXY transform( const QgsPointXY &point, TransformDirection direction = ForwardTransform ) const;
QgsPointXY transform( const QgsPointXY &point, TransformDirection direction = ForwardTransform ) const SIP_THROW( QgsCsException );

/**
* Transform the point specified by x,y from the source CRS to the destination CRS.
@@ -229,7 +229,7 @@ class CORE_EXPORT QgsCoordinateTransform
* crossing the 180 degree longitude line is required
* \returns rectangle in destination CRS
*/
QgsRectangle transformBoundingBox( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const;
QgsRectangle transformBoundingBox( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const SIP_THROW( QgsCsException );

/**
* Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination CRS.
@@ -242,7 +242,7 @@ class CORE_EXPORT QgsCoordinateTransform
* heights) and must be expressed in its vertical units (generally meters)
* \param direction transform direction (defaults to ForwardTransform)
*/
void transformInPlace( double &x, double &y, double &z, TransformDirection direction = ForwardTransform ) const;
void transformInPlace( double &x, double &y, double &z, TransformDirection direction = ForwardTransform ) const SIP_THROW( QgsCsException );

/**
* Transforms an array of x, y and z float coordinates in place, from the source CRS to the destination CRS.
@@ -307,7 +307,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param polygon polygon to transform (occurs in place)
* \param direction transform direction (defaults to forward transformation)
*/
void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const;
void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const SIP_THROW( QgsCsException );

/**
* Transforms a rectangle to the destination CRS.
@@ -317,7 +317,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param direction transform direction (defaults to ForwardTransform)
* \returns transformed rectangle
*/
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const;
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const SIP_THROW( QgsCsException );

/**
* Transform an array of coordinates to the destination CRS.
@@ -329,7 +329,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param z array of z coordinates to transform
* \param direction transform direction (defaults to ForwardTransform)
*/
void transformCoords( int numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const;
void transformCoords( int numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const SIP_THROW( QgsCsException );

/**
* Returns true if the transform short circuits because the source and destination are equivalent.
@@ -139,7 +139,7 @@ class CORE_EXPORT QgsAbstractFeatureIterator
* Will throw a QgsCsException if the rect cannot be transformed from the destination CRS.
* \since QGIS 3.0
*/
QgsRectangle filterRectToSourceCrs( const QgsCoordinateTransform &transform ) const;
QgsRectangle filterRectToSourceCrs( const QgsCoordinateTransform &transform ) const SIP_THROW( QgsCsException );

//! A copy of the feature request.
QgsFeatureRequest mRequest;

0 comments on commit 6165e4c

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