pglyxq 朋友,重载捕捉函数出错,帮看看
<P>重载捕捉函数出错</P><P>AcGePoint3d CMARectWindow::startPt()<BR>{</P>
<P> assertReadEnabled();<BR> return m_startPt;<BR>}</P>
<P>Acad::ErrorStatus CMARectWindow::getOsnapPoints(AcDb::OsnapMode osnapMode,<BR> int gsSelectionMark,const AcGePoint3d& pickPoint,<BR> const AcGePoint3d& lastPoint,const AcGeMatrix3d& viewXform,<BR> AcGePoint3dArray& snapPoints,AcDbIntArray& geomIds) const<BR>{<BR> assertReadEnabled();</P>
<P> Acad::ErrorStatus es=Acad::eOk ;<BR> if (gsSelectionMark == 0) return es;<BR> if (osnapMode != AcDb::kOsModeIns) return es;</P>
<P> AcGePoint3d pt; //插入点</P>
<P> pt = startPt(); //这里出错了,信息如下<BR> snapPoints.append( pt );</P>
<P> <BR> return es;</P>
<P><BR>}</P>
<P>你在worldDraw里是这样 pt = startPt() 调用点的,为什么在这里调用会出错?</P>
<P>error C2662: “CMARectWindow::startPt” : 不能将“this”指针从“const CMARectWindow”转换为“CMARectWindow &</P> <P>谢谢你。问题已解决。现在正试图移动夹点,但是没有成功。附上代码,有空帮看看。</P>
<P>Acad::ErrorStatus CMARectWindow::moveGripPoints(const AcDbIntArray& indices,const AcGeVector3d& offset)<BR>{<BR> assertWriteEnabled();<BR> AcGeVector3d off(offset);<BR> switch(indices)<BR> {<BR> case 1:<BR> m_startPt.x +=off.x;<BR> break;<BR> default:<BR> break;<BR> }<BR> return Acad::eOk;<BR> } <BR></P>
页:
[1]