imaging::Polygon Class Reference
[Polytope Module]

Planar polygon with multiple outlines and holes. More...

#include <Polygon.hpp>

List of all members.

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)
Polygonoperator= (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 SimplePolygoncontour (size_t i) const
const SimplePolygonhole (size_t i) const
void clear ()


Detailed Description

Planar polygon with multiple outlines and holes.

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.


Constructor & Destructor Documentation

imaging::Polygon::Polygon ( const Polygon source  ) 

Copy constructor.

References _contours, and _holes.

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.


Member Function Documentation

Polygon & imaging::Polygon::operator= ( const Polygon source  ) 

Copy assignement.

References _contours, and _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().


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

Generated on Tue Feb 10 10:01:31 2009 for imaging2 by  doxygen 1.5.5