图元的拉伸点集通常是其夹点的子集。当用户调用 STRETCH 命令时,该函数用于返回为所选实体定义的拉伸点。对于许多实体,抓握模式和拉伸模式是相同的。函数和函数的实现是调用你的函数。getStretchPoints()AcDbEntity::getStretchPoints()AcDbEntity::moveStretchPointsAt()subGetGripPoints() subMoveGripPointsAt() 拉伸函数的签名为 virtual Acad::ErrorStatus AcDbEntity::subGetStretchPoints( AcGePoint3dArray& stretchPoints) const; virtual Acad::ErrorStatus AcDbEntity::subMoveStretchPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset); 您不需要覆盖 和 的函数;它们默认为与函数。subGetStretchPoints()subMoveStretchPointsAt()AcDbEntitygetGripPoints()transformBy() 自定义类将重写这些函数,如本节中的示例所示。该函数返回多边形的顶点,但不返回中心。该函数检查是否已选择所有拉伸点。如果有,它会调用函数。否则,它将调用函数。AsdkPolysubGetStretchPoints()subMoveStretchPointsAt()transformBy()moveGripPointsAt() // Stretch points are the same as grip points except // for the center of the polygon. // Acad::ErrorStatus AsdkPoly::subGetStretchPoints( AcGePoint3dArray& stretchPoints) const { assertReadEnabled(); Acad::ErrorStatus es; if ((es = getVertices3d(stretchPoints)) != Acad::eOk) { return es; } // Remove the duplicate point at the start and end. // stretchPoints.removeAt(stretchPoints.length() - 1); return es; } Acad::ErrorStatus AsdkPoly::subMoveStretchPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset) { return moveGripPointsAt(indices, offset); } |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:04
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.