- 积分
- 230
- 明经币
- 个
- 注册时间
- 2005-4-3
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
请教一下从AcDbLine派生时需要重载哪些函数? 可以派生出来的,但好象有些函数不能用,比如TRIM EXTEND等,请大家讨论一下还有哪些函数需要重载? 以下是代码: #include "aced.h" #include "adslib.h" #include "dbsymtb.h" #include "acgi.h" #include "dbapserv.h" #include "dbents.h"
class myline: public AcDbLine { public: ACRX_DECLARE_MEMBERS(myline); myline(); ~myline(); };
ACRX_DXF_DEFINE_MEMBERS(myline,AcDbEntity, AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent, 0x5,\ myline,myline);
myline::myline() { } myline::~myline() { }
void addmyline() { ads_point pt1,pt2; if ((ads_getpoint(NULL,"\nStart point:",pt1))!=RTNORM) return; if ((ads_getpoint(pt1,"\nEnd point:",pt2))!=RTNORM) return;
AcGePoint3d pt11,pt21; pt11.set(pt1[X],pt1[Y],pt1[Z]); pt21.set(pt2[X],pt2[Y],pt2[Z]);
myline *pNewObj = new myline; pNewObj->setStartPoint(pt11); pNewObj->setEndPoint(pt21);
AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlock; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlock, AcDb::kForWrite);
AcDbObjectId objId; pBlock->appendAcDbEntity(objId, pNewObj);
pBlockTable->close(); pBlock->close(); pNewObj->close(); }
void initapp() { myline::rxInit(); acrxBuildClassHierarchy();
acedRegCmds->addCommand("qx", "qq", "qq", ACRX_CMD_TRANSPARENT, addmyline); }
extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* appId) { switch (msg) { case AcRx::kInitAppMsg: acrxDynamicLinker->unlockApplication(appId); acrxDynamicLinker->registerAppMDIAware(appId); initapp(); break; case AcRx::kUnloadAppMsg: acedRegCmds->removeGroup("qx"); deleteAcRxClass(myline::desc()); } return AcRx::kRetOK; } |
|