예제 #1
0
        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));
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public Cube2D(Cube3D cube3d)
 {
     Corners = new List <Coord2D>();
     foreach (Coord3D coord3D in cube3d.Corners)
     {
         Coord2D coord2D = coord3D.ProjectTo2d();
         Corners.Add(coord2D);
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
 private bool Connected(Coord2D other)
 {
     if (UtilString.NumberOfCharactersEqual(Code, other.Code) == 2)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #6
0
 public void Draw(Graphics graafix, Coord2D middle)
 {
     Center(middle);
     Corners.ForEach(c => c.Draw(graafix, Corners));
 }