Click here to Skip to main content
15,881,424 members
Articles / Desktop Programming / Windows Forms

Visualization of the 2D Voronoi Diagram and the Delaunay Triangulation

Rate me:
Please Sign up or sign in to vote.
4.64/5 (17 votes)
18 Nov 2008CPOL 90.6K   3.4K   38  
An add-on for the Fortune's algorithm.
using System;
using System.Collections;

namespace Voronoi.Data
{
	/// <summary>
	/// Summary description for Hashset.
	/// </summary>
	public class HashSet : IEnumerable, ICollection
	{
		Hashtable H = new Hashtable();
		object Dummy = new object();
		public HashSet(){}
		public void Add(object O)
		{
			H[O] = Dummy;
		}
		public void AddRange(IEnumerable List)
		{
			foreach(object O in List)
				Add(O);
		}
		public void Remove(object O)
		{
			H.Remove(O);
		}
		public bool Contains(object O)
		{
			return H.ContainsKey(O);
		}
		public void Clear()
		{
			H.Clear();
		}
		public IEnumerator GetEnumerator()
		{
			return H.Keys.GetEnumerator();
		}
		public int Count
		{
			get
			{
				return H.Count;
			}
		}

		public bool IsSynchronized
		{
			get
			{
				return H.IsSynchronized;
			}
		}

		public void CopyTo(Array array, int index)
		{
			H.Keys.CopyTo(array,index);
		}

		public object SyncRoot
		{
			get
			{
				return H.SyncRoot;
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Russian Federation Russian Federation
Hello! My name is Maxim Subbotin.

Now I work in sphere of web-development. I'm interesting researches in SEO field.
If you interesting, you can see this tool:

KeywordCompetitor

Comments and Discussions