MaterialX 1.39.1
|
Class representing a context for closure evaluation. More...
#include <GenContext.h>
Public Types | |
using | Argument = std::pair< TypeDesc, string > |
An extra argument for closure functions. More... | |
using | Arguments = vector< Argument > |
An array of arguments. | |
using | ClosureParams = std::unordered_map< string, const ShaderInput * > |
Extra parameters for closure evaluation. | |
Public Member Functions | |
ClosureContext (int type=0) | |
Constructor. | |
int | getType () const |
Return the identifier for this context. | |
void | addArgument (TypeDesc nodeType, const Argument &arg) |
For the given node type add an extra argument to be used for the function in this context. | |
void | addArgument (const TypeDesc *nodeType, const Argument &arg) |
const Arguments & | getArguments (TypeDesc nodeType) const |
Return a list of extra argument to be used for the given node in this context. | |
const Arguments & | getArguments (const TypeDesc *nodeType) const |
void | setSuffix (TypeDesc nodeType, const string &suffix) |
For the given node type set a function name suffix to be used for the function in this context. | |
void | setSuffix (const TypeDesc *nodeType, const string &suffix) |
const string & | getSuffix (TypeDesc nodeType) const |
Return the function name suffix to be used for the given node in this context. | |
const string & | getSuffix (const TypeDesc *nodeType) const |
void | setClosureParams (const ShaderNode *closure, const ClosureParams *params) |
Set extra parameters to use for evaluating a closure. | |
const ClosureParams * | getClosureParams (const ShaderNode *closure) const |
Return extra parameters to use for evaluating a closure. More... | |
Protected Attributes | |
const int | _type |
std::unordered_map< TypeDesc, Arguments, TypeDesc::Hasher > | _arguments |
std::unordered_map< TypeDesc, string, TypeDesc::Hasher > | _suffix |
std::unordered_map< const ShaderNode *, const ClosureParams * > | _params |
Static Protected Attributes | |
static const Arguments | EMPTY_ARGUMENTS |
Class representing a context for closure evaluation.
On hardware BSDF closures are evaluated differently in reflection, transmission or environment/indirect contexts. This class represents the context we are in and if extra arguments and function decorators are needed for that context.
An extra argument for closure functions.
An argument is a pair of strings holding the 'type' and 'name' of the argument.
|
inline |
Return extra parameters to use for evaluating a closure.
Or return nullptr if no parameters have been set for the given closure.