1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsellipse.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsEllipse
{
%Docstring(signature="appended")
Ellipse geometry type.
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.
%End
%TypeHeaderCode
#include "qgsellipse.h"
%End
public:
QgsEllipse() /HoldGIL/;
%Docstring
Constructor for QgsEllipse.
%End
virtual ~QgsEllipse();
QgsEllipse( const QgsPoint ¢er, double semiMajorAxis, double semiMinorAxis, double azimuth = 90 ) /HoldGIL/;
%Docstring
Constructs an ellipse by defining all the members.
: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.
%End
static QgsEllipse fromFoci( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3 ) /HoldGIL/;
%Docstring
Constructs an ellipse by foci (``pt1`` and ``pt2``) and a point ``pt3``.
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``. Axes
are calculated from the 2D distance with the third point ``pt3``. The
azimuth is the angle between ``pt1`` and ``pt2``.
:param pt1: First focus.
:param pt2: Second focus.
:param pt3: A point to calculate the axes.
%End
static QgsEllipse fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 ) /HoldGIL/;
%Docstring
Constructs an ellipse by an extent (aka bounding box /
:py:class:`QgsRectangle`). 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``. Axes are calculated from the 2D distance
between ``pt1`` and ``pt2``. The azimuth always takes the default value.
:param pt1: First corner.
:param pt2: Second corner.
%End
static QgsEllipse fromCenterPoint( const QgsPoint &ptc, const QgsPoint &pt1 ) /HoldGIL/;
%Docstring
Constructs an ellipse by a center point and a another point. 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``. Axes are
calculated from the 2D distance between ``ptc`` and ``pt1``. The azimuth
always takes the default value.
:param ptc: Center point.
:param pt1: First point.
%End
static QgsEllipse fromCenter2Points( const QgsPoint &ptc, const QgsPoint &pt1, const QgsPoint &pt2 ) /HoldGIL/;
%Docstring
Constructs an ellipse by a central point and two other points. 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``. Axes are calculated from the 2D distance between ``ptc`` and
``pt1`` and ``pt2``. The azimuth is the angle between ``ptc`` and
``pt1``.
:param ptc: Center point.
:param pt1: First point.
:param pt2: Second point.
%End
virtual bool operator ==( const QgsEllipse &elp ) const;
virtual bool operator !=( const QgsEllipse &elp ) const;
virtual bool isEmpty() const /HoldGIL/;
%Docstring
An ellipse is empty if axes are equal to 0
%End
QgsPoint center() const /HoldGIL/;
%Docstring
Returns the center point.
.. seealso:: :py:func:`setCenter`
.. seealso:: :py:func:`rcenter`
%End
double semiMajorAxis() const /HoldGIL/;
%Docstring
Returns the semi-major axis.
.. seealso:: :py:func:`setSemiMajorAxis`
%End
double semiMinorAxis() const /HoldGIL/;
%Docstring
Returns the semi-minor axis.
.. seealso:: :py:func:`setSemiMinorAxis`
%End
double azimuth() const /HoldGIL/;
%Docstring
Returns the azimuth.
.. seealso:: :py:func:`setAzimuth`
%End
void setCenter( const QgsPoint ¢er ) /HoldGIL/;
%Docstring
Sets the center point.
.. seealso:: :py:func:`center`
.. seealso:: :py:func:`rcenter`
%End
virtual void setSemiMajorAxis( double semiMajorAxis ) /HoldGIL/;
%Docstring
Sets the semi-major axis.
.. seealso:: :py:func:`semiMajorAxis`
%End
virtual void setSemiMinorAxis( double semiMinorAxis ) /HoldGIL/;
%Docstring
Sets the semi-minor axis.
.. seealso:: :py:func:`semiMinorAxis`
%End
void setAzimuth( double azimuth ) /HoldGIL/;
%Docstring
Sets the azimuth (orientation).
.. seealso:: :py:func:`azimuth`
%End
virtual double focusDistance() const /HoldGIL/;
%Docstring
The distance between the center and each foci.
.. seealso:: :py:func:`fromFoci`
.. seealso:: :py:func:`foci`
:return: The distance between the center and each foci.
%End
virtual QVector<QgsPoint> foci() const;
%Docstring
Two foci of the ellipse. The axes are oriented by the azimuth and are on
the semi-major axis.
.. seealso:: :py:func:`fromFoci`
.. seealso:: :py:func:`focusDistance`
:return: the two foci.
%End
virtual double eccentricity() const /HoldGIL/;
%Docstring
The eccentricity of the ellipse. nan is returned if the ellipse is
empty.
%End
virtual double area() const /HoldGIL/;
%Docstring
The area of the ellipse.
%End
virtual double perimeter() const /HoldGIL/;
%Docstring
The circumference of the ellipse using first approximation of Ramanujan.
%End
virtual QVector<QgsPoint> quadrant() const;
%Docstring
The four quadrants of the ellipse. They are oriented and started always
from semi-major axis.
:return: quadrants defined by four points.
%End
virtual QgsPointSequence points( unsigned int segments = 36 ) const;
%Docstring
Returns a list of points with segmentation from ``segments``.
:param segments: Number of segments used to segment geometry.
%End
virtual QgsPolygon *toPolygon( unsigned int segments = 36 ) const /Factory/;
%Docstring
Returns a segmented polygon.
:param segments: Number of segments used to segment geometry.
%End
virtual QgsLineString *toLineString( unsigned int segments = 36 ) const /Factory/;
%Docstring
Returns a segmented linestring.
:param segments: Number of segments used to segment geometry.
%End
virtual QgsPolygon *orientedBoundingBox() const /Factory/;
%Docstring
Returns the oriented minimal bounding box for the ellipse.
%End
virtual QgsRectangle boundingBox() const;
%Docstring
Returns the minimal bounding box for the ellipse.
%End
virtual QString toString( int pointPrecision = 17, int axisPrecision = 17, int azimuthPrecision = 2 ) const;
%Docstring
returns a string representation of the ellipse. Members will be
truncated to the specified precision.
%End
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsEllipse: %1>" ).arg( sipCpp->toString() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsellipse.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|