uicore::Line2x< Type > Class Template Reference

2D line More...

#include <line.h>

Public Member Functions

 Line2x ()
 
 Line2x (const Line2x< Type > &copy)
 
 Line2x (const Vec2< Type > &point_p, const Vec2< Type > &point_q)
 
 Line2x (const Vec2< Type > &point_p, Type gradient)
 
Vec2< Type > intersection (const Line2x< Type > &second, bool &intersect) const
 Return the intersection of this and other line. More...
 
bool operator!= (const Line2x< Type > &line) const
 != operator. More...
 
Line2x< Type > & operator= (const Line2x< Type > &copy)
 = operator. More...
 
bool operator== (const Line2x< Type > &line) const
 == operator. More...
 
Type point_right_of_line (Vec2< Type > point) const
 Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B. More...
 

Public Attributes

Vec2< Type > p
 First point on the line. More...
 
Vec2< Type > q
 

Detailed Description

template<typename Type>
class uicore::Line2x< Type >

2D line

These line templates are defined for: int (Line2i), float (Line2f), double (Line2d)

Constructor & Destructor Documentation

template<typename Type>
uicore::Line2x< Type >::Line2x ( )
inline
template<typename Type>
uicore::Line2x< Type >::Line2x ( const Line2x< Type > &  copy)
inline
template<typename Type>
uicore::Line2x< Type >::Line2x ( const Vec2< Type > &  point_p,
const Vec2< Type > &  point_q 
)
inline
template<typename Type>
uicore::Line2x< Type >::Line2x ( const Vec2< Type > &  point_p,
Type  gradient 
)
inline

Member Function Documentation

template<typename Type>
Vec2<Type> uicore::Line2x< Type >::intersection ( const Line2x< Type > &  second,
bool &  intersect 
) const

Return the intersection of this and other line.

Parameters
second= The second line to use
intersect= On Return: true if the lines intersect, false if the lines are parallel
Returns
The point
template<typename Type>
bool uicore::Line2x< Type >::operator!= ( const Line2x< Type > &  line) const
inline

!= operator.

template<typename Type>
Line2x<Type>& uicore::Line2x< Type >::operator= ( const Line2x< Type > &  copy)
inline

= operator.

template<typename Type>
bool uicore::Line2x< Type >::operator== ( const Line2x< Type > &  line) const
inline

== operator.

template<typename Type>
Type uicore::Line2x< Type >::point_right_of_line ( Vec2< Type >  point) const
inline

Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.

Parameters
point= The point
Returns
Value representing - left (>0), centre (=0), or right (<0)

Member Data Documentation

template<typename Type>
Vec2<Type> uicore::Line2x< Type >::p

First point on the line.

template<typename Type>
Vec2<Type> uicore::Line2x< Type >::q

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