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

VIEWS_API CODPolygonRgn()

Constructor.

VIEWS_API CODPolygonRgn(const CODPolygonRgn& rgn)

Copy constructor.

VIEWS_API CODPolygonRgn(LPPOINT lpPoints, int nCount)

Constructor.

VIEWS_API 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.

VIEWS_API CRect GetBounds() const

Gets the bounding rectangle of the polygon.

VIEWS_API LPPOINT GetPoints() const

Gets the array of points that define the polygon.

VIEWS_API CPoint GetPoint(int nIndex) const

Gets an individual point from the array of points.

VIEWS_API int GetPointCount() const

Gets the number of points in the polygon.

VIEWS_API BOOL operator==(CODPolygonRgn rgn) const

Tests for equality between this polygon region and another.

VIEWS_API BOOL operator!=(CODPolygonRgn rgn) const

Test for inequlity between this polygon region and another.

VIEWS_API CODPolygonRgn& operator=(const CODPolygonRgn& rgn)

Sets this polygon region equal to another.

VIEWS_API void UpdateBounds()

Updates the bounding rectangle of the polygon region.

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

Determines if a point is within this region.

VIEWS_API CODPolygonRgn Transform(CODTransform* pXform) const

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

VIEWS_API CODPolygonRgn InvTransform(CODTransform* pXform) const

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