CODPolygonRgn Class

class CODPolygonRgn

An individual polygon that defines a piece of a  CODRgn object. Polygon regions can have a minimum of two points, thus defining a line. For friendlier hit testing on these regions, a padding value can be passed in. Polygon regions are always defined in logical coordinates.

Defined in: OdPolygonRgn.h

Class Members

 CODPolygonRgn()

Constructor.

 CODPolygonRgn(const CODPolygonRgn& rgn)

Copy constructor.

 CODPolygonRgn(LPPOINT lpPoints, int nCount)

Constructor.

virtual  ~CODPolygonRgn()

Destructor.

CRect m_rcBounds

The bounding rectangle of this polygon.

LPPOINT m_lpPoints

An array of points defining the polygon.

int m_nPointCount

The number of points in the polygon.

CRect  GetBounds() const

Gets the bounding rectangle of the polygon.

LPPOINT  GetPoints() const

Gets the array of points that define the polygon.

CPoint  GetPoint(int nIndex) const

Gets an individual point from the array of points.

int  GetPointCount() const

Gets the number of points in the polygon.

BOOL  operator==(CODPolygonRgn rgn) const

Tests for equality between this polygon region and another.

BOOL  operator!=(CODPolygonRgn rgn) const

Test for inequlity between this polygon region and another.

CODPolygonRgn&  operator=(const CODPolygonRgn& rgn)

Sets this polygon region equal to another.

void  UpdateBounds()

Updates the bounding rectangle of the polygon region.

BOOL  PtInRegion(POINT point, int nPadding = 0) const

Determines if a point is within this region.

CODPolygonRgn  Transform(CODTransform* pXform) const

Applies a transformation matrix to the coordinates of this polygon region.

CODPolygonRgn  InvTransform(CODTransform* pXform) const

Applies the inverse of a transformation matrix to the coordinates of this polygon region.