/// @file /// @brief Task2: class definitions with member function declarations #pragma once #include // std::array #include // std::function #include // std::unordered_set #include // std::vector namespace task2 { /// @brief two-dimensional coordinate using Vec2d = std::array; /// @brief Circle with center and radius using Circle = std::tuple; /// @brief Axis-aligned bounding box with bottom left and top right coordinate) using BBox = std::tuple; /// @brief Arbitrary two-dimensional region described by a boolean function returning /// - true, if the point/coordinate in question lies inside this region, and /// - false, otherwise. using Region = std::function; /// @brief Selects the subset of vertices for which a boolean function evaluates to true /// @param vertices Two-dimensional vertices to select from /// @param region Boolean function to evaluate if a vertex is selected /// @param invert Inverts the selection process if set to true /// @return Indices of the selected vertices std::unordered_set select(const std::vector& vertices, const Region& region, bool invert = false); /// @brief Selects the subset of vertices for which ANY of a sequence of boolean functions evaluates to true /// @param vertices Two-dimensional vertices to select from /// @param regions Sequence of boolean functions to evaluate /// @param invert Inverts the selection process if set to 'true' /// @return Indices of the selected vertices std::unordered_set select_union(const std::vector& vertices, const std::vector& regions, bool invert = false); } // namespace task2