Пример #1
0
        internal void OnDelaunayTriangleCheck(Adjacency adjacency, int triangle)
        {
            Bitmap img    = new Bitmap(800, 800);
            Random random = new Random();
            float  scale  = 1000.0f;

            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x /= scale;
                adjacency.vertices[j].y /= scale;
            }
            adjacency.ToImage(img);

            Graphics g = Graphics.FromImage(img);

            PointF[] points = new PointF[3];
            for (int i = 0; i < 3; i++)
            {
                Vertex v = adjacency.vertices[adjacency.triangles[triangle].vertices[i]];
                points[i] = new PointF(v.x * img.Width, v.y * img.Height);
            }

            g.FillPolygon(new SolidBrush(Color.FromArgb(random.Next(255), random.Next(255), random.Next(255))), points);


            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x *= scale;
                adjacency.vertices[j].y *= scale;
            }

            QueueDebugImage(img);
        }
Пример #2
0
        internal void OnDelaunayStep(Adjacency adjacency)
        {
            Bitmap bmp   = new Bitmap(800, 800);
            float  scale = 1000.0f;

            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x /= scale;
                adjacency.vertices[j].y /= scale;
            }
            adjacency.ToImage(bmp);
            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x *= scale;
                adjacency.vertices[j].y *= scale;
            }
            QueueDebugImage(bmp);
        }
Пример #3
0
 internal void OnDelaunayStep(Adjacency adjacency)
 {
     Bitmap bmp = new Bitmap(800, 800);
     float scale = 1000.0f;
     for (int j = 0; j < adjacency.vertices.Count; j++)
     {
         adjacency.vertices[j].x /= scale;
         adjacency.vertices[j].y /= scale;
     }
     adjacency.ToImage(bmp);
     for (int j = 0; j < adjacency.vertices.Count; j++)
     {
         adjacency.vertices[j].x *= scale;
         adjacency.vertices[j].y *= scale;
     }
     QueueDebugImage(bmp);
 }
Пример #4
0
        internal void OnDelaunayTriangleCheck(Adjacency adjacency, int triangle)
        {
            Bitmap img = new Bitmap(800,800);
            Random random = new Random();
            float scale = 1000.0f;
            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x /= scale;
                adjacency.vertices[j].y /= scale;
            }
            adjacency.ToImage(img);

            Graphics g = Graphics.FromImage(img);
            PointF[] points = new PointF[3];
            for (int i = 0; i < 3; i++)
            {
                Vertex v = adjacency.vertices[adjacency.triangles[triangle].vertices[i]];
                points[i] = new PointF(v.x * img.Width, v.y * img.Height);
            }

            g.FillPolygon(new SolidBrush(Color.FromArgb(random.Next(255), random.Next(255), random.Next(255))), points);

            for (int j = 0; j < adjacency.vertices.Count; j++)
            {
                adjacency.vertices[j].x *= scale;
                adjacency.vertices[j].y *= scale;
            }

            QueueDebugImage(img);
        }