34#ifndef LIB2GEOM_SEEN_PATHVECTOR_H
35#define LIB2GEOM_SEEN_PATHVECTOR_H
38#include <boost/concept/requires.hpp>
39#include <boost/range/algorithm/equal.hpp>
57 , boost::totally_ordered<PathVectorTime>
70 return static_cast<PathTime const &
>(*this) <
static_cast<PathTime const &
>(other);
76 &&
static_cast<PathTime const &
>(*this) ==
static_cast<PathTime const &
>(other);
80 return *
static_cast<PathTime const *
>(
this);
114 , MultipliableNoncommutative< PathVector, Translate
115 , MultipliableNoncommutative< PathVector, Scale
116 , MultipliableNoncommutative< PathVector, Rotate
117 , MultipliableNoncommutative< PathVector, HShear
118 , MultipliableNoncommutative< PathVector, VShear
119 , MultipliableNoncommutative< PathVector, Zoom
120 , boost::equality_comparable< PathVector
139 template <
typename InputIter>
173 _data.push_back(path);
180 return _data.insert(pos, p);
182 template <
typename InputIter>
184 _data.insert(out, first, last);
188 return _data.erase(i);
192 return _data.erase(first, last);
204 void reverse(
bool reverse_paths =
true);
218 return _data.front().initialPoint();
223 return _data.back().finalPoint();
253 template <
typename T>
256 if (
empty())
return *
this;
257 for (
auto & i : *
this) {
264 return boost::range::equal(
_data, other.
_data);
278 std::vector<Point>
nodes()
const;
289std::ostream &operator<<(std::ostream &out, PathVector
const &pv);
Path - a sequence of contiguous curves.
Abstract continuous curve on a plane defined on [0,1].
virtual Coord valueAt(Coord t, Dim2 d) const
Evaluate one of the coordinates at the specified time value.
virtual Point pointAt(Coord t) const
Evaluate the curve at a specified time value.
Intersection between two shapes.
Range of real numbers that is never empty.
Axis-aligned rectangle that can be empty.
PathVector(Path const &p)
std::vector< PathVectorTime > allNearestTimes(Point const &p, Coord *dist=NULL) const
PathVectorTime _factorTime(Coord t) const
size_type size() const
Get the number of paths in the vector.
Path & pathAt(PathVectorTime const &pos)
Coord valueAt(Coord t, Dim2 d) const
void insert(iterator out, InputIter first, InputIter last)
std::vector< Point > nodes() const
const_iterator end() const
void push_back(Path const &path)
Append a path at the end.
Sequence::const_iterator const_iterator
bool operator==(PathVector const &other) const
OptRect boundsExact() const
BOOST_CONCEPT_REQUIRES(((TransformConcept< T >)),(PathVector &)) operator*
Coord valueAt(PathVectorTime const &pos, Dim2 d) const
iterator erase(iterator first, iterator last)
Remove a range of paths from the vector.
std::ptrdiff_t difference_type
Curve const & curveAt(PathVectorTime const &pos) const
Path & operator[](size_type index)
int winding(Point const &p) const
Determine the winding number at the specified point.
std::vector< Path > Sequence
Point finalPoint() const
Get the last point in the last path of the vector.
Interval timeRange() const
Get the range of allowed time values.
Point pointAt(Coord t) const
Point initialPoint() const
Get the first point in the first path of the vector.
Sequence::size_type size_type
void snapEnds(Coord precision=EPSILON)
Path const & back() const
iterator erase(iterator i)
Remove a path from the vector.
OptRect boundsFast() const
void pop_back()
Remove the last path.
Curve const & curveAt(Coord t, Coord *rest=NULL) const
Path const & pathAt(PathVectorTime const &pos) const
Path & at(size_type index)
void clear()
Remove all paths from the vector.
Path const & operator[](size_type index) const
bool empty() const
Check whether the vector contains any paths.
Path const & front() const
iterator insert(iterator pos, Path const &p)
PathVector reversed(bool reverse_paths=true) const
Get a new vector with reversed direction of paths.
std::optional< PathVectorTime > nearestTime(Point const &p, Coord *dist=NULL) const
Path const & at(size_type index) const
void reverse(bool reverse_paths=true)
Reverse the direction of paths in the vector.
Path const & const_reference
PathVector(InputIter first, InputIter last)
Point pointAt(PathVectorTime const &pos) const
std::vector< PathVectorIntersection > intersectSelf(Coord precision=EPSILON) const
Get all intersections of the path-vector with itself.
void resize(size_type n)
Change the number of paths.
size_type curveCount() const
Get the total number of curves in the vector.
std::vector< PVIntersection > intersect(PathVector const &other, Coord precision=EPSILON) const
Path & pathAt(Coord t, Coord *rest=NULL)
const_iterator begin() const
Sequence::iterator iterator
Sequence of contiguous curves, aka spline.
Curve const & back() const
Access the last curve in the path.
Curve const & front() const
Access the first curve in the path.
Curve const & at(size_type i) const
Access a curve by index.
Two-dimensional point that doubles as a vector.
Contains forward declarations of 2geom types.
Dim2
2D axis enumeration (X or Y).
double Coord
Floating point type used to store coordinates.
constexpr Coord EPSILON
Default "acceptably small" value.
Various utility functions.
OptInterval bounds_exact(Bezier const &b)
Intersection< PathVectorTime > PathVectorIntersection
std::ostream & operator<<(std::ostream &os, const Bezier &b)
D2< T > operator*=(D2< T > &a, Point const &b)
PathVectorIntersection PVIntersection
Alias to save typing.
OptInterval bounds_fast(Bezier const &b)
Noncommutative multiplication helper.
Generalized time value in the path.
size_type curve_index
Index of the curve in the path.
Coord t
Time value in the curve.
PathInternal::Sequence::size_type size_type
Generalized time value in the path vector.
PathVectorTime(size_type _i, PathTime const &pos)
size_type path_index
Index of the path in the vector.
bool operator<(PathVectorTime const &other) const
PathTime const & asPathTime() const
bool operator==(PathVectorTime const &other) const
PathVectorTime(size_type _i, size_type _c, Coord _t)
PathVectorIntersection IntersectionType
PathVector AffineClosureType