lw02nju 发表于 2006-5-19 21:33:00

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

<P>我在arx中自定义了一个类,但在加到数据库的时候发生错误,想问一下是否需要什么注册的操作?是否只能在dbx中写啊?谢谢<BR>头文件</P>
<P>class EObject:public AcDbEntity<BR>{<BR>protected:<BR>&nbsp;char *m_name;<BR>&nbsp;Adesk::Int32 m_ID;<BR>&nbsp;char *m_location;<BR>&nbsp;AcGePoint3d m_center;</P>
<P>public:<BR>&nbsp;EObject();<BR>&nbsp;virtual ~EObject(){}<BR>&nbsp;virtual Adesk::Boolean worldDraw (AcGiWorldDraw *mode);<BR>&nbsp;virtual Acad::ErrorStatus getGeomExtents(AcDbExtents &amp; extents);<BR>&nbsp;virtual Acad::ErrorStatus transformBy(const AcGeFastTransform&amp; xform);<BR>&nbsp;virtual Acad::ErrorStatus getTransformedCopy(const AcGeMatrix3d &amp;xform, AcDbEntity *&amp;pEnt);<BR>&nbsp;virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray &amp; gripPoints,AcDbIntArray &amp;osnapModes,AcDbIntArray &amp; geomIds) const;<BR>&nbsp;virtual&nbsp;Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray &amp;indices,const AcGeVector3d &amp;offset);<BR>cpp文件</P>
<P><BR>&nbsp;</P>

lw02nju 发表于 2006-5-19 21:35:00

<P>&nbsp;EObject::EObject()<BR>&nbsp;{<BR>&nbsp;&nbsp;m_ID = -1;<BR>&nbsp;&nbsp;m_location = m_name = NULL;<BR>&nbsp;&nbsp;m_center = AcGePoint3d::kOrigin;<BR>&nbsp;&nbsp;acutPrintf("1eee\n");<BR>&nbsp;}</P>
<P>&nbsp;Adesk::Boolean EObject::worldDraw(AcGiWorldDraw *mode)<BR>&nbsp;{<BR>&nbsp;&nbsp;return (Adesk::kTrue) ;<BR>&nbsp;}</P>
<P>&nbsp;Acad::ErrorStatus EObject::getGeomExtents(AcDbExtents &amp; extents)<BR>&nbsp;{<BR>&nbsp;&nbsp;return Acad::eOk;<BR>&nbsp;}</P>
<P>&nbsp;Acad::ErrorStatus EObject::transformBy(const AcGeFastTransform&amp; xform)<BR>&nbsp;{<BR>&nbsp;&nbsp; assertWriteEnabled(Adesk::kFalse, Adesk::kFalse);<BR>&nbsp;&nbsp; return Acad::eNotApplicable;<BR>&nbsp;}</P>
<P>&nbsp;Acad::ErrorStatus EObject::getTransformedCopy(const AcGeMatrix3d &amp;xform, AcDbEntity *&amp;pEnt)<BR>&nbsp;{<BR>&nbsp;&nbsp;assertReadEnabled();<BR>&nbsp;&nbsp;Acad::ErrorStatus es = Acad::eOk;<BR>&nbsp;&nbsp;return es;<BR>&nbsp;}</P>
<P>&nbsp;Acad::ErrorStatus EObject::getGripPoints(AcGePoint3dArray &amp; gripPoints,AcDbIntArray &amp;osnapModes,AcDbIntArray &amp; geomIds) const<BR>&nbsp;{<BR>&nbsp;&nbsp;return Acad::eNotImplemented;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;Acad::ErrorStatus EObject::moveGripPointsAt(const AcDbIntArray &amp;indices,const AcGeVector3d &amp;offset)<BR>&nbsp;{<BR>&nbsp;&nbsp;return Acad::eNotImplemented;<BR>&nbsp;}<BR></P>
页: [1]
查看完整版本: 在arx中自定义实体遇到的问题