Box class#

template<class value_t, std::size_t dim_>
class Box#

Define a box in multi dimensions.

A box is defined by its minimum and maximum corners.

Template Parameters:
  • value_t – The type of the box corners.

  • dim_ – The dimension of the box

Public Functions

Box(const point_t &min_corner, const point_t &max_corner)#

Construction of a bounded box.

Parameters:
  • min_corner – The vertex with the minimum coordinates

  • max_corner – The vertex with the maximum coordinates

const point_t &min_corner() const#

Return the min corner of the box.

point_t &min_corner()#

Return the min corner of the box.

const point_t &max_corner() const#

Return the max corner of the box.

point_t &max_corner()#

Return the max corner of the box.

auto length() const#

Return the length of the box.

auto min_length() const#

Return the minimum length of the box.

bool is_valid() const#

Check if the box is valid.

bool intersects(const Box &other) const#

Check if the box intersects with another box.

Box intersection(const Box &other) const#

Return the intersection of the box with another box.

std::vector<Box> difference(const Box &other) const#

Removes the intersection of the box with another box.

The result is a list of boxes.

bool operator==(const Box &other) const#

Check if the box is equal to another box.

bool operator!=(const Box &other) const#

Check if the box is different from another box.