都重载了,代码如下,调试发现问题出现在倒数第二个if,谢了 Acad::ErrorStatus TyIcDbSectViewSym::moveGripPointsAt (const AcDbIntArray &indices, const AcGeVector3d &offset) { assertWriteEnabled () ; //----- This method is never called unless you return eNotImplemented //----- from the new moveGripPointsAt() method below (which is the default implementation) for(int i=0; i<indices.length(); ++i) { int index = indices.at(i); if (index == 0) { view_name_pnt += offset; break; } if (index == 1) { AcGePoint3d tempnt = ori_dir_pnt + offset; AcGeVector3d ver = ori_dir_pnt - m_pnts[0]; AcGeVector3d ofs_ver = tempnt - m_pnts[0]; if (ver.angleTo(ofs_ver) > 0.5 * PI) { AcGeVector3d tempvec = m_pnts[0] - ori_dir_pnt; ori_dir_pnt = m_pnts[0] + tempvec; } break; } if (index == 2) { AcGePoint3d tempnt = end_dir_pnt + offset; AcGeVector3d ver = end_dir_pnt - m_pnts[m_pnts_num - 1]; AcGeVector3d ofs_ver = tempnt - m_pnts[m_pnts_num - 1]; if (ver.angleTo(ofs_ver) > 0.5 * PI) { AcGeVector3d tempvec = m_pnts[m_pnts_num - 1] - end_dir_pnt; end_dir_pnt = m_pnts[m_pnts_num - 1] + tempvec; } break; } if ((2 < index) && (index < m_pnts_num + 3)) { m_pnts[index - 3] += offset; loca_pnts[index -3] += offset; if (index == 3 || index == 4 || index == m_pnts_num + 1 || index == m_pnts_num +2) { AcGeVector3d odir_vec(m_pnts[1] - m_pnts[0]); AcGeVector3d oarr_vec(ori_dir_pnt - m_pnts[0]); if (!oarr_vec.isPerpendicularTo(odir_vec) || (oarr_vec.length() != LineLength)) { AcGePlane oplane(m_pnts[0], odir_vec); AcGePoint3d otempnt(ori_dir_pnt.orthoProject(oplane)); AcGeVector3d otem_vec = otempnt - m_pnts[0]; ori_dir_pnt = m_pnts[0] + LineLength * otem_vec.normalize(); } AcGeVector3d edir_vec(m_pnts[m_pnts_num - 2] - m_pnts[m_pnts_num -1]); AcGeVector3d earr_vec(end_dir_pnt - m_pnts[m_pnts_num -1]); if (!earr_vec.isPerpendicularTo(edir_vec) || (earr_vec.length() != LineLength)) { AcGePlane eplane(m_pnts[m_pnts_num -1], edir_vec); AcGePoint3d etempnt(end_dir_pnt.orthoProject(eplane)); AcGeVector3d etem_vec = etempnt - m_pnts[m_pnts_num -1]; ori_dir_pnt = m_pnts[m_pnts_num -1] + LineLength * etem_vec.normalize(); } } break; } if ((m_pnts_num + 2 < index) && (index < 2 * m_pnts_num + 3)) { loca_pnts[index - m_pnts_num - 3] += offset; break; } } return Acad::eOk; //return (AcDbEntity::moveGripPointsAt (indices, offset)) ; } |