Struct rute::auto::point_f::PointF

source ·
pub struct PointF<'a> { /* private fields */ }
Expand description

Notice these docs are heavy WIP and not very relevent yet

A point is specified by a x coordinate and an y coordinate which can be accessed using the x() and y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX() and setY() functions, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation).

Given a point p, the following statements are all equivalent:

A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPointF object can also be divided or multiplied by an int or a qreal.

In addition, the QPointF class provides a constructor converting a QPoint object into a QPointF object, and a corresponding toPoint() function which returns a QPoint copy of this point. Finally, QPointF objects can be streamed as well as compared.

See also: QPoint QPolygonF

Licence

The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.

Implementations

Returns the sum of the absolute values of x() and y(), traditionally known as the of the vector from the origin to the point.

See also: QPoint::manhattanLength()

Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false.

Returns the x coordinate of this point.

See also: setX() rx()

Returns the y coordinate of this point.

See also: setY() ry()

Sets the x coordinate of this point to the given x coordinate.

See also: x() setY()

Sets the y coordinate of this point to the given y coordinate.

See also: y() setX()

Returns a reference to the x coordinate of this point.

Using a reference makes it possible to directly manipulate x. For example:

See also: x() setX()

Returns a reference to the y coordinate of this point.

Using a reference makes it possible to directly manipulate y. For example:

See also: y() setY()

Returns the dot product of p1 and p2.

Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.

See also: QPointF()

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.