CVR-Lib last update 20 Sep 2009

cvr::bresenhamLine Class Reference

Functor for rendering line segments with the Bresenham line drawing algorithm. More...

#include <cvrBresenhamLine.h>

Inheritance diagram for cvr::bresenhamLine:

Inheritance graph
[legend]
Collaboration diagram for cvr::bresenhamLine:

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class bresenhamLine. More...

Public Member Functions

 bresenhamLine ()
 bresenhamLine (const parameters &par)
 bresenhamLine (const bresenhamLine &other)
virtual ~bresenhamLine ()
template<typename T >
bool apply (const int fx, const int fy, const int tx, const int ty, genericMatrix< T > &m, T color) const
bool apply (const int fx, const int fy, const int tx, const int ty, ipointList &l) const
template<typename T >
bool apply (const ipoint &from, const ipoint &to, genericMatrix< T > &m, T color) const
bool apply (const ipoint &from, const ipoint &to, ipointList &l) const
bresenhamLinecopy (const bresenhamLine &other)
bresenhamLineoperator= (const bresenhamLine &other)
virtual const std::string & name () const
virtual bresenhamLineclone () const
virtual bresenhamLinenewInstance () const
const parametersgetParameters () const


Detailed Description

Functor for rendering line segments with the Bresenham line drawing algorithm.

The apply methods take the first and last points of the line segment, and an object where to store the points. Currently two types of point stores are supported:

Additional point stores may be added, see the addPoint() method.


Constructor & Destructor Documentation

cvr::bresenhamLine::bresenhamLine (  ) 

Default constructor.

cvr::bresenhamLine::bresenhamLine ( const parameters par  ) 

Construct a functor using the given parameters.

cvr::bresenhamLine::bresenhamLine ( const bresenhamLine other  ) 

Copy constructor.

Parameters:
other the object to be copied

virtual cvr::bresenhamLine::~bresenhamLine (  )  [virtual]

Destructor.


Member Function Documentation

bool cvr::bresenhamLine::apply ( const ipoint from,
const ipoint to,
ipointList l 
) const [inline]

Render a line from the point f to point t.

The points in the line will be added to the given list.

template<typename T >
bool cvr::bresenhamLine::apply ( const ipoint from,
const ipoint to,
genericMatrix< T > &  m,
color 
) const [inline]

Render a line from the point f to point t.

The line will be drawn to the given genericMatrix<T> instance, using the given color.

bool cvr::bresenhamLine::apply ( const int  fx,
const int  fy,
const int  tx,
const int  ty,
ipointList l 
) const [inline]

Render a line from the point (fx,fy) to point (tx,ty).

The points in the line will be added to the given list.

template<typename T >
bool cvr::bresenhamLine::apply ( const int  fx,
const int  fy,
const int  tx,
const int  ty,
genericMatrix< T > &  m,
color 
) const [inline]

Render a line from the point (fx,fy) to point (tx,ty).

The line will be drawn to the given genericMatrix<T> instance, using the given color.

virtual bresenhamLine* cvr::bresenhamLine::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements cvr::functor.

bresenhamLine& cvr::bresenhamLine::copy ( const bresenhamLine other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

const parameters& cvr::bresenhamLine::getParameters (  )  const

Returns used parameters.

Reimplemented from cvr::parametersManager.

virtual const std::string& cvr::bresenhamLine::name (  )  const [virtual]

Returns the complete name of the functor class.

Implements cvr::functor.

virtual bresenhamLine* cvr::bresenhamLine::newInstance (  )  const [virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::functor.

bresenhamLine& cvr::bresenhamLine::operator= ( const bresenhamLine other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object


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

Generated on Sun Sep 20 22:08:41 2009 for CVR-Lib by Doxygen 1.5.8