Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

ConvexHull2D Class Reference
[Datastructures]

#include <OpenMS/DATASTRUCTURES/ConvexHull2D.h>

List of all members.


Detailed Description

A 2-dimensional convex hull representation (conterclockwise).

Public Types

typedef DPosition< 2 > PointType
typedef std::vector< PointTypePointArrayType
typedef PointArrayType::size_type SizeType
typedef
PointArrayType::const_iterator 
PointArrayTypeConstIterator

Public Member Functions

 ConvexHull2D ()
 default constructor
 ConvexHull2D (const PointArrayType &points)
 Constructor from point array.
ConvexHull2Doperator= (const ConvexHull2D &rhs)
 assignment operator
ConvexHull2Doperator= (const PointArrayType &points)
 constructor from a vector of points
bool operator== (const ConvexHull2D &rhs) const
 equality operator
void clear ()
 removes all points
const PointArrayTypegetPoints () const
 accessor for the points
DBoundingBox< 2 > getBoundingBox () const
 returns the bounding box of the convex hull points
bool addPoint (const PointType &point)
 adds a point to the convex hull if it is not already contained. Returns if the point was added.
bool encloses (const PointType &point) const
 returns if the point lies in the convex hull

Protected Types

typedef CGAL::Cartesian
< DoubleReal >::Point_2 
Point_2

Protected Attributes

PointArrayType points_

Member Typedef Documentation

typedef DPosition<2> PointType

typedef std::vector< PointType > PointArrayType

typedef PointArrayType::size_type SizeType

typedef PointArrayType::const_iterator PointArrayTypeConstIterator

typedef CGAL::Cartesian<DoubleReal>::Point_2 Point_2 [protected]


Constructor & Destructor Documentation

ConvexHull2D (  )  [inline]

default constructor

ConvexHull2D ( const PointArrayType points  )  [inline]

Constructor from point array.


Member Function Documentation

ConvexHull2D& operator= ( const ConvexHull2D rhs  )  [inline]

assignment operator

ConvexHull2D& operator= ( const PointArrayType points  )  [inline]

constructor from a vector of points

bool operator== ( const ConvexHull2D rhs  )  const [inline]

equality operator

void clear (  )  [inline]

removes all points

const PointArrayType& getPoints (  )  const [inline]

accessor for the points

DBoundingBox<2> getBoundingBox (  )  const [inline]

returns the bounding box of the convex hull points

bool addPoint ( const PointType point  )  [inline]

adds a point to the convex hull if it is not already contained. Returns if the point was added.

bool encloses ( const PointType point  )  const [inline]

returns if the point lies in the convex hull

Bug:
Due to numerical instabilities, this test for inclusion might return false even if point is included in the convex hull. As a preliminary workaround, we re-compute the convex hull. In the meantime the points_ variable is made mutable for the workaround. Undo that as soon as it is fixed. (Clemens)


Member Data Documentation

PointArrayType points_ [mutable, protected]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1