HDK
|
#include <knotMap.h>
Public Types | |
using | KnotVec = std::vector< TsKnot > |
using | iterator = KnotVec::iterator |
using | const_iterator = KnotVec::const_iterator |
using | reverse_iterator = KnotVec::reverse_iterator |
using | const_reverse_iterator = KnotVec::const_reverse_iterator |
Public Member Functions | |
Construction and value semantics | |
TS_API | TsKnotMap () |
TS_API | TsKnotMap (std::initializer_list< TsKnot > knots) |
TS_API bool | operator== (const TsKnotMap &other) const |
TS_API bool | operator!= (const TsKnotMap &other) const |
Iteration | |
These methods are | |
TS_API iterator | begin () |
TS_API const_iterator | begin () const |
TS_API const_iterator | cbegin () const |
TS_API iterator | end () |
TS_API const_iterator | end () const |
TS_API const_iterator | cend () const |
TS_API reverse_iterator | rbegin () |
TS_API const_reverse_iterator | rbegin () const |
TS_API const_reverse_iterator | crbegin () const |
TS_API reverse_iterator | rend () |
TS_API const_reverse_iterator | rend () const |
TS_API const_reverse_iterator | crend () const |
Size | |
These methods are | |
TS_API size_t | size () const |
TS_API bool | empty () const |
TS_API void | reserve (size_t size) |
Modification | |
These methods are | |
TS_API void | clear () |
TS_API void | swap (TsKnotMap &other) |
TS_API std::pair< iterator, bool > | insert (const TsKnot &knot) |
TS_API size_t | erase (TsTime time) |
TS_API iterator | erase (iterator i) |
Removes a knot. Returns the iterator after it. More... | |
TS_API iterator | erase (iterator first, iterator last) |
Removes a range of knots. Returns the iterator after the last removed. More... | |
Searching | |
These methods are | |
TS_API iterator | find (TsTime time) |
Exact matches only; returns end() if not found. More... | |
TS_API const_iterator | find (TsTime time) const |
Const version of find(). More... | |
TS_API iterator | lower_bound (TsTime time) |
TS_API const_iterator | lower_bound (TsTime time) const |
Const version of lower_bound(). More... | |
Non-STL Methods | |
TS_API iterator | FindClosest (TsTime time) |
TS_API const_iterator | FindClosest (TsTime time) const |
Const version of FindClosest(). More... | |
TS_API TfType | GetValueType () const |
Returns the value type of the knots, or Unknown if empty. More... | |
TS_API GfInterval | GetTimeSpan () const |
TS_API bool | HasCurveSegments () const |
Returns whether there are any segments with curve interpolation. More... | |
Friends | |
class | TsSpline |
The knots in a spline. Stored as a vector, but unique and sorted like a map. A knot's time is stored within the knot itself, but is also sometimes used as a key. Some methods are vector-like, some are map-like, and some are set-like.
Separate from TsSpline in order to provide identical operations on different collections of knots. The most straightforward collection is the authored knots, provided by GetKnots, but collections included baked loop knots can also be obtained.
using TsKnotMap::const_iterator = KnotVec::const_iterator |
using TsKnotMap::const_reverse_iterator = KnotVec::const_reverse_iterator |
using TsKnotMap::iterator = KnotVec::iterator |
using TsKnotMap::KnotVec = std::vector<TsKnot> |
using TsKnotMap::reverse_iterator = KnotVec::reverse_iterator |
TS_API TsKnotMap::TsKnotMap | ( | ) |
TS_API const_iterator TsKnotMap::begin | ( | ) | const |
TS_API const_iterator TsKnotMap::cbegin | ( | ) | const |
TS_API const_iterator TsKnotMap::cend | ( | ) | const |
Inserts a knot. If there is already a knot at the same time, nothing is changed. Returns an iterator to the newly inserted knot, or the existing one at the same time. The second member of the returned pair indicates whether an insertion took place.
TS_API const_reverse_iterator TsKnotMap::crbegin | ( | ) | const |
TS_API const_reverse_iterator TsKnotMap::crend | ( | ) | const |
TS_API bool TsKnotMap::empty | ( | ) | const |
TS_API const_iterator TsKnotMap::end | ( | ) | const |
TS_API size_t TsKnotMap::erase | ( | TsTime | time | ) |
Removes the knot at the specified time, if it exists. Returns the number of knots erased (0 or 1).
Removes a range of knots. Returns the iterator after the last removed.
TS_API const_iterator TsKnotMap::find | ( | TsTime | time | ) | const |
Const version of find().
Returns the knot whose time most closely (or exactly) matches the specified time. In case of ties, returns the later knot. If there are no knots, returns end().
TS_API const_iterator TsKnotMap::FindClosest | ( | TsTime | time | ) | const |
Const version of FindClosest().
TS_API GfInterval TsKnotMap::GetTimeSpan | ( | ) | const |
Returns the time interval containing the first and last knot. Returns an empty interval if there are no knots.
Returns the value type of the knots, or Unknown if empty.
TS_API bool TsKnotMap::HasCurveSegments | ( | ) | const |
Returns whether there are any segments with curve interpolation.
Inserts a knot. If there is already a knot at the same time, nothing is changed. Returns an iterator to the newly inserted knot, or the existing one at the same time. The second member of the returned pair indicates whether an insertion took place.
If there is a knot at the specified time, returns that. Otherwise, if there is a knot after the specified time, returns the first such knot. Otherwise returns end().
TS_API const_iterator TsKnotMap::lower_bound | ( | TsTime | time | ) | const |
Const version of lower_bound().
TS_API bool TsKnotMap::operator!= | ( | const TsKnotMap & | other | ) | const |
TS_API reverse_iterator TsKnotMap::rbegin | ( | ) |
TS_API const_reverse_iterator TsKnotMap::rbegin | ( | ) | const |
TS_API reverse_iterator TsKnotMap::rend | ( | ) |
TS_API const_reverse_iterator TsKnotMap::rend | ( | ) | const |
TS_API size_t TsKnotMap::size | ( | ) | const |
Inserts a knot. If there is already a knot at the same time, nothing is changed. Returns an iterator to the newly inserted knot, or the existing one at the same time. The second member of the returned pair indicates whether an insertion took place.