Class Region

Class Documentation

class Region

A class to describe a region within spacetime.

This specifies the map whose coordinates should be used, a lower and upper bound to define a time range, and a set of geometry::Space objects to define regions with space.

For the geometry::Space objects, this class acts like an STL container and provides an iterator interface to specify, access, and modify them.

Public Types

using Space = geometry::Space
template<typename E, typename I, typename F>
using base_iterator = rmf_traffic::detail::bidirectional_iterator<E, I, F>
using iterator = base_iterator<Space, IterImpl, Region>
using const_iterator = base_iterator<const Space, IterImpl, Region>

Public Functions

Region(std::string map, Time lower_bound, Time upper_bound, std::vector<Space> spaces)

Construct a region given the parameters.

Parameters:
  • map[in] The map whose coordinates will be used to define the regions in space.

  • lower_bound[in] The lower bound for the time range.

  • upper_bound[in] The upper bound for the time range.

  • spaces[in] A vector of geometry::Space objects to define the desired regions in space.

Region(std::string map, std::vector<Space> spaces)

Construct a region with no time constraints.

Parameters:
  • map[in] The map whose coordinates will be used to define the regions in space.

  • spaces[in] A vector of geometry::Space objects to define the desired regions in space.

const std::string &get_map() const

Get the name of the map that this Spacetime refers to.

Region &set_map(std::string map)

Set the name of the map that this Spacetime refers to.

const Time *get_lower_time_bound() const

Get the lower bound for the time range.

If there is no lower bound for the time range, then this returns a nullptr.

Region &set_lower_time_bound(Time time)

Set the lower bound for the time range.

Region &remove_lower_time_bound()

Remove the lower bound for the time range.

const Time *get_upper_time_bound() const

Get the upper bound for the time range.

If there is no upper bound for the time range, then this returns a nullptr.

Region &set_upper_time_bound(Time time)

Set the upper bound for the time range.

Region &remove_upper_time_bound()

Remove the upper bound for the time range.

void push_back(Space space)

Add a region of space.

void pop_back()

Remove the last region of space that was added.

iterator erase(iterator it)

Erase a specific region of space based on its iterator.

iterator erase(iterator first, iterator last)

Erase a specific sets of regions of space based on their iterators.

iterator begin()

Get the beginning iterator for the regions of space.

const_iterator begin() const

const-qualified begin()

const_iterator cbegin() const

Explicitly const-qualified alternative for begin()

iterator end()

Get the one-past-the-end iterator for the regions of space.

const_iterator end() const

const-qualified end()

const_iterator cend() const

Explicitly const-qualified alternative for end()

std::size_t num_spaces() const

Get the number of Space regions in this Spacetime region.