Example #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();
		}
Example #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();
        }
Example #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();
        }
Example #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);
     }
 }
Example #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();
        }
Example #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;
		}
Example #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;
        }
Example #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;
        }