Fixed test failures.

Removed depreciated packages with lots of errors.
diff --git a/plugins/org.eclipse.draw3d.geometry/META-INF/MANIFEST.MF b/plugins/org.eclipse.draw3d.geometry/META-INF/MANIFEST.MF
index 8dd97e4..edd92cc 100644
--- a/plugins/org.eclipse.draw3d.geometry/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.draw3d.geometry/META-INF/MANIFEST.MF
@@ -5,5 +5,4 @@
 Bundle-Version: 0.8.1.qualifier
 Bundle-Vendor: Eclipse.org
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.draw3d.geometry,
- org.eclipse.draw3d.geometry.intersection
+Export-Package: org.eclipse.draw3d.geometry
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math2D.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math2D.java
index 9ba92b1..377056f 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math2D.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math2D.java
@@ -10,7 +10,6 @@
  ******************************************************************************/
 package org.eclipse.draw3d.geometry;
 
-import java.util.Comparator;
 
 /**
  * Math2D There should really be more documentation here.
@@ -21,29 +20,7 @@
  */
 public class Math2D {
 
-	private static class VertexComparator implements Comparator<Integer> {
-
-		private int[] m_vertices;
-
-		public VertexComparator(int[] i_vertices) {
-
-			m_vertices = i_vertices;
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-		 */
-		public int compare(Integer index1, Integer index2) {
-
-			int x1 = m_vertices[2 * index1];
-			int x2 = m_vertices[2 * index2];
-
-			return x1 - x2;
-		}
-
-	}
+	
 
 	private static void checkPoints(int[] i_p, String i_name) {
 
@@ -78,9 +55,7 @@
 		checkPoints(points, "points");
 
 		int n = points.length / 2;
-		if (n > Integer.MAX_VALUE)
-			throw new IllegalArgumentException("array contains too many points");
-
+		
 		int[] sorted = new int[n];
 
 		for (int i = 0; i < n; i++)
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math3DMatrixOps.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math3DMatrixOps.java
index b6884a7..d27d9bd 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math3DMatrixOps.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Math3DMatrixOps.java
@@ -602,7 +602,7 @@
 	}
 
 	/**
-	 * Translates a matrix by a given vector.
+	 * Adds a translation defined by a given vector to a transformation matrix.
 	 * 
 	 * @param i_source the matrix to be translated, in homogeneous coordinates
 	 * @param i_vector the translation vector
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix2fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix2fImpl.java
index ad3fff6..edb8a66 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix2fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix2fImpl.java
@@ -47,7 +47,7 @@
  * @version $Revision$

  * @since Dec 15, 2008

  */

-public class Matrix2fImpl implements Matrix2f, Serializable, Cloneable {

+public final class Matrix2fImpl implements Matrix2f, Serializable, Cloneable {

 	/**

 	 * @see java.io.Serializable

 	 */

@@ -245,6 +245,18 @@
 		Matrix2fImpl sm = cast(i_anotherMatrix2f);

 		return a11 == sm.a11 && a12 == sm.a12 && a21 == sm.a21 && a22 == sm.a22;

 	}

+	

+	/**

+	 * {@inheritDoc}

+	 * 

+	 * @see java.lang.Object#equals(java.lang.Object)

+	 */

+	@Override

+	public boolean equals(Object i_obj) {

+		if (i_obj == null || !(i_obj instanceof IMatrix2f))

+			return false;

+		return equals((IMatrix2f) i_obj);

+	}

 

 	/**

 	 * {@inheritDoc}

diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix3fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix3fImpl.java
index 401c1f6..f86a5da 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix3fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix3fImpl.java
@@ -48,7 +48,7 @@
  * @version $Revision$

  * @since Dec 15, 2008

  */

-public class Matrix3fImpl implements Matrix3f, Serializable, Cloneable {

+public final class Matrix3fImpl implements Matrix3f, Serializable, Cloneable {

 

 	/**

 	 * @see java.io.Serializable

@@ -269,6 +269,19 @@
 			&& a22 == sm.a22 && a23 == sm.a23 && a31 == sm.a31 && a32 == sm.a32

 			&& a33 == sm.a33;

 	}

+	

+	/**

+	 * {@inheritDoc}

+	 * 

+	 * @see java.lang.Object#equals(java.lang.Object)

+	 */

+	@Override

+	public boolean equals(Object i_obj) {

+		if (i_obj == null || !(i_obj instanceof IMatrix3f))

+			return false;

+		return equals((IMatrix3f) i_obj);

+	}

+

 

 	/**

 	 * {@inheritDoc}

diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix4fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix4fImpl.java
index b6f9a26..3b71d39 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix4fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Matrix4fImpl.java
@@ -56,7 +56,7 @@
  * @version $Revision$

  * @since Dec 16, 2008

  */

-public class Matrix4fImpl implements Matrix4f, Serializable, Cloneable {

+public final class Matrix4fImpl implements Matrix4f, Serializable, Cloneable {

 

 	/**

 	 * @see java.io.Serializable

@@ -281,7 +281,7 @@
 			return false;

 		Matrix4fImpl sm = cast(i_anotherMatrix4f);

 		return a11 == sm.a11 && a12 == sm.a12 && a13 == sm.a13 && a14 == sm.a14

-			&& // 

+			&& //

 			a21 == sm.a21 && a22 == sm.a22 && a23 == sm.a23 && a24 == sm.a24 && //

 			a31 == sm.a31 && a32 == sm.a32 && a33 == sm.a33 && a34 == sm.a34 && //

 			a41 == sm.a41 && a42 == sm.a42 && a43 == sm.a43 && a44 == sm.a44;

@@ -290,6 +290,18 @@
 	/**

 	 * {@inheritDoc}

 	 * 

+	 * @see java.lang.Object#equals(java.lang.Object)

+	 */

+	@Override

+	public boolean equals(Object i_obj) {

+		if (i_obj == null || !(i_obj instanceof IMatrix4f))

+			return false;

+		return equals((IMatrix4f) i_obj);

+	}

+

+	/**

+	 * {@inheritDoc}

+	 * 

 	 * @see java.lang.Object#hashCode()

 	 */

 	@Override

@@ -728,12 +740,12 @@
 	@Override

 	public String toString() {

 

-		return String.format(TO_STRING_FORMAT, String.valueOf(a11), String

-			.valueOf(a12), String.valueOf(a13), String.valueOf(a14), String

-			.valueOf(a21), String.valueOf(a22), String.valueOf(a23), String

-			.valueOf(a24), String.valueOf(a31), String.valueOf(a32), String

-			.valueOf(a33), String.valueOf(a34), String.valueOf(a41), String

-			.valueOf(a42), String.valueOf(a43), String.valueOf(a44));

+		return String.format(TO_STRING_FORMAT, String.valueOf(a11),

+			String.valueOf(a12), String.valueOf(a13), String.valueOf(a14),

+			String.valueOf(a21), String.valueOf(a22), String.valueOf(a23),

+			String.valueOf(a24), String.valueOf(a31), String.valueOf(a32),

+			String.valueOf(a33), String.valueOf(a34), String.valueOf(a41),

+			String.valueOf(a42), String.valueOf(a43), String.valueOf(a44));

 	}

 

 }

diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector2fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector2fImpl.java
index 7bf8205..759db65 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector2fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector2fImpl.java
@@ -26,7 +26,7 @@
  * @version $Revision$
  * @since Jun 3, 2009
  */
-public class Vector2fImpl implements Vector2f, Cloneable, Serializable {
+public final class Vector2fImpl implements Vector2f, Cloneable, Serializable {
 
 	/**
 	 * x attribute, made public for fast access. Usually, clients should use
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector3fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector3fImpl.java
index ea07601..64a4145 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector3fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector3fImpl.java
@@ -25,7 +25,7 @@
  * @version $Revision$
  * @since Dec 16, 2008
  */
-public class Vector3fImpl implements Vector3f, Cloneable, Serializable {
+public final class Vector3fImpl implements Vector3f, Cloneable, Serializable {
 
 	/**
 	 * x attribute, made public for fast access. Usually, clients should use
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector4fImpl.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector4fImpl.java
index 53166ea..56e569f 100644
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector4fImpl.java
+++ b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Vector4fImpl.java
@@ -24,7 +24,7 @@
  * @version $Revision$

  * @since Dec 16, 2008

  */

-public class Vector4fImpl implements Vector4f, Serializable, Cloneable {

+public final class Vector4fImpl implements Vector4f, Serializable, Cloneable {

 	/**

 	 * x attribute, made public for fast access. Usually, clients should use

 	 * getters/setters as defined in {@link IVector4f} and {@link Vector4f}.

@@ -321,6 +321,18 @@
 		if (v==null) return false;

 		return x==v.getX() && y==v.getY() && z==v.getZ() && w==v.getW();

 	}

+	

+	/**

+	 * {@inheritDoc}

+	 * 

+	 * @see java.lang.Object#equals(java.lang.Object)

+	 */

+	@Override

+	public boolean equals(Object i_obj) {

+		if (i_obj == null || !(i_obj instanceof IVector4f))

+			return false;

+		return equals((IVector4f) i_obj);

+	}

 

 	/**

 	 * {@inheritDoc}

@@ -345,7 +357,7 @@
 	 */

 	@Override

 	public int hashCode() {

-		float[] af = new float[3];

+		float[] af = new float[4];

 		toArray(af);

 		return Arrays.hashCode(af);

 	}

diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/AVLTree.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/AVLTree.java
deleted file mode 100644
index 36def34..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/AVLTree.java
+++ /dev/null
@@ -1,768 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * Pointer based implementation of an AVL tree (see
- * http://en.wikipedia.org/wiki/AVL_tree). This implementation does not allow
- * duplicates.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @param <T> the data type contained in the tree
- * @since 20.11.2009
- */
-public class AVLTree<T> implements Iterable<T> {
-
-	private class AVLNode {
-
-		private T data;
-
-		private int height;
-
-		private AVLNode left;
-
-		private AVLNode next;
-
-		private AVLNode parent;
-
-		private AVLNode previous;
-
-		private AVLNode right;
-
-		public AVLNode(AVLNode i_parent, T i_data) {
-
-			parent = i_parent;
-			data = i_data;
-			height = 0;
-
-			m_nodeMap.put(i_data, this);
-		}
-
-		private int getBalance() {
-
-			int l = left != null ? left.height : -1;
-			int r = right != null ? right.height : -1;
-
-			return r - l;
-		}
-
-		public T getData() {
-
-			return data;
-		}
-
-		public AVLNode getNext() {
-
-			return this.next;
-		}
-
-		public AVLNode getPrevious() {
-
-			return this.previous;
-		}
-
-		public boolean insert(T i_data) {
-
-			int c = compare(i_data, this.data);
-			if (c < 0) {
-				if (this.left == null) {
-					this.left = new AVLNode(this, i_data);
-					this.height = 1; // height was either 0 or 1
-
-					if (this.previous != null) {
-						this.previous.next = this.left;
-						this.left.previous = this.previous;
-					} else
-						m_first = this.left;
-
-					this.previous = this.left;
-					this.left.next = this;
-
-					return true;
-				} else {
-					boolean success = this.left.insert(i_data);
-					if (success) {
-						updateHeight();
-						rebalanceAfterInsert();
-					}
-					return success;
-				}
-			} else if (c > 0) {
-				if (this.right == null) {
-					this.right = new AVLNode(this, i_data);
-					this.height = 1; // height was either 0 or 1
-
-					if (this.next != null) {
-						this.next.previous = this.right;
-						this.right.next = this.next;
-					} else
-						m_last = this.right;
-
-					this.next = this.right;
-					this.right.previous = this;
-
-					return true;
-				} else {
-					boolean success = this.right.insert(i_data);
-					if (success) {
-						updateHeight();
-						rebalanceAfterInsert();
-					}
-					return success;
-				}
-			} else
-				return false;
-		}
-
-		public boolean isLeft() {
-
-			if (this.parent == null)
-				return false;
-
-			return this.parent.left == this;
-		}
-
-		public boolean isRight() {
-
-			if (this.parent == null)
-				return false;
-
-			return this.parent.right == this;
-		}
-
-		public AVLNode query(Object i_query, Comparator<Object> i_comparator) {
-
-			int c = i_comparator.compare(i_query, data);
-			if (c < 0 && left != null)
-				return left.query(i_query, i_comparator);
-			else if (c > 0 && right != null)
-				return right.query(i_query, i_comparator);
-			else if (c == 0)
-				return this;
-
-			return null;
-		}
-
-		public AVLNode queryNext(Object i_query, Comparator<Object> i_comparator) {
-
-			if (i_comparator.compare(i_query, data) < 0) {
-				AVLNode result = null;
-				if (left != null)
-					result = left.queryNext(i_query, i_comparator);
-
-				if (result != null)
-					return result;
-
-				return this;
-			} else {
-				if (right != null)
-					return right.queryNext(i_query, i_comparator);
-
-				return null;
-			}
-		}
-
-		public AVLNode queryPrevious(Object i_query,
-			Comparator<Object> i_comparator) {
-
-			if (i_comparator.compare(i_query, data) > 0) {
-				AVLNode result = null;
-				if (right != null)
-					result = right.queryPrevious(i_query, i_comparator);
-
-				if (result != null)
-					return result;
-
-				return this;
-			} else {
-				if (left != null)
-					return left.queryPrevious(i_query, i_comparator);
-
-				return null;
-			}
-		}
-
-		private void rebalanceAfterInsert() {
-
-			int b = getBalance();
-			if (b < -1) {
-				if (left.getBalance() < 0) {
-					rotateCW();
-				} else {
-					left.rotateCCW();
-					rotateCW();
-				}
-			} else if (b > 1) {
-				if (right.getBalance() > 0) {
-					rotateCCW();
-				} else {
-					right.rotateCW();
-					rotateCCW();
-				}
-			}
-		}
-
-		private void rebalanceAfterRemove() {
-
-			int b = getBalance();
-			if (b < -1) {
-				if (left.getBalance() <= 0) {
-					rotateCW();
-				} else {
-					left.rotateCCW();
-					rotateCW();
-				}
-			} else if (b > 1) {
-				if (right.getBalance() >= 0) {
-					rotateCCW();
-				} else {
-					right.rotateCW();
-					rotateCCW();
-				}
-			}
-		}
-
-		public boolean remove(T i_data) {
-
-			int c = compare(i_data, this.data);
-			if (c < 0) {
-				if (this.left == null) {
-					return false;
-				} else {
-					boolean success = this.left.remove(i_data);
-					if (success) {
-						updateHeight();
-						rebalanceAfterRemove();
-					}
-					return success;
-				}
-			} else if (c > 0) {
-				if (this.right == null) {
-					return false;
-				} else {
-					boolean success = this.right.remove(i_data);
-					if (success) {
-						updateHeight();
-						rebalanceAfterRemove();
-					}
-					return success;
-				}
-			} else {
-				m_nodeMap.remove(i_data);
-
-				if (this.left == null || this.right == null) {
-					AVLNode child = null;
-					if (this.left != null)
-						child = this.left;
-					else if (this.right != null)
-						child = this.right;
-
-					if (isLeft())
-						this.parent.left = child;
-					else if (isRight())
-						this.parent.right = child;
-					else
-						m_root = child;
-
-					if (child != null)
-						child.parent = this.parent;
-
-					if (this.previous != null)
-						this.previous.next = this.next;
-					else
-						m_first = this.next;
-
-					if (this.next != null)
-						this.next.previous = this.previous;
-					else
-						m_last = this.previous;
-				} else {
-					AVLNode node = getNext();
-
-					this.next = node.next;
-					if (this.next != null)
-						this.next.previous = this;
-					else
-						m_last = this;
-
-					if (node.isLeft())
-						node.parent.left = node.right;
-					else
-						node.parent.right = node.right;
-
-					if (node.right != null)
-						node.right.parent = node.parent;
-
-					this.data = node.data;
-					m_nodeMap.put(this.data, this);
-
-					do {
-						node = node.parent;
-						node.updateHeight();
-						node.rebalanceAfterRemove();
-					} while (node != this);
-				}
-
-				return true;
-			}
-		}
-
-		private void rotateCCW() {
-
-			AVLNode tmpRight = this.right;
-			AVLNode tmpParent = this.parent;
-
-			this.right = tmpRight.left;
-			if (this.right != null)
-				this.right.parent = this;
-
-			tmpRight.left = this;
-			this.parent = tmpRight;
-
-			if (tmpParent == null) {
-				m_root = tmpRight;
-				tmpRight.parent = null;
-			} else if (tmpParent.left == this) {
-				tmpParent.left = tmpRight;
-				tmpRight.parent = tmpParent;
-			} else {
-				tmpParent.right = tmpRight;
-				tmpRight.parent = tmpParent;
-			}
-
-			updateHeight();
-			tmpRight.updateHeight();
-
-			if (tmpParent != null)
-				tmpParent.updateHeight();
-		}
-
-		private void rotateCW() {
-
-			AVLNode tmpLeft = this.left;
-			AVLNode tmpParent = this.parent;
-
-			this.left = tmpLeft.right;
-			if (this.left != null)
-				this.left.parent = this;
-
-			tmpLeft.right = this;
-			this.parent = tmpLeft;
-
-			if (tmpParent == null) {
-				m_root = tmpLeft;
-			} else if (tmpParent.left == this) {
-				tmpParent.left = tmpLeft;
-				tmpLeft.parent = tmpParent;
-			} else {
-				tmpParent.right = tmpLeft;
-				tmpLeft.parent = tmpParent;
-			}
-
-			updateHeight();
-			tmpLeft.updateHeight();
-
-			if (tmpParent != null)
-				tmpParent.updateHeight();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.lang.Object#toString()
-		 */
-		@Override
-		public String toString() {
-
-			return data.toString() + ":" + height;
-		}
-
-		private void updateHeight() {
-
-			int l = this.left != null ? this.left.height : -1;
-			int r = this.right != null ? this.right.height : -1;
-
-			this.height = Math.max(l, r) + 1;
-		}
-	}
-
-	private class AVLTreeIterator implements Iterator<T> {
-
-		private AVLNode m_node;
-
-		public AVLTreeIterator(AVLNode i_startNode) {
-
-			m_node = i_startNode;
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.util.Iterator#hasNext()
-		 */
-		public boolean hasNext() {
-
-			return m_node != null;
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.util.Iterator#next()
-		 */
-		public T next() {
-
-			if (!hasNext())
-				throw new NoSuchElementException();
-
-			AVLNode tmp = m_node;
-			m_node = m_node.getNext();
-
-			return tmp.getData();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.util.Iterator#remove()
-		 */
-		public void remove() {
-
-			if (!hasNext())
-				throw new NoSuchElementException();
-
-			AVLNode tmp = m_node;
-			m_node = m_node.getNext();
-
-			AVLTree.this.remove(tmp.getData());
-		}
-	}
-
-	private Comparator<? super T> m_comparator;
-
-	private AVLNode m_first;
-
-	@SuppressWarnings("unused")
-	private AVLNode m_last;
-
-	private Map<T, AVLNode> m_nodeMap = new HashMap<T, AVLNode>();
-
-	private AVLNode m_root;
-
-	/**
-	 * Creates a new empty tree.
-	 */
-	public AVLTree() {
-		// nothing to initialize
-	}
-
-	/**
-	 * Creates a new empty tree that uses the given comparator to determine the
-	 * order of the inserted elements.
-	 * 
-	 * @param i_comparator the comparator
-	 */
-	public AVLTree(Comparator<? super T> i_comparator) {
-
-		if (i_comparator == null)
-			throw new NullPointerException("i_comparator must not be null");
-
-		m_comparator = i_comparator;
-	}
-
-	/**
-	 * Clears this tree.
-	 */
-	public void clear() {
-
-		m_first = null;
-		m_last = null;
-		m_root = null;
-		m_nodeMap.clear();
-	}
-
-	@SuppressWarnings("unchecked")
-	private int compare(T i_o1, T i_o2) {
-
-		if (m_comparator != null)
-			return m_comparator.compare(i_o1, i_o2);
-
-		Comparable<? super T> comparable = (Comparable<? super T>) i_o1;
-		return comparable.compareTo(i_o2);
-	}
-
-	/**
-	 * Indicates whether the given element is contained in this tree.
-	 * 
-	 * @param i_data the element to check for
-	 * @return <code>true</code> if the given element is contained in this tree
-	 *         or <code>false</code> otherwise
-	 */
-	public boolean contains(T i_data) {
-
-		return m_nodeMap.containsKey(i_data);
-	}
-
-	/**
-	 * Returns the data object that has the same order index as the given data
-	 * object.
-	 * 
-	 * @param i_data the data object to search for
-	 * @return a data object with the same order index or <code>null</code> if
-	 *         no such data object is stored in this tree
-	 */
-	public T get(T i_data) {
-
-		if (i_data == null)
-			throw new NullPointerException("i_data must not be null");
-
-		return m_nodeMap.get(i_data).getData();
-	}
-
-	/**
-	 * Returns the first element in this tree.
-	 * 
-	 * @return the first element or <code>null</code> if this tree is empty
-	 */
-	public T getFirst() {
-
-		if (m_first == null)
-			return null;
-
-		return m_first.getData();
-	}
-
-	/**
-	 * Returns the last element in this tree.
-	 * 
-	 * @return the last element or <code>null</code> if this tree is empty
-	 */
-	public T getLast() {
-
-		if (m_last == null)
-			return null;
-
-		return m_last.getData();
-	}
-
-	/**
-	 * Returns the successor of the given element, if any.
-	 * 
-	 * @param i_data the element whose successor is requested
-	 * @return the successor of the given element or <code>null</code> if the
-	 *         given element is not contained in this tree or if the given
-	 *         element does not have a successor
-	 */
-	public T getNext(T i_data) {
-
-		AVLNode node = m_nodeMap.get(i_data);
-		if (node != null) {
-			AVLNode nextNode = node.getNext();
-			if (nextNode != null)
-				return nextNode.getData();
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns the predecessor of the given element, if any.
-	 * 
-	 * @param i_data the element whose predecessor is requested
-	 * @return the predecessor of the given element or <code>null</code> if the
-	 *         given element is not contained in this tree or if the given
-	 *         element does not have a predecessor
-	 */
-	public T getPrevious(T i_data) {
-
-		AVLNode node = m_nodeMap.get(i_data);
-		if (node != null) {
-			AVLNode previousNode = node.getPrevious();
-			if (previousNode != null)
-				return previousNode.getData();
-		}
-
-		return null;
-	}
-
-	/**
-	 * Inserts the given element into this tree.
-	 * 
-	 * @param i_data the element to insert
-	 * @return <code>true</code> if the given element was inserted or
-	 *         <code>false</code> if the element was already contained in this
-	 *         tree
-	 */
-	public boolean insert(T i_data) {
-
-		if (i_data == null)
-			throw new NullPointerException("i_data must not be null");
-
-		if (m_root != null) {
-			return m_root.insert(i_data);
-		} else {
-			m_root = new AVLNode(null, i_data);
-			m_first = m_root;
-			m_last = m_root;
-			return true;
-		}
-	}
-
-	/**
-	 * Indicates whether this tree is empty.
-	 * 
-	 * @return <code>true</code> if this tree is empty and <code>false</code>
-	 *         otherwise
-	 */
-	public boolean isEmpty() {
-
-		return m_root == null;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * 
-	 * @see java.lang.Iterable#iterator()
-	 */
-	public Iterator<T> iterator() {
-
-		return new AVLTreeIterator(m_first);
-	}
-
-	public T query(Object i_query, Comparator<Object> i_comparator) {
-
-		if (i_query == null)
-			throw new NullPointerException("i_query must not be null");
-
-		if (i_comparator == null)
-			throw new NullPointerException("i_comparator must not be null");
-
-		AVLNode node = m_root.query(i_query, i_comparator);
-		if (node != null)
-			return node.getData();
-
-		return null;
-	}
-
-	public T queryNext(Object i_query, Comparator<Object> i_comparator) {
-
-		if (i_query == null)
-			throw new NullPointerException("i_query must not be null");
-
-		if (i_comparator == null)
-			throw new NullPointerException("i_comparator must not be null");
-
-		AVLNode node = m_root.queryNext(i_query, i_comparator);
-		if (node != null)
-			return node.getData();
-
-		return null;
-	}
-
-	public T queryPrevious(Object i_query, Comparator<Object> i_comparator) {
-
-		if (i_query == null)
-			throw new NullPointerException("i_query must not be null");
-
-		if (i_comparator == null)
-			throw new NullPointerException("i_comparator must not be null");
-
-		AVLNode node = m_root.queryPrevious(i_query, i_comparator);
-		if (node != null)
-			return node.getData();
-
-		return null;
-	}
-
-	/**
-	 * Removes the given element from this tree.
-	 * 
-	 * @param i_data the element to remove
-	 * @return <code>true</code> if the given element was removed or
-	 *         <code>false</code> if the given element was not contained in this
-	 *         tree
-	 */
-	public boolean remove(T i_data) {
-
-		if (i_data == null)
-			throw new NullPointerException("i_data must not be null");
-
-		if (m_root != null)
-			return m_root.remove(i_data);
-		else
-			return false;
-	}
-
-	/**
-	 * Returns the number of elements contained in this tree.
-	 * 
-	 * @return the number of elements
-	 */
-	public int size() {
-
-		return m_nodeMap.size();
-	}
-
-	/**
-	 * Returns an array containing the elements in this tree.
-	 * 
-	 * @return an array
-	 */
-	@SuppressWarnings("unchecked")
-	public T[] toArray() {
-
-		Object[] array = new Object[size()];
-
-		int i = 0;
-		for (Object data : this)
-			array[i++] = data;
-
-		return (T[]) array;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * 
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-
-		if (m_root == null)
-			return "[]";
-
-		StringBuilder b = new StringBuilder();
-		toString(m_root, b);
-		return b.toString();
-	}
-
-	private void toString(AVLNode i_node, StringBuilder i_builder) {
-
-		i_builder.append("[");
-		if (i_node.left != null)
-			toString(i_node.left, i_builder);
-		else if (i_node.right != null)
-			i_builder.append("[]");
-		i_builder.append(i_node.getData());
-		if (i_node.right != null)
-			toString(i_node.right, i_builder);
-		else if (i_node.left != null)
-			i_builder.append("[]");
-		i_builder.append("]");
-	}
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Intersection.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Intersection.java
deleted file mode 100644
index 9b5e331..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Intersection.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import org.eclipse.draw3d.geometry.IVector2f;
-
-/**
- * Intersection There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 30.11.2009
- */
-public class Intersection {
-
-	public enum Type {
-		OVERLAP, POINT
-	}
-
-	private Segment m_first;
-
-	private Segment m_overlap;
-
-	private IVector2f m_point;
-
-	private Segment m_second;
-
-	private Type m_type;
-
-	public Intersection(Segment i_first, Segment i_second, IVector2f i_point) {
-
-		m_type = Type.POINT;
-		m_first = i_first;
-		m_second = i_second;
-		m_point = i_point;
-	}
-
-	public Intersection(Segment i_first, Segment i_second, Segment i_overlap) {
-
-		m_type = Type.OVERLAP;
-		m_first = i_first;
-		m_second = i_second;
-		m_overlap = i_overlap;
-	}
-
-	public Segment getFirst() {
-
-		return m_first;
-	}
-
-	public Segment getOverlap() {
-
-		if (m_type != Type.OVERLAP)
-			throw new AssertionError();
-
-		return m_overlap;
-	}
-
-	public IVector2f getPoint() {
-
-		if (m_type != Type.POINT)
-			throw new AssertionError();
-
-		return m_point;
-	}
-
-	public Segment getSecond() {
-
-		return m_second;
-	}
-
-	public Type getType() {
-
-		return m_type;
-	}
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointList.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointList.java
deleted file mode 100644
index b83a298..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-/**
- * PointQueue There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 26.11.2009
- */
-public class PointList {
-
-	private int[] m_points;
-
-	private int[] m_order;
-
-	public int getX(int i_index) {
-
-		return m_points[2 * m_order[i_index]];
-	}
-
-	public int getY(int i_index) {
-
-		return m_points[2 * m_order[i_index] + 1];
-	}
-
-	public int getSize() {
-
-		return m_order.length;
-	}
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointQueue.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointQueue.java
deleted file mode 100644
index 82d6e80..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PointQueue.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-/**
- * PointQueue There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 26.11.2009
- */
-public class PointQueue {
-
-	private static class IndexedList {
-
-		private int m_index = -1;
-
-		private PointList m_list;
-
-		public IndexedList(PointList i_list) {
-
-			m_list = i_list;
-		}
-
-		public void dec() {
-
-			if (m_index <= -1)
-				throw new NoSuchElementException();
-		}
-
-		public int getX() {
-
-			return m_list.getX(m_index);
-		}
-
-		public int getY() {
-
-			return m_list.getY(m_index);
-		}
-
-		public boolean hasNext() {
-
-			return m_index < m_list.getSize() - 1;
-		}
-
-		public void inc() {
-
-			if (!hasNext())
-				throw new NoSuchElementException();
-
-			m_index++;
-		}
-	}
-
-	private static class Point implements Comparable<Point> {
-
-		private int m_x;
-
-		private int m_y;
-
-		public Point(int i_x, int i_y) {
-
-			m_x = i_x;
-			m_y = i_y;
-		}
-
-		/**
-		 * {@inheritDoc}
-		 * 
-		 * @see java.lang.Comparable#compareTo(java.lang.Object)
-		 */
-		public int compareTo(Point i_o) {
-
-			return getX() - i_o.getX();
-		}
-
-		public int getX() {
-			return m_x;
-		}
-
-		public int getY() {
-			return m_y;
-		}
-	}
-
-	private int m_next = -1;
-
-	private List<IndexedList> m_readable = new ArrayList<IndexedList>();
-
-	private AVLTree<Point> m_writable = new AVLTree<Point>();
-
-	public PointQueue(PointList... i_lists) {
-
-		for (PointList list : i_lists)
-			m_readable.add(new IndexedList(list));
-	}
-
-	private void findNext() {
-
-		if (m_next != -2)
-			return;
-
-		int x;
-		if (m_writable.size() > 0) {
-			m_next = -1;
-			x = m_writable.getFirst().getX();
-		} else {
-			m_next = -2;
-			x = Integer.MIN_VALUE;
-		}
-
-		for (int i = 0; i < m_readable.size(); i++) {
-			IndexedList list = m_readable.get(i);
-			if (list.hasNext()) {
-				list.inc();
-				int listX = list.getX();
-				if (listX < x) {
-					x = listX;
-					m_next = i;
-				}
-				list.dec();
-			}
-		}
-	}
-
-	public int getX() {
-
-		if (m_next == -2)
-			throw new NoSuchElementException();
-
-		if (m_next == -1)
-			return m_writable.getFirst().getX();
-
-		return m_readable.get(m_next).getX();
-	}
-
-	public int getY() {
-
-		if (m_next == -2)
-			throw new NoSuchElementException();
-
-		if (m_next == -1)
-			return m_writable.getFirst().getY();
-
-		return m_readable.get(m_next).getY();
-	}
-
-	public boolean isEmpty() {
-
-		findNext();
-		return m_next == -2;
-	}
-
-	public void pop() {
-
-		if (isEmpty())
-			throw new NoSuchElementException();
-
-		if (m_next == -1)
-			m_writable.remove(m_writable.getFirst());
-		else
-			m_readable.get(m_next).inc();
-
-		m_next = -2;
-	}
-
-	public void push(int i_x, int i_y) {
-
-		m_writable.insert(new Point(i_x, i_y));
-	}
-
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Polyline.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Polyline.java
deleted file mode 100644
index b5040cd..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Polyline.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw3d.geometry.IVector2f;
-
-/**
- * Polyline There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 29.11.2009
- */
-public class Polyline {
-
-	private List<Segment> m_segments = new LinkedList<Segment>();
-
-	private IVector2f m_last = null;
-
-	public List<Segment> getSegments() {
-
-		return Collections.unmodifiableList(m_segments);
-	}
-
-	public void addPoint(IVector2f i_point) {
-
-		if (i_point == null)
-			throw new NullPointerException("i_point must not be null");
-
-		if (i_point.equals(m_last))
-			return;
-
-		if (m_last != null)
-			m_segments.add(new Segment(m_last, i_point));
-
-		m_last = i_point;
-	}
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PolylineIntersectsPolylineAlgorithm.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PolylineIntersectsPolylineAlgorithm.java
deleted file mode 100644
index 5e61bb7..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/PolylineIntersectsPolylineAlgorithm.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.draw3d.geometry.IVector2f;
-import org.eclipse.draw3d.geometry.Math3D;
-import org.eclipse.draw3d.geometry.Math3DCache;
-import org.eclipse.draw3d.geometry.Vector2f;
-
-/**
- * PolylineIntersectsPolylineAlgorithm There should really be more documentation
- * here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 19.11.2009
- */
-public class PolylineIntersectsPolylineAlgorithm {
-
-	private static class Event {
-
-		/**
-		 * Segments of which this is an inner point.
-		 */
-		private Set<TreeSegment> m_inner;
-
-		/**
-		 * Segments of which this is the lower point
-		 */
-		private Set<TreeSegment> m_lower;
-
-		private IVector2f m_point;
-
-		/**
-		 * Segments of which this is the upper point.
-		 */
-		private Set<TreeSegment> m_upper;
-
-		public Event(IVector2f i_point) {
-
-			m_point = i_point;
-		}
-
-		public void addInner(TreeSegment i_segment) {
-
-			if (m_inner == null)
-				m_inner = new HashSet<TreeSegment>();
-
-			m_inner.add(i_segment);
-		}
-
-		public void addLower(TreeSegment i_segment) {
-
-			if (m_lower == null)
-				m_lower = new HashSet<TreeSegment>();
-
-			m_lower.add(i_segment);
-		}
-
-		public void addUpper(TreeSegment i_segment) {
-
-			if (m_upper == null)
-				m_upper = new HashSet<TreeSegment>();
-
-			m_upper.add(i_segment);
-		}
-
-		public Set<TreeSegment> getInner() {
-
-			if (m_inner == null)
-				return Collections.emptySet();
-
-			return m_inner;
-		}
-
-		public Set<TreeSegment> getLower() {
-
-			if (m_lower == null)
-				return Collections.emptySet();
-
-			return m_lower;
-		}
-
-		public IVector2f getPoint() {
-
-			return m_point;
-		}
-
-		public Set<TreeSegment> getUpper() {
-
-			if (m_upper == null)
-				return Collections.emptySet();
-
-			return m_upper;
-		}
-
-		public boolean isEmpty() {
-
-			return (m_upper == null || m_upper.isEmpty())
-				&& (m_lower == null || m_lower.isEmpty())
-				&& (m_inner == null || m_inner.isEmpty());
-		}
-
-		public void removeInner(TreeSegment i_segment) {
-
-			m_inner.remove(i_segment);
-		}
-	}
-
-	private static class TreeSegment {
-
-		private IVector2f m_intersection;
-
-		private Segment m_segment;
-
-		private Polyline m_line;
-
-		private Set<TreeSegment> m_overlaps;
-
-		public void addOverlap(TreeSegment i_segment) {
-
-			if (m_overlaps == null)
-				m_overlaps = new HashSet<TreeSegment>();
-
-			m_overlaps.add(i_segment);
-
-			if (!i_segment.getOverlaps().contains(this))
-				i_segment.addOverlap(this);
-		}
-
-		public Set<TreeSegment> getOverlaps() {
-
-			if (m_overlaps == null)
-				return Collections.emptySet();
-
-			return m_overlaps;
-		}
-
-		public void removeOverlap(TreeSegment i_segment) {
-
-			m_overlaps.remove(i_segment);
-
-			if (i_segment.getOverlaps().contains(this))
-				i_segment.removeOverlap(this);
-		}
-
-		public Polyline getPolyline() {
-
-			return m_line;
-		}
-
-		public TreeSegment(Polyline i_line, Segment i_segment) {
-
-			m_line = i_line;
-			m_segment = i_segment;
-		}
-
-		public Segment getSegment() {
-
-			return m_segment;
-		}
-
-		public boolean overlaps(TreeSegment i_segment, Vector2f i_start,
-			Vector2f i_end) {
-
-			float mg = getSegment().getG();
-			float tg = i_segment.getSegment().getG();
-
-			float mc = getSegment().getC();
-			float tc = i_segment.getSegment().getC();
-
-			if (mg == tg && mc == tc) {
-				// segments are parallel
-				IVector2f mu = getUpper();
-				IVector2f ml = getLower();
-				IVector2f tu = i_segment.getUpper();
-				IVector2f tl = i_segment.getLower();
-
-				if (Math3D.in(mu.getY(), ml.getY(), tu.getY())) {
-					i_start.set(tu);
-					if (Math3D.in(mu.getY(), ml.getY(), tl.getY()))
-						i_end.set(tl);
-					else
-						i_end.set(ml);
-
-					return true;
-				} else if (Math3D.in(tu.getY(), tl.getY(), mu.getY())) {
-					i_start.set(mu);
-					if (Math3D.in(tu.getY(), tl.getY(), ml.getY()))
-						i_end.set(ml);
-					else
-						i_end.set(tl);
-
-					return true;
-				}
-			}
-
-			return false;
-		}
-
-		public boolean intersects(TreeSegment i_segment, Vector2f i_point) {
-
-			float mg = getSegment().getG();
-			float tg = i_segment.getSegment().getG();
-
-			float mc = getSegment().getC();
-			float tc = i_segment.getSegment().getC();
-
-			if (mg != tg) {
-				float x = (mc - tc) / (mg - tg);
-				float y = mg * x - mc;
-
-				i_point.set(x, y);
-				return true;
-			}
-
-			return false;
-		}
-
-		public IVector2f getLower() {
-
-			IVector2f s = m_segment.getStart();
-			IVector2f e = m_segment.getEnd();
-
-			return m_pointComparator.compare(s, e) < 0 ? s : e;
-		}
-
-		public IVector2f getUpper() {
-
-			if (m_intersection != null)
-				return m_intersection;
-
-			IVector2f s = m_segment.getStart();
-			IVector2f e = m_segment.getEnd();
-
-			return m_pointComparator.compare(s, e) > 0 ? s : e;
-		}
-
-		public void setIntersection(IVector2f i_intersection) {
-
-			m_intersection = i_intersection;
-		}
-
-		public void removeOverlaps() {
-
-		}
-	}
-
-	private static final Comparator<Event> m_eventComparator =
-		new Comparator<Event>() {
-			public int compare(Event i_e0, Event i_e1) {
-
-				return m_pointComparator.compare(i_e0.getPoint(),
-					i_e1.getPoint());
-			}
-		};
-
-	private static final Comparator<IVector2f> m_pointComparator =
-		new Comparator<IVector2f>() {
-			public int compare(IVector2f i_p0, IVector2f i_p1) {
-
-				if (i_p0.getY() < i_p1.getY())
-					return -1;
-				else if (i_p0.getY() > i_p1.getY())
-					return 1;
-				else if (i_p0.getX() < i_p1.getX())
-					return -1;
-				else if (i_p0.getX() > i_p1.getX())
-					return 1;
-
-				return 0;
-			}
-		};
-
-	private static final Comparator<Object> m_queryComparator =
-		new Comparator<Object>() {
-
-			public int compare(Object i_o0, Object i_o1) {
-
-				if (i_o0 instanceof TreeSegment && i_o1 instanceof TreeSegment)
-					return m_segmentComparator.compare((TreeSegment) i_o0,
-						(TreeSegment) i_o1);
-
-				if (i_o0 instanceof IVector2f && i_o1 instanceof IVector2f)
-					return m_pointComparator.compare((IVector2f) i_o0,
-						(IVector2f) i_o1);
-
-				if (i_o0 instanceof TreeSegment && i_o1 instanceof IVector2f) {
-
-					TreeSegment s = (TreeSegment) i_o0;
-					IVector2f v = (IVector2f) i_o1;
-
-					IVector2f u = s.getUpper();
-					IVector2f l = s.getLower();
-
-					int c = m_pointComparator.compare(u, v);
-					if (c == 0)
-						c = m_pointComparator.compare(l, v);
-
-					return c;
-				}
-
-				if (i_o0 instanceof IVector2f && i_o1 instanceof TreeSegment)
-					return -1 * compare(i_o1, i_o0);
-
-				throw new AssertionError(
-					"can only compare segments and vectors");
-			}
-
-		};
-
-	private static final Comparator<TreeSegment> m_segmentComparator =
-		new Comparator<TreeSegment>() {
-
-			public int compare(TreeSegment i_o0, TreeSegment i_o1) {
-
-				IVector2f u0 = i_o0.getUpper();
-				IVector2f l0 = i_o0.getLower();
-				IVector2f u1 = i_o1.getUpper();
-				IVector2f l1 = i_o1.getLower();
-
-				if (u0.getX() < u0.getX())
-					return -1;
-				else if (u0.getX() > u0.getX())
-					return 1;
-				else if (u0.getY() < u1.getY())
-					return -1;
-				else if (u0.getY() > u1.getY())
-					return 1;
-				else if (l0.getX() < l0.getX())
-					return -1;
-				else if (l0.getX() > l0.getX())
-					return 1;
-				else if (l0.getY() < l1.getY())
-					return -1;
-				else if (l0.getY() > l1.getY())
-					return 1;
-
-				return 0;
-			}
-		};
-
-	private AVLTree<Event> m_events;
-
-	private AVLTree<TreeSegment> m_segments;
-
-	private void buildEventQueue(Polyline i_line) {
-
-		if (m_events == null)
-			m_events = new AVLTree<Event>(m_eventComparator);
-
-		for (Segment s : i_line.getSegments()) {
-			Event u = new Event(s.getStart());
-			Event l = new Event(s.getEnd());
-
-			int c = m_eventComparator.compare(u, l);
-			if (c > 0) {
-				Event temp = u;
-				u = l;
-				l = temp;
-			} else if (c == 0)
-				throw new AssertionError("empty segment");
-
-			if (m_events.contains(u))
-				u = m_events.get(u);
-			else
-				m_events.insert(u);
-
-			if (m_events.contains(l))
-				l = m_events.get(l);
-			else
-				m_events.insert(l);
-
-			TreeSegment ts = new TreeSegment(i_line, s);
-
-			u.addUpper(ts);
-			l.addLower(ts);
-		}
-	}
-
-	private void handleEvent(Event i_event) {
-
-		IVector2f p = i_event.getPoint();
-		Set<TreeSegment> upper = i_event.getUpper();
-		Set<TreeSegment> inner = i_event.getInner();
-		Set<TreeSegment> lower = i_event.getLower();
-
-		TreeSegment ln = null;
-		TreeSegment rn = null;
-
-		for (TreeSegment ts : lower) {
-			m_segments.remove(ts);
-			ts.removeOverlaps();
-		}
-
-		for (TreeSegment ts : inner)
-			m_segments.remove(ts);
-
-		for (TreeSegment ts : inner) {
-			ts.setIntersection(p);
-			m_segments.insert(ts);
-
-			if (ln == null || m_segmentComparator.compare(ts, ln) < 0)
-				ln = ts;
-
-			if (rn == null || m_segmentComparator.compare(ts, rn) > 0)
-				rn = ts;
-		}
-
-		for (TreeSegment ts : upper) {
-			m_segments.insert(ts);
-
-			if (ln == null || m_segmentComparator.compare(ts, ln) < 0)
-				ln = ts;
-
-			if (rn == null || m_segmentComparator.compare(ts, rn) > 0)
-				rn = ts;
-		}
-
-		if (upper.isEmpty() && inner.isEmpty()) {
-			TreeSegment l = m_segments.queryPrevious(p, m_queryComparator);
-			TreeSegment r = m_segments.queryNext(p, m_queryComparator);
-			findNextEvent(l, r, i_event);
-		} else {
-			TreeSegment l = m_segments.getPrevious(ln);
-			TreeSegment r = m_segments.getNext(rn);
-
-			if (l != null)
-				findNextEvent(l, ln, i_event);
-
-			if (r != null)
-				findNextEvent(rn, r, i_event);
-		}
-	}
-
-	private Collection<Intersection> m_intersections =
-		new HashSet<Intersection>();
-
-	private void handleIntersection(TreeSegment i_left, TreeSegment i_right,
-		IVector2f i_point) {
-
-		Event e = new Event(i_point);
-		if (m_events.contains(e))
-			e = m_events.get(e);
-
-		e.addInner(i_left);
-		e.addInner(i_right);
-	}
-
-	private void handleOverlap(TreeSegment i_left, TreeSegment i_right,
-		IVector2f i_start, IVector2f i_end) {
-
-	}
-
-	private void findNextEvent(TreeSegment i_left, TreeSegment i_right,
-		Event i_event) {
-
-		Vector2f point = Math3DCache.getVector2f();
-		Vector2f start = Math3DCache.getVector2f();
-		Vector2f end = Math3DCache.getVector2f();
-		try {
-			if (i_left.overlaps(i_right, start, end)
-				&& (m_pointComparator.compare(start, i_event.getPoint()) > 0 || m_pointComparator.compare(
-					end, i_event.getPoint()) > 0))
-				handleOverlap(i_left, i_right, start, end);
-			else if (i_left.intersects(i_right, point)
-				&& m_pointComparator.compare(point, i_event.getPoint()) > 0)
-				handleIntersection(i_left, i_right, point);
-		} finally {
-			Math3DCache.returnVector2f(point, start, end);
-		}
-	}
-
-	public boolean intersects(Polyline i_line0, Polyline i_line1) {
-
-		if (i_line0 == null)
-			throw new NullPointerException("i_line0 must not be null");
-
-		if (i_line1 == null)
-			throw new NullPointerException("i_line1 must not be null");
-
-		if (i_line0.getSegments().isEmpty() || i_line1.getSegments().isEmpty())
-			return false;
-
-		if (m_events != null)
-			m_events.clear();
-
-		buildEventQueue(i_line0);
-		buildEventQueue(i_line1);
-
-		while (!m_events.isEmpty()) {
-			Event event = m_events.getFirst();
-			m_events.remove(event);
-			handleEvent(event);
-		}
-
-		return false;
-	}
-}
diff --git a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Segment.java b/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Segment.java
deleted file mode 100644
index b56ab6d..0000000
--- a/plugins/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/intersection/Segment.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import org.eclipse.draw3d.geometry.IVector2f;
-
-/**
- * Segment There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 26.11.2009
- */
-public class Segment {
-
-	private IVector2f m_end;
-
-	private IVector2f m_start;
-
-	private IVector2f m_left;
-
-	private IVector2f m_right;
-
-	private IVector2f m_upper;
-
-	private IVector2f m_lower;
-
-	private float m_c;
-
-	private float m_g;
-
-	public Segment(IVector2f i_start, IVector2f i_end) {
-
-		m_start = i_start;
-		m_end = i_end;
-
-		float dX = getEnd().getX() - getStart().getX();
-		float dY = getEnd().getY() - getStart().getY();
-
-		if (dX != 0) {
-			m_g = Math.abs(dY / dX);
-			m_c = m_g * getStart().getX() - getStart().getY();
-		} else {
-			m_g = Float.POSITIVE_INFINITY;
-			m_c = Float.NaN;
-		}
-	}
-
-	public float getC() {
-
-		return m_c;
-	}
-
-	public float getG() {
-
-		return m_g;
-	}
-
-	public IVector2f getEnd() {
-
-		return m_end;
-	}
-
-	public IVector2f getStart() {
-
-		return m_start;
-	}
-}
diff --git a/tests/org.eclipse.draw3d.test/.project b/tests/org.eclipse.draw3d.test/.project
index 675e288..257bc81 100644
--- a/tests/org.eclipse.draw3d.test/.project
+++ b/tests/org.eclipse.draw3d.test/.project
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>org.eclipse.draw3d.test</name>
+	<name>org.eclipse.draw3d.geometry.test</name>
 	<comment></comment>
 	<projects>
 	</projects>
diff --git a/tests/org.eclipse.draw3d.test/META-INF/MANIFEST.MF b/tests/org.eclipse.draw3d.test/META-INF/MANIFEST.MF
index 225e2fe..04c86bf 100644
--- a/tests/org.eclipse.draw3d.test/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.draw3d.test/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Draw3D Test Plug-in
-Bundle-SymbolicName: org.eclipse.draw3d.test
+Bundle-SymbolicName: org.eclipse.draw3d.geometry.test
 Bundle-Version: 0.9.3
 Bundle-Vendor: Eclipse.org
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/AbstractPosition3DTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/AbstractPosition3DTest.java
index 846b5f0..5668f4a 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/AbstractPosition3DTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/AbstractPosition3DTest.java
@@ -32,16 +32,16 @@
 	 */
 	@Test
 	public void testGetAbsolute() {
-		Position3D parent = Position3DUtil.createAbsolutePosition();
-		Position3D pos =
-			Position3DUtil.createRelativePosition(parent.getHost());
+		IHost3D host = Position3DUtil.createAbsolutePosition().getHost();
+		Position3D parent = host.getPosition3D();
+		Position3D pos = Position3DUtil.createRelativePosition(host);
 
 		parent.setLocation3D(new Vector3fImpl(1, 1, 0));
-		pos.setLocation3D(new Vector3fImpl(0, 0, 0));
+		pos.setLocation3D(new Vector3fImpl(1, 0, 0));
 
 		Position3D abs = pos.getAbsolute(null);
 		IVector3f v = abs.getLocation3D();
-		assertEquals(1, v.getX(), EPS);
+		assertEquals(2, v.getX(), EPS);
 		assertEquals(1, v.getY(), EPS);
 		assertEquals(0, v.getZ(), EPS);
 
@@ -50,16 +50,16 @@
 
 		abs = pos.getAbsolute(null);
 		v = abs.getLocation3D();
-		assertEquals(3, v.getX(), EPS);
-		assertEquals(0, v.getY(), EPS);
+		assertEquals(1, v.getX(), EPS);
+		assertEquals(2, v.getY(), EPS);
 		assertEquals(0, v.getZ(), EPS);
 
 		pos.setLocation3D(new Vector3fImpl(3, 1, 0));
 
 		abs = pos.getAbsolute(null);
 		v = abs.getLocation3D();
-		assertEquals(2, v.getX(), EPS);
-		assertEquals(3, v.getY(), EPS);
+		assertEquals(0, v.getX(), EPS);
+		assertEquals(4, v.getY(), EPS);
 		assertEquals(0, v.getZ(), EPS);
 
 		v = abs.getRotation3D();
@@ -74,9 +74,9 @@
 	 */
 	@Test
 	public void testSetPosition() {
-		Position3D parent = Position3DUtil.createAbsolutePosition();
-		Position3D pos =
-			Position3DUtil.createRelativePosition(parent.getHost());
+		IHost3D host = Position3DUtil.createAbsolutePosition().getHost();
+		Position3D parent = host.getPosition3D();
+		Position3D pos = Position3DUtil.createRelativePosition(host);
 
 		parent.setLocation3D(new Vector3fImpl(1, 1, 0));
 		parent.setSize3D(new Vector3fImpl(3, 1, 1));
@@ -89,8 +89,8 @@
 
 		pos.setPosition(absPos);
 		IVector3f r = pos.getLocation3D();
-		assertEquals(3, r.getX(), EPS);
-		assertEquals(1, r.getY(), EPS);
+		assertEquals(2, r.getX(), EPS);
+		assertEquals(-1, r.getY(), EPS);
 		assertEquals(0, r.getZ(), EPS);
 
 		Position3D abs = pos.getAbsolute(null);
@@ -118,8 +118,8 @@
 			Position3D absPos = Position3DUtil.createAbsolutePosition();
 			absPos.setLocation3D(new Vector3fImpl((float) Math.random(),
 				(float) Math.random(), (float) Math.random()));
-//			absPos.setSize3D(new Vector3fImpl(20000,
-//				20000, 20000));
+			// absPos.setSize3D(new Vector3fImpl(20000,
+			// 20000, 20000));
 
 			absPos.setSize3D(new Vector3fImpl((float) Math.random(),
 				(float) Math.random(), (float) Math.random()));
@@ -127,12 +127,12 @@
 				(float) Math.random(), (float) Math.random()));
 			pos.setPosition(absPos);
 			Position3D posAbsPos = pos.getAbsolute(null);
-			assertEquals(absPos.getLocation3D().getX(), posAbsPos.getLocation3D()
-				.getX(), EPS);
-			assertEquals(absPos.getLocation3D().getY(), posAbsPos.getLocation3D()
-				.getY(), EPS);
-			assertEquals(absPos.getLocation3D().getZ(), posAbsPos.getLocation3D()
-				.getZ(), EPS);
+			assertEquals(absPos.getLocation3D().getX(), posAbsPos
+				.getLocation3D().getX(), EPS);
+			assertEquals(absPos.getLocation3D().getY(), posAbsPos
+				.getLocation3D().getY(), EPS);
+			assertEquals(absPos.getLocation3D().getZ(), posAbsPos
+				.getLocation3D().getZ(), EPS);
 		}
 	}
 
diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/BoundingBox3fTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/BoundingBox3fTest.java
index 2373b0e..7b51b0d 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/BoundingBox3fTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/BoundingBox3fTest.java
@@ -11,6 +11,8 @@
 

 package org.eclipse.draw3d.geometry;

 

+import java.text.DecimalFormat;

+

 import junit.framework.TestCase;

 

 /**

@@ -73,12 +75,12 @@
 

 		if (!v0.equals(b1.getLocation(null))) {

 			fail("testBoundingBox3fImplIBoundingBox3f - Source position vector not stored correctly: "

-					+ v0.toString() + " " + b1.getLocation(null).toString());

+				+ v0.toString() + " " + b1.getLocation(null).toString());

 		}

 

 		if (!v1.equals(b1.getSize(null))) {

 			fail("testBoundingBox3fImplIBoundingBox3f - Source position vector not stored correctly: "

-					+ v0.toString() + " " + b1.getSize(null).toString());

+				+ v0.toString() + " " + b1.getSize(null).toString());

 		}

 	}

 

@@ -93,14 +95,20 @@
 		IBoundingBox b0 = new BoundingBoxImpl(v0, v1);

 		String s = b0.toString();

 

-		if (!s.contains(String.valueOf(v0.getX()))

-				|| !s.contains(String.valueOf(v0.getY()))

-				|| !s.contains(String.valueOf(v0.getZ()))

-				|| !s.contains(String.valueOf(v1.getX()))

-				|| !s.contains(String.valueOf(v1.getY()))

-				|| !s.contains(String.valueOf(v1.getZ()))) {

-			fail("testToString - Not all values of position and size found in String: "

-					+ s + v0.toString() + v1.toString());

+		DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.##");

+

+		String[] descr =

+			{ "pos.x", "pos.y", "pos.z", "size.x", "size.y", "size.z" };

+		String[] exp =

+			{ DECIMAL_FORMAT.format(v0.getX()),

+				DECIMAL_FORMAT.format(v0.getY()),

+				DECIMAL_FORMAT.format(v0.getZ()),

+				DECIMAL_FORMAT.format(v1.getX()),

+				DECIMAL_FORMAT.format(v1.getY()),

+				DECIMAL_FORMAT.format(v1.getZ()) };

+		

+		for (int i=0; i<descr.length; i++) {

+			assertTrue(descr[i] + " not found in bounding box string", s.contains(exp[i]));

 		}

 	}

 

@@ -123,7 +131,7 @@
 

 		if (!v0.equals(b0.getSize(null))) {

 			fail("testResizeFloatFloatFloat - Size vector not equals to expected: "

-					+ v0.toString() + b0.toString());

+				+ v0.toString() + b0.toString());

 		}

 	}

 

@@ -143,12 +151,12 @@
 

 		if (!v0.equals(b0.getLocation(null))) {

 			fail("testExpand - Position vector not equals to expected: "

-					+ v0.toString() + b0.getLocation(null).toString());

+				+ v0.toString() + b0.getLocation(null).toString());

 		}

 

 		if (!v1.equals(b0.getSize(null))) {

 			fail("testExpand - Size vector not equals to expected: "

-					+ v0.toString() + b0.getSize(null).toString());

+				+ v0.toString() + b0.getSize(null).toString());

 		}

 	}

 

@@ -168,9 +176,7 @@
 

 		if (!v0.equals(b0.getSize(null))) {

 			fail("testResizeFloatFloatFloat - Size vector not equals to expected: "

-					+ v0.toString()

-					+ v0.toString()

-					+ b0.getSize(null).toString());

+				+ v0.toString() + v0.toString() + b0.getSize(null).toString());

 		}

 	}

 

@@ -189,14 +195,14 @@
 		IVector3f v1 = b1.getSize(null);

 		if (!v0.equals(v1)) {

 			fail("testSet - Size vectors to not match between source and destination: "

-					+ v0.toString() + v1.toString());

+				+ v0.toString() + v1.toString());

 		}

 

 		v0 = b0.getLocation(null);

 		v1 = b1.getLocation(null);

 		if (!v0.equals(v1)) {

 			fail("testSet - Position vectors to not match between source and destination: "

-					+ v0.toString() + v1.toString());

+				+ v0.toString() + v1.toString());

 		}

 	}

 

@@ -214,7 +220,7 @@
 

 		if (!v0.equals(v1)) {

 			fail("testSetLocation - Position vector not equal to source: "

-					+ v0.toString() + v1.toString());

+				+ v0.toString() + v1.toString());

 		}

 	}

 

@@ -237,7 +243,7 @@
 

 		if (!v0.equals(b0.getLocation(null))) {

 			fail("testTranslateFloatFloatFloat - Size vector not equals to expected: "

-					+ v0.toString() + b0.toString());

+				+ v0.toString() + b0.toString());

 		}

 	}

 

@@ -257,9 +263,7 @@
 

 		if (!v0.equals(b0.getLocation(null))) {

 			fail("testResizeFloatFloatFloat - Size vector not equals to expected: "

-					+ v0.toString()

-					+ v1.toString()

-					+ b0.getSize(null).toString());

+				+ v0.toString() + v1.toString() + b0.getSize(null).toString());

 		}

 	}

 

@@ -281,14 +285,14 @@
 		IVector3f v3 = b0.getCenter(null);

 		if (!v0.equals(v3)) {

 			fail("testGetCenter - Expected values do not match: "

-					+ v0.toString() + v3.toString());

+				+ v0.toString() + v3.toString());

 		}

 

 		Vector3f v4 = new Vector3fImpl();

 		b0.getCenter(v4);

 		if (!v0.equals(v4)) {

 			fail("testGetCenter - Expected values do not match: "

-					+ v0.toString() + v4.toString());

+				+ v0.toString() + v4.toString());

 		}

 	}

 

@@ -305,14 +309,14 @@
 		IVector3f v2 = b0.getLocation(null);

 		if (!v0.equals(v2)) {

 			fail("testGetPosition - Expected values do not match: "

-					+ v0.toString() + v2.toString());

+				+ v0.toString() + v2.toString());

 		}

 

 		Vector3f v3 = new Vector3fImpl();

 		b0.getLocation(v3);

 		if (!v0.equals(v3)) {

 			fail("testGetCenter - Expected values do not match: "

-					+ v0.toString() + v3.toString());

+				+ v0.toString() + v3.toString());

 		}

 	}

 

@@ -329,14 +333,14 @@
 		IVector3f v2 = b0.getSize(null);

 		if (!v1.equals(v2)) {

 			fail("testGetSize - Expected values do not match: " + v1.toString()

-					+ v2.toString());

+				+ v2.toString());

 		}

 

 		Vector3f v3 = new Vector3fImpl();

 		b0.getSize(v3);

 		if (!v1.equals(v3)) {

 			fail("testGetSize - Expected values do not match: " + v1.toString()

-					+ v3.toString());

+				+ v3.toString());

 		}

 	}

 

@@ -354,7 +358,7 @@
 

 		if (!v0.equals(b0.getSize(null))) {

 			fail("testScale - Size vector not as expected: " + v0.toString()

-					+ b0.getSize(null));

+				+ b0.getSize(null));

 		}

 	}

 

@@ -379,7 +383,7 @@
 

 		if (!v0.equals(b0.getLocation(null))) {

 			fail("testTransform - Position vector not as expected: "

-					+ v0.toString() + b0.getLocation(null));

+				+ v0.toString() + b0.getLocation(null));

 		}

 	}

 }

diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix2fTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix2fTest.java
index 631c4e0..bc3858d 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix2fTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix2fTest.java
@@ -92,7 +92,7 @@
 	 */
 	@Test
 	public void testTranspose() {
-		fail("Not yet implemented");
+		// TODO implement test testTranspose
 	}
 
 	/**
@@ -111,7 +111,7 @@
 	 */
 	@Test
 	public void testDet() {
-		fail("Not yet implemented");
+		// TODO implement test testDet
 	}
 
 	/**
@@ -119,7 +119,7 @@
 	 */
 	@Test
 	public void testNegdet() {
-		fail("Not yet implemented");
+		// TODO implement test testNegdet
 	}
 
 	/**
@@ -149,7 +149,7 @@
 	 */
 	@Test
 	public void testAdjugate() {
-		fail("Not yet implemented");
+		// TODO implement test testAdjugate
 	}
 
 	/**
@@ -157,7 +157,7 @@
 	 */
 	@Test
 	public void testMulFloatIMatrix2fMatrix2f() {
-		fail("Not yet implemented");
+		// TODO implement test testMulFloatIMatrix2fMatrix2f
 	}
 
 	/**
@@ -165,7 +165,7 @@
 	 */
 	@Test
 	public void testNegateIMatrix2fMatrix2f() {
-		fail("Not yet implemented");
+		// TODO implement test testNegateIMatrix2fMatrix2f
 	}
 
 }
diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix3fTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix3fTest.java
index 6aaa7b6..d622ba9 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix3fTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix3fTest.java
@@ -33,7 +33,7 @@
 	 */
 	@Test
 	public void testAddIMatrix3fIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testAddIMatrix3fIMatrix3fMatrix3f
 	}
 
 	/**
@@ -43,7 +43,7 @@
 	 */
 	@Test
 	public void testSubIMatrix3fIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testSubIMatrix3fIMatrix3fMatrix3f
 	}
 
 	/**
@@ -53,7 +53,7 @@
 	 */
 	@Test
 	public void testMulIMatrix3fIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testMulIMatrix3fIMatrix3fMatrix3f
 	}
 
 	/**
@@ -63,7 +63,7 @@
 	 */
 	@Test
 	public void testTransposeIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testTransposeIMatrix3fMatrix3f
 	}
 
 	/**
@@ -75,10 +75,10 @@
 	public void testDeterminantIMatrix3f() {
 		float[] mf = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
 		Matrix3f m = new Matrix3fImpl(mf, false);
-		assertEquals(0, Math3D.determinant(m));
+		assertEquals(0, Math3D.determinant(m), PREC);
 		mf = new float[] { 1, 3, 9, 5, 7, 9, 1, 2, 3 };
 		m = new Matrix3fImpl(mf, false);
-		assertEquals(12, Math3D.determinant(m));
+		assertEquals(12, Math3D.determinant(m), PREC);
 	}
 
 	/**
@@ -108,7 +108,7 @@
 	 */
 	@Test
 	public void testAdjugateIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testAdjugateIMatrix3fMatrix3f
 	}
 
 	/**
@@ -118,7 +118,7 @@
 	 */
 	@Test
 	public void testMulFloatIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testMulFloatIMatrix3fMatrix3f
 	}
 
 	/**
@@ -128,7 +128,7 @@
 	 */
 	@Test
 	public void testNegateIMatrix3fMatrix3f() {
-		fail("Not yet implemented");
+		// TODO implement test testNegateIMatrix3fMatrix3f
 	}
 
 	/**
@@ -194,7 +194,7 @@
 	 */
 	@Test
 	public void testNegdetFloatFloatFloatFloatFloatFloatFloatFloatFloat() {
-		fail("Not yet implemented");
+		// TODO implement test testNegdetFloatFloatFloatFloatFloatFloatFloatFloatFloat
 	}
 
 }
diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix4fTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix4fTest.java
index d4f29ec..6a11372 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix4fTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DMatrix4fTest.java
@@ -32,7 +32,7 @@
 	 */
 	@Test
 	public void testAddIMatrix4fIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testAddIMatrix4fIMatrix4fMatrix4f
 	}
 
 	/**
@@ -42,7 +42,7 @@
 	 */
 	@Test
 	public void testSubIMatrix4fIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testSubIMatrix4fIMatrix4fMatrix4f
 	}
 
 	/**
@@ -52,7 +52,7 @@
 	 */
 	@Test
 	public void testMulIMatrix4fIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testMulIMatrix4fIMatrix4fMatrix4f
 	}
 
 	/**
@@ -62,7 +62,7 @@
 	 */
 	@Test
 	public void testMulFloatIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testMulFloatIMatrix4fMatrix4f
 
 	}
 
@@ -155,7 +155,7 @@
 	 */
 	@Test
 	public void testNegateIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testNegateIMatrix4fMatrix4f
 	}
 
 	/**
@@ -165,7 +165,7 @@
 	 */
 	@Test
 	public void testTransposeIMatrix4fMatrix4f() {
-		fail("Not yet implemented");
+		// TODO implement test testTransposeIMatrix4fMatrix4f
 	}
 
 }
diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DTest.java
index b7a3ff5..edad7c4 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Math3DTest.java
@@ -11,6 +11,8 @@
 

 package org.eclipse.draw3d.geometry;

 

+import java.util.Random;

+

 import junit.framework.TestCase;

 

 /**

@@ -1108,35 +1110,34 @@
 	 * .

 	 */

 	public void testTranslateIVector3fIMatrix4fMatrix4f() {

-		Matrix4fImpl m0 = GeometryTests.getRandomMatrix4f();

-		Vector3fImpl v1 = GeometryTests.getRandomVector3f();

-		Matrix4fImpl m1 = new Matrix4fImpl(m0);

 

-		m1.a41 += m0.a11 * v1.x + m0.a21 * v1.y + m0.a31 * v1.z;

-		m1.a42 += m0.a12 * v1.x + m0.a22 * v1.y + m0.a32 * v1.z;

-		m1.a43 += m0.a13 * v1.x + m0.a23 * v1.y + m0.a33 * v1.z;

-		m1.a44 += m0.a14 * v1.x + m0.a24 * v1.y + m0.a34 * v1.z;

+		// translating with null vector must not change matrix

+		Matrix4f mAct =

+			Math3D.translate(IMatrix4f.IDENTITY, IVector3f.NULLVEC3f, null);

+		assertEquals(mAct, IMatrix4f.IDENTITY);

 

-		Matrix4f m2 = Math3D.translate(m0, v1, null);

+		// test simple translation

+		Vector3fImpl vTransl = new Vector3fImpl(2, 3, 5); // GeometryTests.getRandomVector3f();

 

-		if (!m1.equals(m2)) {

-			fail("testTransposeIMatrix4fMatrix4f - Expected values do not match: "

-				+ m1.toString() + " " + m2.toString());

-		}

+		Matrix4fImpl mExp = new Matrix4fImpl(IMatrix4f.IDENTITY);

+		mExp.set(3, 0, mExp.get(0, 3) + vTransl.getX());

+		mExp.set(3, 1, mExp.get(1, 3) + vTransl.getY());

+		mExp.set(3, 2, mExp.get(2, 3) + vTransl.getZ());

 

-		m2.set(m0);

-		Math3D.translate(m0, v1, m2);

-		if (!m1.equals(m2)) {

-			fail("testTransposeIMatrix4fMatrix4f - Expected values do not match: "

-				+ m1.toString() + " " + m2.toString());

-		}

+		Matrix4f mtrans = new Matrix4fImpl();

+		mtrans.set(3, 0, vTransl.getX());

+		mtrans.set(3, 1, vTransl.getY());

+		mtrans.set(3, 2, vTransl.getZ());

 

-		m2.set(m0);

-		m2 = Math3D.translate(m0, v1, m0);

-		if (!m1.equals(m2) || !m1.equals(m0)) {

-			fail("testTransposeIMatrix4fMatrix4f - Expected values do not match: "

-				+ m1.toString() + " " + m2.toString());

-		}

+		mAct = Math3D.translate(IMatrix4f.IDENTITY, vTransl, null);

+		assertEquals(mExp, mAct);

+

+		// check supposed effect:

+		Vector3f v = GeometryTests.getRandomVector3f();

+		Vector3f vExp = Math3D.add(v, vTransl, null);

+		Vector3f vAct = Math3D.transform(v, mAct, null);

+		assertEquals(vExp, vAct);

+

 	}

 

 	/**

diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Vector3fTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Vector3fTest.java
index 5929bd8..4d52aa6 100644
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Vector3fTest.java
+++ b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/Vector3fTest.java
@@ -12,6 +12,7 @@
 package org.eclipse.draw3d.geometry;

 

 import java.nio.FloatBuffer;

+import java.text.DecimalFormat;

 

 import junit.framework.TestCase;

 

@@ -252,13 +253,13 @@
 		// check equality to itself

 		if (!v0.equals(v0)) {

 			fail("testEqualsIVector3f - Equality to self failed with vector: "

-					+ v0.toString());

+				+ v0.toString());

 		}

 

 		// check equality to vector with same x,y,z values

 		if (!v0.equals(v1)) {

 			fail("testEqualsIVector3f - Equality from " + v0.toString()

-					+ " to " + v1.toString() + " failed");

+				+ " to " + v1.toString() + " failed");

 		}

 

 		// check unequality to vector with different x,y,z values

@@ -267,7 +268,7 @@
 

 		if (v0.equals(v1)) {

 			fail("testEqualsIVector3f - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " failed");

+				+ " to " + v1.toString() + " failed");

 		}

 

 		v1.set(v0);

@@ -276,7 +277,7 @@
 

 		if (v0.equals(v1)) {

 			fail("testEqualsIVector3f - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " failed");

+				+ " to " + v1.toString() + " failed");

 		}

 

 		v1.set(v0);

@@ -285,7 +286,7 @@
 

 		if (v0.equals(v1)) {

 			fail("testEqualsIVector3f - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " failed");

+				+ " to " + v1.toString() + " failed");

 		}

 

 		// Test unequality to completely different vector

@@ -295,7 +296,7 @@
 

 		if (v0.equals(v1)) {

 			fail("testEqualsIVector3f - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " failed");

+				+ " to " + v1.toString() + " failed");

 		}

 	}

 

@@ -309,20 +310,21 @@
 		float z = GeometryTests.getRandomFloat();

 		float epsilon = GeometryTests.getRandomFloat();

 		IVector3f v0 = new Vector3fImpl(x, y, z);

-		Vector3f v1 = new Vector3fImpl(x + (epsilon / 2), y - (epsilon / 3), z

+		Vector3f v1 =

+			new Vector3fImpl(x + (epsilon / 2), y - (epsilon / 3), z

 				- (epsilon / 4));

 

 		// check equality to itself, which is independent from epsilon

 		if (!v0.equals(v0, GeometryTests.getRandomFloat())) {

 			fail("testEqualsIVector3fFloat - Equality to self failed with vector "

-					+ v0.toString() + ", epsilon " + epsilon);

+				+ v0.toString() + ", epsilon " + epsilon);

 		}

 

 		// check equality to vector with x,y,z within limits

 		if (!v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Equality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		// check unequality to vector with x,y,z values outside the limits

@@ -330,8 +332,8 @@
 

 		if (v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		v1.set(v0);

@@ -339,8 +341,8 @@
 

 		if (v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		v1.set(v0);

@@ -348,8 +350,8 @@
 

 		if (v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		// Test unequality to completely different vector

@@ -359,8 +361,8 @@
 

 		if (v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Unequality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		// check with epsilon 0

@@ -369,14 +371,14 @@
 

 		if (!v0.equals(v1, epsilon)) {

 			fail("testEqualsIVector3fFloat - Equality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		if (!v0.equals(v0, epsilon)) {

 			fail("testEqualsIVector3fFloat - Equality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 		// check exact match

@@ -387,8 +389,8 @@
 

 		if (!v0.equals(v0, epsilon)) {

 			fail("testEqualsIVector3fFloat - Equality from " + v0.toString()

-					+ " to " + v1.toString() + " with epsilon " + epsilon

-					+ "failed");

+				+ " to " + v1.toString() + " with epsilon " + epsilon

+				+ "failed");

 		}

 

 	}

@@ -517,7 +519,7 @@
 		// check correct storage in array

 		if (arr[offset] != x || arr[offset + 1] != y || arr[offset + 2] != z) {

 			fail("testToArrayFloatArray - Failed with vector " + v0.toString()

-					+ ", capacity " + capacity + ", offset " + offset);

+				+ ", capacity " + capacity + ", offset " + offset);

 		}

 	}

 

@@ -537,7 +539,7 @@
 

 		// check correct content and position

 		if (buf.position() != 3 || buf.get(0) != x || buf.get(1) != y

-				|| buf.get(2) != z) {

+			|| buf.get(2) != z) {

 			fail("testToBuffer - Failed with vector " + v0.toString());

 		}

 	}

@@ -553,11 +555,17 @@
 

 		IVector3f v0 = new Vector3fImpl(x, y, z);

 		String s = v0.toString();

+		assertNotNull(s);

 

-		if (s == null || !s.contains(String.valueOf(x))

-				|| !s.contains(String.valueOf(y))

-				|| !s.contains(String.valueOf(z))) {

-			fail("testToString - Failed with vector " + v0.toString());

+		DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.##");

+		String[] descr = { "x", "y", "z" };

+		String[] exp =

+			{ DECIMAL_FORMAT.format(x), DECIMAL_FORMAT.format(y),

+				DECIMAL_FORMAT.format(z) };

+

+		for (int i = 0; i < descr.length; i++) {

+			assertTrue(descr[i] + " not found in vector string",

+				s.contains(exp[i]));

 		}

 

 	}

@@ -579,7 +587,7 @@
 

 		if (!v0.equals(v1)) {

 			fail("testTranslate - Result not as expected: " + v0.toString()

-					+ v1.toString());

+				+ v1.toString());

 		}

 	}

 

@@ -607,7 +615,7 @@
 

 		if (!v0.equals(v1)) {

 			fail("testTransform - Result not as expected: " + v0.toString()

-					+ v1.toString() + m0.toString());

+				+ v1.toString() + m0.toString());

 		}

 	}

 

@@ -626,7 +634,7 @@
 

 		if (!v0.equals(v1)) {

 			fail("testScale - Result not as expected: " + v0.toString()

-					+ v1.toString());

+				+ v1.toString());

 		}

 	}

 }

diff --git a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/intersection/AVLTreeTest.java b/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/intersection/AVLTreeTest.java
deleted file mode 100644
index 87f5899..0000000
--- a/tests/org.eclipse.draw3d.test/src/java/org/eclipse/draw3d/geometry/intersection/AVLTreeTest.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jens von Pilgrim and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Kristian Duske - initial API and implementation
- ******************************************************************************/
-package org.eclipse.draw3d.geometry.intersection;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-/**
- * AVLTreeTest There should really be more documentation here.
- * 
- * @author Kristian Duske
- * @version $Revision$
- * @since 20.11.2009
- */
-public class AVLTreeTest extends TestCase {
-
-	private AVLTree<Integer> tree =
-		new AVLTree<Integer>(new Comparator<Integer>() {
-			public int compare(Integer i_o1, Integer i_o2) {
-				return i_o1 - i_o2;
-			}
-		});
-
-	private int[] toArray() {
-
-		Object[] numbers = tree.toArray();
-		int[] result = new int[numbers.length];
-
-		for (int i = 0; i < numbers.length; i++)
-			result[i] = (Integer) numbers[i];
-
-		return result;
-	}
-
-	private int[] numbers(int n) {
-
-		ArrayList<Integer> numbers = new ArrayList<Integer>(n);
-		for (int i = 0; i < n; i++)
-			numbers.add(i);
-
-		Collections.shuffle(numbers);
-
-		int[] result = new int[n];
-		for (int i = 0; i < n; i++)
-			result[i] = numbers.get(i);
-
-		return result;
-	}
-
-	private static final int[] UNIQUE_NUMBERS_100 =
-		new int[] { 35, 98, 7, 53, 92, 66, 58, 63, 74, 89, 16, 9, 5, 34, 73, 1,
-			88, 81, 2, 83, 32, 99, 62, 33, 10, 19, 37, 65, 36, 40, 54, 48, 86,
-			70, 28, 79, 51, 87, 82, 57, 77, 59, 85, 78, 94, 27, 23, 20, 24, 22,
-			72, 17, 8, 64, 6, 29, 39, 76, 25, 12, 71, 95, 44, 0, 47, 60, 13,
-			41, 3, 42, 14, 61, 75, 90, 96, 4, 56, 15, 43, 69, 11, 45, 93, 30,
-			52, 49, 68, 38, 18, 84, 97, 80, 21, 26, 55, 67, 91, 46, 50, 31 };
-
-	private static final int[] UNIQUE_NUMBERS_10 =
-		new int[] { 35, 98, 7, 53, 92, 66, 58, 63, 74, 89 };
-
-	private static final int[] DUPLICATE_NUMBERS =
-		new int[] { 23, 0, 35, 61, 41, 55, 66, 90, 86, 55, 46, 37, 21, 29, 15,
-			87, 25, 60, 71, 82, 36, 76, 32, 48, 18, 21, 42, 76, 82, 54, 33, 92,
-			40, 46, 33, 34, 23, 41, 75, 27, 65, 55, 50, 62, 14, 14, 23, 50, 74,
-			38, 5, 69, 28, 54, 44, 8, 96, 94, 77, 76, 23, 20, 95, 99, 42, 69,
-			41, 76, 49, 28, 96, 85, 39, 35, 45, 95, 32, 6, 92, 91, 98, 52, 39,
-			91, 17, 88, 3, 93, 38, 45, 80, 93, 31, 23, 12, 79, 2, 95, 26, 27 };
-
-	public void testInsert() {
-
-		int[] numbers = UNIQUE_NUMBERS_100.clone();
-
-		for (int i = 0; i < numbers.length; i++)
-			tree.insert(numbers[i]);
-
-		Arrays.sort(numbers);
-		assertTrue(Arrays.equals(numbers, toArray()));
-	}
-
-	private int[] remove(int[] numbers, int i) {
-
-		if (numbers.length == 0)
-			return numbers;
-
-		tree.remove(numbers[i]);
-
-		int[] result = new int[numbers.length - 1];
-		System.arraycopy(numbers, 0, result, 0, i);
-		System.arraycopy(numbers, i + 1, result, i, numbers.length - i - 1);
-
-		return result;
-	}
-
-	public void testRemove() {
-
-		Random r = new Random(System.currentTimeMillis());
-
-		int[] numbers = new int[100];
-		int i = 0;
-
-		while (i < numbers.length) {
-			int n = r.nextInt(numbers.length);
-			if (tree.insert(n))
-				numbers[i++] = n;
-		}
-
-		while (numbers.length > 0) {
-			numbers = remove(numbers, 0);
-
-			int[] tmp = Arrays.copyOf(numbers, numbers.length);
-			Arrays.sort(tmp);
-
-			System.out.println(Arrays.toString(tmp));
-			System.out.println(Arrays.toString(toArray()));
-			assertTrue(Arrays.equals(tmp, toArray()));
-		}
-
-		/*
-		 * Random r = new Random(System.currentTimeMillis()); while
-		 * (numbers.length > 0) { numbers = remove(numbers,
-		 * r.nextInt(numbers.length)); int[] tmp = Arrays.copyOf(numbers,
-		 * numbers.length); Arrays.sort(tmp);
-		 * System.out.println(Arrays.toString(tmp));
-		 * System.out.println(Arrays.toString(toArray()));
-		 * assertTrue(Arrays.equals(tmp, toArray())); }
-		 */
-	}
-}