Esempio n. 1
0
        private PolygonExtended GetRobotGhostPolygon()
        {
            PolygonExtended polygonToDisplay = new PolygonExtended();

            foreach (var pt in ghostShape.polygon.Points)
            {
                Point polyPt = new Point(pt.X * Math.Cos(ghostLocation.Theta) - pt.Y * Math.Sin(ghostLocation.Theta), pt.X * Math.Sin(ghostLocation.Theta) + pt.Y * Math.Cos(ghostLocation.Theta));
                polyPt.X += ghostLocation.X;
                polyPt.Y += ghostLocation.Y;
                polygonToDisplay.polygon.Points.Add(polyPt);
                polygonToDisplay.backgroundColor = ghostShape.backgroundColor;
                polygonToDisplay.borderColor     = ghostShape.borderColor;
                polygonToDisplay.borderWidth     = ghostShape.borderWidth;
            }
            return(polygonToDisplay);
        }
 public void SetGhostShape(PolygonExtended rbtShape)
 {
     ghostShape = rbtShape;
 }
 public void SetRobotShape(PolygonExtended rbtShape)
 {
     robotShape = rbtShape;
 }
 public void AddOrUpdatePolygonExtended(int id, PolygonExtended p)
 {
     polygonList.AddOrUpdate(id, p, (key, value) => p);
 }