Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
geometry::two_d::ConvexHull< T > Class Template Reference

#include <convex_hull.h>

List of all members.

Classes

class  PointCompare

Public Types

typedef Point< T > PointType

Public Member Functions

void clear ()
void addPoint (const PointType point)
std::vector< PointTypeconvexHull ()

Private Member Functions

std::vector< PointTypecomputeChain (const std::vector< PointType > data)
std::vector< PointTyperotate180 (const std::vector< PointType > data)

Private Attributes

std::vector< PointTypedata

Detailed Description

template<typename T>
class geometry::two_d::ConvexHull< T >

Class computing the convex hull of a set of points


Member Typedef Documentation

template<typename T >
typedef Point<T> geometry::two_d::ConvexHull< T >::PointType

Member Function Documentation

template<typename T >
void geometry::two_d::ConvexHull< T >::addPoint ( const PointType  point) [inline]

Add a new point.

template<typename T >
void geometry::two_d::ConvexHull< T >::clear ( ) [inline]

Removes all points.

template<typename T >
std::vector<PointType> geometry::two_d::ConvexHull< T >::computeChain ( const std::vector< PointType data) [inline, private]

Returns monotone chain

Chain starts at leftmost point (in case of more leftmost points the one with smallest y coordinate), it is upper half of the convex hull and ends in rightmost (in case of tie the topmost one of them) point

Precondition:
  • data sorted ascending by x coordinate, then y coordinate
Returns:
upper monotone chain
template<typename T >
std::vector<PointType> geometry::two_d::ConvexHull< T >::convexHull ( ) [inline]

Compute convex hull

Note: Convex hull of an empty set is an empty set.

template<typename T >
std::vector<PointType> geometry::two_d::ConvexHull< T >::rotate180 ( const std::vector< PointType data) [inline, private]

Rotates all points by 180 degrees


Member Data Documentation

template<typename T >
std::vector<PointType> geometry::two_d::ConvexHull< T >::data [private]

inserted points.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines