7#ifndef PXR_EXEC_EXEC_IR_CONTROLLER_BUILDER_H
8#define PXR_EXEC_EXEC_IR_CONTROLLER_BUILDER_H
26#include "pxr/exec/exec/builtinComputations.h"
30PXR_NAMESPACE_OPEN_SCOPE
134 template <
typename ValueType>
145 template <
typename ValueType>
158 template <
typename ValueType>
171 template <
typename ValueType>
181 template <
typename ValueType>
189 static const TfToken &_GetConstantInputName();
197template <
typename ValueType>
202 using namespace exec_registration;
206 _forwardComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
209template <
typename ValueType>
214 using namespace exec_registration;
218 _forwardComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
221 _inverseComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
224template <
typename ValueType>
229 using namespace exec_registration;
238 _inverseComputeReg.
Inputs(
241 .InputName(attributeName));
246 .Callback(+[](
const VdfContext &ctx) -> ValueType {
251 const auto it = resultMap.
find(attributeName);
252 if (it != resultMap.
end()) {
253 return it->second.Get<ValueType>();
257 "Failed to find a result value for output attribute '%s' "
266 Constant(attributeName).InputName(_GetConstantInputName()));
269template <
typename ValueType>
274 using namespace exec_registration;
277 _forwardComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
278 _inverseComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
281template <
typename ValueType>
286 using namespace exec_registration;
290 _forwardComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
291 _inverseComputeReg.
Inputs(AttributeValue<ValueType>(attributeName));
294PXR_NAMESPACE_CLOSE_SCOPE
The top-level builder object (aka, the self variable generated by EXEC_REGISTER_COMPUTATIONS_FOR_SCHE...
Builder class used to register invertible controller computations.
void SwitchAttribute(const TfToken &attributeName)
Registers a switch attribute.
EXECIR_API ExecIrControllerBuilder(ExecComputationBuilder &self, Callback forwardCallback, Callback inverseCallback)
Constructs a builder that is used to register computations that implement an invertible controller.
ExecIrResult(*)(const VdfContext &) Callback
The type for forward and inverse controller computation calbacks.
void InvertibleOutputAttribute(const TfToken &attributeName)
Registers an invertible output attribute; the output is inverible if invertible is true.
void PassthroughAttribute(const TfToken &attributeName)
Registers a passthrough attribute.
void NonInvertibleInputAttribute(const TfToken &attributeName)
Registers a non-invertible input attribute.
void InvertibleInputAttribute(const TfToken &attributeName)
Registers an invertible input attribute.
Class used to build prim computation definitions.
This is a space efficient container that mimics the TfHashMap API that uses a vector for storage when...
iterator find(const key_type &k)
Finds the element with key k.
iterator end()
Returns an const_iterator pointing to the end of the map.
Token for efficient comparison, assignment, and hashing of known strings.
char const * GetText() const
Return the text that this token represents.
A context is the parameter bundle passed to callbacks of computations.
VdfByValueOrConstRef< T > GetInputValue(const TfToken &name) const
Returns a value from the input named name of type T.
VDF_API std::string GetNodeDebugName() const
Returns the debug name for the node for this context.
const T & GetFallback() const
Returns the registered fallback value for T from the registry.
static VDF_API VdfExecutionTypeRegistry & GetInstance()
Returns the VdfExecutionTypeRegistry singleton instance.
This is a public header, but many of the symbols have private names because they are not intended for...
TfDenseHashMap< TfToken, VtValue, TfToken::HashFunctor > ExecIrResult
Map used to return results from controller forward and inverse computations.
ExecPrimComputationBuilder & Inputs(Args &&... args)
Takes one or more input registrations that specify how to source input values for a prim computation.
EXEC_API ExecAttributeExpressionBuilder AttributeExpression(const TfToken &attributeName)
Registers an attribute expression for attributes named attributeName.
ValueSpecifier Computation(const TfToken &computationName)
See Computation().
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
Attribute accessor, valid for providing input to a prim computation.
Computation value specifier, valid for providing input to any computation.
Prim accessor, valid for providing input to an attribute computation.