Esempio n. 1
0
 public void SetPosition(UnitPoint postion)
 {
     if (this.nodeType == MultiSegementNodeType.CommonNode)
     {
         this.clone.Points[this.nodeIndex] = new UnitPointBulge(postion, this.clone.Points[this.nodeIndex].Bulge);
         //if (this.owner.IsCloseFigure)
         //{
         //    this.clone.Points[this.clone.Points.Count - 1] = this.clone.Points[0];
         //}
     }
     else
     {
         int index = this.nodeIndex + 1;
         if (this.nodeIndex + 1 > this.owner.PointCount - 1)
         {
             index = 0;
         }
         ArcModelMini arcModel = HitUtil.GetArcParametersFromThreePoints(this.clone.Points[this.nodeIndex].Point, postion, this.clone.Points[index].Point);
         float        angle    = Math.Abs(arcModel.SweepAngle) / 4;
         double       bulge    = Math.Tan(angle * Math.PI / 180);
         bulge = arcModel.Clockwise ? -bulge : bulge;
         this.clone.Points[this.nodeIndex] = new UnitPointBulge(this.clone.Points[this.nodeIndex].Point, bulge);
     }
 }