Geom

Trait Geom 

Source
pub trait Geom {
    // Required method
    fn size(&self) -> Size;

    // Provided methods
    fn row(&self) -> i32 { ... }
    fn column(&self) -> i32 { ... }
    fn cell_len(&self) -> usize { ... }
    fn contains(&self, p: Point) -> bool { ... }
    fn point_to_cellid(&self, p: Point) -> CellId { ... }
    fn cellid_to_point(&self, id: CellId) -> Point { ... }
    fn points(&self) -> Points  { ... }
    fn points_in_row(&self, row: i32) -> PointsInRow  { ... }
    fn points_in_column(&self, column: i32) -> PointsInColumn  { ... }
}
Expand description

A rectangle area.

Required Methods§

Source

fn size(&self) -> Size

Returns the rectangle’s size.

Provided Methods§

Source

fn row(&self) -> i32

Returns the number of the rectangle’s rows.

Source

fn column(&self) -> i32

Returns the number of the rectangle’s columns.

Source

fn cell_len(&self) -> usize

Returns the cell length which is contained in the rectangle.

Source

fn contains(&self, p: Point) -> bool

Returns true if the point is contained in the rectangle.

Source

fn point_to_cellid(&self, p: Point) -> CellId

Convert a point to a corresponding cell ID.

Source

fn cellid_to_point(&self, id: CellId) -> Point

Convert a cell ID to a corresponding point.

Source

fn points(&self) -> Points

Returns an iterator iterating all points.

Source

fn points_in_row(&self, row: i32) -> PointsInRow

Returns an iterator iterating all points in the row.

Source

fn points_in_column(&self, column: i32) -> PointsInColumn

Returns an iterator iterating all points in the column.

Implementors§

Source§

impl<T> Geom for Table<T>