Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
Polygon Struct Reference

#include <Primitives.h>

Collaboration diagram for Polygon:
Collaboration graph
[legend]

Public Member Functions

 operator std::vector< Point > & ()
 
 operator const std::vector< Point > & () const
 
 Polygon (const std::vector< Point > &points={})
 
Point centroid () const
 
void center ()
 Translates points such that the centroid becomes (0, 0). More...
 
void scale (double scaling)
 
Polygon scaled (double scaling)
 
void translate (const Point &t)
 
void rotate (double angle)
 Rotates polygon counterclockwise about the origin. More...
 
Polygon transformed (const ompl::base::State *state) const
 
Point min () const
 Minimum x/y coordinates of all points. More...
 
Point max () const
 Maximum x/y coordinates of all points. More...
 
bool isConvex () const
 
Polygon convexHull () const
 
 operator std::vector< Eigen::Matrix< double, 2, 1 > > () const
 Cast to the polygon format compatible with the collision2d library. More...
 

Static Public Member Functions

static Polygon loadFromSvgPathStr (std::string path_str)
 Loads polygon from a path tag inside an SVG file. More...
 

Public Attributes

std::vector< Pointpoints
 

Friends

std::ostream & operator<< (std::ostream &stream, const Polygon &p)
 

Constructor & Destructor Documentation

◆ Polygon()

Polygon::Polygon ( const std::vector< Point > &  points = {})
inline

Member Function Documentation

◆ center()

void Polygon::center ( )
inline

Translates points such that the centroid becomes (0, 0).

◆ centroid()

Point Polygon::centroid ( ) const
inline

◆ convexHull()

Polygon Polygon::convexHull ( ) const

◆ isConvex()

bool Polygon::isConvex ( ) const

◆ loadFromSvgPathStr()

static Polygon Polygon::loadFromSvgPathStr ( std::string  path_str)
inlinestatic

Loads polygon from a path tag inside an SVG file.

◆ max()

Point Polygon::max ( ) const
inline

Maximum x/y coordinates of all points.

◆ min()

Point Polygon::min ( ) const
inline

Minimum x/y coordinates of all points.

◆ operator const std::vector< Point > &()

Polygon::operator const std::vector< Point > & ( ) const
inline

◆ operator std::vector< Eigen::Matrix< double, 2, 1 > >()

Polygon::operator std::vector< Eigen::Matrix< double, 2, 1 > > ( ) const
inline

Cast to the polygon format compatible with the collision2d library.

◆ operator std::vector< Point > &()

Polygon::operator std::vector< Point > & ( )
inline

◆ rotate()

void Polygon::rotate ( double  angle)
inline

Rotates polygon counterclockwise about the origin.

◆ scale()

void Polygon::scale ( double  scaling)
inline

◆ scaled()

Polygon Polygon::scaled ( double  scaling)
inline

◆ transformed()

Polygon Polygon::transformed ( const ompl::base::State state) const
inline

◆ translate()

void Polygon::translate ( const Point t)
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
const Polygon p 
)
friend

Member Data Documentation

◆ points

std::vector<Point> Polygon::points

The documentation for this struct was generated from the following files: