Skip to main content

class region_map

Declaration

template <typename ValueType>
class region_map { /* full declaration omitted */ };

Description

The region_map is a spatial data structure for storing values within an n-dimensional extent. Each point within the extent can hold a single value of type ValueType, and all points are initially set to a provided default value.

Template Parameters

ValueType

Member Variables

int m_dims
std::variant< std::monostate, region_map_detail::region_map_impl<ValueType, 0>, region_map_detail::region_map_impl<ValueType, 1>, region_map_detail::region_map_impl<ValueType, 2>, region_map_detail::region_map_impl<ValueType, 3>> m_region_map

Member Function Overview

  • template <typename Functor>
    apply_to_values(const Functor & f) → void
  • format_to(fmt::format_context::iterator out) const → auto
  • get_region_values(const region<3> & request) const → std::vector<std::pair<box<3>, ValueType>>
  • get_region_values(const box<3> & request) const → std::vector<std::pair<box<3>, ValueType>>
  • region_map(const range<3> & extent, const ValueType & default_value = ValueType{})
  • region_map(const box<3> & extent, const ValueType & default_value = ValueType{})
  • update_box(const box<3> & box, const ValueType & value) → void
  • update_region(const region<3> & region, const ValueType & value) → void
  • template <int Dims>
    get_map() → region_map_detail::region_map_impl<ValueType, Dims> &
  • template <int Dims>
    get_map() const → const region_map_detail::region_map_impl<ValueType, Dims> &

Member Functions

template <typename Functor>
void apply_to_values(const Functor& f)

Description

Applies a function f to every value within the region map and stores the result in its place.

Template Parameters

Functor

Parameters

const Functor& f

auto format_to(
    fmt::format_context::iterator out) const

Parameters

fmt::format_context::iterator out

std::vector<std::pair<box<3>, ValueType>>
get_region_values(const region<3>& request) const

Description

Returns all entries in the region map that intersect with the request region.

Parameters

const region<3>& request

Returns

A list of boxes clamped to the request region, and their associated values.


std::vector<std::pair<box<3>, ValueType>>
get_region_values(const box<3>& request) const

Description

Returns all entries in the region map that intersect with the request box.

Parameters

const box<3>& request

Returns

A list of boxes clamped to the request box, and their associated values.


region_map(
    const range<3>& extent,
    const ValueType& default_value = ValueType{})

Parameters

const range<3>& extent
The extent of the region map defines the set of points for which it can hold values. All update operations and query results are clamped to this extent.
const ValueType& default_value = ValueType{}

region_map(
    const box<3>& extent,
    const ValueType& default_value = ValueType{})

Parameters

const box<3>& extent
The extent of the region map defines the set of points for which it can hold values. All update operations and query results are clamped to this extent.
const ValueType& default_value = ValueType{}

void update_box(const box<3>& box,
                const ValueType& value)

Description

Sets a new value for the provided box within the region map.

Parameters

const box<3>& box
const ValueType& value

void update_region(const region<3>& region,
                   const ValueType& value)

Description

Sets a new value for the provided region within the region map.

Parameters

const region<3>& region
const ValueType& value

template <int Dims>
region_map_detail::region_map_impl<ValueType,
                                   Dims>&
get_map()

Template Parameters

int Dims

template <int Dims>
const region_map_detail::
    region_map_impl<ValueType, Dims>&
    get_map() const

Template Parameters

int Dims