35 bool contains(std::shared_ptr<Shapes::Shape>
const &shape)
const noexcept {
36 return std::ranges::find(m_shapes, shape) != m_shapes.end();
39 void add(std::shared_ptr<Shapes::Shape>
const &shape) {
40 m_shapes.emplace_back(shape);
43 void remove(std::shared_ptr<Shapes::Shape>
const &shape) {
44 std::erase(m_shapes, shape);
57 auto dist_compare = [&pos](std::pair<double, Utils::Vector3d>
const &
res,
58 std::shared_ptr<Shapes::Shape>
const &shape) {
64 throw std::domain_error(
65 "Distance to Union not well-defined for given position!");
72 std::accumulate(m_shapes.begin(), m_shapes.end(),
73 std::make_pair(std::numeric_limits<double>::infinity(),
79 return std::ranges::any_of(
80 m_shapes, [&pos](
auto const &shape) {
return shape->is_inside(pos); });
84 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.