TouchVG framework
类 | Public 类型 | Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表
MgShapes类 参考

图形列表类 更多...

#include <mgshapes.h>

类 MgShapes 继承关系图:
Inheritance graph

类

struct  I
 

Public 类型

typedef bool(* Filter) (const MgShape *sp, void *data)
 

Public 成员函数

MgShapes * cloneShapes () const
 复制出一个新图形列表对象 更多...
 
MgShapes * shallowCopy () const
 复制出一个新图形列表对象,并添加所有图形的引用 更多...
 
const MgShape * getFirstShape (void *&it) const
 
const MgShape * getNextShape (void *&it) const
 
void freeIterator (void *&it) const
 
int traverseByType (int type, void(*c)(const MgShape *, void *), void *d)
 
int getShapeCount () const
 
int getShapeCountByTypeOrTag (int type, int tag) const
 
int getShapeIndex (int sid) const
 
const MgShape * getShapeAtIndex (int index) const
 
const MgShape * getHeadShape () const
 
const MgShape * getLastShape () const
 
const MgShape * findShape (int sid) const
 
const MgShape * findShapeByTag (int tag) const
 
const MgShape * findShapeByType (int type) const
 
const MgShape * findShapeByTypeAndTag (int type, int tag) const
 
Box2d getExtent () const
 
const MgShape * hitTest (const Box2d &limits, MgHitResult &res, Filter filter=(Filter) 0, void *data=(void *) 0) const
 
int draw (GiGraphics &gs, const GiContext *ctx=(const GiContext *) 0) const
 
int dyndraw (int mode, GiGraphics &gs, const GiContext *ctx, int segment, const int *ignoreIds=(const int *) 0) const
 
bool save (MgStorage *s, int startIndex=0) const
 
bool saveShape (MgStorage *s, const MgShape *shape, int index) const
 
int load (MgShapeFactory *factory, MgStorage *s, bool addOnly=false)
 
void setNewShapeID (int sid)
 
void clear ()
 删除所有图形 更多...
 
void clearCachedData ()
 释放临时数据内存 更多...
 
int copyShapes (const MgShapes *src, bool deeply=true, bool needClear=true)
 复制(默认为深拷贝)每一个图形,浅拷贝则添加图形的引用计数且不改变图形的拥有者 更多...
 
MgShape * addShape (const MgShape &src)
 复制出新图形并添加到图形列表中 更多...
 
bool addShapeDirect (MgShape *shape, bool force=true)
 添加新图形到图形列表中,自动更新图形的包络框 更多...
 
bool updateShape (MgShape *shape, bool force=true)
 更新为新的图形,该图形从原来图形克隆得到. 原图形对象会被删除! 更多...
 
bool updateShape (const MgShape *&oldsp, MgShape *newsp)
 更新为新的图形,该图形从原来图形克隆得到. 原图形对象(oldsp)会被释放并指向新的图形对象 更多...
 
bool reorderShapes (int n, const int *ids)
 指定新的顺序 更多...
 
MgShape * cloneShape (int sid) const
 复制出一个新图形对象 更多...
 
void transform (const Matrix2d &mat)
 对每个图形进行变形 更多...
 
bool removeShape (int sid)
 移除一个图形 更多...
 
bool moveShapeTo (int sid, MgShapes *dest)
 将一个图形移到另一个图形列表 更多...
 
void copyShapesTo (MgShapes *dest) const
 将所有图形复制到另一个图形列表 更多...
 
bool bringToFront (int sid)
 移动图形到最后,以便显示在最顶部 更多...
 
bool bringToBack (int sid)
 移动图形到开始处,以便显示在最下面 更多...
 
bool bringToIndex (int sid, int index)
 移动图形到指定序号位置 更多...
 
MgObject * getOwner () const
 返回拥有者对象 更多...
 
int getIndex () const
 返回图层序号 更多...
 
long toHandle () const
 得到句柄,用于跨库转换 更多...
 
virtual MgObject * clone () const
 复制出一个新对象 更多...
 
virtual void copy (const MgObject &src)
 复制对象数据 更多...
 
virtual void release ()
 释放引用计数,为0时销毁对象 更多...
 
virtual void addRef ()
 添加引用计数 更多...
 
virtual bool equals (const MgObject &src) const
 比较与另一同类对象是否相同 更多...
 
virtual int getType () const
 返回对象类型 更多...
 
virtual bool isKindOf (int type) const
 返回是否能转化为指定类型的对象,即本类为指定类或其派生类 更多...
 
- Public 成员函数 继承自 MgObject
MgObject & operator= (const MgObject &src)
 
bool operator== (const MgObject &src) const
 
bool operator!= (const MgObject &src) const
 

静态 Public 成员函数

static int Type ()
 返回本对象的类型 更多...
 
static MgShapes * create (MgObject *owner=(MgObject *) 0, int index=-1)
 创建图形列表 更多...
 
static const MgShape * getParentShape (const MgShape *shape)
 得到上一级图形对象,或NULL 更多...
 
static MgShapes * fromHandle (long h)
 转为对象 更多...
 
- 静态 Public 成员函数 继承自 MgObject
template<class T >
static void release_pointer (T *&p)
 

Protected 成员函数

 MgShapes (MgObject *owner, int index)
 
virtual ~MgShapes ()
 
virtual bool saveExtra (MgStorage *s) const
 
virtual bool loadExtra (MgStorage *s)
 
- Protected 成员函数 继承自 MgObject
virtual ~MgObject ()
 

Protected 属性

I * im
 

详细描述

图形列表类

参见
MgShapeIterator

该类的文档由以下文件生成:

通用矢量图形框架, 版权所有 (C) 张云贵 2004-2017,BSD 开源许可证