Struct rute::auto::line::Line

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

Notice these docs are heavy WIP and not very relevent yet

A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.

  • qline-point.png

  • qline-coordinates.png

The positions of the line’s start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.

Finally, the line can be translated a given offset using the translate() function.

See also: LineF Polygon Rect

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 true if the line is not set up with valid start and end point; otherwise returns false.

Returns the line’s start point.

See also: [x1()] [y1()] [p2()]

Returns the line’s end point.

See also: [x2()] [y2()] [p1()]

Returns the x-coordinate of the line’s start point.

See also: [p1()]

Returns the y-coordinate of the line’s start point.

See also: [p1()]

Returns the x-coordinate of the line’s end point.

See also: [p2()]

Returns the y-coordinate of the line’s end point.

See also: [p2()]

Returns the horizontal component of the line’s vector.

See also: [dy()]

Returns the vertical component of the line’s vector.

See also: [dx()]

Returns the center point of this line. This is equivalent to (p1() + p2()) / 2, except it will never overflow.

Sets the starting point of this line to p1.

See also: [set_p2()] [p1()]

Sets the end point of this line to p2.

See also: [set_p1()] [p2()]

Sets the start point of this line to p1 and the end point of this line to p2.

See also: [set_p1()] [set_p2()] [p1()] [p2()]

Sets this line to the start in x1, y1 and end in x2, y2.

See also: [set_p1()] [set_p2()] [p1()] [p2()]

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.