示例#1
0
		private void Init(List<Vector2f> points, Rectf plotBounds) {
			sites = new SiteList();
			sitesIndexedByLocation = new Dictionary<Vector2f, Site>();
			AddSites(points);
			this.plotBounds = plotBounds;
			triangles = new List<Triangle>();
			edges = new List<Edge>();
			
			FortunesAlgorithm();
		}
示例#2
0
        private void Init(List <Vector2> points, Rectf plotBounds)
        {
            sites = new SiteList();
            SitesIndexedByLocation = new Dictionary <Vector2, Site>();
            AddSites(points);
            this.plotBounds = plotBounds;
            triangles       = new List <Triangle>();
            Edges           = new List <Edge>();

            FortunesAlgorithm();
        }
示例#3
0
        private void Init(List <Vector2f> points, Rectf plotBounds)
        {
            this.sitelist = new SiteList();
            this.SitesIndexedByLocation = new Dictionary <Vector2f, Site>();
            this.AddSites(points);
            this.PlotBounds = plotBounds;
            this.triangles  = new List <Triangle>();
            this.edges      = new List <Edge>();

            FortunesAlgorithm();
        }
示例#4
0
 public Voronoi(VoronoiManager manager, List <Vector2f> points, Rectf plotBounds, int lloydIterations)
 {
     this.manager      = manager;
     sites             = new SiteList(manager);
     weigthDistributor = new Random();
     Init(points, plotBounds);
     if (lloydIterations > 0)
     {
         LloydRelaxation(lloydIterations);
     }
 }
示例#5
0
        private void Init(List <Vector2f> points, Rectf plotBounds, List <Vector2f> specialPoints)
        {
            sites                  = new SiteList();
            this.plotBounds        = plotBounds;
            sitesIndexedByLocation = new Dictionary <Vector2f, Site>();
            AddSites(points);
            AddSites(specialPoints);
            triangles = new List <SiteTriangle>();
            edges     = new List <Edge>();

            FortunesAlgorithm();
        }
示例#6
0
		public void Dispose() {
			sites.Dispose();
			sites = null;

			foreach (Triangle t in triangles) {
				t.Dispose();
			}
			triangles.Clear();

			foreach (Edge e in edges) {
				e.Dispose();
			}
			edges.Clear();

			plotBounds = Rectf.zero;
			sitesIndexedByLocation.Clear();
			sitesIndexedByLocation = null;
		}
示例#7
0
        public void Dispose()
        {
            sites.Dispose();
            sites = null;

            foreach (Triangle t in triangles)
            {
                t.Dispose();
            }
            triangles.Clear();

            foreach (Edge e in Edges)
            {
                e.Dispose();
            }
            Edges.Clear();

            plotBounds = Rectf.zero;
            SitesIndexedByLocation.Clear();
            SitesIndexedByLocation = null;
        }
示例#8
0
        public void Dispose()
        {
            this.sitelist.Dispose();
            this.sitelist = null;

            foreach (Triangle t in this.triangles)
            {
                t.Dispose();
            }
            this.triangles.Clear();

            foreach (Edge e in this.edges)
            {
                e.Dispose();
            }
            this.edges.Clear();

            this.PlotBounds = Rectf.ZERO;
            this.SitesIndexedByLocation.Clear();
            this.SitesIndexedByLocation = null;
        }