Create an empty region set for a gridSize
x gridSize
grid.
dimension of grid, must be nonnegative integer
Add a rectangle of grid cells to the region labeled by the given label (or create such a labeled region if it was not already present), if it does not conflict with other existing labeled regions.
Two regions with distinct labels conflict if any of their grid cells share an edge.
label of region
rectangle to add to labeled region. Required to have nonzero area and integer coordinates
drawn from {0...gridSize
}.
Get the bounding box of a labeled region.
label of region
the smallest rectangle that contains all the grid cells in the labeled region, or undefined if no region with that label exists.
Get the labels of regions that intersect the given rectangle (where the intersection contains at least one full grid cell).
rectangle to query. Its coordinates must be integers in {0...gridSize
}.
the labels of regions in this set whose intersection with rect contains at least one grid cell
Generated using TypeDoc
An implementation of RegionSet.
PS2 instructions: you must use the provided rep. You may not change the spec of the constructor.