36 bool contains(std::shared_ptr<Shapes::Shape>
const &shape)
const noexcept {
37 return std::find(m_shapes.begin(), m_shapes.end(), 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 m_shapes.erase(std::remove(m_shapes.begin(), m_shapes.end(), shape),
59 auto dist_compare = [&
pos](std::pair<double, Utils::Vector3d>
const &
res,
60 std::shared_ptr<Shapes::Shape>
const &shape) {
63 shape->calculate_dist(
pos, d, vec);
65 throw std::domain_error(
66 "Distance to Union not well-defined for given position!");
68 return std::make_pair(d, vec);
73 std::accumulate(m_shapes.begin(), m_shapes.end(),
74 std::make_pair(std::numeric_limits<double>::infinity(),
81 m_shapes.begin(), m_shapes.end(),
82 [&
pos](
auto const &shape) { return shape->is_inside(pos); });
86 std::vector<std::shared_ptr<Shapes::Shape>> m_shapes;
__shared__ int pos[MAXDEPTH *THREADS5/WARPSIZE]
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