Cell

class Cell(val x: Int, val y: Int, val cellSize: Double)(source)

Represents a cell in a 2D space, defined by its position and size.

Constructors

Link copied to clipboard
constructor(x: Int, y: Int, cellSize: Double)

Properties

Link copied to clipboard
val bounds: Rectangle

Calculates and returns the rectangular bounds of the cell in the 2D grid. The bounds are represented as a rectangle with its top-left position and size derived from the cell's position (x, y) and cellSize.

Link copied to clipboard

The size of the cell along each axis.

Link copied to clipboard
val contentBounds: Rectangle

Computes the bounds of the content within the cell, considering the points stored in it. If no points are present in the cell, the bounds will be represented as an empty rectangle. Otherwise, the bounds are determined by the minimum and maximum x and y coordinates among the points in the cell.

Link copied to clipboard
val x: Int

The x-coordinate of the cell in the grid.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val y: Int

The y-coordinate of the cell in the grid.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun points(): Sequence<Pair<Vector2, Any?>>

Generates a sequence of points contained within the current cell. Iterates over the points stored in the cell and yields each point one by one.