Skip to content

Commit

Permalink
Hold the GIL for more geometry related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 18, 2020
1 parent 3d67b37 commit fe5615e
Show file tree
Hide file tree
Showing 48 changed files with 672 additions and 672 deletions.
24 changes: 12 additions & 12 deletions python/core/auto_generated/geometry/qgsabstractgeometry.sip.in
Expand Up @@ -130,7 +130,7 @@ Returns a unique string representing the geometry type.
.. seealso:: :py:func:`wktTypeStr`
%End

QgsWkbTypes::Type wkbType() const;
QgsWkbTypes::Type wkbType() const /HoldGIL/;
%Docstring
Returns the WKB type of the geometry.

Expand All @@ -148,14 +148,14 @@ Returns the WKT type string of the geometry.
.. seealso:: :py:func:`wkbType`
%End

bool is3D() const;
bool is3D() const /HoldGIL/;
%Docstring
Returns ``True`` if the geometry is 3D and contains a z-value.

.. seealso:: :py:func:`isMeasure`
%End

bool isMeasure() const;
bool isMeasure() const /HoldGIL/;
%Docstring
Returns ``True`` if the geometry contains m values.

Expand Down Expand Up @@ -850,17 +850,17 @@ struct QgsVertexId

explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex );

bool isValid() const;
bool isValid() const /HoldGIL/;
%Docstring
Returns ``True`` if the vertex id is valid
%End

bool operator==( QgsVertexId other ) const;
bool operator!=( QgsVertexId other ) const;
bool partEqual( QgsVertexId o ) const;
bool ringEqual( QgsVertexId o ) const;
bool vertexEqual( QgsVertexId o ) const;
bool isValid( const QgsAbstractGeometry *geom ) const;
bool operator==( QgsVertexId other ) const /HoldGIL/;
bool operator!=( QgsVertexId other ) const /HoldGIL/;
bool partEqual( QgsVertexId o ) const /HoldGIL/;
bool ringEqual( QgsVertexId o ) const /HoldGIL/;
bool vertexEqual( QgsVertexId o ) const /HoldGIL/;
bool isValid( const QgsAbstractGeometry *geom ) const /HoldGIL/;

int part;
int ring;
Expand Down Expand Up @@ -946,7 +946,7 @@ Constructor for QgsGeometryPartIterator
Constructs iterator for the given geometry
%End

bool hasNext() const;
bool hasNext() const /HoldGIL/;
%Docstring
Find out whether there are more parts
%End
Expand Down Expand Up @@ -994,7 +994,7 @@ Constructor for QgsGeometryConstPartIterator
Constructs iterator for the given geometry
%End

bool hasNext() const;
bool hasNext() const /HoldGIL/;
%Docstring
Find out whether there are more parts
%End
Expand Down
40 changes: 20 additions & 20 deletions python/core/auto_generated/geometry/qgsbox3d.sip.in
Expand Up @@ -28,24 +28,24 @@ extent of a geometry or collection of geometries.
%End
public:

QgsBox3d( double xmin = 0, double ymin = 0, double zmin = 0, double xmax = 0, double ymax = 0, double zmax = 0 );
QgsBox3d( double xmin = 0, double ymin = 0, double zmin = 0, double xmax = 0, double ymax = 0, double zmax = 0 ) /HoldGIL/;
%Docstring
Constructor for QgsBox3D which accepts the ranges of x/y/z coordinates.
%End

QgsBox3d( const QgsPoint &p1, const QgsPoint &p2 );
QgsBox3d( const QgsPoint &p1, const QgsPoint &p2 ) /HoldGIL/;
%Docstring
Constructs a QgsBox3D from two points representing opposite corners of the box.
The box is normalized after construction.
%End

QgsBox3d( const QgsRectangle &rect );
QgsBox3d( const QgsRectangle &rect ) /HoldGIL/;
%Docstring
Constructs a QgsBox3D from a rectangle.
Z Minimum and Z Maximum are set to 0.0.
%End

void setXMinimum( double x );
void setXMinimum( double x ) /HoldGIL/;
%Docstring
Sets the minimum ``x`` value.

Expand All @@ -54,7 +54,7 @@ Sets the minimum ``x`` value.
.. seealso:: :py:func:`setXMaximum`
%End

void setXMaximum( double x );
void setXMaximum( double x ) /HoldGIL/;
%Docstring
Sets the maximum ``x`` value.

Expand All @@ -63,7 +63,7 @@ Sets the maximum ``x`` value.
.. seealso:: :py:func:`setXMinimum`
%End

double xMinimum() const;
double xMinimum() const /HoldGIL/;
%Docstring
Returns the minimum x value.

Expand All @@ -72,7 +72,7 @@ Returns the minimum x value.
.. seealso:: :py:func:`xMaximum`
%End

double xMaximum() const;
double xMaximum() const /HoldGIL/;
%Docstring
Returns the maximum x value.

Expand All @@ -81,7 +81,7 @@ Returns the maximum x value.
.. seealso:: :py:func:`xMinimum`
%End

void setYMinimum( double y );
void setYMinimum( double y ) /HoldGIL/;
%Docstring
Sets the minimum ``y`` value.

Expand All @@ -90,7 +90,7 @@ Sets the minimum ``y`` value.
.. seealso:: :py:func:`setYMaximum`
%End

void setYMaximum( double y );
void setYMaximum( double y ) /HoldGIL/;
%Docstring
Sets the maximum ``y`` value.

Expand All @@ -99,7 +99,7 @@ Sets the maximum ``y`` value.
.. seealso:: :py:func:`setYMinimum`
%End

double yMinimum() const;
double yMinimum() const /HoldGIL/;
%Docstring
Returns the minimum y value.

Expand All @@ -108,7 +108,7 @@ Returns the minimum y value.
.. seealso:: :py:func:`yMaximum`
%End

double yMaximum() const;
double yMaximum() const /HoldGIL/;
%Docstring
Returns the maximum y value.

Expand All @@ -117,7 +117,7 @@ Returns the maximum y value.
.. seealso:: :py:func:`yMinimum`
%End

void setZMinimum( double z );
void setZMinimum( double z ) /HoldGIL/;
%Docstring
Sets the minimum ``z`` value.

Expand All @@ -126,7 +126,7 @@ Sets the minimum ``z`` value.
.. seealso:: :py:func:`setZMaximum`
%End

void setZMaximum( double z );
void setZMaximum( double z ) /HoldGIL/;
%Docstring
Sets the maximum ``z`` value.

Expand All @@ -135,7 +135,7 @@ Sets the maximum ``z`` value.
.. seealso:: :py:func:`setZMinimum`
%End

double zMinimum() const;
double zMinimum() const /HoldGIL/;
%Docstring
Returns the minimum z value.

Expand All @@ -144,7 +144,7 @@ Returns the minimum z value.
.. seealso:: :py:func:`zMaximum`
%End

double zMaximum() const;
double zMaximum() const /HoldGIL/;
%Docstring
Returns the maximum z value.

Expand All @@ -158,7 +158,7 @@ Returns the maximum z value.
Normalize the box so it has non-negative width/height/depth.
%End

double width() const;
double width() const /HoldGIL/;
%Docstring
Returns the width of the box.

Expand All @@ -167,7 +167,7 @@ Returns the width of the box.
.. seealso:: :py:func:`depth`
%End

double height() const;
double height() const /HoldGIL/;
%Docstring
Returns the height of the box.

Expand All @@ -176,7 +176,7 @@ Returns the height of the box.
.. seealso:: :py:func:`depth`
%End

double depth() const;
double depth() const /HoldGIL/;
%Docstring
Returns the depth of the box.

Expand All @@ -185,7 +185,7 @@ Returns the depth of the box.
.. seealso:: :py:func:`height`
%End

double volume() const;
double volume() const /HoldGIL/;
%Docstring
Returns the volume of the box.
%End
Expand All @@ -195,7 +195,7 @@ Returns the volume of the box.
Returns the intersection of this box and another 3D box.
%End

bool is2d() const;
bool is2d() const /HoldGIL/;
%Docstring
Returns ``True`` if the box can be considered a 2-dimensional box, i.e.
it has equal minimum and maximum z values.
Expand Down
28 changes: 14 additions & 14 deletions python/core/auto_generated/geometry/qgscircle.sip.in
Expand Up @@ -31,7 +31,7 @@ The azimuth is the north angle to the semi-major axis, in degrees. By default, t
public:
QgsCircle();

QgsCircle( const QgsPoint &center, double radius, double azimuth = 0 );
QgsCircle( const QgsPoint &center, double radius, double azimuth = 0 ) /HoldGIL/;
%Docstring
Constructs a circle by defining all the members.

Expand All @@ -40,7 +40,7 @@ Constructs a circle by defining all the members.
:param azimuth: Angle in degrees started from the North to the first quadrant.
%End

static QgsCircle from2Points( const QgsPoint &pt1, const QgsPoint &pt2 );
static QgsCircle from2Points( const QgsPoint &pt1, const QgsPoint &pt2 ) /HoldGIL/;
%Docstring
Constructs a circle by 2 points on the circle.
The center point can have m value which is the result from the midpoint
Expand All @@ -53,7 +53,7 @@ The azimuth is the angle between ``pt1`` and ``pt2``.
:param pt2: Second point.
%End

static QgsCircle from3Points( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, double epsilon = 1E-8 );
static QgsCircle from3Points( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, double epsilon = 1E-8 ) /HoldGIL/;
%Docstring
Constructs a circle by 3 points on the circle.
M value is dropped for the center point.
Expand All @@ -68,7 +68,7 @@ If the points are colinear an empty circle is returned.
:param epsilon: Value used to compare point.
%End

static QgsCircle fromCenterDiameter( const QgsPoint &center, double diameter, double azimuth = 0 );
static QgsCircle fromCenterDiameter( const QgsPoint &center, double diameter, double azimuth = 0 ) /HoldGIL/;
%Docstring
Constructs a circle by a center point and a diameter.
The center point keeps z and m values from ``center``.
Expand All @@ -79,7 +79,7 @@ The center point keeps z and m values from ``center``.
%End


static QgsCircle fromCenterPoint( const QgsPoint &center, const QgsPoint &pt1 );
static QgsCircle fromCenterPoint( const QgsPoint &center, const QgsPoint &pt1 ) /HoldGIL/;
%Docstring
Constructs a circle by a center point and another point.
The center point keeps z and m values from ``center``.
Expand All @@ -93,7 +93,7 @@ The azimuth is the angle between ``center`` and ``pt1``.

static QgsCircle from3Tangents( const QgsPoint &pt1_tg1, const QgsPoint &pt2_tg1,
const QgsPoint &pt1_tg2, const QgsPoint &pt2_tg2,
const QgsPoint &pt1_tg3, const QgsPoint &pt2_tg3, double epsilon = 1E-8 );
const QgsPoint &pt1_tg3, const QgsPoint &pt2_tg3, double epsilon = 1E-8 ) /HoldGIL/;
%Docstring
Constructs a circle by 3 tangents on the circle (aka inscribed circle of a triangle).
Z and m values are dropped for the center point.
Expand All @@ -108,7 +108,7 @@ The azimuth always takes the default value.
:param epsilon: Value used to compare point.
%End

static QgsCircle fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 );
static QgsCircle fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 ) /HoldGIL/;
%Docstring
Constructs a circle by an extent (aka bounding box / :py:class:`QgsRectangle`).
The center point can have m value which is the result from the midpoint
Expand All @@ -121,7 +121,7 @@ The azimuth always takes the default value.
:param pt2: Second corner.
%End

static QgsCircle minimalCircleFrom3Points( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, double epsilon = 1E-8 );
static QgsCircle minimalCircleFrom3Points( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, double epsilon = 1E-8 ) /HoldGIL/;
%Docstring
Constructs the smallest circle from 3 points.
Z and m values are dropped for the center point.
Expand Down Expand Up @@ -215,14 +215,14 @@ Note that this method is 2D only and does not consider the z-value of the circle
.. versionadded:: 3.6
%End

virtual double area() const;
virtual double area() const /HoldGIL/;

virtual double perimeter() const;
virtual double perimeter() const /HoldGIL/;




virtual void setSemiMajorAxis( double semiMajorAxis );
virtual void setSemiMajorAxis( double semiMajorAxis ) /HoldGIL/;

%Docstring
Inherited method. Use setRadius instead.
Expand All @@ -232,7 +232,7 @@ Inherited method. Use setRadius instead.
.. seealso:: :py:func:`setRadius`
%End

virtual void setSemiMinorAxis( double semiMinorAxis );
virtual void setSemiMinorAxis( double semiMinorAxis ) /HoldGIL/;

%Docstring
Inherited method. Use setRadius instead.
Expand All @@ -242,11 +242,11 @@ Inherited method. Use setRadius instead.
.. seealso:: :py:func:`setRadius`
%End

double radius() const;
double radius() const /HoldGIL/;
%Docstring
Returns the radius of the circle
%End
void setRadius( double radius );
void setRadius( double radius ) /HoldGIL/;
%Docstring
Sets the radius of the circle
%End
Expand Down

0 comments on commit fe5615e

Please sign in to comment.