updated triangle

This commit is contained in:
zzzzrrr 2009-08-01 00:08:14 -04:00
parent 2db07fc4be
commit 0e5724ed3f
2 changed files with 10 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class AFront(iTriangle: Triangle) {
throw new Exception("Advancing front error")
}
def +=(tuple: Tuple3[Point, Triangle, Node]) = {
def insert(tuple: Tuple3[Point, Triangle, Node]) = {
val (point, triangle, nNode) = tuple
val node = new Node(point, triangle)
// Update pointer

View File

@ -59,6 +59,15 @@ class Triangle(val points: Array[Point], val neighbors: Array[Triangle]) {
neighbors(2) = triangle
}
def oppositePoint(t: Triangle) = {
if(points(0) == t.points(1))
points(1)
else if(points(0) == t.points(2))
points(2)
else
points(0)
}
// Fast point in triangle test
def pointIn(point: Point): Boolean = {