CVR-Lib last update 20 Sep 2009

cvr::convexHull Class Reference

Computes the convex hull of a set of points. More...

#include <cvrConvexHull.h>

Inheritance diagram for cvr::convexHull:

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

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class convexHull More...

Public Member Functions

 convexHull ()
 convexHull (const parameters &par)
 convexHull (const convexHull &other)
virtual ~convexHull ()
virtual const std::string & name () const
bool apply (const ipointList &src, ipolygonPoints &dest) const
bool apply (const ioPoints &src, ipolygonPoints &dest) const
bool apply (const pointList< float > &src, polygonPoints< float > &dest) const
bool apply (const pointList< double > &src, polygonPoints< double > &dest) const
convexHullcopy (const convexHull &other)
convexHulloperator= (const convexHull &other)
virtual convexHullclone () const
virtual convexHullnewInstance () const
const parametersgetParameters () const
template<typename T >
polygonPoints< T > & computeConvexHull (const pointList< T > &thePointList, polygonPoints< T > &thePolygonPoints) const


Detailed Description

Computes the convex hull of a set of points.

The algorithm used is similar to the one explained in:

M. de Berg, et. al. Computational Geometry. Algorithms and Applications, 2nd. edition. Springer, 2000


Constructor & Destructor Documentation

cvr::convexHull::convexHull (  ) 

default constructor

cvr::convexHull::convexHull ( const parameters par  ) 

Construct a functor using the given parameters.

cvr::convexHull::convexHull ( const convexHull other  ) 

copy constructor

Parameters:
other the object to be copied

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

destructor


Member Function Documentation

bool cvr::convexHull::apply ( const pointList< double > &  src,
polygonPoints< double > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src pointList with the source data.
dest pointList where the result will be left.
Returns:
true if apply successful or false otherwise.

bool cvr::convexHull::apply ( const pointList< float > &  src,
polygonPoints< float > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src pointList with the source data.
dest pointList where the result will be left.
Returns:
true if apply successful or false otherwise.

bool cvr::convexHull::apply ( const ioPoints src,
ipolygonPoints dest 
) const

operates on a copy of the given parameters.

Parameters:
src pointList with the source data.
dest pointList where the result will be left.
Returns:
true if apply successful or false otherwise.

bool cvr::convexHull::apply ( const ipointList src,
ipolygonPoints dest 
) const

operates on a copy of the given parameters.

Parameters:
src pointList with the source data.
dest pointList where the result will be left.
Returns:
true if apply successful or false otherwise.

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

returns a pointer to a clone of this functor.

Implements cvr::functor.

template<typename T >
polygonPoints<T>& cvr::convexHull::computeConvexHull ( const pointList< T > &  thePointList,
polygonPoints< T > &  thePolygonPoints 
) const [inline]

Creates the smallest convex polygon that contains all points in the given point list.

The list of points must be a set, i.e. the same point is not allowed to be twice in the list. (This usually is not the case in cvr::ioPoints lists, see castFrom(const ioPoints&)).

For more information on the algorithm used here see:

M. de Berg, et.al. Computational Geometry, Algorithms and Applications. 2nd. edition, Springer, 2000, pp. 6ff

Parameters:
thePointList a set of points (the same point is not allowed to be twice in the list).
thePolygonPoints the resulting polygon
Returns:
a reference to the result

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

copy data of "other" functor.

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

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

returns used parameters

Reimplemented from cvr::parametersManager.

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

returns the name of this type

Implements cvr::functor.

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

returns a pointer to a new instance of this functor.

Implements cvr::functor.

convexHull& cvr::convexHull::operator= ( const convexHull 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:44 2009 for CVR-Lib by Doxygen 1.5.8