[讨论]请教一下从AcDbLine派生时需要重载哪些函数?
<FONT face=宋体,verdana,arial,helvetica>请教一下从AcDbLine派生时需要重载哪些函数?</B></FONT> <INPUT class=btn style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体" onclick="text1.style.fontSize='12pt';" type=button value=12号字> <OPTION value="9pt">9pt</OPTION> <OPTION value="10pt" selected>10pt</OPTION> <OPTION value="11pt">11pt</OPTION> <OPTION value="12pt">12pt</OPTION> <OPTION value="13pt">13pt</OPTION> <OPTION value="15pt">15pt</OPTION> <FONT id=text1 style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica"><BR>可以派生出来的,但好象有些函数不能用,比如TRIM EXTEND等,请大家讨论一下还有哪些函数需要重载?<BR>以下是代码:<BR>#include "aced.h"<BR>#include "adslib.h"<BR>#include "dbsymtb.h"<BR>#include "acgi.h"<BR>#include "dbapserv.h"<BR>#include "dbents.h"<BR><BR>class myline: public AcDbLine<BR>{<BR>public:<BR>ACRX_DECLARE_MEMBERS(myline);<BR>myline(); <BR>~myline();<BR>};<BR><BR>ACRX_DXF_DEFINE_MEMBERS(myline,AcDbEntity,<BR>AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent, 0x5,\<BR>myline,myline);<BR><BR>myline::myline()<BR>{<BR>}<BR>myline::~myline()<BR>{<BR>}<BR><BR>void<BR>addmyline()<BR>{<BR>ads_point pt1,pt2;<BR>if ((ads_getpoint(NULL,"\nStart point:",pt1))!=RTNORM)<BR>return;<BR>if ((ads_getpoint(pt1,"\nEnd point:",pt2))!=RTNORM)<BR>return;<BR><BR>AcGePoint3d pt11,pt21;<BR>pt11.set(pt1,pt1,pt1);<BR>pt21.set(pt2,pt2,pt2);<BR><BR>myline *pNewObj = new myline;<BR>pNewObj->setStartPoint(pt11);<BR>pNewObj->setEndPoint(pt21);<BR><BR>AcDbBlockTable *pBlockTable;<BR>acdbHostApplicationServices()->workingDatabase()<BR>->getSymbolTable(pBlockTable, AcDb::kForRead);<BR><BR>AcDbBlockTableRecord *pBlock;<BR>pBlockTable->getAt(ACDB_MODEL_SPACE, pBlock,<BR>AcDb::kForWrite);<BR><BR>AcDbObjectId objId;<BR>pBlock->appendAcDbEntity(objId, pNewObj);<BR><BR>pBlockTable->close();<BR>pBlock->close();<BR>pNewObj->close();<BR>}<BR><BR><BR>void<BR>initapp()<BR>{<BR>myline::rxInit();<BR>acrxBuildClassHierarchy();<BR><BR>acedRegCmds->addCommand("qx",<BR>"qq",<BR>"qq",<BR>ACRX_CMD_TRANSPARENT,<BR>addmyline);<BR>}<BR><BR><BR>extern "C" AcRx::AppRetCode<BR>acrxEntryPoint(AcRx::AppMsgCode msg, void* appId) <BR>{<BR>switch (msg) {<BR>case AcRx::kInitAppMsg:<BR>acrxDynamicLinker->unlockApplication(appId);<BR>acrxDynamicLinker->registerAppMDIAware(appId);<BR>initapp();<BR>break;<BR>case AcRx::kUnloadAppMsg:<BR>acedRegCmds->removeGroup("qx");<BR>deleteAcRxClass(myline::desc());<BR>}<BR>return AcRx::kRetOK;<BR>}</FONT>
页:
[1]