badboy518 发表于 2006-3-4 21:52:00

pglyxq 朋友,重载捕捉函数出错,帮看看

<P>重载捕捉函数出错</P>
<P>AcGePoint3d CMARectWindow::startPt()<BR>{</P>
<P>&nbsp;assertReadEnabled();<BR>&nbsp;return m_startPt;<BR>}</P>
<P>Acad::ErrorStatus CMARectWindow::getOsnapPoints(AcDb::OsnapMode osnapMode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int gsSelectionMark,const AcGePoint3d&amp; pickPoint,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const AcGePoint3d&amp; lastPoint,const AcGeMatrix3d&amp; viewXform,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AcGePoint3dArray&amp; snapPoints,AcDbIntArray&amp; geomIds) const<BR>{<BR>&nbsp;assertReadEnabled();</P>

<P>&nbsp;Acad::ErrorStatus es=Acad::eOk ;<BR>&nbsp;if (gsSelectionMark == 0)&nbsp;return es;<BR>&nbsp;if (osnapMode != AcDb::kOsModeIns)&nbsp;return es;</P>
<P>&nbsp;AcGePoint3d pt;&nbsp; //插入点</P>
<P>&nbsp;pt = startPt();&nbsp;&nbsp;&nbsp;&nbsp; //这里出错了,信息如下<BR>&nbsp;snapPoints.append( pt );</P>
<P>&nbsp;<BR>&nbsp;return es;</P>
<P><BR>}</P>
<P>你在worldDraw里是这样 pt = startPt()&nbsp;&nbsp;&nbsp; 调用点的,为什么在这里调用会出错?</P>
<P>error C2662: “CMARectWindow::startPt” : 不能将“this”指针从“const CMARectWindow”转换为“CMARectWindow &amp;</P>

pglyxq 发表于 2006-3-6 19:17:00

badboy518 发表于 2006-3-9 20:52:00

<P>谢谢你。问题已解决。现在正试图移动夹点,但是没有成功。附上代码,有空帮看看。</P>
<P>Acad::ErrorStatus CMARectWindow::moveGripPoints(const AcDbIntArray&amp; indices,const AcGeVector3d&amp; offset)<BR>{<BR>&nbsp;assertWriteEnabled();<BR>&nbsp;AcGeVector3d off(offset);<BR>&nbsp;switch(indices)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;case 1:<BR>&nbsp;&nbsp;&nbsp;m_startPt.x +=off.x;<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;default:<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;}<BR>&nbsp;return Acad::eOk;<BR>&nbsp;}&nbsp; <BR></P>

pglyxq 发表于 2006-3-9 22:09:00

页: [1]
查看完整版本: pglyxq 朋友,重载捕捉函数出错,帮看看