#include <qgsline.h>
Collaboration diagram for QgsLine:

Comparisons (==, !=) honor the direction of the line. This means that flipped lines with the same coordinates are not considered to be equal.
For example, (1,1 2,2) != (2,2 1,1)
Definition at line 34 of file qgsline.h.
Public Member Functions | |
| QgsLine () | |
| Default constructor. | |
| QgsLine (QgsPoint &p1, QgsPoint &p2) | |
| ~QgsLine () | |
| Destructor. | |
| void | setBegin (QgsPoint &p1) |
| Sets the begin point of the line. | |
| void | setEnd (QgsPoint &p2) |
| Sets the end point of the line. | |
| QgsPoint | begin () const |
| Get the begin point of the line. | |
| QgsPoint | end () const |
| Get the end point of the line. | |
| QString | toString () const |
| String representation of the line. | |
| QString | toString (int thePrecision) const |
| As above but with precision for string representation of a line. | |
| QString | wellKnownText () |
| bool | operator== (const QgsLine &other) |
| Equality operator. | |
| bool | operator!= (const QgsLine &other) |
| Inequality operator. | |
| QgsLine & | operator= (const QgsLine &other) |
| Assignment. | |
Private Attributes | |
| QgsPoint | mBegin |
| Begin point. | |
| QgsPoint | mEnd |
| End point. | |
| QgsLine::QgsLine | ( | ) |
Create a line from two points
| p1 | begin point | |
| p2 | end point |
Definition at line 27 of file qgsline.cpp.
| QgsLine::~QgsLine | ( | ) |
| void QgsLine::setBegin | ( | QgsPoint & | p1 | ) |
Sets the begin point of the line.
Sets the begin point of the line
| p1 | Beginning point of the line |
Definition at line 38 of file qgsline.cpp.
References mBegin.
| void QgsLine::setEnd | ( | QgsPoint & | p2 | ) |
Sets the end point of the line.
Sets the end point of the line
| p1 | End point of the line |
Definition at line 43 of file qgsline.cpp.
References mEnd.
| QgsPoint QgsLine::begin | ( | ) | const |
Get the begin point of the line.
Get the begin point of the line
Definition at line 49 of file qgsline.cpp.
References mBegin.
Referenced by operator!=(), operator=(), and operator==().
| QgsPoint QgsLine::end | ( | ) | const |
Get the end point of the line.
Get the end point of the line
Definition at line 55 of file qgsline.cpp.
References mEnd.
Referenced by operator!=(), operator=(), and operator==().
| QString QgsLine::toString | ( | ) | const |
String representation of the line.
Definition at line 61 of file qgsline.cpp.
Referenced by operator<<().
| QString QgsLine::toString | ( | int | thePrecision | ) | const |
As above but with precision for string representation of a line.
Definition at line 67 of file qgsline.cpp.
| QString QgsLine::wellKnownText | ( | ) |
Return the well known text representation for the line. The wkt is created without an SRID.
Definition at line 76 of file qgsline.cpp.
| bool QgsLine::operator== | ( | const QgsLine & | other | ) |
Equality operator.
| bool QgsLine::operator!= | ( | const QgsLine & | other | ) |
QgsPoint QgsLine::mBegin [private] |
Begin point.
Definition at line 93 of file qgsline.h.
Referenced by begin(), operator!=(), operator=(), and setBegin().
QgsPoint QgsLine::mEnd [private] |
End point.
Definition at line 96 of file qgsline.h.
Referenced by end(), operator!=(), operator=(), and setEnd().
1.5.1