明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1418|回复: 1

在arx中自定义实体遇到的问题

[复制链接]
发表于 2006-5-19 21:33:00 | 显示全部楼层 |阅读模式

我在arx中自定义了一个类,但在加到数据库的时候发生错误,想问一下是否需要什么注册的操作?是否只能在dbx中写啊?谢谢
头文件

class EObject:public AcDbEntity
{
protected:
 char *m_name;
 Adesk::Int32 m_ID;
 char *m_location;
 AcGePoint3d m_center;

public:
 EObject();
 virtual ~EObject(){}
 virtual Adesk::Boolean worldDraw (AcGiWorldDraw *mode);
 virtual Acad::ErrorStatus getGeomExtents(AcDbExtents & extents);
 virtual Acad::ErrorStatus transformBy(const AcGeFastTransform& xform);
 virtual Acad::ErrorStatus getTransformedCopy(const AcGeMatrix3d &xform, AcDbEntity *&pEnt);
 virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray & gripPoints,AcDbIntArray &osnapModes,AcDbIntArray & geomIds) const;
 virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray &indices,const AcGeVector3d &offset);
cpp文件


 

 楼主| 发表于 2006-5-19 21:35:00 | 显示全部楼层

 EObject::EObject()
 {
  m_ID = -1;
  m_location = m_name = NULL;
  m_center = AcGePoint3d::kOrigin;
  acutPrintf("1eee\n");
 }

 Adesk::Boolean EObject::worldDraw(AcGiWorldDraw *mode)
 {
  return (Adesk::kTrue) ;
 }

 Acad::ErrorStatus EObject::getGeomExtents(AcDbExtents & extents)
 {
  return Acad::eOk;
 }

 Acad::ErrorStatus EObject::transformBy(const AcGeFastTransform& xform)
 {
   assertWriteEnabled(Adesk::kFalse, Adesk::kFalse);
   return Acad::eNotApplicable;
 }

 Acad::ErrorStatus EObject::getTransformedCopy(const AcGeMatrix3d &xform, AcDbEntity *&pEnt)
 {
  assertReadEnabled();
  Acad::ErrorStatus es = Acad::eOk;
  return es;
 }

 Acad::ErrorStatus EObject::getGripPoints(AcGePoint3dArray & gripPoints,AcDbIntArray &osnapModes,AcDbIntArray & geomIds) const
 {
  return Acad::eNotImplemented;
 }
   
 Acad::ErrorStatus EObject::moveGripPointsAt(const AcDbIntArray &indices,const AcGeVector3d &offset)
 {
  return Acad::eNotImplemented;
 }

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-29 16:46 , Processed in 0.171372 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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