天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 50|回复: 0

ObjectARX自定义实体

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
AcDbEntity 是所有具有图形表现的数据库对象的基类。它由AcDbObject派生。创建自定义实体包括以下步骤:

1.从AcDbEntity派生一个自定义类;

2.重载所有必要的AcDbObject函数;

3.重载要求的AcDbEntity函数;

4.重载支持自定义功能的其它函数;

5.如果要支持MATCHPROP命令,执行AcDbMatchProperties作为扩展协议;

6.如果要为自定义实体创建拖曳序列,执行自定义的AcEdJig。



(1)必须重载的AcDbEntity函数

当从AcDbEntity派生自定义类时,下述函数必须重载:

virtual Adesk::Boolean worldDraw(AcGiWorldDraw* mode);

virtual Acad::ErrorStatus getGeomExtents(AcDbExtents& extents)const;

virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);

virtual Acad::ErrorStatus getTransformedCopy(const AcGeMatrix3d& xform,AcDbEntity*& ent)const;

virtual Acad::ErrorStatus getGripPoint,AcDbIntArray& osnapModes,AcDbIntArray& getomIds)const;

virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);

(2)通常需要重载的AcDbEntity函数

当从AcDbEntity派生自定义类时,下述函数通常需要重载,是否重载它们取决于自定义类的功能。

virtual void viewportDraw(AcGiViewportDraw* mode);

virtual void list() const;

vitual Acad::ErrorStatus intersectWith(const AcDbEntity* ent,AcDb::Intersect intType,AcGePoint3dArray& points,int thisGsMarker=0,int otherGsMarker=0)const;

virtual Acad::ErrorStatus intersectWith(const AcDbEntity* ent,AcDb::Intersect intType,const AcGePlane& projPlane,AcGePoint3dArray& points,int thisGsMarker=0,int otherGsMarker=0)const;

vitual Acad::ErrorStatus getOsnapPoints(AcDb::OsnapMode osnapMode,int gsSelectionMark,const AcGePoint3d& pickPoint,const AcGePoint3d& lastPoint,const AcGeMatrixed& viewXform,AcGePoint3dArray& snapPoints,AcDbIntArray& geomIds)const;

virtual Acad::ErrorStatus getStretchPoints(AcGePoint3dArray&)const;

virtual Acad::ErrorStatus moveStretchPointsAt(const AcDbIntArray& indeces,const AcGeVector3d& offset);

virtual Acad::ErrorStatus explode(AcDbVoidPtrArray& entitySet)const;

virtual Acad::ErrorStatus getSubentPathsAtGsMarker(AcDb::SubentType type,int gsMark,const AcGePoint3d& pickPoint,const AcGeMatrix3d& viewXform,int& numPaths,AcDbFullSubentPaths*& subentPaths,int numInserts=0,AcDbObjectId* entAndInsertStack=NULL)const;

virtual Acad::ErrorStatus applyPartialUndo(AcDbDwgFiler* undoFiler,AcRxClass* classObj);

virtual void subSetDatabaseDefaults(AcDbDatabase* pDb);

virtual void saveAs(AcGiWorldDraw *mode,AcDb::SaveType st);

(3)很少重载的AcDbEntity函数

virtual Acad::ErrorStatus setColor(const AcCmColor &color);

virtual Acad::ErrorStatus setColorIndex(Adesk::UInt16 color);

virtual Acad::ErrorStatus setLinetype(const char* newVal);

virtual Acad::ErrorStatus setLinetype(AcDbObjectId newVal);

virtual void getEcs(AcGeMatrix3d& retVal)const;

virtual Acad::ErrorStatus gerGsMarkersAtSubentPath(const AcDbFullSubentPath& subPath,AcDbIntArray& gsMarkers)const;

virtual Acad::ErrorStatus highlight(const AcDbFullSubentPath& subId=kNullSubent)const;

virtual Acad::ErrorStatus unhighlight(const AcDbFullSubentPath& subId=kNullSubent)const;

virtual AcDbEntity* subentPtr(const AcDbFullSubentPath& id)const;

virtual Adesk::Boolean saveImagesByDefault() const;

virtual void setAttributes(AcGiSubEntityTraits* pTraits);

 

 

 

 

ObjectARX自定义实体
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 13:38 , Processed in 0.123242 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表