QGIS API Documentation
2.8.2-Wien
|
A class to represent a point. More...
#include <qgspoint.h>
Public Member Functions | |
QgsPoint () | |
Default constructor. | |
QgsPoint (const QgsPoint &p) | |
QgsPoint (double x, double y) | |
QgsPoint (const QPointF &point) | |
QgsPoint (const QPoint &point) | |
~QgsPoint () | |
double | azimuth (const QgsPoint &other) |
Calculates azimuth between this point and other one (clockwise in degree, starting from north) | |
void | multiply (const double &scalar) |
Multiply x and y by the given value. | |
int | onSegment (const QgsPoint &a, const QgsPoint &b) const |
Test if this point is on the segment defined by points a, b. | |
bool | operator!= (const QgsPoint &other) const |
Inequality operator. | |
QgsPoint | operator+ (const QgsVector &v) const |
QgsPoint & | operator+= (const QgsVector &v) |
QgsVector | operator- (QgsPoint p) const |
QgsPoint | operator- (const QgsVector &v) const |
QgsPoint & | operator-= (const QgsVector &v) |
QgsPoint & | operator= (const QgsPoint &other) |
Assignment. | |
bool | operator== (const QgsPoint &other) |
equality operator | |
void | set (double x, double y) |
void | setX (double x) |
void | setY (double y) |
double | sqrDist (double x, double y) const |
Returns the squared distance between this point and x,y. | |
double | sqrDist (const QgsPoint &other) const |
Returns the squared distance between this and other point. | |
double | sqrDistToSegment (double x1, double y1, double x2, double y2, QgsPoint &minDistPoint, double epsilon=DEFAULT_SEGMENT_EPSILON) const |
Returns the minimum distance between this point and a segment. | |
QString | toDegreesMinutes (int thePrecision, const bool useSuffix=true, const bool padded=false) const |
Return a string representation as degrees minutes. | |
QString | toDegreesMinutesSeconds (int thePrecision, const bool useSuffix=true, const bool padded=false) const |
Return a string representation as degrees minutes seconds. | |
QPointF | toQPointF () const |
Converts a point to a QPointF. | |
QString | toString () const |
String representation of the point (x,y) | |
QString | toString (int thePrecision) const |
As above but with precision for string representation of a point. | |
QString | wellKnownText () const |
double | x () const |
double | y () const |
Friends | |
uint | qHash (const QgsPoint &pnt) |
A class to represent a point.
Currently no Z axis / 2.5D support is implemented.
Definition at line 63 of file qgspoint.h.
|
inline |
Default constructor.
Definition at line 67 of file qgspoint.h.
QgsPoint::QgsPoint | ( | const QgsPoint & | p | ) |
Create a point from another point
Definition at line 115 of file qgspoint.cpp.
|
inline |
Create a point from x,y coordinates
x | x coordinate |
y | y coordinate |
Definition at line 77 of file qgspoint.h.
|
inline |
Create a point from a QPointF
point | QPointF source |
Definition at line 85 of file qgspoint.h.
|
inline |
Create a point from a QPoint
point | QPoint source |
Definition at line 93 of file qgspoint.h.
|
inline |
Definition at line 97 of file qgspoint.h.
double QgsPoint::azimuth | ( | const QgsPoint & | other | ) |
Calculates azimuth between this point and other one (clockwise in degree, starting from north)
Definition at line 343 of file qgspoint.cpp.
void QgsPoint::multiply | ( | const double & | scalar | ) |
Multiply x and y by the given value.
Definition at line 378 of file qgspoint.cpp.
Test if this point is on the segment defined by points a, b.
Definition at line 384 of file qgspoint.cpp.
bool QgsPoint::operator!= | ( | const QgsPoint & | other | ) | const |
Inequality operator.
Definition at line 359 of file qgspoint.cpp.
Definition at line 213 of file qgspoint.h.
Definition at line 211 of file qgspoint.h.
Definition at line 210 of file qgspoint.h.
Definition at line 214 of file qgspoint.h.
Definition at line 212 of file qgspoint.h.
Assignment.
Definition at line 367 of file qgspoint.cpp.
bool QgsPoint::operator== | ( | const QgsPoint & | other | ) |
equality operator
Definition at line 351 of file qgspoint.cpp.
|
inline |
Sets the x and y value of the point
Definition at line 117 of file qgspoint.h.
|
inline |
|
inline |
double QgsPoint::sqrDist | ( | double | x, |
double | y | ||
) | const |
Returns the squared distance between this point and x,y.
Definition at line 333 of file qgspoint.cpp.
double QgsPoint::sqrDist | ( | const QgsPoint & | other | ) | const |
Returns the squared distance between this and other point.
Definition at line 338 of file qgspoint.cpp.
double QgsPoint::sqrDistToSegment | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
QgsPoint & | minDistPoint, | ||
double | epsilon = DEFAULT_SEGMENT_EPSILON |
||
) | const |
Returns the minimum distance between this point and a segment.
Definition at line 414 of file qgspoint.cpp.
QString QgsPoint::toDegreesMinutes | ( | int | thePrecision, |
const bool | useSuffix = true , |
||
const bool | padded = false |
||
) | const |
Return a string representation as degrees minutes.
Its up to the calling function to ensure that this point can be meaningfully represented in this form.
thePrecision | number of decimal points to use for minutes |
useSuffix | set to true to include a direction suffix (eg 'N'), set to false to use a "-" prefix for west and south coordinates |
padded | set to true to force minutes to use two decimals, eg, '05' instead of '5'. |
Definition at line 244 of file qgspoint.cpp.
QString QgsPoint::toDegreesMinutesSeconds | ( | int | thePrecision, |
const bool | useSuffix = true , |
||
const bool | padded = false |
||
) | const |
Return a string representation as degrees minutes seconds.
Its up to the calling function to ensure that this point can be meaningfully represented in this form.
thePrecision | number of decimal points to use for seconds |
useSuffix | set to true to include a direction suffix (eg 'N'), set to false to use a "-" prefix for west and south coordinates |
padded | set to true to force minutes and seconds to use two decimals, eg, '05' instead of '5'. |
Definition at line 142 of file qgspoint.cpp.
QPointF QgsPoint::toQPointF | ( | ) | const |
Converts a point to a QPointF.
Definition at line 121 of file qgspoint.cpp.
QString QgsPoint::toString | ( | ) | const |
String representation of the point (x,y)
Definition at line 126 of file qgspoint.cpp.
QString QgsPoint::toString | ( | int | thePrecision | ) | const |
As above but with precision for string representation of a point.
Definition at line 135 of file qgspoint.cpp.
QString QgsPoint::wellKnownText | ( | ) | const |
Return the well known text representation for the point. The wkt is created without an SRID.
Definition at line 328 of file qgspoint.cpp.
|
inline |
|
inline |
|
friend |
Definition at line 244 of file qgspoint.h.