自定义实体制作中出现 的问题
<P><FONT face=宋体 size=2>我从AcDbEntity派生了一个子类AzhtEntity,然后又从AzhtEntity派生AzhtBreaker,如下:一些必须的重载函数还有些返回值都已省略,<BR>AzhtEntity中:<BR>class AzhtEntity:public AcDbEntity<BR>{<BR>public:<BR>ACRX_DECLARE_MEMBERS(AzhtEntity);<BR>AzhtEntity();<BR>virtual ~AzhtEntity();<BR>.....................................<BR>.....................................<BR>..................moveGripPointsAt()..........<BR>..................getGripPoints()................<BR>..................transformBy()..................<BR>.........................................................<BR>........................................................<BR>private:<BR>AcGePoint3d m_insertPt; //插入点<BR>};<BR><BR>AzhtEntity::getGripPoints(AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds) const<BR>{<BR>assertReadEnabled();<BR>gripPoints.append(m_insertPt);<BR>return Acad::eOk;<BR>}<BR><BR>AzhtEntity::moveGripPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset)<BR>{<BR>assertWriteEnabled();<BR>return Acad::eOk;<BR>}<BR><BR>AzhtEntity::transformBy(const AcGeMatrix3d& xform)<BR>{<BR>assertWriteEnabled();<BR>return Acad::eOk;<BR>}<BR>AzhtBreaker中:<BR>class AzhtBreaker:public AzhtEntity<BR>{<BR>public:<BR>ACRX_DECLARE_MEMBERS(AzhtBreaker);<BR>AzhtBreaker();<BR>virtual ~AzhtBreaker();<BR>.....................................<BR>.....................................<BR>..................moveGripPointsAt()..........<BR>..................getGripPoints()................<BR>..................transformBy()..................<BR>.........................................................<BR>........................................................<BR>private:<BR>AcGePoint3d m_otherPt; //插入点<BR>};<BR>AzhtBreaker::getGripPoints(AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds) const<BR>{<BR>assertReadEnabled();<BR>int iDirection = ((AzhtEntity*)this)->getDirection();<BR>AcGePoint3d insertPt = ((AzhtEntity*)this)->getInsertPt();<BR>gripPoints.append(m_otherPt);<BR>AzhtEntity::getGripPoints(gripPoints, osnapModes, geomIds);<BR>return Acad::eOk;<BR>}<BR><BR>AzhtBreaker::moveGripPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset)<BR>{<BR>assertWriteEnabled();<BR>//若没有选中点或偏移为0<BR>if(indices.length()==0 || offset.isZeroLength())<BR>return Acad::eOk;<BR>return transformBy(AcGeMatrix3d::translation(offset));<BR>}<BR><BR>AzhtBreaker::transformBy(const AcGeMatrix3d& xform)<BR>{<BR>assertWriteEnabled();<BR>AcGePoint3d insertPt = getInsertPt();<BR>insertPt.transformBy(xform);<BR>m_otherPt.transformBy(xform);<BR><BR>return Acad::eOk;<BR>}<BR><BR>我这样做之后,能够得到夹点,但在移动的时候出现问题,说什么内存不足!请高手指教一下,谢谢!!!!!!</FONT></P><P><FONT face=宋体 size=2>在下想知道,在重载这些函数的时候需要有些什么原则和注意的地方吗?</FONT> </P> 看你的worlddraw,估计是那的问题
页:
[1]