Esempio n. 1
0
 public void Reset()
 {
     _mesh      = null;
     Heights    = null;
     Downhill   = null;
     CityRender = null;
 }
Esempio n. 2
0
        private void VisualizeCities(Graphics g, CityRender cityRender, Mesh mesh)
        {
            var cities = cityRender.Cities;
            var n      = cityRender.AreaProperties.NumberOfTerritories;

            var multiplier   = _drawnBitmap.Width;
            var offsetHeight = _drawnBitmap.Height / 2;
            var offsetWidth  = _drawnBitmap.Width / 2;

            using (var brush = new SolidBrush(Color.White))
            {
                using (var pen = new Pen(Color.Black, 5))
                {
                    for (int i = 0; i < cities.Count; i++)
                    {
                        var city  = cities[i];
                        var vxs   = mesh.Vxs[city];
                        var r     = i >= n ? 10 : 25;
                        var halfr = r / 2f;
                        g.FillEllipse(brush, (float)((vxs.X * multiplier) + offsetWidth) - halfr, (float)((vxs.Y * multiplier) + offsetHeight) - halfr, r, r);
                        g.DrawEllipse(pen, (float)((vxs.X * multiplier) + offsetWidth) - halfr, (float)((vxs.Y * multiplier) + offsetHeight) - halfr, r, r);
                    }
                }
            }
        }