|
ActiveLib
|
Class to represent a line. More...
#include <Line.h>

Public Types | |
| using | Unique = std::unique_ptr<Line> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Line> |
| Shared pointer. | |
| using | Option = std::optional<Line> |
| Optional. | |
Public Member Functions | |
| Line (const Point &origin, const Point &end) | |
| Line (const Point &origin, double rad, double azim) | |
| bool | operator== (const Line &ref) const |
| bool | operator!= (const Line &ref) const |
| Line | operator+ (const Point &offset) const |
| Line & | operator+= (const Point &offset) |
| Line | operator- (const Point &offset) const |
| Line & | operator-= (const Point &offset) |
| Line | operator* (double scale) const |
| Line & | operator*= (double scale) |
| Line | operator* (const Matrix3x3 &matrix) const |
| Line & | operator*= (const Matrix3x3 &matrix) |
| bool | isEqual2D (const Line &ref, double prec=math::eps) const |
| bool | isEqual3D (const Line &ref, double prec=math::eps) const |
| double | length2D () const |
| double | length3D () const |
| double | azimuthAngle () const |
| double | altitudeAngle () const |
| double | angleTo (const Line &ref) const |
| Point | midpoint () const |
| double | heightAt (const Point &ref) const |
| bool | isColinearTo2D (const Line &ref, double prec=math::eps) const |
| bool | isColinearTo3D (const Line &ref, double prec=math::eps) const |
| bool | isParallelTo2D (const Line &ref, double prec=math::eps) const |
| bool | isParallelTo3D (const Line &ref, double prec=math::eps) const |
| Point | closestPointTo2D (const Point &ref, double prec=math::eps) const |
| Point | closestPointTo3D (const Point &ref, double prec=math::eps) const |
| Point | closestPointAlong2D (const Point &ref, double prec=math::eps) const |
| Point | closestPointAlong3D (const Point &ref, double prec=math::eps) const |
| XPoint::Option | intersectionWith2D (const Line &ref, double prec=math::eps) const |
| vertex_index | intersectionWith2D (const Line &ref, XList &inter, double prec=math::eps) const |
| vertex_index | intersectionWith3D (const Line &ref, XList &inter, double prec=math::eps) const |
| Position | positionOf2D (const Point &ref, double prec=math::eps) const |
| Position | positionOf3D (const Point &ref, double prec=math::eps) const |
| bool | encloses2D (const Point &ref, double prec) const |
| bool | encloses3D (const Point &ref, double prec) const |
| double | angleTo2D (const Line &ref) const |
| void | extend (double len) |
| void | movePolar (double len, double azim, double alt) |
| void | movePolar (double len, double angle) |
| void | flip () |
Public Attributes | |
| Point | origin |
| The line origin. | |
| Point | end |
| The line end. | |
Class to represent a line.
Constructor
| origin | Origin point of the line |
| end | End point of the line |

|
inline |
Constructor
| origin | Origin point of the line |
| rad | The radial offset to the end of the line |
| azim | The azimuth angle of the line |

| double Line::altitudeAngle | ( | ) | const |
Get the altitude angle of the line


| double Line::angleTo | ( | const Line & | ref | ) | const |
Get the angle between two lines
| ref | The reference line |


| double Line::angleTo2D | ( | const Line & | ref | ) | const |
Get the angle between two lines
| ref | The reference line |

| double Line::azimuthAngle | ( | ) | const |
Get the azimuth angle of the line


Get the closest point along the line to a given point in 2D
| ref | The reference point |


Get the closest point along the line to a given point
| ref | The reference point |


Get the closest point in the line to a given point in 2D
| ref | The reference point |


Get the closest point in the line to a given point
| ref | The reference point |


| bool Line::encloses2D | ( | const Point & | ref, |
| double | prec ) const |
Determine if a point is enclosed by a line in 2D
| ref | The reference point |

| bool Line::encloses3D | ( | const Point & | ref, |
| double | prec ) const |
Determine if a point is enclosed by a line
| ref | The reference point |

| void Line::extend | ( | double | len | ) |
Extend the line length by the specified amount
| len | The amount to extend the line by |

| void Line::flip | ( | ) |
Flip the line
| double Line::heightAt | ( | const Point & | ref | ) | const |
Get the height of the line at a specified point
| ref | The point at which to calculate the height |

| XPoint::Option Line::intersectionWith2D | ( | const Line & | ref, |
| double | prec = math::eps ) const |
Get the intersection point of two lines in 2D (NB: either along or projected beyond the line extents)
| ref | The reference line |
| prec | The required precision |


| vertex_index Line::intersectionWith2D | ( | const Line & | ref, |
| XList & | inter, | ||
| double | prec = math::eps ) const |
Get the intersection point of two lines in 2D
| ref | The reference line |
| inter | The intersection list to populate |
| prec | The required precision |

| vertex_index Line::intersectionWith3D | ( | const Line & | ref, |
| XList & | inter, | ||
| double | prec = math::eps ) const |
Get the intersection point of two lines in 3D ref: The reference line inter: The intersection list to populate prec: The required precision return: The number of intersections calculated


Check if two lines are colinear
| ref | The reference line |

Check if two lines are colinear
| ref | The reference line |

Determine if two lines are equal in 2D
| ref | The line to compare with this |
| prec | The required precision |

Determine if two lines are equal
| ref | The line to compare with this |
| prec | The required precision |


Check if two lines are parallel
| ref | The reference line |


Check if two lines are parallel
| ref | The reference line |


| double Line::length2D | ( | ) | const |
Get the length of the line in 2D


| double Line::length3D | ( | ) | const |
Get the length of the line

| Point Line::midpoint | ( | ) | const |
Get the midpoint of the line

| void Line::movePolar | ( | double | len, |
| double | angle ) |
Move the line by the specified distance and angle
| len | The distance to move the line |
| angle | The angle to move the line along |

| void Line::movePolar | ( | double | len, |
| double | azim, | ||
| double | alt ) |
Move the line by the specified distance and azimuth/altitude angles
| len | The distance to move the line |
| azim | The azimuth angle to move the line along |
| alt | The altitude angle to move the line along |

|
inline |
Inequality operator
| ref | The line to compare with this |

Multiplication operator
| matrix | The matrix to multiply the line by |

| Line Line::operator* | ( | double | scale | ) | const |
Multiplication operator
| scale | The amount to multiply the line by |

Multiplication with assignment operator
| matrix | The matrix to multiply the line by |
| Line & Line::operator*= | ( | double | scale | ) |
Multiplication with assignment operator
| scale | The amount to multiply the line by |
Addition operator
| offset | The amount to add to the line |

Addition with assignment operator
| offset | The amount to add to the line |
Subtraction operator
| offset | The amount to subtract from the line |

Subtraction with assignment operator
| offset | The amount to subtract from the line |
|
inline |
Equality operator
| ref | The line to compare with this |

Determine the relationship of a point to the line in 2D
| ref | The point to test |
| prec | The required precision |


Determine the relationship of a point to the line in 3D
| ref | The point to test |
| prec | The required precision |

