Skip to main content

class box

Declaration

template <int Dims>
class box { /* full declaration omitted */ };

Description

An arbitrary-dimensional box described by its minimum and maximum points.

Declared at: include/grid.h:56

Template Parameters

int Dims

Member Variables

static const int dimensions = Dims
id<Dims> m_min
id<Dims> m_max

Member Function Overview

Friend Function Overview

  • operator!=(const box<Dims> & lhs, const box<Dims> & rhs) → friend bool
  • operator==(const box<Dims> & lhs, const box<Dims> & rhs) → friend bool

Member Functions

box()

Description

Construct an empty box for Dims > 0, and a unit-sized box for Dims == 0

Declared at: include/grid.h:62


box(const id<Dims>& min, const id<Dims>& max)

Description

Construct a box from two points where min must be less or equal to max in every dimension. Empty boxes are normalized to [0,0,0] - [0,0,0], meaning that every box-shaped set of points has a unique representation.

Declared at: include/grid.h:66

Parameters

const id<Dims>& min
const id<Dims>& max

box(const subrange<Dims>& other)

Declared at: include/grid.h:80

Parameters

const subrange<Dims>& other

bool covers(const box<Dims>& other) const

Declared at: include/grid.h:118

Parameters

const box<Dims>& other

bool empty() const

Declared at: include/grid.h:90


static box<Dims> full_range(
    const range<Dims>& range)

Declared at: include/grid.h:88

Parameters

const range<Dims>& range

size_t get_area() const

Description

Counts the number of points covered by the region.

Declared at: include/grid.h:107


int get_effective_dims() const

Description

Returns the smallest dimensionality that *this can be box_cast to.

Declared at: include/grid.h:110


const id<Dims>& get_max() const

Declared at: include/grid.h:99


const id<Dims>& get_min() const

Declared at: include/grid.h:98


const id<Dims>& get_offset() const

Declared at: include/grid.h:101


range<Dims> get_range() const

Declared at: include/grid.h:102


subrange<Dims> get_subrange() const

Declared at: include/grid.h:103


operator subrange<Dims>() const

Declared at: include/grid.h:104


box(grid_detail::non_empty_t,
    const id<Dims>& min,
    const id<Dims>& max)

Declared at: include/grid.h:140

Parameters

grid_detail::non_empty_t
const id<Dims>& min
const id<Dims>& max

Friend Functions

friend bool operator!=(const box<Dims>& lhs,
                       const box<Dims>& rhs)

Declared at: include/grid.h:130

Parameters

const box<Dims>& lhs
const box<Dims>& rhs

friend bool operator==(const box<Dims>& lhs,
                       const box<Dims>& rhs)

Declared at: include/grid.h:129

Parameters

const box<Dims>& lhs
const box<Dims>& rhs