|
CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
路径顶点源(在GPathStorage的世界里,椭圆,弧线,样条曲线都是由足够细腻的直线拟合的) 更多...
类 BUI::GPathStorage 继承关系图:Public 类型 | |
| enum | CombinationPathFlag { combination_or , combination_and , combination_xor , combination_a_minus_b , combination_b_minus_a } |
| typedef vertex_base_f | value_type |
Public 成员函数 | |
| GPathStorage () | |
| GPathStorage (GPathStorage *other) | |
| virtual | ~GPathStorage () |
| unsigned | vertex (double *x, double *y) |
| 获得顶点数据。调用一次后,内部游标会自动指向下一个顶点,直到返回0结束。 rewind(0)表示将游标设置到0位置 | |
| unsigned | last_command () |
| unsigned | last_vertex (double *x, double *y) |
| unsigned | prev_vertex (double *x, double *y) |
| void | rewind (unsigned path_id) |
| 重置内部访问游标 | |
| void | add_vertex (double x, double y, unsigned cmd) |
| 添加顶点 | |
| UINT | size () const |
| 顶点个数 | |
| void | clear () |
| 清除所有顶点 | |
| value_type & | operator[] (unsigned int pos) |
| float | total_length () |
| 计算路径长度 | |
| BOOL | GetScreenPoint (POINT &pt, int pos, int dx, int dy) |
| 获得pos位置的顶点坐标,然后经过变换,最后加上(dx,dy)的偏移量 | |
| void | ConcatPath (GPathStorage &vs, unsigned path_id=0, PathConvType type=CONV_NONE) |
| 将vs连接到本路径中。 | |
| void | Revert () |
| 首尾翻转。同时翻转坐标和顶点类型 | |
| BOOL | IsClosed () |
| 判断是否是几何闭合路径 | |
| void | Invert () |
| 路径顶点倒置。值翻转坐标,顶点类型不翻转 | |
| void | SetTransform (PathTransform *trans) |
| 设置顶点变换 | |
| BoundRect | PathBox (unsigned path_id=0, bool useTrans=false, Transform2d *mtx=NULL) |
| 获得路径的矩形区域 | |
| RECT | PathBoxToRect (unsigned path_id=0, bool useTrans=false, Transform2d *mtx=NULL) |
| void | CenterAverage (double *x, double *y) |
| 计算几何中心 | |
| void | PuckerOrBloat (GPathStorage *other, float xa, float ya, float xc, float yc, float amount) |
| Pucker/Bloat效果 | |
| int | StartNewPath () |
| unsigned | PathIDCounts () |
| 组合路径数量 | |
| unsigned | PathId () |
| 当前的索引ID | |
| void | ClosePath () |
| void | RelToAbs (double *x, double *y) |
| void | PathMoveTo (double x, double y) |
| void | PathLineTo (double x, double y) |
| void | PathHLineTo (double x) |
| void | PathVLineTo (double y) |
| void | Curve3 (double x_to, double y_to) |
| void | Curve4 (double x_ctrl2, double y_ctrl2, double x_to, double y_to) |
| void | PathCurve4 (POINT pt[4]) |
| void | PathCurve3 (POINT pt[3]) |
| void | PathCurve4WithDouble (VecFloat2 pt[4]) |
| void | PathCurve3WithDouble (VecFloat2 pt[3]) |
| void | PathBSpline (POINT *pt, int len) |
| void | ParseCmdData (const char *data) |
| void | ParsePointsData (const char *data, BOOL isClose) |
| void | PathArcTo (double x, double y, double rx, double ry, double a1, double a2, bool ccw=true) |
| PathArcTo | |
| void | PathJoinArcTo (double x, double y, double rx, double ry, double a1, double a2, bool ccw) |
| void | PathPie (double x0, double y0, double rx, double ry, double a1, double a2) |
| void | PathRing (double x0, double y0, double rx, double ry, double a1, double a2, double dis) |
| void | PathRingRound (double x0, double y0, double rx, double ry, double a1, double a2, double dis, double round=PI/45) |
| void | PathEllipse (double cx, double cy, double rx, double ry) |
| void | PathRect (double x1, double y1, double w, double h, double rx1=0, double ry1=0, double rx2=0, double ry2=0, double rx3=0, double ry3=0, double rx4=0, double ry4=0) |
| void | CurveFrom (GPathStorage *vs) |
| 片段化。用折线近似曲线 | |
| void | Trimmed (GPathStorage *out, float start, float end, float offset, BOOL curve=FALSE) |
| 截取路径的一部分 | |
| void | UpdateYValue (double low, double hight) |
| 随机生成Y更新测试数据 | |
| BOOL | HitTestPoint (double x, double y) |
| 测试命中点 | |
| void | ConvertToPolarCoordinate (double cx, double cy) |
| 将笛卡尔坐标系数据点,转换为极坐标系 | |
| void | CreateWebTabPath (RECT rcBox, double angle, int dir, float r=4, BOOL isBorder=TRUE) |
| Create a Web Tab Path object | |
| void | generate_soft_icon (int R) |
| 软件图标 | |
| void | CreateG3RoundRectPath (RECT rcBox, int n) |
| 生成G3曲率的圆角矩形 | |
| void | generate_star_round (int R) |
| 圆角五角星 | |
| void | generate_petal5 (int R) |
| 五花瓣 | |
| void | generate_gear_wheel (int R1, double a1, int R2, double a2) |
| 齿轮 | |
| void | generate_along_with_single_path (TransAlongSinglePath &tap) |
| 将图形沿单一路径变换 | |
| void | generate_along_with_double_path (TransAlongDoublePath &tap) |
| 将图形沿双路径变换 | |
| void | clip_polygon (GPathStorage *result_path, int x1, int y1, int x2, int y2) |
| 矩形区域裁剪路径 | |
静态 Public 成员函数 | |
| static void | generate_arrowhead (ArrowHead &head, int size) |
| static void | build_radius_border_path (GPathStorage *path, RECT &rcRound, RoundRectRadius &radius, BOOL isRoundRadiusDrawLine, BOOL isRoundRadiusParl) |
| 构建边缘路径 | |
| static void | build_radius_border_parl_path (GPathStorage *path, RECT &rcRound, RoundRectRadius &radius) |
| static void | combination_path (GPathStorage *result_path, GPathStorage *path1, GPathStorage *path2, CombinationPathFlag cmp_op) |
| 路径组合操作 | |
Protected 成员函数 | |
| virtual value_type & | GetAt (unsigned int pos) |
| virtual void | push_back (const value_type &vx) |
| unsigned | get_transform_vertex (unsigned int pos, double *x, double *y) |
Protected 属性 | |
| unsigned int | m_index |
| unsigned int | m_num_vertices |
| std::vector< value_type > | m_vertexs |
| PathTransform * | m_transform |
路径顶点源(在GPathStorage的世界里,椭圆,弧线,样条曲线都是由足够细腻的直线拟合的)
| BUI::GPathStorage::GPathStorage | ( | ) |
| BUI::GPathStorage::GPathStorage | ( | GPathStorage * | other | ) |
|
virtual |
| void BUI::GPathStorage::add_vertex | ( | double | x, |
| double | y, | ||
| unsigned | cmd | ||
| ) |
添加顶点
|
static |
|
static |
构建边缘路径
| isRoundRadiusDrawLine | TRUE:直线型, FALSE:圆角型 |
| void BUI::GPathStorage::CenterAverage | ( | double * | x, |
| double * | y | ||
| ) |
计算几何中心
| x | 输出参数:X坐标 |
| y | 输出参数:Y坐标 |
| void BUI::GPathStorage::clear | ( | ) |
清除所有顶点
| void BUI::GPathStorage::clip_polygon | ( | GPathStorage * | result_path, |
| int | x1, | ||
| int | y1, | ||
| int | x2, | ||
| int | y2 | ||
| ) |
矩形区域裁剪路径
| void BUI::GPathStorage::ClosePath | ( | ) |
|
static |
路径组合操作
| result_path | 输出结果路径 |
| path1 | |
| path2 | |
| cmp_op | 合并操作 |
| void BUI::GPathStorage::ConcatPath | ( | GPathStorage & | vs, |
| unsigned | path_id = 0, |
||
| PathConvType | type = CONV_NONE |
||
| ) |
将vs连接到本路径中。
| void BUI::GPathStorage::ConvertToPolarCoordinate | ( | double | cx, |
| double | cy | ||
| ) |
将笛卡尔坐标系数据点,转换为极坐标系
| void BUI::GPathStorage::CreateG3RoundRectPath | ( | RECT | rcBox, |
| int | n | ||
| ) |
生成G3曲率的圆角矩形
| void BUI::GPathStorage::CreateWebTabPath | ( | RECT | rcBox, |
| double | angle, | ||
| int | dir, | ||
| float | r = 4, |
||
| BOOL | isBorder = TRUE |
||
| ) |
Create a Web Tab Path object
| angle | 偏角大小 |
| dir | 方向 |
| r | 圆角尺寸 |
| void BUI::GPathStorage::Curve3 | ( | double | x_to, |
| double | y_to | ||
| ) |
| void BUI::GPathStorage::Curve4 | ( | double | x_ctrl2, |
| double | y_ctrl2, | ||
| double | x_to, | ||
| double | y_to | ||
| ) |
| void BUI::GPathStorage::CurveFrom | ( | GPathStorage * | vs | ) |
片段化。用折线近似曲线
| void BUI::GPathStorage::generate_along_with_double_path | ( | TransAlongDoublePath & | tap | ) |
将图形沿双路径变换
| void BUI::GPathStorage::generate_along_with_single_path | ( | TransAlongSinglePath & | tap | ) |
将图形沿单一路径变换
|
static |
| void BUI::GPathStorage::generate_gear_wheel | ( | int | R1, |
| double | a1, | ||
| int | R2, | ||
| double | a2 | ||
| ) |
齿轮
| R1 | 齿外边缘半径 |
| a1 | 齿外边缘弧度大小 |
| R2 | 齿内边缘半径 |
| a2 | 齿内边缘弧度大小 |
| void BUI::GPathStorage::generate_petal5 | ( | int | R | ) |
五花瓣
| void BUI::GPathStorage::generate_soft_icon | ( | int | R | ) |
软件图标
| void BUI::GPathStorage::generate_star_round | ( | int | R | ) |
圆角五角星
|
protected |
|
protectedvirtual |
被 BUI::GPathBufferStorage 重载.
获得pos位置的顶点坐标,然后经过变换,最后加上(dx,dy)的偏移量
| pt | :输出结果 |
| pos | :顶点索引 |
| dx | : x增量 |
| dy | : y增量 |
| BOOL BUI::GPathStorage::HitTestPoint | ( | double | x, |
| double | y | ||
| ) |
测试命中点
| void BUI::GPathStorage::Invert | ( | ) |
路径顶点倒置。值翻转坐标,顶点类型不翻转
| BOOL BUI::GPathStorage::IsClosed | ( | ) |
判断是否是几何闭合路径
| unsigned BUI::GPathStorage::last_command | ( | ) |
| unsigned BUI::GPathStorage::last_vertex | ( | double * | x, |
| double * | y | ||
| ) |
| value_type & BUI::GPathStorage::operator[] | ( | unsigned int | pos | ) |
| void BUI::GPathStorage::ParseCmdData | ( | const char * | data | ) |
| void BUI::GPathStorage::ParsePointsData | ( | const char * | data, |
| BOOL | isClose | ||
| ) |
| void BUI::GPathStorage::PathArcTo | ( | double | x, |
| double | y, | ||
| double | rx, | ||
| double | ry, | ||
| double | a1, | ||
| double | a2, | ||
| bool | ccw = true |
||
| ) |
PathArcTo
| a1 | a2 基于三点方向顺时针的角度 |
| ccw | 优弧顺时针方向为true,劣弧逆时针方向为false |
| BoundRect BUI::GPathStorage::PathBox | ( | unsigned | path_id = 0, |
| bool | useTrans = false, |
||
| Transform2d * | mtx = NULL |
||
| ) |
获得路径的矩形区域
| path_id | 路径起始位置 |
| useTrans | false:原始坐标点,true:变换后的坐标点 |
| mtx | 变换矩阵 |
| RECT BUI::GPathStorage::PathBoxToRect | ( | unsigned | path_id = 0, |
| bool | useTrans = false, |
||
| Transform2d * | mtx = NULL |
||
| ) |
| void BUI::GPathStorage::PathBSpline | ( | POINT * | pt, |
| int | len | ||
| ) |
| void BUI::GPathStorage::PathCurve3 | ( | POINT | pt[3] | ) |
| void BUI::GPathStorage::PathCurve3WithDouble | ( | VecFloat2 | pt[3] | ) |
| void BUI::GPathStorage::PathCurve4 | ( | POINT | pt[4] | ) |
| void BUI::GPathStorage::PathCurve4WithDouble | ( | VecFloat2 | pt[4] | ) |
| void BUI::GPathStorage::PathEllipse | ( | double | cx, |
| double | cy, | ||
| double | rx, | ||
| double | ry | ||
| ) |
| void BUI::GPathStorage::PathHLineTo | ( | double | x | ) |
| unsigned BUI::GPathStorage::PathId | ( | ) |
当前的索引ID
| unsigned BUI::GPathStorage::PathIDCounts | ( | ) |
组合路径数量
| void BUI::GPathStorage::PathJoinArcTo | ( | double | x, |
| double | y, | ||
| double | rx, | ||
| double | ry, | ||
| double | a1, | ||
| double | a2, | ||
| bool | ccw | ||
| ) |
| void BUI::GPathStorage::PathLineTo | ( | double | x, |
| double | y | ||
| ) |
| void BUI::GPathStorage::PathMoveTo | ( | double | x, |
| double | y | ||
| ) |
| void BUI::GPathStorage::PathPie | ( | double | x0, |
| double | y0, | ||
| double | rx, | ||
| double | ry, | ||
| double | a1, | ||
| double | a2 | ||
| ) |
| void BUI::GPathStorage::PathRect | ( | double | x1, |
| double | y1, | ||
| double | w, | ||
| double | h, | ||
| double | rx1 = 0, |
||
| double | ry1 = 0, |
||
| double | rx2 = 0, |
||
| double | ry2 = 0, |
||
| double | rx3 = 0, |
||
| double | ry3 = 0, |
||
| double | rx4 = 0, |
||
| double | ry4 = 0 |
||
| ) |
| void BUI::GPathStorage::PathRing | ( | double | x0, |
| double | y0, | ||
| double | rx, | ||
| double | ry, | ||
| double | a1, | ||
| double | a2, | ||
| double | dis | ||
| ) |
| void BUI::GPathStorage::PathRingRound | ( | double | x0, |
| double | y0, | ||
| double | rx, | ||
| double | ry, | ||
| double | a1, | ||
| double | a2, | ||
| double | dis, | ||
| double | round = PI/45 |
||
| ) |
| void BUI::GPathStorage::PathVLineTo | ( | double | y | ) |
| unsigned BUI::GPathStorage::prev_vertex | ( | double * | x, |
| double * | y | ||
| ) |
| void BUI::GPathStorage::PuckerOrBloat | ( | GPathStorage * | other, |
| float | xa, | ||
| float | ya, | ||
| float | xc, | ||
| float | yc, | ||
| float | amount | ||
| ) |
Pucker/Bloat效果
| other | 输入源路径 |
| xa | 锚点的x坐标 |
| ya | 锚点的y坐标 |
| xc | 中心的x坐标。可以是几何中心,也可以是质心(也称重心) |
| yc | 中心的y坐标 |
| amount | 百分比(0-1) |
|
protectedvirtual |
被 BUI::GPathBufferStorage 重载.
| void BUI::GPathStorage::RelToAbs | ( | double * | x, |
| double * | y | ||
| ) |
| void BUI::GPathStorage::Revert | ( | ) |
首尾翻转。同时翻转坐标和顶点类型
| void BUI::GPathStorage::rewind | ( | unsigned | path_id | ) |
重置内部访问游标
| void BUI::GPathStorage::SetTransform | ( | PathTransform * | trans | ) |
设置顶点变换
| UINT BUI::GPathStorage::size | ( | ) | const |
顶点个数
| int BUI::GPathStorage::StartNewPath | ( | ) |
| float BUI::GPathStorage::total_length | ( | ) |
计算路径长度
| void BUI::GPathStorage::Trimmed | ( | GPathStorage * | out, |
| float | start, | ||
| float | end, | ||
| float | offset, | ||
| BOOL | curve = FALSE |
||
| ) |
截取路径的一部分
| void BUI::GPathStorage::UpdateYValue | ( | double | low, |
| double | hight | ||
| ) |
随机生成Y更新测试数据
| unsigned BUI::GPathStorage::vertex | ( | double * | x, |
| double * | y | ||
| ) |
获得顶点数据。调用一次后,内部游标会自动指向下一个顶点,直到返回0结束。 rewind(0)表示将游标设置到0位置
| x | :输出参数 |
| y | :输出参数 |
|
protected |
|
protected |
|
protected |
|
protected |