Click here to Skip to main content
15,892,298 members
Articles / Programming Languages / C#

Fortune's Voronoi algorithm implemented in C#

Rate me:
Please Sign up or sign in to vote.
2.95/5 (31 votes)
21 Apr 2013MPL2 min read 454.4K   3.4K   51  
A C# implementation of the Fortune algorithm to compute 2D Voronoi graphs.
  • source-archive.zip
    • fortune-voronoi
      • .git
        • branches
        • config
        • description
        • HEAD
        • hooks
          • applypatch-msg.sample
          • commit-msg.sample
          • post-update.sample
          • pre-applypatch.sample
          • pre-commit.sample
          • prepare-commit-msg.sample
          • pre-rebase.sample
          • update.sample
        • index
        • info
          • exclude
        • logs
          • HEAD
          • refs
            • heads
              • master
            • remotes
              • origin
                • HEAD
        • objects
          • 04
            • 530015d0564bf304a0b7fe19d95b0a489f65fe
          • 24
            • 654bda1559bdd90ca990f315bcb298f6bd1e40
          • 47
            • ae08f783fe856a4fc43f71b43f71da6167de15
          • 5c
            • ac7895dbb13ecede504ad7280b98efce956591
          • 64
            • 61d69f6d3328e9eccd1d96df29a63c01880554
          • 8c
            • ec5ff2e4a7fbae75bf3f6b1f83b89c619eec7d
          • 98
            • aea5ed8616c683fefd3df2c2d29f314a8b43c4
          • a9
            • 05397e1799f9bbb173eaad4583c84e255f6c63
          • b0
            • c9f21e9aa33884906b175fedf6e228db9863a5
          • e0
            • 47aeb3f359f754d9d528d2ead9db3f184253d6
          • e2
            • 4fc84408e23734a97c87406ce0363854045235
          • e3
            • d94b3da9c5abe2a5b696a1651756e430febea7
          • e5
            • d67989a2a6f73994de6e2efdc35ca7888ae442
          • eb
            • c68bf67536f96ff4f392a74fb483de27cdb4ae
          • info
          • pack
        • packed-refs
        • refs
          • heads
            • master
          • remotes
            • origin
              • HEAD
          • tags
      • FortuneVoronoi.0.1.zip
      • FortuneVoronoi
  • FortuneVoronoi.zip
using System;
using System.Collections;

namespace BenTools.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 Mozilla Public License 1.1 (MPL 1.1)


Written By
Software Developer (Senior)
Germany Germany
I did my diploma in Dresden and Sydney where I dealt with algorithms, agents and other cool AI stuff. Now I moved to Frankfurt to work on my PhD dealing with software structures for artificial intelligence systems. If I can, I do things in C# and ASP.NET, but if I have to, my C++, Java and SQL are not that bad.
Long Live .NET.

Comments and Discussions