многоугольник просто оттранслирован количеством, равняются
Если пользователь выбрал средний пункт{*точку*} власти{*захвата*}, многоугольник просто оттранслирован количеством, равняются смещению (это значение пропускают к transformBy () функция, как показано здесь).
Acad::ErrorStatus
AsdkPoly::getGripPoints(
AcGePoint3dArray& gripPoints,
AcDbIntArray& osnapModes,
AcDbIntArray& geomIds) const
{
assertReadEnabled();
Acad::ErrorStatus es;
if ((es = getVertices3d(gripPoints)) != Acad::eOk) {
return es;
}
// Remove the duplicate point at the start/end and add
// center as the last point.
//
gripPoints.removeAt(gripPoints.length() - 1);
AcGePoint3d center;
getCenter(center);
gripPoints.append(center);
return es;
}
Acad::ErrorStatus
AsdkPoly::moveGripPointsAt(
const AcDbIntArray& indices,
const AcGeVector3d& offset)
{
if (indices.length()== 0 || offset.isZeroLength())
return Acad::eOk; //that’s easy :-)
if (mDragDataFlags & kCloneMeForDraggingCalled) {
mDragDataFlags &= kUseDragCache;
// We need to make sure that all the poly’s drag data members
// are in sync with the true data members.
//
//mDragCenter = mCenter;
//mDragStartPoint = mStartPoint;
} else
// Only if we’re not dragging do we want to make an undo
// recording and check if the object’s open for write.
//
assertWriteEnabled();
//if there’s more than one hot vertex or there's one and it is
//the center then simply transform.
if (indices.length()>1 || indices[0] == mNumSides)
return transformBy(AcGeMatrix3d::translation(offset));
AcGeVector3d off(offset);
// Calculate the offset vector of the startpoint
// from the offset vector on a vertex.
double rotateBy = 2.0 * 3.14159265358979323846 /
mNumSides * indices[0];
AcGePoint3d cent;
getCenter(cent);
off.transformBy(AcGeMatrix3d::rotation(rotateBy,
normal(),cent));
acdbWcs2Ecs(asDblArray(off),asDblArray(off),
asDblArray(normal()),Adesk::kTrue);
if (mDragDataFlags & kUseDragCache){
mDragStartPoint = mStartPoint + AcGeVector2d(off.x,off.y);
mDragElevation = mElevation + off.z;
} else{
mStartPoint = mStartPoint + AcGeVector2d(off.x,off.y);
mElevation = mElevation + off.z;
}
return Acad::eOk;
}
Содержание Назад Вперед