java.lang.Objectcomputational.geometry.pointlocation.PointLocation
computational.geometry.pointlocation.Kirkpatrick
public class Kirkpatrick
Class implements Kirkpatrick's method for solving point location in planar triangulation with n points. Kirkpatrick's method has O(n log n) for preprocessing and O(log n) query cost.
Field Summary |
---|
Fields inherited from class computational.geometry.pointlocation.PointLocation |
---|
history, points |
Constructor Summary | |
---|---|
Kirkpatrick()
Default constructor |
|
Kirkpatrick(java.util.Collection ps)
Constructor with collection of points |
|
Kirkpatrick(java.util.Collection ps,
LogManager history)
Constructor with collection of points and history |
Method Summary | |
---|---|
void |
checkPreconditions()
Method used to verify if preconditions are satisfied |
java.util.List |
getPoints()
Returns list of points of triangulation. |
java.util.Collection |
getSegments()
Returns collection of segments that compose the triangulation. |
Triangle |
getTriangle(Point point)
Method executes query - localizes triangle that contains point. |
void |
update()
Method executed every time when is needed to update the structure used in Kirkpatrick's method. |
Methods inherited from class computational.geometry.pointlocation.PointLocation |
---|
addPoint, clear, deletePoint, draw, draw, getLogManager, getPolygon, isUpdated, movePoint, setLogManager, setPoints, setUpdated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Kirkpatrick()
public Kirkpatrick(java.util.Collection ps)
ps
- collection of input pointspublic Kirkpatrick(java.util.Collection ps, LogManager history)
ps
- collection of input pointshistory
- log used for tracking changesMethod Detail |
---|
public void checkPreconditions() throws PreconditionViolatedException
checkPreconditions
in class PointLocation
PreconditionViolatedException
- this exception is
thrown if some points is outside limiting boxpublic java.util.List getPoints()
getPoints
in class PointLocation
public java.util.Collection getSegments()
getSegments
in class PointLocation
public Triangle getTriangle(Point point)
getTriangle
in class PointLocation
point
- point for which query is executedpublic void update()
update
in class PointLocation