HerdSoftware  0.1.1
Classes | Public Member Functions | Private Attributes | List of all members
Herd::Line Class Reference

Class describing a line in the 3D space. More...

#include <dataobjects/Line.h>

Classes

class  ParallelToZ
 Exception class for invalid operations on a line parallel to the Z axis. More...
 

Public Member Functions

 Line ()
 Default Constructor. More...
 
 Line (const Point &point, const float polar, const float azimuth)
 Constructor. More...
 
 Line (const Point &point, const Vec3D &direction)
 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...
 

Private Attributes

Point _point
 
float _polar
 
float _azimuth
 

Detailed Description

Class describing a line in the 3D space.

Constructor & Destructor Documentation

◆ Line() [1/4]

Herd::Line::Line ( )
inline

Default Constructor.

◆ Line() [2/4]

Herd::Line::Line ( const Point point,
const float  polar,
const float  azimuth 
)

Constructor.

Constructs a line starting from a point and two angles.

Parameters
pointA point on the line [cm].
polarThe polar angle of the line [rad].
azimuthThe azimuth angle of the line [rad].

◆ Line() [3/4]

Herd::Line::Line ( const Point point,
const Vec3D direction 
)

Constructor.

Constructs a line starting from a point and a vector.

Parameters
pointA point on the line [cm].
directionthe direction of the line.

◆ Line() [4/4]

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.

Parameters
proj1The first projection.
view1The view of the first projection.
proj2The second projection.
view1The view of the second projection.

◆ ~Line()

virtual Herd::Line::~Line ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ Azimuth()

float Herd::Line::Azimuth ( ) const

Returns the azimuth angle of the line.

If the line is parallel to the Z axis an exception is thrown

Returns
the azimuth angle (rad) in the range [0,2pi].
Exceptions
Line::ParallelToZif the line is parallel to the Z axis.

◆ Direction()

Vec3D Herd::Line::Direction ( ) const

Returns direction of the line.

Returns
the direction vector.

◆ DistanceToPoint()

double Herd::Line::DistanceToPoint ( const Point  p) const

Computes the distance of a point to the line.

Parameters
ppoint
Returns
the distance of the point from the line

◆ Intersection() [1/2]

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.

Parameters
axisThe normal axis of the plane.
cooThe coordinate of the requested point along the normal axis to the plane.
Returns
The coordinate of the line at intersection point.
Exceptions
Herd::Exceptionif the line is parallel to the given plane.

◆ Intersection() [2/2]

Point Herd::Line::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.

Parameters
lineLine to compute the vertex point with
Returns
The coordinate of vertex point with the previous line.
Exceptions
Herd::Exceptionif the two lines are parallel.

◆ MinimumDistanceToLine()

double Herd::Line::MinimumDistanceToLine ( const Line  line) const

Computes the minimum distance between two lines.

Parameters
lineLine
Returns
the minimum distance between the two lines

◆ Origin()

Point Herd::Line::Origin ( ) const
inline

Returns the "point of origin" of the line.

This is arbitrarily chosen to lie on the line

Returns
the "origin point" (cm, cm).

◆ Polar()

float Herd::Line::Polar ( ) const
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.

Returns
the polar angle (rad) in the range [0,pi].

◆ Projection() [1/2]

Line Herd::Line::Projection ( const Plane plane) const

Computes the projection of the line on a given plane.

Parameters
planeThe projection plane.
Returns
a The projected line.

◆ Projection() [2/2]

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.

Parameters
pThe plane point.
viewThe plane orientation.
Returns
a The projected line.

◆ Projection2D()

Line2D Herd::Line::Projection2D ( RefFrame::View  view) const

Computes the 2D projection of the line on a given view.

Parameters
viewThe projection plane.
Returns
a The projected line.

Member Data Documentation

◆ _azimuth

float Herd::Line::_azimuth
private

◆ _point

Point Herd::Line::_point
private

◆ _polar

float Herd::Line::_polar
private

The documentation for this class was generated from the following files: