public interface IObstaclePartition extends IPartition
IPartition
that takes a list of Obstacle
s as input to subdivide an area into
PartitionCell
s.
Implementations have to satisfy the following condition for each pair of Obstacle
and PartitionCell
:
Obstacle
s either completely cover PartitionCell
s or do not intersect PartitionCell
s at all.
Example of an IObstaclePartition
of a graph consisting of two nodes connected by one edge. The two nodes are
considered to be obstacles. The colored partition cells subdivide the area such that each obstacle either completely
covers a partition cell or does not intersect with a partition cell.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the partition data such that the
IObstaclePartition can be reused and initialized
with new Obstacle s. |
List<Object> |
getCells(Obstacle obstacle)
Returns all
PartitionCell s that are completely covered by the given Obstacle . |
List<Object> |
getObstacles(PartitionCell cell)
Returns all
Obstacle s that cover the given PartitionCell . |
void |
init(List<Object> obstacles,
YRectangle bounds)
Initializes a new
IObstaclePartition of the area with the given bounds using the given list of
Obstacle s. |
getBounds, getCells, getNeighbors
void clear()
IObstaclePartition
can be reused and initialized
with new Obstacle
s.init(List, YRectangle)
List<Object> getCells(Obstacle obstacle)
PartitionCell
s that are completely covered by the given Obstacle
.obstacle
- the obstacle for which the covered cells will be returnedPartitionCell
instances that are completely covered by the given obstacleList<Object> getObstacles(PartitionCell cell)
Obstacle
s that cover the given PartitionCell
.cell
- the partition cell for which the obstacles will be returnedObstacle
instances that cover the given cellvoid init(List<Object> obstacles, YRectangle bounds)
IObstaclePartition
of the area with the given bounds using the given list of
Obstacle
s.
Unused partitions must be cleared using method clear()
.