コード例 #1
0
        public Voronoi(List <Vector2> points, List <uint> colors, List <float> weights, Rect plotBounds)
        {
            _plotBounds             = plotBounds;
            min_weight              = 3.40282347E+38f;
            max_weight              = -3.40282347E+38f;
            _sites                  = new SiteList();
            _sitesIndexedByLocation = new Dictionary <Vector2, Site>();
            _triangles              = new List <Triangle>();
            _edges                  = new List <Edge>();
            AddSites(points, colors, weights);
            float num = max_weight - min_weight;

            if (num > 0f)
            {
                _sites.ScaleWeight(1f + num);
            }
            FortunesAlgorithm();
        }