#include <Polygon.hpp>
Public Member Functions | |
Polygon (const Polygon &source) | |
Polygon (const SimplePolygon &simple_polygon) | |
Polygon (std::auto_ptr< std::vector< SimplePolygon > > contours, std::auto_ptr< std::vector< SimplePolygon > > &holes) | |
Polygon & | operator= (const Polygon &source) |
void | set_contours (std::auto_ptr< std::vector< SimplePolygon > > contours) |
void | set_holes (std::auto_ptr< std::vector< SimplePolygon > > holes) |
const std::vector < SimplePolygon > & | contours () const |
const std::vector < SimplePolygon > & | holes () const |
size_t | n_contours () const |
size_t | n_holes () const |
const SimplePolygon & | contour (size_t i) const |
const SimplePolygon & | hole (size_t i) const |
void | clear () |
This class implements a polygon defined by multiple contours and holes. Each of the contours and the holes is a SimplePolygon. For polygons consisting of one boundary contour only, use SimplePolygon instead.
imaging::Polygon::Polygon | ( | const Polygon & | source | ) |
imaging::Polygon::Polygon | ( | const SimplePolygon & | simple_polygon | ) | [explicit] |
Constructs a polygon object from a SimplePolygon.
imaging::Polygon::Polygon | ( | std::auto_ptr< std::vector< SimplePolygon > > | contours, | |
std::auto_ptr< std::vector< SimplePolygon > > & | holes | |||
) |
Constructs a polygon from a vector of contours and a vector holes.
void imaging::Polygon::set_contours | ( | std::auto_ptr< std::vector< SimplePolygon > > | contours | ) |
Sets the contours of the polygon.
References contours().
void imaging::Polygon::set_holes | ( | std::auto_ptr< std::vector< SimplePolygon > > | holes | ) |
Sets the holes of the polygon.
References holes().
const std::vector<SimplePolygon>& imaging::Polygon::contours | ( | ) | const [inline] |
Returns the contours of the polygon.
Referenced by set_contours().
const std::vector<SimplePolygon>& imaging::Polygon::holes | ( | ) | const [inline] |
Returns the holes of the polygon.
Referenced by set_holes().
size_t imaging::Polygon::n_contours | ( | ) | const [inline] |
Returns the number of contours of the polygon.
Referenced by imaging::operator<<().
size_t imaging::Polygon::n_holes | ( | ) | const [inline] |
Returns the number of holes of the polygon.
Referenced by imaging::operator<<().
const SimplePolygon& imaging::Polygon::contour | ( | size_t | i | ) | const [inline] |
Returns the i-th contour of the polygon.
Referenced by imaging::operator<<().
const SimplePolygon& imaging::Polygon::hole | ( | size_t | i | ) | const [inline] |
Returns the i-th hole of the polygon.
Referenced by imaging::operator<<().
void imaging::Polygon::clear | ( | ) |
Removes all contours and holes of the polygon.
Referenced by imaging::PolygonModel2d::compute_boundary().