mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-05 22:09:52 +01:00
removed unessary case 4 query graph pointer magic
This commit is contained in:
parent
4b40deb5db
commit
5f651233d8
@ -86,13 +86,7 @@ class QueryGraph(var head: Node) {
|
||||
|
||||
def case4(sink: Sink, s: Segment, tList: ArrayBuffer[Trapezoid]) {
|
||||
val yNode = new YNode(s, Sink.init(tList(0)), Sink.init(tList(1)))
|
||||
if(s.left != null) {
|
||||
val pNode = new XNode(new Point(s.p.x, s.p.y, s), Sink.init(s.left), yNode)
|
||||
val qNode = new XNode(new Point(s.q.x, s.q.y, s), pNode, Sink.init(tList(2)))
|
||||
replace(sink, qNode)
|
||||
} else {
|
||||
val qNode = new XNode(new Point(s.q.x, s.q.y, s), yNode, Sink.init(tList(2)))
|
||||
replace(sink, qNode)
|
||||
}
|
||||
val qNode = new XNode(new Point(s.q.x, s.q.y, s), yNode, Sink.init(tList(2)))
|
||||
replace(sink, qNode)
|
||||
}
|
||||
}
|
||||
|
@ -37,16 +37,11 @@ class XNode(point: Point, lChild: Node, rChild: Node) extends Node(lChild, rChil
|
||||
// Move to the right in the graph
|
||||
return right.locate(s)
|
||||
} else if(s.p.x == point.x) {
|
||||
if(point.y > s.p.y) {
|
||||
s.left = point.segment.below
|
||||
} else {
|
||||
s.left = point.segment.above
|
||||
}
|
||||
// Move to the right in the graph
|
||||
return right.locate(s)
|
||||
} else {
|
||||
// Move to the left in the graph
|
||||
return left.locate(s)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user