Public Member Functions | Private Member Functions | Private Attributes | Related Functions
vgl_1d_basis< T > Class Template Reference

Storage for 3 collinear points to serve as 1-D projective basis. More...

#include <vgl_1d_basis.h>

List of all members.

Public Member Functions

origin () const
unity () const
inf_pt () const
bool affine () const
bool projective () const
 vgl_1d_basis (T const &o, T const &u, T const &i)
 Construct from three collinear points (projective basis).
 vgl_1d_basis (T const &o, T const &u)
 Construct from two points (affine basis).
vgl_homg_point_1d< double > project (T const &p)
 Projection from a point in the source space to a 1-D homogeneous point.

Private Member Functions

 vgl_1d_basis ()

Private Attributes

origin_
 The point to be mapped to homogeneous (0,1)
unity_
 The point to be mapped to homogeneous (1,1)
inf_pt_
 The point to be mapped to homogeneous (1,0)
bool affine_
 normally false; if true, inf_pt_ is not used: affine basis

Related Functions

(Note that these are not member functions.)

template<class T >
vcl_ostream & operator<< (vcl_ostream &s, vgl_1d_basis< T > const &)
 Write "<vgl_1d_basis o u i> " to stream.

Detailed Description

template<class T>
class vgl_1d_basis< T >

Storage for 3 collinear points to serve as 1-D projective basis.

This class is templated on the point type that will be stored. Typically, T will be vgl_point_2d<double> or vgl_homg_point_2d<int> or even vgl_line_2d<float> or vgl_point_3d<T>.

This class stores three unequal collinear points and will use these to define a projection from e.g. 2d points on a line to a 1-dimensional projective space: the first point receives coordinates (0,1), the second one (the unit point) (1,1), and the third one (point at infinity) (1,0).

Note that this class can also be used for ``projecting'' from e.g. vgl_homg_point_1d<float> or vgl_point_1d<int> to vgl_homg_point_1d<double>, i.e., a kind of type casting operation, by passing it the homogeneous points (0,1), (1,1) and (1,0). Note that the destination space is always vgl_homg_point_1d<double>.

The only conditions on template type T are the following:

These conditions are satisfied for the vgl_point_[23]d<Type> and vgl_homg_point_[123]d<Type> classes. For concurrent vgl_line_2d's the method project() has to be specialised (which is easily done by taking its intersection with the line at infinity!)

Definition at line 92 of file vgl_1d_basis.h.


Constructor & Destructor Documentation

template<class T >
vgl_1d_basis< T >::vgl_1d_basis ( ) [inline, private]

Definition at line 100 of file vgl_1d_basis.h.

template<class T >
vgl_1d_basis< T >::vgl_1d_basis ( T const &  o,
T const &  u,
T const &  i 
)

Construct from three collinear points (projective basis).

It will serve as origin (0,1), unity (1,1) and point at infinity (1,0). The points must be collinear, and different from each other.

Note that there is no valid default constructor, since any sensible default heavily depends on the structure of the point class T, the template type.

Note that there is no way to overwrite an existing vgl_basis_1d; just create a new one if you need a different one. Hence it is not possible to read a vgl_basis_1d from stream with >>.

Definition at line 10 of file vgl_1d_basis.txx.

template<class T >
vgl_1d_basis< T >::vgl_1d_basis ( T const &  o,
T const &  u 
)

Construct from two points (affine basis).

It will serve as origin (0,1) and unity point (1,1). The points must be different from each other, and not at infinity. This creates an affine basis, i.e., the point at infinity of the basis will be the point at infinity of the line o-u in the source space.

Definition at line 17 of file vgl_1d_basis.txx.


Member Function Documentation

template<class T >
bool vgl_1d_basis< T >::affine ( ) const [inline]

Definition at line 106 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::inf_pt ( ) const [inline]

Definition at line 105 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::origin ( ) const [inline]

Definition at line 103 of file vgl_1d_basis.h.

template<class T >
vgl_homg_point_1d< double > vgl_1d_basis< T >::project ( T const &  p)

Projection from a point in the source space to a 1-D homogeneous point.

Definition at line 24 of file vgl_1d_basis.txx.

template<class T >
bool vgl_1d_basis< T >::projective ( ) const [inline]

Definition at line 107 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::unity ( ) const [inline]

Definition at line 104 of file vgl_1d_basis.h.


Friends And Related Function Documentation

template<class T >
vcl_ostream & operator<< ( vcl_ostream &  s,
vgl_1d_basis< T > const &   
) [related]

Write "<vgl_1d_basis o u i> " to stream.


Member Data Documentation

template<class T >
bool vgl_1d_basis< T >::affine_ [private]

normally false; if true, inf_pt_ is not used: affine basis

Definition at line 98 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::inf_pt_ [private]

The point to be mapped to homogeneous (1,0)

Definition at line 97 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::origin_ [private]

The point to be mapped to homogeneous (0,1)

Definition at line 95 of file vgl_1d_basis.h.

template<class T >
T vgl_1d_basis< T >::unity_ [private]

The point to be mapped to homogeneous (1,1)

Definition at line 96 of file vgl_1d_basis.h.


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