|
TouchVG framework
|
二维点类 更多...
#include <mgpnt.h>
Public 成员函数 | |
| Point2d () | |
| 构造为原点 更多... | |
| Point2d (float xx, float yy) | |
| 构造为点(x, y) 更多... | |
| Point2d (const Point2d &src) | |
| 拷贝构造函数 更多... | |
| Point2d | transform (const Matrix2d &m) const |
| 矩阵变换, 点 * 矩阵 更多... | |
| Point2d | operator* (const Matrix2d &m) const |
| 矩阵变换, 点 * 矩阵 更多... | |
| Point2d & | operator*= (const Matrix2d &m) |
| 矩阵变换, 点 *= 矩阵 更多... | |
| Point2d | operator* (float s) const |
| 点 * 数 更多... | |
| Point2d & | operator*= (float s) |
| 点 *= 数 更多... | |
| Point2d | operator/ (float s) const |
| 点 / 数 更多... | |
| Point2d & | operator/= (float s) |
| 点 /= 数 更多... | |
| Point2d & | scaleBy (float sx, float sy) |
| 比例放缩 更多... | |
| Point2d & | scaleBy (float s) |
| 比例放缩 更多... | |
| Point2d | operator+ (const Point2d &pnt) const |
| 点累加 更多... | |
| Point2d & | operator+= (const Point2d &pnt) |
| 点累加 更多... | |
| Point2d | operator+ (const Vector2d &vec) const |
| 用矢量平移, 点 + 矢量 = 点 更多... | |
| Point2d & | operator+= (const Vector2d &vec) |
| 用矢量平移, 点 += 矢量 更多... | |
| Point2d | operator- (const Vector2d &vec) const |
| 用矢量平移, 点 - 矢量 = 点 更多... | |
| Point2d & | operator-= (const Vector2d &vec) |
| 用矢量平移, 点 -= 矢量 更多... | |
| void | offset (float dx, float dy) |
| 平移 更多... | |
| void | offset (const Vector2d &vec) |
| 平移 更多... | |
| Point2d | add (const Point2d &pnt) const |
| 点累加 更多... | |
| Vector2d | subtract (const Point2d &pnt) const |
| 得到两点之间的矢量, 点 - 点 = 矢量 更多... | |
| Point2d | subtract (const Vector2d &vec) const |
| 用矢量平移, 点 - 矢量 = 点 更多... | |
| Vector2d | operator- (const Point2d &pnt) const |
| 得到两点之间的矢量, 点 - 点 = 矢量 更多... | |
| Vector2d | operator- () const |
| 返回负矢量 更多... | |
| Vector2d | negate () const |
| 返回负矢量 更多... | |
| Vector2d | asVector () const |
| 转换为矢量 更多... | |
| float | length () const |
| 到原点的距离 更多... | |
| float | distanceTo (const Point2d &pnt) const |
| 两点距离 更多... | |
| float | distanceSquare (const Point2d &pnt) const |
| 两点距离的平方 更多... | |
| bool | operator== (const Point2d &pnt) const |
| 判断两个点是否相等 更多... | |
| bool | operator!= (const Point2d &pnt) const |
| 判断两个点是否不相等 更多... | |
| bool | isEqualTo (const Point2d &pnt, const Tol &tol=Tol::gTol()) const |
| 用欧拉规则判断两个点是否相等 更多... | |
| bool | isDegenerate () const |
| 返回某个分量是为NAN越界值 更多... | |
| Point2d & | set (float xx, float yy) |
| 设置为点(xx, yy) 更多... | |
| Point2d & | set (const Point2d &pnt) |
| 设置为新的点 更多... | |
| void | get (long &xx, long &yy) const |
| 得到四舍五入后的坐标 更多... | |
| Point2d | polarPoint (float angle, float dist) const |
| 极坐标法计算坐标 更多... | |
| Point2d | rulerPoint (const Point2d &dir, float yoff) const |
| 移动直尺法 更多... | |
| Point2d | rulerPoint (const Point2d &dir, float xoff, float yoff) const |
| 移动直尺法 更多... | |
静态 Public 成员函数 | |
| static const Point2d | kInvalid () |
| 无效点 更多... | |
| static const Point2d | kOrigin () |
| 原点(0,0) 更多... | |
Public 属性 | |
| float | x |
| X坐标分量 更多... | |
| float | y |
| Y坐标分量 更多... | |
友元 | |
| Point2d | operator* (const Matrix2d &m, const Point2d &pnt) |
| 矩阵变换, 矩阵 * 点 更多... | |
| Point2d | operator* (float s, const Point2d &pnt) |
| 数 * 点 更多... | |
| Point2d | operator+ (const Vector2d &vec, const Point2d &pnt) |
| 用矢量平移, 矢量 + 点 = 点 更多... | |
二维点类
本类用于描述二维平面上任意位置的点,具有x和y两个坐标分量