TouchVG framework
|
图形位置关系函数 更多...
#include <mglnrel.h>
Public 类型 | |
enum | PtInAreaRet { kPtInArea, kPtOutArea, kPtOnEdge, kPtAtVertex } |
静态 Public 成员函数 | |
static bool | isLeft (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否在有向直线a->b的左边 (开区间) 更多... | |
static bool | isLeft2 (const Point2d &a, const Point2d &b, const Point2d &pt, const Tol &tol) |
判断点pt是否在有向直线a->b的左边 更多... | |
static bool | isLeftOn (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否在有向直线a->b的左边或线上 (闭区间) 更多... | |
static bool | isLeftOn2 (const Point2d &a, const Point2d &b, const Point2d &pt, const Tol &tol) |
判断点pt是否在有向直线a->b的左边或线上 更多... | |
static bool | isColinear (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否在直线a->b的线上 更多... | |
static bool | isColinear2 (const Point2d &a, const Point2d &b, const Point2d &pt, const Tol &tol) |
判断点pt是否在直线a->b的线上 更多... | |
static bool | isIntersectProp (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d) |
判断两个线段ab和cd是否相交于线段内部 更多... | |
static bool | isBetweenLine (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否在线段ab上(闭区间) 更多... | |
static bool | isProjectBetweenLine (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否投影在线段ab上(闭区间) 更多... | |
static bool | isProjectBetweenRayline (const Point2d &a, const Point2d &b, const Point2d &pt) |
判断点pt是否投影在射线a->b上(闭区间) 更多... | |
static bool | isBetweenLine2 (const Point2d &a, const Point2d &b, const Point2d &pt, const Tol &tol) |
判断点pt是否在线段ab上 更多... | |
static bool | isBetweenLine3 (const Point2d &a, const Point2d &b, const Point2d &pt, Point2d *nearpt=(Point2d *) 0) |
已知点pt在直线ab上, 判断点pt是否在线段ab上(闭区间) 更多... | |
static bool | isIntersect (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d) |
判断两个线段ab和cd是否相交(交点在线段闭区间内) 更多... | |
static float | ptToBeeline (const Point2d &a, const Point2d &b, const Point2d &pt) |
计算点pt到无穷直线ab的距离 更多... | |
static float | ptToBeeline2 (const Point2d &a, const Point2d &b, Point2d pt, Point2d &ptPerp) |
计算点pt到无穷直线ab的距离 更多... | |
static float | ptToLine (const Point2d &a, const Point2d &b, Point2d pt, Point2d &nearpt) |
计算点pt到线段ab的最近距离 更多... | |
static bool | crossLineAbc (float a1, float b1, float c1, float a2, float b2, float c2, Point2d &ptCross, const Tol &tolVec=Tol::gTol()) |
求两条直线(ax+by+c=0)的交点 更多... | |
static bool | cross2Beeline (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d, Point2d &ptCross, float *pu=(float *) 0, float *pv=(float *) 0, const Tol &tolVec=Tol::gTol()) |
求两条无穷直线的交点 更多... | |
static bool | cross2Line (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d, Point2d &ptCross, const Tol &tolVec=Tol::gTol()) |
求两条线段的交点 更多... | |
static bool | cross2LineV (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d, float *v1=(float *) 0, float *v2=(float *) 0) |
求两条线段的交点 更多... | |
static bool | crossLineBeeline (const Point2d &a, const Point2d &b, const Point2d &c, const Point2d &d, Point2d &ptCross, float *pv=(float *) 0, const Tol &tolVec=Tol::gTol()) |
求线段和直线的交点 更多... | |
static bool | clipLine (Point2d &pt1, Point2d &pt2, const Box2d &box) |
用矩形剪裁线段,Sutherland-Cohen算法 更多... | |
static int | ptInArea (const Point2d &pt, int count, const Point2d *vertexs, int &order, const Tol &tol=Tol::gTol(), bool closed=true, int flags=-1, int ignoreVertex=-1) |
判断一点是否在一多边形范围内 更多... | |
static bool | isConvex (int count, const Point2d *vertexs, bool *acw=(bool *) 0) |
判断多边形是否为凸多边形 更多... | |
图形位置关系函数