2017-04-12 14:38:07 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsellipse.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsEllipse
{
%Docstring
Ellipse geometry type.
2017-12-15 10:36:55 -04:00
An ellipse is defined by a center point with a semi-major axis, a semi-minor axis and an azimuth.
The azimuth is the north angle to the first quadrant (always oriented on the semi-major axis), in degrees. By default, the semi-major axis is oriented to the east (90 degrees).
The semi-minor axis is always smaller than the semi-major axis. If it is set larger, it will be swapped and the azimuth will increase by 90 degrees.
2017-04-12 14:38:07 +02:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsellipse.h"
%End
public:
2017-09-28 08:17:06 +10:00
2017-04-12 14:38:07 +02:00
QgsEllipse();
2017-09-28 08:17:06 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsEllipse.
2017-09-28 08:17:06 +10:00
%End
2017-04-12 14:38:07 +02:00
2017-09-18 12:23:36 +10:00
virtual ~QgsEllipse();
2017-06-01 12:18:43 +02:00
QgsEllipse( const QgsPoint ¢er, const double semiMajorAxis, const double semiMinorAxis, const double azimuth = 90 );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructs an ellipse by defining all the members.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param center: The center of the ellipse.
:param semiMajorAxis: Semi-major axis of the ellipse.
:param semiMinorAxis: Semi-minor axis of the ellipse.
:param azimuth: Angle in degrees started from the North to the first quadrant.
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
static QgsEllipse fromFoci( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3 );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructs an ellipse by foci (``pt1`` and ``pt2``) and a point ``pt3``.
2018-01-15 08:31:12 +00:00
The center point can have m value which is the result from the midpoint
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
2017-12-15 10:36:55 -04:00
Axes are calculated from the 2D distance with the third point ``pt3``.
The azimuth is the angle between ``pt1`` and ``pt2``.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param pt1: First focus.
:param pt2: Second focus.
:param pt3: A point to calculate the axes.
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
static QgsEllipse fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-19 11:43:52 -04:00
Constructs an ellipse by an extent (aka bounding box / :py:class:`QgsRectangle`).
2018-01-15 08:31:12 +00:00
The center point can have m value which is the result from the midpoint
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
2017-12-15 10:36:55 -04:00
Axes are calculated from the 2D distance between ``pt1`` and ``pt2``.
The azimuth always takes the default value.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param pt1: First corner.
:param pt2: Second corner.
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
static QgsEllipse fromCenterPoint( const QgsPoint &ptc, const QgsPoint &pt1 );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructs an ellipse by a center point and a another point.
2018-01-15 08:31:12 +00:00
The center point keeps m value from ``ptc``. Z dimension is also
supported and is retrieved from the first 3D point amongst ``ptc`` and
``pt1``.
2017-12-15 10:36:55 -04:00
Axes are calculated from the 2D distance between ``ptc`` and ``pt1``.
The azimuth always takes the default value.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param ptc: Center point.
:param pt1: First point.
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
static QgsEllipse fromCenter2Points( const QgsPoint &ptc, const QgsPoint &pt1, const QgsPoint &pt2 );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructs an ellipse by a central point and two other points.
2018-01-15 08:31:12 +00:00
The center point keeps m value from ``ptc``. Z dimension is also
supported and is retrieved from the first 3D point amongst ``ptc``,
``pt1`` and ``pt2``.
2017-12-15 10:36:55 -04:00
Axes are calculated from the 2D distance between ``ptc`` and ``pt1`` and ``pt2``.
The azimuth is the angle between ``ptc`` and ``pt1``.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param ptc: Center point.
:param pt1: First point.
:param pt2: Second point.
2017-04-12 14:38:07 +02:00
%End
virtual bool operator ==( const QgsEllipse &elp ) const;
virtual bool operator !=( const QgsEllipse &elp ) const;
virtual bool isEmpty() const;
%Docstring
An ellipse is empty if axes are equal to 0
%End
2017-06-01 12:18:43 +02:00
QgsPoint center() const;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the center point.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setCenter`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`rcenter`
2017-04-12 14:38:07 +02:00
%End
double semiMajorAxis() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the semi-major axis.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setSemiMajorAxis`
2017-04-12 14:38:07 +02:00
%End
double semiMinorAxis() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the semi-minor axis.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setSemiMinorAxis`
2017-04-12 14:38:07 +02:00
%End
double azimuth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the azimuth.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setAzimuth`
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
void setCenter( const QgsPoint ¢er );
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the center point.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`center`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`rcenter`
2017-04-12 14:38:07 +02:00
%End
virtual void setSemiMajorAxis( const double semiMajorAxis );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the semi-major axis.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`semiMajorAxis`
2017-04-12 14:38:07 +02:00
%End
virtual void setSemiMinorAxis( const double semiMinorAxis );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the semi-minor axis.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`semiMinorAxis`
2017-04-12 14:38:07 +02:00
%End
void setAzimuth( const double azimuth );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the azimuth (orientation).
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`azimuth`
2017-04-12 14:38:07 +02:00
%End
virtual double focusDistance() const;
%Docstring
2017-12-15 10:36:55 -04:00
The distance between the center and each foci.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`fromFoci`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`foci`
2017-12-15 10:36:55 -04:00
:return: The distance between the center and each foci.
2017-04-12 14:38:07 +02:00
%End
2017-06-01 12:18:43 +02:00
virtual QVector<QgsPoint> foci() const;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Two foci of the ellipse. The axes are oriented by the azimuth and are on the semi-major axis.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`fromFoci`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`focusDistance`
2017-12-15 10:36:55 -04:00
:return: the two foci.
2017-04-12 14:38:07 +02:00
%End
virtual double eccentricity() const;
%Docstring
2017-12-15 10:36:55 -04:00
The eccentricity of the ellipse.
nan is returned if the ellipse is empty.
2017-04-12 14:38:07 +02:00
%End
virtual double area() const;
%Docstring
The area of the ellipse.
%End
virtual double perimeter() const;
%Docstring
The circumference of the ellipse using first approximation of Ramanujan.
%End
2017-06-01 12:18:43 +02:00
virtual QVector<QgsPoint> quadrant() const;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The four quadrants of the ellipse.
They are oriented and started always from semi-major axis.
:return: quadrants defined by four points.
2017-04-12 14:38:07 +02:00
%End
2017-05-10 14:23:28 +02:00
virtual QgsPointSequence points( unsigned int segments = 36 ) const;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of points with segmentation from ``segments``.
2017-12-15 21:36:08 -04:00
:param segments: Number of segments used to segment geometry.
2017-04-12 14:38:07 +02:00
%End
2017-10-29 12:08:07 +01:00
virtual QgsPolygon *toPolygon( unsigned int segments = 36 ) const /Factory/;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a segmented polygon.
2017-12-15 21:36:08 -04:00
:param segments: Number of segments used to segment geometry.
2017-04-12 14:38:07 +02:00
%End
virtual QgsLineString *toLineString( unsigned int segments = 36 ) const /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a segmented linestring.
2017-12-15 21:36:08 -04:00
:param segments: Number of segments used to segment geometry.
2017-04-12 14:38:07 +02:00
%End
2017-10-29 12:08:07 +01:00
virtual QgsPolygon *orientedBoundingBox() const /Factory/;
2017-04-12 14:38:07 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the oriented minimal bounding box for the ellipse.
2017-04-12 14:38:07 +02:00
%End
virtual QgsRectangle boundingBox() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the minimal bounding box for the ellipse.
2017-04-12 14:38:07 +02:00
%End
virtual QString toString( int pointPrecision = 17, int axisPrecision = 17, int azimuthPrecision = 2 ) const;
%Docstring
2017-12-15 10:36:55 -04:00
returns a string representation of the ellipse.
Members will be truncated to the specified precision.
2017-04-12 14:38:07 +02:00
%End
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsellipse.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/