HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TsKnotMap Class Reference

#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 std::vector-like.

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 std::vector-like.

TS_API size_t size () const
 
TS_API bool empty () const
 
TS_API void reserve (size_t size)
 
Modification

These methods are std::set-like.

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 std::map-like.

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
 

Detailed Description

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.

Definition at line 36 of file knotMap.h.

Member Typedef Documentation

using TsKnotMap::const_iterator = KnotVec::const_iterator

Definition at line 42 of file knotMap.h.

using TsKnotMap::const_reverse_iterator = KnotVec::const_reverse_iterator

Definition at line 44 of file knotMap.h.

using TsKnotMap::iterator = KnotVec::iterator

Definition at line 41 of file knotMap.h.

using TsKnotMap::KnotVec = std::vector<TsKnot>

Definition at line 39 of file knotMap.h.

using TsKnotMap::reverse_iterator = KnotVec::reverse_iterator

Definition at line 43 of file knotMap.h.

Constructor & Destructor Documentation

TS_API TsKnotMap::TsKnotMap ( )
TS_API TsKnotMap::TsKnotMap ( std::initializer_list< TsKnot knots)

Member Function Documentation

TS_API iterator TsKnotMap::begin ( )
TS_API const_iterator TsKnotMap::begin ( ) const
TS_API const_iterator TsKnotMap::cbegin ( ) const
TS_API const_iterator TsKnotMap::cend ( ) const
TS_API void TsKnotMap::clear ( )

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 iterator TsKnotMap::end ( )
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).

TS_API iterator TsKnotMap::erase ( iterator  i)

Removes a knot. Returns the iterator after it.

TS_API iterator TsKnotMap::erase ( iterator  first,
iterator  last 
)

Removes a range of knots. Returns the iterator after the last removed.

TS_API iterator TsKnotMap::find ( TsTime  time)

Exact matches only; returns end() if not found.

TS_API const_iterator TsKnotMap::find ( TsTime  time) const

Const version of find().

TS_API iterator TsKnotMap::FindClosest ( TsTime  time)

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.

TS_API TfType TsKnotMap::GetValueType ( ) const

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.

TS_API std::pair<iterator, bool> TsKnotMap::insert ( const TsKnot knot)

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 iterator TsKnotMap::lower_bound ( TsTime  time)

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 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 void TsKnotMap::reserve ( size_t  size)
TS_API size_t TsKnotMap::size ( ) const
TS_API void TsKnotMap::swap ( TsKnotMap other)

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.

Friends And Related Function Documentation

friend class TsSpline
friend

Definition at line 209 of file knotMap.h.


The documentation for this class was generated from the following file: