My Project
|
We always shape the region points and edges in clockwise. More...
#include <GDIRegion.h>
Public Member Functions | |
CGDIRegion () | |
This default constructor constructs an infinite region. | |
CGDIRegion (const RECT &rect) | |
This constructor constructs a region with the given rectangle. | |
bool | operator== (const CGDIRegion ®ion) |
bool | operator== (const RECT &rect) |
operator RECT () | |
void | Translate (float dx, float dy, float dz=0) |
Move the whole region. | |
void | Translate (const Vector3 &v) |
bool | IsEmpty () const |
Check if the region is empty. | |
bool | IsInfinite () const |
Check if the region is infinite. | |
void | MakeEmpty () |
void | MakeInifinite () |
CGDIRegion * | Clone () |
bool | LineIntersect (const Vector3 &point1, const Vector3 &point2, Vector3 &outpoint) const |
Find the intersection of a line with the region. More... | |
bool | LineIntersect (const GDISimpleEdge &edge, vector< Vector3 > &outpoint, vector< int > &outedge) const |
bool | InsideTest (const Vector3 &point) const |
Decide if the point is inside or outside the region. More... | |
int | PolygonClip (const CGDIRegion ®ion, vector< CGDIRegion > &outregions) |
Clip the input region with the current region the outregion contains all intersections, because clipping a polygon may result in more than one polygon The input region is the polygon to be clipped and the current region is the clipping window. | |
int | RectClip (const CGDIRegion ®ion, CGDIRegion &outregion) |
Clip two rectangle regions. | |
Vector3 | GetPoint (int index) const |
int | PointCount () const |
GDISimpleEdge | GetEdge (int index) const |
Static Public Member Functions | |
static bool | EdgeIntersect (const GDISimpleEdge &edge1, const GDISimpleEdge &edge2, Vector3 &point) |
Static function to decide and find the intersect point of two edges. More... | |
Protected Member Functions | |
bool | IsPoint1Closer (const Vector3 &point, const Vector3 &point1, const Vector3 &point2, int relation=0) |
Decide if the input edge intersects with any of the edges in the current region,. More... | |
bool | CalculateClipX (const GDISimpleEdge &edge1, const GDISimpleEdge &edge2, float &pointx) const |
void | GenerateEdge () |
void | Preprocessing () |
Protected Attributes | |
vector< Vector3 > | m_points |
vector< GDISimpleEdge > | m_edges |
list< GDIClipNode > | m_nodes |
int | m_shape |
We always shape the region points and edges in clockwise.
|
static |
Static function to decide and find the intersect point of two edges.
bool CGDIRegion::InsideTest | ( | const Vector3 & | point | ) | const |
Decide if the point is inside or outside the region.
|
protected |
Decide if the input edge intersects with any of the edges in the current region,.
bool CGDIRegion::LineIntersect | ( | const Vector3 & | point1, |
const Vector3 & | point2, | ||
Vector3 & | outpoint | ||
) | const |
Find the intersection of a line with the region.
point1,point2 | [in] the start point and end point of the input line |
outpoint1,outpoint2 | [out] the start point and end point of the line which intersects with the region. Their meaningless if the return is false; : true if the line is inside the region or intersects with the region. false if the line is outside the region |