Exemplo n.º 1
0
        private void DrawQuandrantOverlay(Graphics g, GCMap map, Rectangle mapArea, QuadrantArray qa)
        {
            for (int x = 0; x < qa.Quadrants.GetLength(0); x++)
            {
                for (int y = 0; y < qa.Quadrants.GetLength(1); y++)
                {
                    double longitude  = qa.Longitudes[x];
                    double latitude   = qa.Latitudes[y];
                    double longitude2 = qa.Longitudes[x + 1];
                    double latitude2  = qa.Latitudes[y + 1];

                    int x0, y0, x1, y1;

                    x0 = map.LongitudeToX(longitude, ref mapArea);
                    y0 = map.LatitudeToY(latitude, ref mapArea);
                    x1 = map.LongitudeToX(longitude2, ref mapArea);
                    y1 = map.LatitudeToY(latitude2, ref mapArea);

                    Quadrant q = qa.Quadrants[x, y];

                    //g.DrawString(q.ResultState.ToString(), SystemFonts.MenuFont, Brushes.Black, (x0 + x1) / 2, (y0 + y1) / 2);
                    switch (q.ResultState)
                    {
                    case QuadrantResultState.Consistent:
                        Color c = q.WS.Result.color;
                        g.FillRectangle(getBrush(c), x0, y1, x1 - x0, y0 - y1);
                        break;

                    case QuadrantResultState.Inconsistent:
                        if (q.Details != null)
                        {
                            DrawQuandrantOverlay(g, map, mapArea, q.Details);
                        }
                        break;

                    case QuadrantResultState.Decomposable:
                        if (q.Details != null)
                        {
                            DrawQuandrantOverlay(g, map, mapArea, q.Details);
                        }
                        break;

                    case QuadrantResultState.NotAvailable:
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void DrawLatitudeLine(Graphics g, double latitude, GCMap map, Rectangle mapArea)
        {
            int ay0 = map.LatitudeToY(latitude, ref mapArea);

            if (ay0 > mapArea.Top && ay0 < mapArea.Bottom)
            {
                g.DrawLine(Pens.Red, mapArea.Left, ay0, mapArea.Right, ay0);
            }
        }