private void Center(Coord2D middle) { Coord2D average = AverageCoordinate(); double deltaX = middle.X - average.X; double deltaY = middle.Y - average.Y; Corners.ForEach(c => c.Add(deltaX, deltaY)); }
private void DrawLine(Graphics graafix, Coord2D other) { if (!other.Hidden) { Pen pen = new Pen(Brushes.Red, 5); graafix.DrawLine(pen, (int)X, (int)Y, (int)other.X, (int)other.Y); } }
public Cube2D(Cube3D cube3d) { Corners = new List <Coord2D>(); foreach (Coord3D coord3D in cube3d.Corners) { Coord2D coord2D = coord3D.ProjectTo2d(); Corners.Add(coord2D); } }
public void Draw(Graphics graafix, Coord2D middle, double canvasHeight) { double averageY = AverageCoordinate().Y; Corners.ForEach(c => c.MirrorY(averageY)); Cube2D cube2D = ProjectTo2D(); cube2D.Draw(graafix, middle); }
private bool Connected(Coord2D other) { if (UtilString.NumberOfCharactersEqual(Code, other.Code) == 2) { return(true); } else { return(false); } }
public void Draw(Graphics graafix, Coord2D middle) { Center(middle); Corners.ForEach(c => c.Draw(graafix, Corners)); }