36 bool contains(std::shared_ptr<Shapes::Shape>
const &shape)
const noexcept {
37 return std::ranges::find(m_shapes, shape) != m_shapes.end();
40 void add(std::shared_ptr<Shapes::Shape>
const &shape) {
41 m_shapes.emplace_back(shape);
44 void remove(std::shared_ptr<Shapes::Shape>
const &shape) {
45 std::erase(m_shapes, shape);
58 auto dist_compare = [&pos](std::pair<double, Utils::Vector3d>
const &
res,
59 std::shared_ptr<Shapes::Shape>
const &shape) {
65 throw std::domain_error(
66 "Distance to Union not well-defined for given position!");
73 std::accumulate(m_shapes.begin(), m_shapes.end(),
74 std::make_pair(std::numeric_limits<double>::infinity(),
80 return std::ranges::any_of(
81 m_shapes, [&pos](
auto const &shape) {
return shape->is_inside(pos); });
85 std::vector<std::shared_ptr<Shapes::Shape>> m_shapes;
void calculate_dist(Utils::Vector3d const &pos, double &dist, Utils::Vector3d &vec) const override
Calculate the minimum of all distances and the corresponding distance vector for a given position and...
void add(std::shared_ptr< Shapes::Shape > const &shape)
bool contains(std::shared_ptr< Shapes::Shape > const &shape) const noexcept
void remove(std::shared_ptr< Shapes::Shape > const &shape)
bool is_inside(Utils::Vector3d const &pos) const override
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.