|
TouchVG framework
|
图形系统类 更多...
#include <gigraph.h>
Public 类型 | |
| enum | { kAlignLeft = 0, kAlignCenter = 1, kAlignRight = 2, kAlignTop = 0, kAlignBottom = 0x10, kAlignVCenter = 0x20, kAlignHVCenter = kAlignCenter|kAlignVCenter } |
Public 成员函数 | |
| GiGraphics () | |
| 构造函数,自动创建坐标系管理对象 更多... | |
| GiGraphics (GiTransform *xform, bool needFreeXf=false) | |
| 构造函数,坐标系管理对象必须有效 更多... | |
| GiGraphics (const GiGraphics &src) | |
| 拷贝构造函数 更多... | |
| virtual | ~GiGraphics () |
| 析构函数 更多... | |
| long | toHandle () const |
| 得到句柄 更多... | |
| void | copy (const GiGraphics &src) |
| 复制指定对象到本对象 更多... | |
| const GiTransform & | xf () const |
| 返回坐标系管理对象 更多... | |
| bool | isDrawing () const |
| 返回是否正在绘制,即调用了 beginPaint() 还未调用 endPaint() 更多... | |
| bool | isPrint () const |
| 返回是否打印或打印预览 更多... | |
| bool | isStopping () const |
| 返回是否需要停止绘图 更多... | |
| void | stopDrawing (bool stopped=true) |
| 标记需要停止绘图 更多... | |
| Box2d | getClipModel () const |
| 返回剪裁框,模型坐标 更多... | |
| Box2d | getClipWorld () const |
| 返回剪裁框,世界坐标 更多... | |
| RECT_2D & | getClipBox (RECT_2D &rc) const |
| 得到剪裁框,逻辑坐标 更多... | |
| bool | setClipBox (const RECT_2D &rc) |
| 设置剪裁框,逻辑坐标 更多... | |
| bool | setClipWorld (const Box2d &rectWorld) |
| 设置剪裁框,世界坐标 更多... | |
| bool | isGrayMode () const |
| 返回颜色模式 更多... | |
| void | setGrayMode (bool gray) |
| 设置颜色模式 更多... | |
| GiColor | getBkColor () const |
| 返回背景色(打印或打印预览时为白色) 更多... | |
| GiColor | setBkColor (const GiColor &color) |
| 设置新的背景色,返回原来的背景色 更多... | |
| GiColor | calcPenColor (const GiColor &color) const |
| 计算画笔颜色 更多... | |
| float | calcPenWidth (float lineWidth, bool useViewScale) const |
| 计算画笔宽度 更多... | |
| void | setMaxPenWidth (float pixels, float minw=1) |
| 设置最大画笔宽度,像素 更多... | |
| bool | setPhaseEnabled (bool enabled) |
| 是否允许虚线偏移量 更多... | |
| bool | drawLine (const GiContext *ctx, const Point2d &startPt, const Point2d &endPt, bool modelUnit=true) |
| 绘制直线段,模型坐标或世界坐标 更多... | |
| bool | drawRayline (const GiContext *ctx, const Point2d &startPt, const Point2d &endPt, bool modelUnit=true) |
| 绘制射线,模型坐标或世界坐标 更多... | |
| bool | drawBeeline (const GiContext *ctx, const Point2d &startPt, const Point2d &endPt, bool modelUnit=true) |
| 绘制无穷直线,模型坐标或世界坐标 更多... | |
| bool | drawLines (const GiContext *ctx, int count, const Point2d *points, bool modelUnit=true) |
| 绘制折线,模型坐标或世界坐标 更多... | |
| bool | drawBeziers (const GiContext *ctx, int count, const Point2d *points, bool closed=false, bool modelUnit=true) |
| 绘制多条三次贝塞尔曲线,模型坐标或世界坐标 更多... | |
| bool | drawBeziers (const GiContext *ctx, int count, const Point2d *knot, const Vector2d *knotvs, bool closed=false, bool modelUnit=true) |
| 绘制多条贝塞尔曲线,模型坐标或世界坐标 更多... | |
| bool | drawArc (const GiContext *ctx, const Point2d ¢er, float rx, float ry, float startAngle, float sweepAngle, bool modelUnit=true) |
| 绘制椭圆弧,模型坐标或世界坐标 更多... | |
| bool | drawArc3P (const GiContext *ctx, const Point2d &startpt, const Point2d &midpt, const Point2d &endpt, bool modelUnit=true) |
| 给定线上三点绘制椭圆弧,模型坐标或世界坐标 更多... | |
| bool | drawPolygon (const GiContext *ctx, int count, const Point2d *points, bool modelUnit=true) |
| 绘制并填充多边形,模型坐标或世界坐标 更多... | |
| bool | drawCircle (const GiContext *ctx, const Point2d ¢er, float r, bool modelUnit=true) |
| 绘制并填充圆,模型坐标或世界坐标 更多... | |
| bool | drawEllipse (const GiContext *ctx, const Point2d ¢er, float rx, float ry, bool modelUnit=true) |
| 绘制并填充椭圆,模型坐标或世界坐标 更多... | |
| bool | drawEllipse (const GiContext *ctx, const Box2d &rect, bool modelUnit=true) |
| 绘制并填充椭圆,模型坐标或世界坐标 更多... | |
| bool | drawPie (const GiContext *ctx, const Point2d ¢er, float rx, float ry, float startAngle, float sweepAngle, bool modelUnit=true) |
| 绘制并填充椭圆弧饼图,模型坐标或世界坐标 更多... | |
| bool | drawRect (const GiContext *ctx, const Box2d &rect, bool modelUnit=true) |
| 绘制并填充直角矩形,模型坐标或世界坐标 更多... | |
| bool | drawRoundRect (const GiContext *ctx, const Box2d &rect, float rx, float ry=0, bool modelUnit=true) |
| 绘制并填充圆角矩形,模型坐标或世界坐标 更多... | |
| bool | drawHermiteSplines (const GiContext *ctx, int count, const Point2d *knots, const Vector2d *knotvs, bool closed=false, bool modelUnit=true) |
| 绘制三次参数样条曲线(Hermite曲线),模型坐标或世界坐标 更多... | |
| bool | drawBSplines (const GiContext *ctx, int count, const Point2d *ctlpts, bool closed=false, bool modelUnit=true) |
| 绘制三次B样条曲线,模型坐标或世界坐标 更多... | |
| bool | drawQuadSplines (const GiContext *ctx, int count, const Point2d *ctlpts, bool closed=false, bool modelUnit=true) |
| 绘制二次B样条曲线,模型坐标或世界坐标 更多... | |
| bool | drawPath (const GiContext *ctx, const MgPath &path, bool fill, bool modelUnit=true) |
| 显示路径对象 更多... | |
| bool | drawHandle (const Point2d &pnt, int type, float angle=0, bool modelUnit=true) |
| 在给定中心位置显示特殊符号 更多... | |
| float | drawTextAt (int argb, const char *text, const Point2d &pnt, float h, int align=1, float angle=0) |
| 在给定模型坐标位置显示指定像素高的单行文本 更多... | |
| bool | beginPaint (GiCanvas *canvas, const RECT_2D &clipBox=RECT_2D()) |
| 在显示适配类的 beginPaint() 中调用 更多... | |
| void | endPaint () |
| 在显示适配类的 endPaint() 中调用 更多... | |
| GiCanvas * | getCanvas () |
| 返回当前绘图画布对象 更多... | |
| GiTransform & | _xf () |
| 返回坐标系管理对象 更多... | |
| bool | rawLine (const GiContext *ctx, float x1, float y1, float x2, float y2) |
| bool | rawLines (const GiContext *ctx, const Point2d *pxs, int count) |
| bool | rawBeziers (const GiContext *ctx, const Point2d *pxs, int count, bool closed=false) |
| bool | rawPolygon (const GiContext *ctx, const Point2d *pxs, int count) |
| bool | rawRect (const GiContext *ctx, float x, float y, float w, float h) |
| bool | rawEllipse (const GiContext *ctx, float x, float y, float w, float h) |
| bool | rawBeginPath () |
| bool | rawEndPath (const GiContext *ctx, bool fill) |
| bool | rawMoveTo (float x, float y) |
| bool | rawLineTo (float x, float y) |
| bool | rawBezierTo (float c1x, float c1y, float c2x, float c2y, float x, float y) |
| bool | rawQuadTo (float cpx, float cpy, float x, float y) |
| bool | rawClosePath () |
| float | rawText (const char *text, float x, float y, float h, int align=1) |
| bool | rawImage (const char *name, float xc, float yc, float w, float h, float angle) |
| bool | beginShape (int type, int sid, int version, float x, float y, float w, float h) |
| void | endShape (int type, int sid, float x, float y) |
| float | drawTextAt (GiTextWidthCallback *c, int argb, const char *text, const Point2d &pnt, float h, int align=1, float angle=0) |
静态 Public 成员函数 | |
| static GiGraphics * | fromHandle (long h) |
| 转为对象 更多... | |
| static void | setPenWidthFactor (float factor) |
| 设置像素线宽的放大系数 更多... | |
Private 成员函数 | |
| bool | setPen (const GiContext *ctx) |
| bool | setBrush (const GiContext *ctx) |
| bool | _drawPolygon (const GiContext *ctx, int count, const Point2d *points, bool m2d, bool fill, bool edge, bool modelUnit) |
| bool | drawPathWithArrayHead (const GiContext &ctx, MgPath &path, int startArray, int endArray) |
| void | drawArrayHead (const GiContext &ctx, MgPath &path, int type, float px, float scale) |
| bool | drawPath_ (const GiContext *ctx, const MgPath &path, bool fill, const Matrix2d &matD) |
| GiGraphics & | operator= (const GiGraphics &) |
Private 属性 | |
| GiGraphicsImpl * | m_impl |
| 内部实现 更多... | |
图形系统类
本类用于显示各种图形,图元显示原语由外部的 GiCanvas 实现类来实现。 显示图形所用的坐标计算和坐标系转换是在 GiTransform 中定义的。