|
| __init__ (self, Rectangle world_bounds, int capacity=10, int max_depth=8) |
int | add_polygon (self, Polygon polygon) |
int | add_rectangle (self, Rectangle rectangle) |
bool | remove_object (self, int obj_id) |
List[Tuple[int, int]] | find_intersecting_edges (self) |
List[int] | find_nearby_objects (self, int obj_id, float distance) |
List[int] | query_region (self, Rectangle region) |
High-level spatial indexing interface.
Definition at line 227 of file spatial.py.
◆ __init__()
zlayout.spatial.SpatialIndex.__init__ |
( |
| self, |
|
|
Rectangle | world_bounds, |
|
|
int | capacity = 10, |
|
|
int | max_depth = 8 ) |
◆ add_polygon()
int zlayout.spatial.SpatialIndex.add_polygon |
( |
| self, |
|
|
Polygon | polygon ) |
Add a polygon to the spatial index.
Definition at line 235 of file spatial.py.
◆ add_rectangle()
int zlayout.spatial.SpatialIndex.add_rectangle |
( |
| self, |
|
|
Rectangle | rectangle ) |
Add a rectangle to the spatial index.
Definition at line 244 of file spatial.py.
◆ find_intersecting_edges()
List[Tuple[int, int]] zlayout.spatial.SpatialIndex.find_intersecting_edges |
( |
| self | ) |
|
Find all pairs of polygons with potentially intersecting edges.
Definition at line 262 of file spatial.py.
◆ find_nearby_objects()
List[int] zlayout.spatial.SpatialIndex.find_nearby_objects |
( |
| self, |
|
|
int | obj_id, |
|
|
float | distance ) |
Find objects within distance of the given object.
Definition at line 286 of file spatial.py.
◆ query_region()
List[int] zlayout.spatial.SpatialIndex.query_region |
( |
| self, |
|
|
Rectangle | region ) |
Find all objects that intersect with the given region.
Definition at line 304 of file spatial.py.
◆ remove_object()
bool zlayout.spatial.SpatialIndex.remove_object |
( |
| self, |
|
|
int | obj_id ) |
Remove an object by ID. Note: QuadTree doesn't support efficient removal.
Definition at line 253 of file spatial.py.
◆ _next_id
int zlayout.spatial.SpatialIndex._next_id = 0 |
|
protected |
◆ objects
dict zlayout.spatial.SpatialIndex.objects = {} |
◆ quadtree
zlayout.spatial.SpatialIndex.quadtree = QuadTree(world_bounds, capacity, max_depth) |
The documentation for this class was generated from the following file: