- UID
- 317852
- 积分
- 103
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-9-3
- 最后登录
- 1970-1-1
|
发表于 2006-1-14 16:18:24
|
显示全部楼层
Acad::ErrorStatus
CRdsBiaoZhu::moveGripPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset)
{
if(indices.length()==0||offset.isZeroLength())
return Acad::eOk;
assertWriteEnabled();
if(indices.length()>1||indices[0]==0)
{
return transformBy(AcGeMatrix3d::translation(offset));
}
AcGeVector3d off(offset);
AcGeLine3d line(mStartPoint,mStartVect);
AcGePoint3d tempPt;
double len;
switch(indices[0])
{
case 1:
tempPt=mInsertPoint;
tempPt+=off;
if(!(line.isOn(tempPt))) //拐点移动后在原直线上
{
len=mStartPoint.distanceTo(tempPt);
if(len>=5)
{
mLength2=len;
mInsertPoint=tempPt;
}
}
else //拐点移动后不在原直线上
{
tempPt=line.closestPointTo(tempPt);//实体折线拐点
mLength2=mStartPoint.distanceTo(tempPt);
mInsertPoint=tempPt;
}
mText1InsPoint.set(mInsertPoint.x-mTextHeight*0.5,mInsertPoint.y+mTextHeight,mInsertPoint.z);
mText2InsPoint.set(mInsertPoint.x+mTextHeight*1.5,mInsertPoint.y+mTextHeight,mInsertPoint.z);
break;
case 2:
tempPt=mInsertPoint+mLength*mStartVect;
tempPt+=off;
line.set(mInsertPoint,mStartVect);
if(!(line.isOn(tempPt))) //拐点移动后在原直线上
{
mLength=mInsertPoint.distanceTo(tempPt);
}
else //拐点移动后不在原直线上
{
tempPt=line.closestPointTo(tempPt);//实体折线拐点
mLength=mInsertPoint.distanceTo(tempPt);
}
break;
}
return Acad::eOk;
}; |
|