8#ifndef PXR_BASE_TS_KNOT_MAP_H
9#define PXR_BASE_TS_KNOT_MAP_H
12#include "pxr/base/ts/api.h"
13#include "pxr/base/ts/knot.h"
14#include "pxr/base/ts/types.h"
18#include <initializer_list>
21PXR_NAMESPACE_OPEN_SCOPE
39 using KnotVec = std::vector<TsKnot>;
41 using iterator = KnotVec::iterator;
42 using const_iterator = KnotVec::const_iterator;
43 using reverse_iterator = KnotVec::reverse_iterator;
44 using const_reverse_iterator = KnotVec::const_reverse_iterator;
54 TsKnotMap(std::initializer_list<TsKnot> knots);
57 bool operator==(
const TsKnotMap &other)
const;
60 bool operator!=(
const TsKnotMap &other)
const;
73 const_iterator begin()
const;
76 const_iterator cbegin()
const;
82 const_iterator end()
const;
85 const_iterator cend()
const;
88 reverse_iterator rbegin();
91 const_reverse_iterator rbegin()
const;
94 const_reverse_iterator crbegin()
const;
97 reverse_iterator rend();
100 const_reverse_iterator rend()
const;
103 const_reverse_iterator crend()
const;
119 void reserve(
size_t size);
152 iterator
erase(iterator first, iterator last);
167 const_iterator
find(TsTime time)
const;
221PXR_NAMESPACE_CLOSE_SCOPE
A basic mathematical interval class.
TfType represents a dynamic runtime type.
A knot belonging to a TsSpline.
TS_API TfType GetValueType() const
Returns the value type of the knots, or Unknown if empty.
TS_API iterator FindClosest(TsTime time)
Returns the knot whose time most closely (or exactly) matches the specified time.
TS_API iterator erase(iterator i)
Removes a knot. Returns the iterator after it.
TS_API const_iterator lower_bound(TsTime time) const
Const version of lower_bound().
TS_API size_t erase(TsTime time)
Removes the knot at the specified time, if it exists.
TS_API const_iterator find(TsTime time) const
Const version of find().
TS_API std::pair< iterator, bool > insert(const TsKnot &knot)
Inserts a knot.
TS_API GfInterval GetTimeSpan() const
Returns the time interval containing the first and last knot.
TS_API bool HasCurveSegments() const
Returns whether there are any segments with curve interpolation.
TS_API iterator find(TsTime time)
Exact matches only; returns end() if not found.
TS_API const_iterator FindClosest(TsTime time) const
Const version of FindClosest().
TS_API iterator erase(iterator first, iterator last)
Removes a range of knots. Returns the iterator after the last removed.
TS_API iterator lower_bound(TsTime time)
If there is a knot at the specified time, returns that.
A mathematical description of a curved function from time to value.