34#ifndef SEEN_LIB2GEOM_INTERSECTION_H
35#define SEEN_LIB2GEOM_INTERSECTION_H
45template <
typename TimeA = Coord,
typename TimeB = TimeA>
47 : boost::totally_ordered< Intersection<TimeA, TimeB> >
53 template <
typename TA,
typename TB>
54 Intersection(TA
const &sa, TB
const &sb, TimeA
const &ta, TimeB
const &tb)
57 ,
_point(
lerp(0.5, sa.pointAt(ta), sb.pointAt(tb)))
116template <
typename A,
typename B>
inline
118 std::vector< Intersection<A, B> >
result;
119 for (std::size_t i = 0; i < in.size(); ++i) {
125template <
typename T>
inline
127 for (std::size_t i = 0; i < xs.size(); ++i) {
128 std::swap(xs[i].first, xs[i].second);
Cartesian point / 2D vector and related operations.
Intersection between two shapes.
TimeB second
Second shape and time value.
bool operator==(Intersection const &other) const
bool operator<(Intersection const &other) const
Point point() const
Intersection point, as calculated by the intersection algorithm.
Intersection(TA const &sa, TB const &sb, TimeA const &ta, TimeB const &tb)
Construct from shape references and time values.
TimeA first
First shape and time value.
friend void swap(Intersection &a, Intersection &b)
Intersection(TimeA const &ta, TimeB const &tb, Point const &p)
Additionally report the intersection point.
Range of real numbers that is never empty.
Two-dimensional point that doubles as a vector.
Integral and real coordinate types and some basic utilities.
constexpr Coord lerp(Coord t, Coord a, Coord b)
Numerically stable linear interpolation.
double Coord
Floating point type used to store coordinates.
Various utility functions.
void transpose_in_place(std::vector< Intersection< T, T > > &xs)
std::vector< Intersection< A, B > > transpose(std::vector< Intersection< B, A > > const &in)
Intersection ShapeIntersection
Intersection IntersectionType