该接口对应一个多边形(LPolygon对象) 更多...
Public 成员函数 | |
| void | AddPoints (ILPoints *points) |
| int | Count () |
| double | DistanceToPoint (ILPoint *point, LPVAggregation aggType, ILPoint **rootPoint) |
| double | DistanceToPolygon (ILPolygon *polygon, LPVAggregation aggType, ILPoint **rootPoint1, ILPoint **rootPoint2) |
| void | Draw (BOOL bFill, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
| void | FromPolyRegion (ILPolyRegion *val) |
| double | GetArea () |
| ILPoint * | GetGravityCenter () |
| ILCircle * | GetInscribedCircle () |
| double | GetPerimeter () |
| ILPoints * | GetPoints () |
| BOOL | IntersectCircle (ILCircle *circle, ILPoints **intersectPoints) |
| LPVIntersectType | IntersectLine (ILLine *line, ILPoints **intersectPoints) |
| BOOL | IntersectPolygon (ILPolygon *polygon, ILPoints **intersectPoints) |
| ILPoint * | Item (int index) |
| LPVPointTestResult | PointTest (ILPoint *point) |
| void | RemovePoints (double lbX, double ubX, double lbY, double ubY) |
| ILPolygon * | Resample (int num) |
| ILPolygon * | ResampleByStep (double step, double stepThreshold) |
| void | Set (int index, double x, double y) |
| void | SetPolygon (LArray< double > xs, LArray< double > ys, BOOL isClosed) |
| ILPolyRegion * | ToPolyRegion () |
| ILPolygon * | Transform (ILTransform *tf) |
| ILPolygon * | Translate (double offsetX, double offsetY) |
Public 成员函数 继承自 ILGeomObject | |
| void | Drag (LPVGeomHandle geomHandle, int posX, int posY, double zoomX, double zoomY, double panX, double panY) |
| void | EnableHandle (LPVGeomHandle geomHandle, BOOL enabled) |
| LPVGeomHandle | HitTest (int posX, int posY, double zoomX, double zoomY, double panX, double panY) |
| void | ScaleTo (double factorX, double factorY) |
| void | TransformTo (ILTransform *tf) |
| void | TranslateTo (double offsetX, double offsetY) |
Public 成员函数 继承自 ILObject | |
| ILObject * | Copy () |
| LPVErrorCode | Load (LString filename) |
| void | Reset () |
| LPVErrorCode | Save (LString filename) |
| BOOL | Valid () |
属性 | |
| BOOL | Closed [get, set] |
| 多边形是否闭合 | |
属性 继承自 ILObject | |
| LString | Name [get, set] |
| 对象的名称,默认为空。 大多数情况下,LPV 算法类并不使用这个名称。 若 ILDrawable::SetDrawName() 启用,该名称将被绘制在对象的附近 更多... | |
该接口对应一个多边形(LPolygon对象)
| void AddPoints | ( | ILPoints * | points | ) |
将输入点集中的点添加到多边形的末尾
| [in] | points | 输入的点集 |
| int Count | ( | ) |
获取多边形顶点的总数
| double DistanceToPoint | ( | ILPoint * | point, |
| LPVAggregation | aggType, | ||
| ILPoint ** | rootPoint | ||
| ) |
计算输入点到多边形顶点或边的最小距离
| [in] | point | 输入的点 |
| [in] | aggType | 聚合方式,仅接受 LPVAggMin 或 LPVAggMax |
| [out] | rootPoint | 返回垂足,可能是多边形的某一个顶点,或输入点到多边形的某一条边的垂足 |
| val | 返回最小距离 |
| double DistanceToPolygon | ( | ILPolygon * | polygon, |
| LPVAggregation | aggType, | ||
| ILPoint ** | rootPoint1, | ||
| ILPoint ** | rootPoint2 | ||
| ) |
计算该多边形和输入多边形顶点或边之间的最小距离。 例如,红色为当前多边形,绿色为输入多边形,其最小距离和垂足如下图所示:
| [in] | polygon | 输入的多边形 |
| [in] | aggType | 聚合方式,仅接受 LPVAggMin 或 LPVAggMax |
| [out] | rootPoint1 | 返回当前多边形上的垂足 |
| [out] | rootPoint2 | 返回输入前多边形上的垂足 |
| val | 返回最小距离 |
| void Draw | ( | BOOL | bFill, |
| HDC | hdc, | ||
| double | zoomX, | ||
| double | zoomY, | ||
| double | panX, | ||
| double | panY | ||
| ) |
| void FromPolyRegion | ( | ILPolyRegion * | val | ) |
根据输入的多边形区域对象,设置该多边形的位置和顶点坐标。
| double GetArea | ( | ) |
获取多边形的面积。对于非闭合的多边形,将连接首尾形成闭合形状。
| val | 返回多边形的面积 |
| ILPoint* GetGravityCenter | ( | ) |
获取该多边形的重心
| ILCircle* GetInscribedCircle | ( | ) |
计算该多边形的内接圆
| double GetPerimeter | ( | ) |
获取多边形的周长
| val | 返回多边形的周长 |
| ILPoints* GetPoints | ( | ) |
获取多边形的所有顶点到一个点集,用于进行如计算包围矩形、拟合等计算
| val | 返回顶点的点集 |
判断当前多边形的边和输入的圆形是否相交,若相交,返回所有交点。 与 ILCircle::IntersectPoly() 的报告结果一致。
| [in] | circle | 输入的圆形 |
| [out] | intersectPoints | 返回交点的点集,每条被穿越的边可能给出 2 个交点, 若无相交,该点集为空。 |
| result | 若多边形的任意边与圆形相交,返回 True,否则返回 False。 |
| LPVIntersectType IntersectLine | ( | ILLine * | line, |
| ILPoints ** | intersectPoints | ||
| ) |
判断当前多边形和输入直线是否相交,若相交,返回一个或多个交点。
| [in] | line | 输入的直线 |
| [out] | intersectPoints | 返回交点的点集,若当前多边形和输入直线不相交,则该点集为空,否则可能包含一个或多个点。 |
判断当前多边形和输入的另一个多边形是否相交,若相交,返回所有交点。
| [in] | polygon | 输入的另一个多边形 |
| [out] | intersectPoints | 返回交点的点集,若当前多边形和输入不相交,则该点集为空,否则可能包含一个或多个点。 |
| result | 若两个多边形相交,返回 True,否则返回 False。 |
| ILPoint* Item | ( | int | index | ) |
获取多边形中的指定索引的顶点
| [in] | index | 输入指定的索引,从 0 开始但小于总数的数字 |
| point | 返回该索引对应的顶点 |
| LPVPointTestResult PointTest | ( | ILPoint * | point | ) |
判断输入的点是否在多边形内部、外部或边上。 对于非闭合的多边形,点总是在多边形外部或者边上。
| [in] | point | 输入的点 |
| val | 返回判断结果 |
| void RemovePoints | ( | double | lbX, |
| double | ubX, | ||
| double | lbY, | ||
| double | ubY | ||
| ) |
删除多边形中在指定范围中的顶点
| [in] | lbX | 指定删除范围的 x 坐标下限 |
| [in] | ubX | 指定删除范围的 x 坐标上限 |
| [in] | lbY | 指定删除范围的 y 坐标下限 |
| [in] | ubY | 指定删除范围的 y 坐标上限 |
| ILPolygon* Resample | ( | int | num | ) |
沿该多边形采样,生成一个指定顶点数量的多边形。 对于非闭合多边形,其端点总是包含在采样结果中。
| [in] | num | 采样顶点数量,至少为 3 |
| result | 返回采样得到的结果多边形 |
| ILPolygon* ResampleByStep | ( | double | step, |
| double | stepThreshold | ||
| ) |
沿该多边形采样,按指定距离步长,生成一个新的多边形。 对于非闭合多边形,其端点总是包含在采样结果中。
| [in] | step | 采样距离步长 |
| [in] | stepThreshold | 若最后一个采样点与端点的剩余距离小于该设定阈值,则忽略该采样点。 默认设置为 0,表示使用 \( Step / 4 \) 距离作为阈值。 |
| result | 返回采样得到的结果多边形 |
| void Set | ( | int | index, |
| double | x, | ||
| double | y | ||
| ) |
修改多边形的给定索引对应的顶点
| [in] | index | 输入指定的索引,从 0 开始但小于总数的数字,设置为 -1 在最后插入一个新的顶点 |
| [in] | x | 顶点新的 x 坐标 |
| [in] | y | 顶点新的 y 坐标 |
设置多边形中的顶点
| [in] | xs | 多边形中所有顶点的 x 坐标 |
| [in] | ys | 多边形中所有顶点的 y 坐标 |
| [in] | isClosed | 是否为闭合多边形 |
| ILPolyRegion* ToPolyRegion | ( | ) |
根据当前多边形的位置和顶点坐标,生成一个多边形区域
| ILPolygon* Transform | ( | ILTransform * | tf | ) |
应用指定的变换矩阵到当前多边形,得到一个新的多边形
| [in] | tf | 变换矩阵 |
| 返回新的多边形 |
| ILPolygon* Translate | ( | double | offsetX, |
| double | offsetY | ||
| ) |
平移当前多边形,生成一个新的多边形
| [in] | offsetX | x 方向的平移量 |
| [in] | offsetY | y 方向的平移量 |
| results | 返回新的多边形 |