路径类 更多...
#include <Path.h>
Public 成员函数 | |
| Path () | |
| 默认构造函数 | |
| Path (const Path &other) | |
| Path (Path &&other) | |
| ~Path () | |
| void | addArc (const fRect &rect, float startAngle, float sweepAngle) |
| 向路径中添加圆弧 | |
| void | addBezier (const fBezier &bezier) |
| 向路径中添加贝塞尔曲线 | |
| void | addCircle (const fCircle &circle) |
| 向路径中添加圆 | |
| void | addEllipse (const fEllipse &ellipse) |
| 向路径中添加椭圆 | |
| void | addFitCurve (const fFitCurve &fitCurve) |
| 向路径中添加拟合曲线 | |
| void | addLine (const fLine &line) |
| 向路径中添加直线 | |
| void | addPath (const Path &other, bool connect=false) |
| 向路径中添加路径 | |
| void | addPie (const fRect &rect, float startAngle, float sweepAngle) |
| 向路径中添加扇形 | |
| void | addPolygon (const fPolygon &points) |
| 向路径中添加多边形 | |
| void | addRect (const fRect &rect) |
| 向路径中添加矩形 | |
| void | addText (const std::wstring &text, const fPoint &position, const Font &font=Font(L"宋体")) |
| 向路径中添加文本 | |
| void | close () |
| 闭合当前图元 | |
| void | closeAll () |
| 闭合所有未闭合的图元 | |
| int | count () const |
| 计算路径共有多少个控制点 | |
| fRect | getBounds (const fMat3x3 &transform=fMat3x3::I()) const |
| 获取路径的最小外接矩形 | |
| fPoint | getLastPoint () const |
| 获取路径的最后一个点 | |
| Path & | operator= (const Path &other) |
| Path & | operator= (Path &&other) |
| void | outline () |
| 转变为图形的轮廓线 | |
| void | reset () |
| 清空路径 | |
| void | reverse () |
| 反转路径 | |
| void | start () |
| 开始一个新的图元 | |
| void | transformBy (const fMat3x3 &transform) |
| 对路径应用变换矩阵 | |
友元 | |
| class | Graphics |
路径类
用于绘制图形,可以包含多种图元,如直线、圆弧、贝塞尔曲线、多边形等
| GFt::Path::Path | ( | ) |
默认构造函数
| GFt::Path::Path | ( | const Path & | other | ) |
| GFt::Path::Path | ( | Path && | other | ) |
| GFt::Path::~Path | ( | ) |
| void GFt::Path::addArc | ( | const fRect & | rect, |
| float | startAngle, | ||
| float | sweepAngle ) |
向路径中添加圆弧
| rect | 圆弧所在矩形 |
| startAngle | 圆弧起始角度 |
| sweepAngle | 圆弧扫过角度 |
| void GFt::Path::addBezier | ( | const fBezier & | bezier | ) |
向路径中添加贝塞尔曲线
| bezier | 贝塞尔曲线 |
| void GFt::Path::addCircle | ( | const fCircle & | circle | ) |
向路径中添加圆
| circle | 圆 |
| void GFt::Path::addEllipse | ( | const fEllipse & | ellipse | ) |
向路径中添加椭圆
| ellipse | 椭圆 |
| void GFt::Path::addFitCurve | ( | const fFitCurve & | fitCurve | ) |
向路径中添加拟合曲线
| fitCurve | 拟合曲线 |
| void GFt::Path::addLine | ( | const fLine & | line | ) |
向路径中添加直线
| line | 直线 |
| void GFt::Path::addPath | ( | const Path & | other, |
| bool | connect = false ) |
向路径中添加路径
| other | 要添加的路径 |
| connect | 是否连接两个路径(仅在路径未闭合时有效) |
| void GFt::Path::addPie | ( | const fRect & | rect, |
| float | startAngle, | ||
| float | sweepAngle ) |
向路径中添加扇形
| rect | 扇形所在矩形 |
| startAngle | 扇形起始角度 |
| sweepAngle | 扇形扫过角度 |
| void GFt::Path::addPolygon | ( | const fPolygon & | points | ) |
向路径中添加多边形
| points | 多边形的点集 |
| void GFt::Path::addRect | ( | const fRect & | rect | ) |
向路径中添加矩形
| rect | 矩形 |
| void GFt::Path::addText | ( | const std::wstring & | text, |
| const fPoint & | position, | ||
| const Font & | font = Font(L"宋体") ) |
向路径中添加文本
| text | 文本内容 |
| position | 文本位置 |
| font | 字体 |
| void GFt::Path::close | ( | ) |
闭合当前图元
| void GFt::Path::closeAll | ( | ) |
闭合所有未闭合的图元
| int GFt::Path::count | ( | ) | const |
计算路径共有多少个控制点
| fRect GFt::Path::getBounds | ( | const fMat3x3 & | transform = fMat3x3::I() | ) | const |
获取路径的最小外接矩形
所得的外接矩形是经过变换后的路径的最小外接矩形
| transform | 变换矩阵, 默认为单位矩阵 |
对于输入的矩阵, 会默认其已经过齐次变换
| fPoint GFt::Path::getLastPoint | ( | ) | const |
获取路径的最后一个点
| void GFt::Path::outline | ( | ) |
转变为图形的轮廓线
| void GFt::Path::reset | ( | ) |
清空路径
| void GFt::Path::reverse | ( | ) |
反转路径
| void GFt::Path::start | ( | ) |
开始一个新的图元
| void GFt::Path::transformBy | ( | const fMat3x3 & | transform | ) |
对路径应用变换矩阵
| transform | 变换矩阵 |
|
friend |