|
constexpr | MapCoordF () noexcept |
| Creates a MapCoordF with both values set to zero. More...
|
|
constexpr | MapCoordF (qreal x, qreal y) noexcept |
| Creates a MapCoordF with the given position in map coordinates. More...
|
|
constexpr | MapCoordF (const MapCoord &coord) noexcept |
| Creates a MapCoordF from a MapCoord, dropping its flags. More...
|
|
constexpr | MapCoordF (const MapCoordF &) noexcept=default |
| Copy constructor. More...
|
|
constexpr | MapCoordF (const QPointF &point) noexcept |
| Copy constructor for QPointF prototypes. More...
|
|
MapCoordF & | operator= (const QPointF &point) noexcept |
| Assignment operator. More...
|
|
qreal | length () const |
| Returns the length of the vector. More...
|
|
constexpr qreal | lengthSquared () const |
| Returns the square of the length of the vector. More...
|
|
qreal | distanceTo (const MapCoordF &to) const |
| Returns the distance of the coordinate to another coordinate. More...
|
|
constexpr qreal | distanceSquaredTo (const MapCoordF &to) const |
| Returns the square of the distance of this coordinate to another coordinate. More...
|
|
void | setLength (qreal new_length) |
| Changes the length of the vector. More...
|
|
void | normalize () |
| Normalizes the length of the vector. More...
|
|
qreal | angle () const |
| Returns the angle of the vector relative to the vector (1, 0). More...
|
|
void | rotate (qreal angle) |
| Rotates the vector. More...
|
|
const MapCoordF | rotated (qreal angle) const |
| Returns a vector which is the result of rotating this vector. More...
|
|
constexpr const MapCoordF | perpRight () const |
| Returns a vector with the same length that is perpendicular to this vector. More...
|
|
constexpr const MapCoordF | normalVector () const |
| Returns a vector with the same length that is perpendicular to this vector. More...
|
|
constexpr const MapCoordF | operator- () const |
| Additive inverse. More...
|
|
MapCoordF & | operator+= (const MapCoordF &rhs) |
| Component-wise addition. More...
|
|
MapCoordF & | operator-= (const MapCoordF &rhs) |
| Component-wise subtraction. More...
|
|
MapCoordF & | operator*= (qreal factor) |
| Multiply with a scalar. More...
|
|
MapCoordF & | operator/= (qreal divisor) |
| Divide by a scalar. More...
|
|
| QPointF () |
|
| QPointF (const QPoint &point) |
|
| QPointF (qreal xpos, qreal ypos) |
|
qreal | manhattanLength () const const |
|
bool | isNull () const const |
|
qreal | x () const const |
|
qreal | y () const const |
|
void | setX (qreal x) |
|
void | setY (qreal y) |
|
qreal & | rx () |
|
qreal & | ry () |
|
QPointF & | operator+= (const QPointF &point) |
|
QPointF & | operator-= (const QPointF &point) |
|
QPointF & | operator*= (qreal factor) |
|
QPointF & | operator/= (qreal divisor) |
|
QPoint | toPoint () const const |
|
CGPoint | toCGPoint () const const |
|
const QPointF | operator+ (const QPointF &p1, const QPointF &p2) |
|
const QPointF | operator- (const QPointF &p1, const QPointF &p2) |
|
const QPointF | operator* (const QPointF &point, qreal factor) |
|
const QPointF | operator* (qreal factor, const QPointF &point) |
|
const QPointF | operator+ (const QPointF &point) |
|
const QPointF | operator- (const QPointF &point) |
|
const QPointF | operator/ (const QPointF &point, qreal divisor) |
|
bool | operator== (const QPointF &p1, const QPointF &p2) |
|
bool | operator!= (const QPointF &p1, const QPointF &p2) |
|
QDataStream & | operator<< (QDataStream &stream, const QPointF &point) |
|
QDataStream & | operator>> (QDataStream &stream, QPointF &point) |
|
Map coordinates stored as floating point numbers.
The unit is millimeters on the map paper.
This type was initially meant as intermediate format for rendering but is currently used in a wide range of functions related to editing. In contrast to MapCoord, MapCoordF does not store flags.
The type is based on QPointF and provides additional methods for using it to represent 2D vectors. (Some of the methods do have counterparts in QLineF rather than QPointF.) Similar to QPointF, many operators return const values, although one might argue that it is no longer good practice in C++11.