A closed, manysided figure which defines an area in a twodimensional Cartesian coordinate system. More...
Public Member Functions  
BPolygon ()  
Initializes an empty polygon without any points. More...  
BPolygon (const BPoint *points, int32 count)  
Initializes a new BPolygon object from an array of points. More...  
BPolygon (const BPolygon &other)  
Initializes a new BPolygon object from another BPolygon and copies the list of BPoint objects from other. More...  
BPolygon (const BPolygon *other)  
Initializes a new BPolygon object from a pointer to another BPolygon and copies the list of BPoint objects from other. More...  
virtual  ~BPolygon () 
Destroys the object and frees the memory used by the associated BPoint objects. More...  
void  AddPoints (const BPoint *points, int32 count) 
Adds an array of BPoint objects. More...  
int32  CountPoints () const 
Returns the number of points associated with the polygon. More...  
BRect  Frame () const 
Returns the frame rectangle that encloses the BPolygon object. More...  
void  MapTo (BRect source, BRect destination) 
Modifies each BPoint in the BPolygon so that the shape fits inside the destination rectangle. More...  
BPolygon &  operator= (const BPolygon &other) 
Initializes a new BPolygon object and copies the list of BPoint objects from other. More...  
void  PrintToStream () const 
Prints each of the points of the BPolygon to standard output. More...  
A closed, manysided figure which defines an area in a twodimensional Cartesian coordinate system.
A BPolygon is defined as a set of BPoint objects, each BPoint represents a vertex of the polygon. Unlike a BRect, a BPolygon can can have any number of sides and the sides don't have to be aligned on coordinate axes.
BPolygon objects are most commonly used for drawing. BView::StrokePolygon() and BView::FillPolygon() allow you to draw a polygon in a BView by taking a BPolygon object as an argument.
BPolygon::BPolygon  (  const BPoint *  points, 
int32  count  
) 
BPolygon::BPolygon  (  const BPolygon &  other  ) 
BPolygon::BPolygon  (  const BPolygon *  other  ) 
BPolygon::BPolygon  (  ) 
Initializes an empty polygon without any points.

virtual 
Destroys the object and frees the memory used by the associated BPoint objects.
void BPolygon::AddPoints  (  const BPoint *  points, 
int32  count  
) 
int32 BPolygon::CountPoints  (  )  const 
Returns the number of points associated with the polygon.
BRect BPolygon::Frame  (  )  const 
Returns the frame rectangle that encloses the BPolygon object.
Modifies each BPoint in the BPolygon so that the shape fits inside the destination rectangle.
The source rectangle is used so that the points are mapped proportionally. To modify a polygon so that it is inscribed in the destination rectangle exactly, pass the frame rectangle as the source.
void BPolygon::PrintToStream  (  )  const 
Prints each of the points of the BPolygon to standard output.