示例#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));
 }