QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
Represents a single 2D line segment, consisting of a 2D start and end vertex only. More...
#include <qgslinesegment.h>
Public Member Functions | |
QgsLineSegment2D (const QgsPointXY &start, const QgsPointXY &end) SIP_HOLDGIL | |
Constructor for a QgsLineSegment2D from the specified start point to the end point. More... | |
QgsLineSegment2D (double x1, double y1, double x2, double y2) SIP_HOLDGIL | |
Constructor for a QgsLineSegment2D from the point (x1, y2) to (x2, y2). More... | |
QgsPointXY | end () const SIP_HOLDGIL |
Returns the segment's end point. More... | |
double | endX () const SIP_HOLDGIL |
Returns the segment's end x-coordinate. More... | |
double | endY () const SIP_HOLDGIL |
Returns the segment's end y-coordinate. More... | |
double | length () const SIP_HOLDGIL |
Returns the length of the segment. More... | |
double | lengthSquared () const SIP_HOLDGIL |
Returns the squared length of the segment. More... | |
bool | operator!= (const QgsLineSegment2D &other) const SIP_HOLDGIL |
Inequality operator. More... | |
bool | operator== (const QgsLineSegment2D &other) const SIP_HOLDGIL |
Equality operator. More... | |
int | pointLeftOfLine (const QgsPointXY &point) const SIP_HOLDGIL |
Tests if a point is to the left of the line segment. More... | |
void | reverse () SIP_HOLDGIL |
Reverses the line segment, so that the start and end points are flipped. More... | |
void | setEnd (const QgsPointXY &end) SIP_HOLDGIL |
Sets the segment's end point. More... | |
void | setEndX (double x) SIP_HOLDGIL |
Sets the segment's end x coordinate. More... | |
void | setEndY (double y) SIP_HOLDGIL |
Sets the segment's end y coordinate. More... | |
void | setStart (const QgsPointXY &start) SIP_HOLDGIL |
Sets the segment's start point. More... | |
void | setStartX (double x) SIP_HOLDGIL |
Sets the segment's start x coordinate. More... | |
void | setStartY (double y) SIP_HOLDGIL |
Sets the segment's start y coordinate. More... | |
QgsPointXY | start () const SIP_HOLDGIL |
Returns the segment's start point. More... | |
double | startX () const SIP_HOLDGIL |
Returns the segment's start x-coordinate. More... | |
double | startY () const SIP_HOLDGIL |
Returns the segment's start y-coordinate. More... | |
Represents a single 2D line segment, consisting of a 2D start and end vertex only.
Definition at line 31 of file qgslinesegment.h.
|
inline |
Constructor for a QgsLineSegment2D from the specified start point to the end point.
Definition at line 40 of file qgslinesegment.h.
|
inline |
Constructor for a QgsLineSegment2D from the point (x1, y2) to (x2, y2).
Definition at line 49 of file qgslinesegment.h.
|
inline |
Returns the segment's end point.
Definition at line 129 of file qgslinesegment.h.
|
inline |
Returns the segment's end x-coordinate.
Definition at line 97 of file qgslinesegment.h.
|
inline |
Returns the segment's end y-coordinate.
Definition at line 107 of file qgslinesegment.h.
|
inline |
Returns the length of the segment.
Definition at line 58 of file qgslinesegment.h.
|
inline |
Returns the squared length of the segment.
Definition at line 67 of file qgslinesegment.h.
|
inline |
Inequality operator.
Definition at line 230 of file qgslinesegment.h.
|
inline |
Equality operator.
Definition at line 224 of file qgslinesegment.h.
int QgsLineSegment2D::pointLeftOfLine | ( | const QgsPointXY & | point | ) | const |
Tests if a point is to the left of the line segment.
Returns -1 if the point falls to the left of the line, or +1 if the point is to the right.
If the return value is 0, then the test was unsuccessful (e.g. due to testing a point exactly on the line, or exactly in line with the segment) and the result is undefined.
Definition at line 21 of file qgslinesegment.cpp.
|
inline |
Reverses the line segment, so that the start and end points are flipped.
Definition at line 216 of file qgslinesegment.h.
|
inline |
Sets the segment's end point.
Definition at line 195 of file qgslinesegment.h.
|
inline |
Sets the segment's end x coordinate.
Definition at line 162 of file qgslinesegment.h.
|
inline |
Sets the segment's end y coordinate.
Definition at line 173 of file qgslinesegment.h.
|
inline |
Sets the segment's start point.
Definition at line 184 of file qgslinesegment.h.
|
inline |
Sets the segment's start x coordinate.
Definition at line 140 of file qgslinesegment.h.
|
inline |
Sets the segment's start y coordinate.
Definition at line 151 of file qgslinesegment.h.
|
inline |
Returns the segment's start point.
Definition at line 118 of file qgslinesegment.h.
|
inline |
Returns the segment's start x-coordinate.
Definition at line 77 of file qgslinesegment.h.
|
inline |
Returns the segment's start y-coordinate.
Definition at line 87 of file qgslinesegment.h.