|
MaterialX 1.38.2
|
A block of variables in a shader stage. More...
#include <ShaderStage.h>
Public Member Functions | |
| VariableBlock (const string &name, const string &instance) | |
| const string & | getName () const |
| Get the name of this block. | |
| void | setName (const string &name) |
| Set the name of this block. | |
| const string & | getInstance () const |
| Get the instance name of this block. | |
| void | setInstance (const string &instance) |
| Set the instance name of this block. | |
| bool | empty () const |
| Return true if the block has no variables. | |
| size_t | size () const |
| Return the number of variables in this block. | |
| ShaderPort * | operator[] (size_t index) |
| Return a variable by index. | |
| const ShaderPort * | operator[] (size_t index) const |
| Return a variable by index. | |
| const vector< ShaderPort * > & | getVariableOrder () const |
| Return a const reference to our variable order vector. | |
| ShaderPort * | operator[] (const string &name) |
| Return a variable by name. More... | |
| const ShaderPort * | operator[] (const string &name) const |
| Return a variable by name. More... | |
| ShaderPort * | find (const string &name) |
| Return a variable by name. More... | |
| const ShaderPort * | find (const string &name) const |
| Return a variable by name. More... | |
| ShaderPort * | find (const ShaderPortPredicate &predicate) |
| Find a port based on a predicate. | |
| ShaderPort * | add (const TypeDesc *type, const string &name, ValuePtr value=nullptr) |
| Add a new shader port to this block. | |
| void | add (ShaderPortPtr port) |
| Add an existing shader port to this block. | |
A block of variables in a shader stage.
| ShaderPort * find | ( | const string & | name | ) |
Return a variable by name.
Returns nullptr if no variable is found by the given name.
| const ShaderPort * find | ( | const string & | name | ) | const |
Return a variable by name.
Returns nullptr if no variable is found by the given name.
| ShaderPort * operator[] | ( | const string & | name | ) |
Return a variable by name.
Throws exception if no variable is found by the given name.
| const ShaderPort * operator[] | ( | const string & | name | ) | const |
Return a variable by name.
Throws exception if no variable is found by the given name.