Пример #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;
                    }
                }
            }
        }
Пример #2
0
        private void DrawLongitudeLine(Graphics g, double longitude, GCMap map, Rectangle mapArea)
        {
            int ax0 = map.LongitudeToX(longitude, ref mapArea);

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