java.lang.Object computational.geometry.pointlocation.PointLocation
public abstract class PointLocation
Abstract class that contains basic method used for problem of point location. It has basic constructors, update method and query method used to localize triangle that contains given point.
Field Summary | |
---|---|
protected LogManager |
history
|
protected java.util.List |
points
|
Constructor Summary | |
---|---|
PointLocation()
Default constructor |
|
PointLocation(java.util.Collection ps)
Constructor with collection of points |
|
PointLocation(java.util.Collection ps,
LogManager history)
Constructor with collection of points and history |
Method Summary | |
---|---|
void |
addPoint(Point p)
Adds point to triangulation |
abstract void |
checkPreconditions()
Method used to verify if preconditions are satisfied |
void |
clear()
Clears points from triangulation |
void |
deletePoint(Point p)
Deletes point from triangulation |
void |
draw(java.awt.Graphics gfx)
Draws triangulation to the graphics |
void |
draw(Point point,
java.awt.Graphics gfx)
Draws point to the graphics |
LogManager |
getLogManager()
Returns log manager used for tracking changes. |
java.util.List |
getPoints()
Returns list of points of triangulation. |
protected java.awt.Polygon |
getPolygon(Triangle triangle)
Creates polygon from triangle |
abstract java.util.Collection |
getSegments()
Returns collection of segments that compose the triangulation. |
abstract Triangle |
getTriangle(Point point)
Method executes query - localizes triangle that contains point. |
boolean |
isUpdated()
Checks if structure is updated. |
void |
movePoint(Point p,
int dx,
int dy)
Moves point in triangulation |
void |
setLogManager(LogManager history)
Sets log manager used for tracking changes. |
void |
setPoints(java.util.Collection cp)
Sets points of triangulation |
void |
setUpdated(boolean updated)
Sets state of structure used for solving problem |
abstract void |
update()
Method executed every time when is needed to update the structure used in Kirkpatrick's method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LogManager history
protected java.util.List points
Constructor Detail |
---|
public PointLocation()
public PointLocation(java.util.Collection ps)
ps
- collection of input pointspublic PointLocation(java.util.Collection ps, LogManager history)
ps
- collection of input pointshistory
- log used for tracking changesMethod Detail |
---|
public void addPoint(Point p)
p
- public abstract void checkPreconditions() throws PreconditionViolatedException
PreconditionViolatedException
- this exception is
thrown if some points is outside limiting boxpublic void clear()
public void deletePoint(Point p)
p
- public void draw(java.awt.Graphics gfx)
gfx
- public void draw(Point point, java.awt.Graphics gfx)
point
- gfx
- public LogManager getLogManager()
public java.util.List getPoints()
protected java.awt.Polygon getPolygon(Triangle triangle)
public abstract java.util.Collection getSegments()
public abstract Triangle getTriangle(Point point)
point
- point for which query is executedpublic boolean isUpdated()
public void movePoint(Point p, int dx, int dy)
p
- dx
- dy
- public void setLogManager(LogManager history)
history
- public void setPoints(java.util.Collection cp)
cp
- public void setUpdated(boolean updated)
updated
- public abstract void update()