![]() |
|
This iterator can be used to iterate through an input that is weighted by one or more weight vectors. More...
#include <weightedIterator.h>
Inheritance diagram for VdfWeightedIterator< IteratorType >:Public Types | |
| typedef IteratorType::value_type | value_type |
| Type of the elements this iterator gives access to. | |
| typedef IteratorType::reference | reference |
| Type of a reference to a value of this iterator. | |
Public Member Functions | |
| template<typename... Args> | |
| VdfWeightedIterator (const VdfContext &context, const TfToken &weightName, Args &&... args) | |
| Constructs a weighted iterator using a single weight name. | |
| template<typename... Args> | |
| VdfWeightedIterator (const VdfContext &context, std::initializer_list< TfToken > weightNames, Args &&... args) | |
| Constructs a weighted iterator using an initializer list for weight names. | |
| template<typename... Args> | |
| VdfWeightedIterator (const VdfContext &context, const std::vector< TfToken > &weightNames, Args &&... args) | |
| Constructs a weighted iterator using a vector for weight names. | |
| ~VdfWeightedIterator ()=default | |
| Destructor. | |
| VdfWeightedIterator & | operator++ () |
| Increment operator to point to the next element. | |
| reference | operator* () const |
| Returns reference to current element. | |
| bool | IsAtEnd () const |
| Returns true if the iterator is done iterating and false otherwise. | |
| int | GetCurrentIndex () const |
| Returns the current index for the current connection. | |
| void | AdvanceToEnd () |
| Advance the iterator to the end. | |
| double | GetWeight (size_t slot=0, double defWeight=0.0) const |
| Returns the weight at the current element. | |
| bool | HasExplicitWeight (size_t slot) const |
Returns true if the weight at the current element is explicitly set at slot. | |
| std::pair< bool, double > | GetExplicitWeight (size_t slot=0, double defWeight=0.0) const |
Returns a pair (bool, double) indicating whether there is a weight explicitly present at the given slot and giving the weight or the given default weight as fallback. | |
| size_t | GetNumSlots () const |
| Get the number of weight slots used. | |
| size_t | GetNumExplicitWeights (size_t slot=0) const |
Returns the # of explicit weights for slot. | |
Friends | |
| int | Vdf_GetIteratorIndex (const VdfWeightedIterator &it) |
Additional Inherited Members | |
Protected Member Functions inherited from VdfIterator | |
| ~VdfIterator ()=default | |
| Disallow destruction via base class pointers. | |
| const VdfNode & | _GetNode (const VdfContext &context) const |
| Returns the current node being run. | |
| const VdfExecutorInterface & | _GetExecutor (const VdfContext &context) const |
| Returns the executor for the given context. | |
| VDF_API const VdfVector * | _GetInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const |
| Returns a vector for reading an input value. | |
| VDF_API const VdfVector & | _GetRequiredInputValue (const VdfContext &context, const VdfConnection &connection, const VdfMask &mask) const |
Returns the cached output value for a given output, or issues an error message if a cache value is not available. | |
| VDF_API const VdfOutput * | _GetRequiredOutputForWriting (const VdfContext &context, const TfToken &name) const |
Returns the output for writing based on the name provided. | |
| VDF_API VdfVector * | _GetOutputValueForWriting (const VdfContext &context, const VdfOutput &output) const |
| Returns a vector for writing an output value into. | |
| VDF_API bool | _GetOutputMasks (const VdfContext &context, const VdfOutput &output, const VdfMask **requestMask, const VdfMask **affectsMask) const |
Retrieves the request and affects masks of the given output. | |
| VDF_API bool | _IsRequiredInput (const VdfContext &context, const VdfConnection &connection) const |
Returns true when the connection is scheduled and required, and false otherwise. | |
| VDF_API const VdfMask * | _GetRequestMask (const VdfContext &context, const VdfOutput &output) const |
Returns the request mask of output, if the output has been scheduled and NULL otherwise. | |
| VDF_API void | _ForEachScheduledOutput (const VdfContext &context, const VdfNode &node, const VdfScheduledOutputCallback &callback) const |
Loops over each scheduled output of node and calls callback with the output and request mask in an efficient manner. | |
This iterator can be used to iterate through an input that is weighted by one or more weight vectors.
Definition at line 155 of file weightedIterator.h.
| typedef IteratorType::reference reference |
Type of a reference to a value of this iterator.
Definition at line 165 of file weightedIterator.h.
| typedef IteratorType::value_type value_type |
Type of the elements this iterator gives access to.
Definition at line 161 of file weightedIterator.h.
|
inline |
Constructs a weighted iterator using a single weight name.
Definition at line 170 of file weightedIterator.h.
|
inline |
Constructs a weighted iterator using an initializer list for weight names.
Definition at line 183 of file weightedIterator.h.
|
inline |
Constructs a weighted iterator using a vector for weight names.
Definition at line 194 of file weightedIterator.h.
|
default |
Destructor.
|
inline |
Advance the iterator to the end.
Definition at line 234 of file weightedIterator.h.
|
inline |
Returns the current index for the current connection.
This method should not generally be used.
Definition at line 228 of file weightedIterator.h.
| std::pair< bool, double > GetExplicitWeight | ( | size_t | slot = 0, |
| double | defWeight = 0.0 |
||
| ) | const |
Returns a pair (bool, double) indicating whether there is a weight explicitly present at the given slot and giving the weight or the given default weight as fallback.
Definition at line 508 of file weightedIterator.h.
|
inline |
Returns the # of explicit weights for slot.
Definition at line 270 of file weightedIterator.h.
|
inline |
Get the number of weight slots used.
Definition at line 264 of file weightedIterator.h.
|
inline |
Returns the weight at the current element.
If no weight is explicitly present at the given slot, defWeight (default is 0.0) is returned.
Definition at line 242 of file weightedIterator.h.
|
inline |
Returns true if the weight at the current element is explicitly set at slot.
Definition at line 250 of file weightedIterator.h.
|
inline |
Returns true if the iterator is done iterating and false otherwise.
Definition at line 220 of file weightedIterator.h.
|
inline |
Returns reference to current element.
Definition at line 214 of file weightedIterator.h.
| VdfWeightedIterator< IteratorType > & operator++ |
Increment operator to point to the next element.
Definition at line 409 of file weightedIterator.h.
|
friend |
Definition at line 282 of file weightedIterator.h.