ZLayout EDA Library v1.0.0
Advanced Electronic Design Automation Layout Library with Bilingual Documentation
Loading...
Searching...
No Matches
zlayout.spatial.SpatialIndex Class Reference

Public Member Functions

 __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)

Public Attributes

 quadtree = QuadTree(world_bounds, capacity, max_depth)
dict objects = {}

Protected Attributes

int _next_id = 0

Detailed Description

High-level spatial indexing interface.

Definition at line 227 of file spatial.py.

Constructor & Destructor Documentation

◆ __init__()

zlayout.spatial.SpatialIndex.__init__ ( self,
Rectangle world_bounds,
int capacity = 10,
int max_depth = 8 )

Definition at line 230 of file spatial.py.

Member Function Documentation

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Member Data Documentation

◆ _next_id

int zlayout.spatial.SpatialIndex._next_id = 0
protected

Definition at line 233 of file spatial.py.

◆ objects

dict zlayout.spatial.SpatialIndex.objects = {}

Definition at line 232 of file spatial.py.

◆ quadtree

zlayout.spatial.SpatialIndex.quadtree = QuadTree(world_bounds, capacity, max_depth)

Definition at line 231 of file spatial.py.


The documentation for this class was generated from the following file: