LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
rcsc::ConvexHull Class Reference

Public Types

enum  MethodType { DirectMethod , WrappingMethod , GrahamScan }
 algoritym type
 
typedef std::vector< Vector2DPointCont
 input point container
 
typedef std::vector< Vector2DVertexCont
 result vertex container
 
typedef std::vector< Segment2DEdgeCont
 result edge container
 

Public Member Functions

 ConvexHull ()
 create empty convex hull
 
 ConvexHull (const PointCont &v)
 create convex hull with given points More...
 
void clear ()
 clear all data.
 
void clearResults ()
 clear result variables.
 
void addPoint (const Vector2D &p)
 add a new point to the set of input point More...
 
void addPoints (const PointCont &v)
 add new points to the set of input pointc More...
 
void compute (const MethodType type=WrappingMethod)
 generate convex hull by default method. More...
 
const PointContinputPoints () const
 get the reference to the input point container More...
 
const VertexContvertices () const
 get the reference to the vertex container ordered by counter clockwise More...
 
const EdgeContedges () const
 get the reference to the result edge container More...
 
Polygon2D toPolygon () const
 get the convex hull polygon More...
 
std::ostream & printInputPoints (std::ostream &os) const
 output input points to the stream in gnuplot format. More...
 
std::ostream & printVertices (std::ostream &os) const
 output vertices to the stream in gnuplot format. More...
 
std::ostream & printEdges (std::ostream &os) const
 output edges to the stream in gnuplot format. More...
 

Constructor & Destructor Documentation

◆ ConvexHull()

rcsc::ConvexHull::ConvexHull ( const PointCont v)

create convex hull with given points

Parameters
varray of input points

Member Function Documentation

◆ addPoint()

void rcsc::ConvexHull::addPoint ( const Vector2D p)
inline

add a new point to the set of input point

Parameters
pnew point

◆ addPoints()

void rcsc::ConvexHull::addPoints ( const PointCont v)
inline

add new points to the set of input pointc

Parameters
vinput point container

◆ compute()

void rcsc::ConvexHull::compute ( const MethodType  type = WrappingMethod)

generate convex hull by default method.

generate convex hull by specified method

Parameters
typemethod type id

◆ edges()

const EdgeCont & rcsc::ConvexHull::edges ( ) const
inline

get the reference to the result edge container

Returns
const reference to the result edge container

◆ inputPoints()

const PointCont & rcsc::ConvexHull::inputPoints ( ) const
inline

get the reference to the input point container

Returns
const reference to the input point container

◆ printEdges()

std::ostream & rcsc::ConvexHull::printEdges ( std::ostream &  os) const

output edges to the stream in gnuplot format.

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ printInputPoints()

std::ostream & rcsc::ConvexHull::printInputPoints ( std::ostream &  os) const

output input points to the stream in gnuplot format.

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ printVertices()

std::ostream & rcsc::ConvexHull::printVertices ( std::ostream &  os) const

output vertices to the stream in gnuplot format.

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ toPolygon()

Polygon2D rcsc::ConvexHull::toPolygon ( ) const

get the convex hull polygon

Returns
new 2d polygon object

◆ vertices()

const VertexCont & rcsc::ConvexHull::vertices ( ) const
inline

get the reference to the vertex container ordered by counter clockwise

Returns
const reference to the ordered vertex container

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