5#include "vipra/geometry/circle.hpp"
6#include "vipra/geometry/line.hpp"
7#include "vipra/geometry/rectangle.hpp"
8#include "vipra/geometry/triangle.hpp"
10namespace VIPRA::Geometry {
12template <
typename class_t>
17template <has_s
ides polygon_t, has_s
ides other_t>
18VIPRA_POLY_FUNC
auto do_intersect(polygon_t
const& polygon,
19 other_t
const& other)
noexcept ->
bool
21 auto const sideList = polygon.sides();
22 return std::any_of(sideList.begin(), sideList.end(), [&](
Line const& side) {
23 auto const otherSides = other.sides();
24 return std::any_of(otherSides.begin(), otherSides.end(), [&](Line const& otherSide) {
25 return otherSide.does_intersect(side);
30template <has_s
ides polygon_t>
31VIPRA_POLY_FUNC
auto do_intersect(polygon_t
const& polygon,
32 Line
const& line)
noexcept ->
bool
34 auto const sideList = polygon.sides();
35 return std::any_of(sideList.begin(), sideList.end(),
36 [&](Line
const& side) { return line.does_intersect(side); });
39template <has_s
ides polygon_t>
40VIPRA_POLY_FUNC
auto do_intersect(Line
const& line,
41 polygon_t
const& polygon)
noexcept ->
bool
43 auto const sideList = polygon.sides();
44 return std::any_of(sideList.begin(), sideList.end(),
45 [&](Line
const& side) { return line.does_intersect(side); });
48template <has_s
ides polygon_t>
49VIPRA_POLY_FUNC
auto do_intersect(polygon_t
const& polygon,
50 Circle
const& circle)
noexcept ->
bool
52 auto const sideList = polygon.sides();
53 return std::any_of(sideList.begin(), sideList.end(),
54 [&](Line
const& side) { return circle.does_intersect(side); });
57template <has_s
ides polygon_t>
58VIPRA_POLY_FUNC
auto do_intersect(Circle
const& circle,
59 polygon_t
const& polygon)
noexcept ->
bool
61 auto const sideList = polygon.sides();
62 return std::any_of(sideList.begin(), sideList.end(),
63 [&](Line
const& side) { return circle.does_intersect(side); });
Definition geometry.hpp:13