Ejemplo n.º 1
0
        // tegner ruten fra Diagram A til B på pilene
        private void setPath()
        {
            string temp = "M";

            for (int i = 0; i < pathObjects.Count; i++)
            {
                temp += " " + pathObjects.ElementAt(i).X + "," + pathObjects.ElementAt(i).Y;
            }
            Path = temp;
        }
Ejemplo n.º 2
0
        private void setArrow()
        {
            string temp = "";

            if (!Type.Equals(EArrows.NORMAL) && pathObjects.Count != 0)
            {
                for (int i = 0; i < thisArrow.Count; i++)
                {
                    temp += " " + (pathObjects.ElementAt(pathObjects.Count - 1).X + rotatingArrow.ElementAt(i).X) +
                            "," + (pathObjects.ElementAt(pathObjects.Count - 1).Y + rotatingArrow.ElementAt(i).Y);
                }
                Arrow = temp;
            }
        }
Ejemplo n.º 3
0
 public void rotateArrow()
 {
     if (oldAnchor != newAnchor)
     {
         oldAnchor = newAnchor;
         double          cTheta = Math.Cos(angle * (Math.PI / 180));
         double          sTheta = Math.Sin(angle * (Math.PI / 180));
         PointCollection temp   = new PointCollection();
         for (int i = 0; i < thisArrow.Count; i++)
         {
             double x = (int)((thisArrow.ElementAt(i).X - 0) * cTheta - (thisArrow.ElementAt(i).Y - 0) * sTheta);
             double y = (int)((thisArrow.ElementAt(i).X - 0) * sTheta + (thisArrow.ElementAt(i).Y - 0) * cTheta);
             temp.Add(new Point(x, y));
         }
         rotatingArrow = temp;
     }
 }