Public Member Functions | Private Attributes | Related Functions | List of all members
vgl_line_3d_2_points< Type > Class Template Reference

A class to hold a non-homogeneous representation of a 3D line. More...

#include <vgl_fwd.h>

Public Member Functions

 vgl_line_3d_2_points (void)
 Default constructor with (0,0,0) and (1,0,0), which is the line y=z=0. More...
 
 vgl_line_3d_2_points (const vgl_line_3d_2_points< Type > &that)
 Copy constructor. More...
 
 vgl_line_3d_2_points (vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2)
 Construct from two points. More...
 
bool operator== (vgl_line_3d_2_points< Type > const &l) const
 comparison. More...
 
bool operator!= (vgl_line_3d_2_points< Type > const &l) const
 
vgl_point_3d< Type > point1 () const
 Return the first point representing this line. More...
 
vgl_point_3d< Type > point2 () const
 Return the second point representing this line. More...
 
void set (vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2)
 Assignment. More...
 
bool ideal (Type=(Type) 0) const
 Return true iff line is at infinity (which is always false). More...
 
vgl_vector_3d< Type > direction () const
 Return the direction vector of this line (not normalised - but perhaps it should be, like other line classes?). More...
 
vgl_point_3d< Type > point_t (const double t) const
 Return a point on the line defined by a scalar parameter t such that t=0.0 at point1 and t=1.0 at point2. More...
 

Private Attributes

vgl_point_3d< Type > point1_
 Any point on the line. More...
 
vgl_point_3d< Type > point2_
 Any other point on the line. More...
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points (const vgl_line_3d_2_points< T > &l1, const vgl_line_3d_2_points< T > &l2, bool *unique=nullptr)
 Return the points of closest approach on 2 3D lines. More...
 
template<class T >
std::pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points (const vgl_infinite_line_3d< T > &l1, const vgl_infinite_line_3d< T > &l2, bool *unique=nullptr)
 Return the points of closest approach on two infinite 3D lines. More...
 
template<class T >
double vgl_distance_origin (vgl_line_3d_2_points< T > const &l)
 find the shortest distance of the line to the origin. More...
 
template<class T >
double vgl_distance (vgl_line_3d_2_points< T > const &l, vgl_point_3d< T > const &p)
 Return the perpendicular distance from a point to a line in 3D. More...
 
template<class T >
vgl_point_3d< T > vgl_intersection (vgl_line_3d_2_points< T > const &l1, vgl_line_3d_2_points< T > const &l2)
 Return the intersection point of two concurrent lines. More...
 
template<class T >
bool vgl_intersection (vgl_line_3d_2_points< T > const &l1, vgl_line_segment_3d< T > const &l2, vgl_point_3d< T > &i_pnt)
 Return the intersection point of segments of a concurrent line and line segment pair. Returns false if the intersection point is not inside both line segments. More...
 
template<class Type >
bool is_ideal (l const &, Type=(Type) 0)
 Return true iff line is at infinity (which is always false). More...
 
template<class Type >
bool coplanar (l const &l1, l const &l2)
 Are two lines coplanar, i.e., do they either intersect or are parallel?. More...
 
template<class Type >
bool concurrent (l const &l1, l const &l2)
 Are two lines concurrent, i.e., do they intersect in a finite point?. More...
 
template<class Type >
bool coplanar (l const &l1, l const &l2, l const &l3)
 Are three lines coplanar, i.e., are they in a common plane?. More...
 
template<class Type >
bool concurrent (l const &l1, l const &l2, l const &l3)
 Are three lines concurrent, i.e., do they pass through a common point?. More...
 
template<class Type >
std::ostream & operator<< (std::ostream &s, l const &)
 Write to stream (verbose). More...
 
template<class Type >
std::istream & operator>> (std::istream &is, l &)
 Read parameters from stream. More...
 

Detailed Description

template<class Type>
class vgl_line_3d_2_points< Type >

A class to hold a non-homogeneous representation of a 3D line.

The line is stored as a pair of non-homogeneous 3D points.

Definition at line 17 of file vgl_fwd.h.

Constructor & Destructor Documentation

◆ vgl_line_3d_2_points() [1/3]

template<class Type>
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points ( void  )
inline

Default constructor with (0,0,0) and (1,0,0), which is the line y=z=0.

Definition at line 41 of file vgl_line_3d_2_points.h.

◆ vgl_line_3d_2_points() [2/3]

template<class Type>
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points ( const vgl_line_3d_2_points< Type > &  that)
inline

Copy constructor.

Definition at line 45 of file vgl_line_3d_2_points.h.

◆ vgl_line_3d_2_points() [3/3]

template<class Type>
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points ( vgl_point_3d< Type > const &  p1,
vgl_point_3d< Type > const &  p2 
)
inline

Construct from two points.

Definition at line 49 of file vgl_line_3d_2_points.h.

Member Function Documentation

◆ direction()

template<class Type>
vgl_vector_3d<Type> vgl_line_3d_2_points< Type >::direction ( ) const
inline

Return the direction vector of this line (not normalised - but perhaps it should be, like other line classes?).

Definition at line 74 of file vgl_line_3d_2_points.h.

◆ ideal()

template<class Type>
bool vgl_line_3d_2_points< Type >::ideal ( Type  = (Type)0) const
inline

Return true iff line is at infinity (which is always false).

Definition at line 71 of file vgl_line_3d_2_points.h.

◆ operator!=()

template<class Type>
bool vgl_line_3d_2_points< Type >::operator!= ( vgl_line_3d_2_points< Type > const &  l) const
inline

Definition at line 55 of file vgl_line_3d_2_points.h.

◆ operator==()

template<class Type >
bool vgl_line_3d_2_points< Type >::operator== ( vgl_line_3d_2_points< Type > const &  l) const

comparison.

Definition at line 22 of file vgl_line_3d_2_points.hxx.

◆ point1()

template<class Type>
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point1 ( ) const
inline

Return the first point representing this line.

Definition at line 60 of file vgl_line_3d_2_points.h.

◆ point2()

template<class Type>
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point2 ( ) const
inline

Return the second point representing this line.

Definition at line 62 of file vgl_line_3d_2_points.h.

◆ point_t()

template<class Type>
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point_t ( const double  t) const
inline

Return a point on the line defined by a scalar parameter t such that t=0.0 at point1 and t=1.0 at point2.

Note
Assumes that direction() is not normalized.

Definition at line 78 of file vgl_line_3d_2_points.h.

◆ set()

template<class Type>
void vgl_line_3d_2_points< Type >::set ( vgl_point_3d< Type > const &  p1,
vgl_point_3d< Type > const &  p2 
)
inline

Assignment.

Definition at line 65 of file vgl_line_3d_2_points.h.

Friends And Related Function Documentation

◆ concurrent() [1/2]

template<class Type >
bool concurrent ( l const &  l1,
l const &  l2 
)
related

Are two lines concurrent, i.e., do they intersect in a finite point?.

Definition at line 106 of file vgl_line_3d_2_points.h.

◆ concurrent() [2/2]

template<class Type >
bool concurrent ( l const &  l1,
l const &  l2,
l const &  l3 
)
related

Are three lines concurrent, i.e., do they pass through a common point?.

Definition at line 150 of file vgl_line_3d_2_points.h.

◆ coplanar() [1/2]

template<class Type >
bool coplanar ( l const &  l1,
l const &  l2 
)
related

Are two lines coplanar, i.e., do they either intersect or are parallel?.

Definition at line 100 of file vgl_line_3d_2_points.h.

◆ coplanar() [2/2]

template<class Type >
bool coplanar ( l const &  l1,
l const &  l2,
l const &  l3 
)
related

Are three lines coplanar, i.e., are they in a common plane?.

Definition at line 121 of file vgl_line_3d_2_points.h.

◆ is_ideal()

template<class Type >
bool is_ideal ( l const &  ,
Type  = (Type)0 
)
related

Return true iff line is at infinity (which is always false).

Definition at line 86 of file vgl_line_3d_2_points.h.

◆ operator<<()

template<class Type >
std::ostream & operator<< ( std::ostream &  s,
l const &   
)
related

Write to stream (verbose).

◆ operator>>()

template<class Type >
std::istream & operator>> ( std::istream &  is,
l  
)
related

Read parameters from stream.

◆ vgl_closest_points() [1/2]

template<class T >
std::pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points ( const vgl_line_3d_2_points< T > &  l1,
const vgl_line_3d_2_points< T > &  l2,
bool *  unique = nullptr 
)
related

Return the points of closest approach on 2 3D lines.

Uses non-homogeneous representations.

Returns
The pair of closest points, the first on l1, the second on l2.
Return values
uniqueIf provided, will be set to true if the returned points are unique, otherwise many solutions exist and the returned points are an arbitrary choice. The distance between the points is still valid, however.

◆ vgl_closest_points() [2/2]

template<class T >
std::pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points ( const vgl_infinite_line_3d< T > &  l1,
const vgl_infinite_line_3d< T > &  l2,
bool *  unique = nullptr 
)
related

Return the points of closest approach on two infinite 3D lines.

Uses non-homogeneous representations.

Returns
The pair of closest points, the first on l1, the second on l2.
Return values
uniqueIf provided, will be set to true if the returned points are unique, otherwise many solutions exist and the returned points are an arbitrary choice. The distance between the points is still valid, however.

Definition at line 283 of file vgl_closest_point.h.

◆ vgl_distance()

template<class T >
double vgl_distance ( vgl_line_3d_2_points< T > const &  l,
vgl_point_3d< T > const &  p 
)
related

Return the perpendicular distance from a point to a line in 3D.

See vgl_closest_point.h for more information.

◆ vgl_distance_origin()

template<class T >
double vgl_distance_origin ( vgl_line_3d_2_points< T > const &  l)
related

find the shortest distance of the line to the origin.

◆ vgl_intersection() [1/2]

template<class T >
vgl_point_3d< T > vgl_intersection ( vgl_line_3d_2_points< T > const &  l1,
vgl_line_3d_2_points< T > const &  l2 
)
related

Return the intersection point of two concurrent lines.

Allows intersection points outside the line segments Throws an assertion if lines not concurrent

◆ vgl_intersection() [2/2]

template<class T >
bool vgl_intersection ( vgl_line_3d_2_points< T > const &  l1,
vgl_line_segment_3d< T > const &  l2,
vgl_point_3d< T > &  i_pnt 
)
related

Return the intersection point of segments of a concurrent line and line segment pair. Returns false if the intersection point is not inside both line segments.

Return the intersection point of segments of two concurrent lines.

Definition at line 549 of file vgl_intersection.hxx.

Member Data Documentation

◆ point1_

template<class Type>
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point1_
private

Any point on the line.

Definition at line 31 of file vgl_line_3d_2_points.h.

◆ point2_

template<class Type>
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point2_
private

Any other point on the line.

Definition at line 33 of file vgl_line_3d_2_points.h.


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