|
Public Types |
|
typedef CWinPolygon::tagRANGE | RANGE |
| | 2D range
|
|
typedef CWinPolygon::tagRANGE * | LPRANGE |
| | 2D range
|
Public Member Functions |
| long | Distance (CWinPolygon *pWp) |
| | Calculates the minimum distance between polygon points.
|
| BOOL | GetIBeam (LPPOINT ptTop, LPPOINT ptBottom, BOOL bInvY=FALSE) |
| | Returns points representing the vertical height of the polygon.
|
| BOOL | Scale (LPRECT pSrc, LPRECT pDst) |
| | Scales the polygon points according to the ratio of specified rectangles.
|
| BOOL | Intersect (LPPOINT pPts, DWORD dwPts) |
| | Collision tests with another polygon.
|
| BOOL | Intersect (CWinPolygon *pWp) |
| | Collision tests with another polygon.
|
| void | rScanSort (LPPOINT pPts, DWORD left, DWORD right) |
| | Performs a recursive quick sort on the polygons.
|
| BOOL | ScanSort () |
| | Performs a recursive quick sort on the polygons.
|
| BOOL | Inflate (long x, long y) |
| | Inflates the polygon by the specified amount.
|
| float | SimpleArea () |
| | Calculates a rough estimate of the polygon area.
|
| BOOL | ConvexHull () |
| | Calculates a convex hull of the polygon.
|
| BOOL | ApxConvexHull () |
| | Calculates an approximate convex hull.
|
| BOOL | FromMap (LPDWORD map, long x, long y, long w, long h, UINT th, LPBYTE buf=NULL) |
| | Creates a polygon from a map.
|
|
| CWinPolygon () |
| | Default constructor.
|
| | CWinPolygon (LPPOINT pPts, DWORD dwPts) |
| | Constructs a polygon object from a list of points.
|
| | CWinPolygon (CWinPolygon &wp) |
| | Constructs a polygon object by copying another CWinPolygon object.
|
|
virtual | ~CWinPolygon () |
| | Destructor.
|
|
void | Destroy () |
| | Releases the polygon resources.
|
| BOOL | Allocate (DWORD sz) |
| | Allocates the specified number of points in the polygon.
|
|
LPPOINT | GetPoints () |
| | Returns a pointer to the polygon POINT structure array.
|
|
DWORD | GetNumPoints () |
| | Returns the total number of points in the polygon.
|
|
DWORD | GetNumEdges () |
| | Returns the number of edges the polygon has.
|
| LPLINE | GetEdge (DWORD i) |
| | Returns a line struture pointer for the specified edge.
|
| BOOL | PtInPolygon (LPPOINT ppt) |
| | Tests to see if the point lies within the polygon.
|
| BOOL | CombinePoint (LPPOINT ppt) |
| | Adds a point into the current polygon by calculating the closest edge.
|
| CWinPolygon & | operator+= (LPPOINT ppt) |
| | Appends point to the end of the polygon.
|
| BOOL | AddPoint (LPPOINT ppt) |
| | Appends point to the end of the polygon.
|
| BOOL | AddPoints (LPPOINT ppt, DWORD dwPts) |
| | Appends points to the end of the polygon point list.
|
| BOOL | AddPoint (long x, long y) |
| | Appends point to the end of the polygon.
|
| BOOL | AddPolygon (CWinPolygon *pWp) |
| | Add The points from the specified polygon.
|
| BOOL | RemovePoint (DWORD dwPt) |
| | Removes the specified point from the polygon.
|
| BOOL | RemovePoint (long x, long y) |
| | Removes the specified point from the polygon.
|
|
| operator DWORD () |
| | Returns the number of points in the polygon.
|
|
| operator LPPOINT () |
| | Returns a pointer to the polygon POINT structure array.
|
|
POINT & | operator[] (DWORD i) |
| | Returns a reference to the specified point.
|
| long | isLeft (POINT P0, POINT P1, POINT P2) |
| | Returns greater than zero if the specified triangle is left-handed.
|
| long | ComparePoint (POINT p1, POINT p2) |
| | For sorting points.
|
| POINT | CalculateCenter () |
| | Calculates the center point of the polygon.
|
|
CWinPolygon & | operator= (CWinPolygon &wp) |
| | Copies another CWinPolygon object.
|
| BOOL | SetPoints (LPPOINT pPts, DWORD dwPts) |
| | Sets the value of the polygon points.
|
| BOOL | SetPoints (CWinPolygon *pWp) |
| | Sets the value of the polygon points.
|
| void | Offset (LPPOINT ppt) |
| | Offsets the polygon by the specified distance.
|
| void | Offset (long x, long y) |
| | Offsets the polygon by the specified distance.
|
| float | ConvexArea () |
| | Calculates the area of a convex polygon.
|
Static Public Member Functions |
| static BOOL | PtInPolygon (LPPOINT pptList, DWORD dwListSize, LPPOINT ppt) |
| | Tests to see if the point lies within the polygon.
|
| static BOOL | CombinePoint (LPPOINT pptList, DWORD dwListSize, LPPOINT ppt) |
| | Adds a point into the current polygon by calculating the closest edge.
|
| static float | TriangleArea (float a, float b, float c) |
| | Calculates the area of a triangle given the lengths of it's sides.
|
| static float | TriangleArea (float x1, float y1, float x2, float y2, float x3, float y3) |
| | Calculates the area of the triangle defined by three points.
|
Classes |
| struct | tagRANGE |
| | 2D range More...
|
This structure encapsulates a polylgon and provides a few nifty functions for manipulating them. The polygon is stored simply as a list of points.