HerdSoftware
0.3.2
|
Class describing a line in the 3D space. More...
#include <dataobjects/Line.h>
Classes | |
class | Degenerate |
Exception class for invalid operations on a degenerate line. More... | |
Public Member Functions | |
Line () | |
Default Constructor. More... | |
Line (const Line &other)=default | |
Default copy constructor. More... | |
Line (Line &&other)=default | |
Default move constructor. More... | |
Line & | operator= (const Line &other)=default |
Default copy assignment. More... | |
Line & | operator= (Line &&other)=default |
Default move assignment. More... | |
Line (Point point, Vec3D direction) | |
Constructor. More... | |
Line (const Point &point, float polar, float azimuth) | |
Constructor. More... | |
Line (const Line2D &proj1, RefFrame::View view1, const Line2D &proj2, RefFrame::View view2) | |
Constructor. More... | |
virtual | ~Line ()=default |
Virtual destructor. More... | |
float | Polar () const |
Returns the polar angle of the line with respect to the NEGATIVE Z axis. More... | |
float | Azimuth () const |
Returns the azimuth angle of the line. More... | |
Point | Origin () const |
Returns the "point of origin" of the line. More... | |
Vec3D | Direction () const |
Returns direction of the line. More... | |
Point | Intersection (RefFrame::Axis axis, float coo) const |
Returns the line coordinate at given plane, defined by its normal axis and the coordinate along that axis. More... | |
Point | Intersection (const Line &line) const |
Returns the coordinate of the vertex between two lines: the intersection point if the lines are secant and the point at the midle of the minimal segment between the two lines if they are not secant. More... | |
Line | Projection (const Plane &plane) const |
Computes the projection of the line on a given plane. More... | |
Line | Projection (const Point p, RefFrame::View view) const |
Computes the projection of the line on a given view plane, passing for a given point. More... | |
Line2D | Projection2D (RefFrame::View view) const |
Computes the 2D projection of the line on a given view. More... | |
double | DistanceToPoint (const Point p) const |
Computes the distance of a point to the line. More... | |
double | MinimumDistanceToLine (const Line line) const |
Computes the minimum distance between two lines. More... | |
bool | operator== (const Line &rhs) const |
Comparison operators. More... | |
bool | operator!= (const Line &rhs) const |
Private Attributes | |
Point | _point |
Vec3D | _direction |
Class describing a line in the 3D space.
|
inline |
Default Constructor.
|
default |
Default copy constructor.
|
default |
Default move constructor.
Constructor.
Constructs a line starting from a point and a vector.
point | A point on the line [cm]. |
direction | the direction of the line. |
Herd::Line::Line | ( | const Point & | point, |
float | polar, | ||
float | azimuth | ||
) |
Constructor.
Constructs a line starting from a point and two angles.
point | A point on the line [cm]. |
polar | The polar angle of the line [rad]. |
azimuth | The azimuth angle of the line [rad]. |
Herd::Line::Line | ( | const Line2D & | proj1, |
RefFrame::View | view1, | ||
const Line2D & | proj2, | ||
RefFrame::View | view2 | ||
) |
Constructor.
Constructs a 3D line starting from two 2D projections.
proj1 | The first projection. |
view1 | The view of the first projection. |
proj2 | The second projection. |
view1 | The view of the second projection. |
|
virtualdefault |
Virtual destructor.
|
inline |
Returns the azimuth angle of the line.
If the line is parallel to the Z axis an exception is thrown
Line::Degenerate | if the line is parallel to the Z axis. |
|
inline |
Returns direction of the line.
double Herd::Line::DistanceToPoint | ( | const Point | p | ) | const |
Computes the distance of a point to the line.
p | point |
Point Herd::Line::Intersection | ( | RefFrame::Axis | axis, |
float | coo | ||
) | const |
Returns the line coordinate at given plane, defined by its normal axis and the coordinate along that axis.
axis | The normal axis of the plane. |
coo | The coordinate of the requested point along the normal axis to the plane. |
Degenerate | if the line is parallel to the given plane. |
Returns the coordinate of the vertex between two lines: the intersection point if the lines are secant and the point at the midle of the minimal segment between the two lines if they are not secant.
line | Line to compute the vertex point with |
Herd::Exception | if the two lines are parallel. |
double Herd::Line::MinimumDistanceToLine | ( | const Line | line | ) | const |
Computes the minimum distance between two lines.
line | Line |
|
inline |
|
inline |
Comparison operators.
rhs | The right-hand-side of the comparison operation. |
|
inline |
Returns the "point of origin" of the line.
This is arbitrarily chosen to lie on the line
|
inline |
Returns the polar angle of the line with respect to the NEGATIVE Z axis.
The angle is 0 for lines whose direction if towards the negative Z axis.
Computes the projection of the line on a given plane.
plane | The projection plane. |
Line Herd::Line::Projection | ( | const Point | p, |
RefFrame::View | view | ||
) | const |
Computes the projection of the line on a given view plane, passing for a given point.
p | The plane point. |
view | The plane orientation. |
Line2D Herd::Line::Projection2D | ( | RefFrame::View | view | ) | const |
Computes the 2D projection of the line on a given view.
view | The projection plane. |
|
private |
|
private |