![]() |
MaterialX 1.39.4
|
Class representing a node in the shader generation DAG. More...
#include <ShaderNode.h>
Classes | |
| class | Classification |
| Flags for classifying nodes into different categories. More... | |
Public Member Functions | |
| ShaderNode (const ShaderGraph *parent, const string &name) | |
| Constructor. | |
| virtual bool | isAGraph () const |
| Return true if this node is a graph. | |
| const ShaderGraph * | getParent () const |
| Return the parent graph that owns this node. | |
| void | setClassification (uint32_t c) |
| Set classification bits for this node, replacing any previous set bits. | |
| uint32_t | getClassification () const |
| Get classification bits set for this node. | |
| void | addClassification (uint32_t c) |
| Add classification bits to this node. | |
| bool | hasClassification (uint32_t c) const |
| Return true if this node matches the given classification. | |
| const string & | getName () const |
| Return the name of this node. | |
| const ShaderNodeImpl & | getImplementation () const |
| Return the implementation used for this node. | |
| void | initialize (const Node &node, const NodeDef &nodeDef, GenContext &context) |
| Initialize this shader node with all required data from the given node and nodedef. | |
| ShaderInput * | addInput (const string &name, TypeDesc type) |
| Add inputs/outputs. | |
| ShaderOutput * | addOutput (const string &name, TypeDesc type) |
| size_t | numInputs () const |
| Get number of inputs/outputs. | |
| size_t | numOutputs () const |
| ShaderInput * | getInput (size_t index) |
| Get inputs/outputs by index. | |
| ShaderOutput * | getOutput (size_t index=0) |
| const ShaderInput * | getInput (size_t index) const |
| const ShaderOutput * | getOutput (size_t index=0) const |
| ShaderInput * | getInput (const string &name) |
| Get inputs/outputs by name. | |
| ShaderOutput * | getOutput (const string &name) |
| const ShaderInput * | getInput (const string &name) const |
| const ShaderOutput * | getOutput (const string &name) const |
| const vector< ShaderInput * > & | getInputs () const |
| Get vector of inputs/outputs. | |
| const vector< ShaderOutput * > & | getOutputs () const |
| void | setMetadata (ShaderMetadataVecPtr metadata) |
| Set the metadata vector. | |
| ShaderMetadataVecPtr | getMetadata () |
| Get the metadata vector. | |
| const ShaderMetadataVecPtr & | getMetadata () const |
| Get the metadata vector. | |
| bool | isEditable (const ShaderInput &input) const |
| Returns true if an input is editable by users. | |
| bool | isEditable (const ShaderGraphInputSocket &input) const |
| Returns true if a graph input is accessible by users. | |
Static Public Member Functions | |
| static ShaderNodePtr | create (const ShaderGraph *parent, const string &name, const NodeDef &nodeDef, GenContext &context) |
| Create a new node from a nodedef. | |
| static ShaderNodePtr | create (const ShaderGraph *parent, const string &name, ShaderNodeImplPtr impl, unsigned int classification=Classification::TEXTURE) |
| Create a new node from a node implementation. | |
Static Public Attributes | |
| static const ShaderNodePtr | NONE |
| static const string | CONSTANT |
| static const string | DOT |
| static const string | IMAGE |
| static const string | SURFACESHADER |
| static const string | BSDF_R |
| static const string | BSDF_T |
| static const string | TRANSFORM_POINT |
| static const string | TRANSFORM_VECTOR |
| static const string | TRANSFORM_NORMAL |
| static const string | TEXTURE2D_GROUPNAME |
| static const string | TEXTURE3D_GROUPNAME |
| static const string | PROCEDURAL2D_GROUPNAME |
| static const string | PROCEDURAL3D_GROUPNAME |
| static const string | GEOMETRIC_GROUPNAME |
Protected Member Functions | |
| void | createMetadata (const NodeDef &nodeDef, GenContext &context) |
| Create metadata from the nodedef according to registered metadata. | |
Protected Attributes | |
| const ShaderGraph * | _parent |
| string | _name |
| uint32_t | _classification |
| std::unordered_map< string, ShaderInputPtr > | _inputMap |
| vector< ShaderInput * > | _inputOrder |
| std::unordered_map< string, ShaderOutputPtr > | _outputMap |
| vector< ShaderOutput * > | _outputOrder |
| ShaderNodeImplPtr | _impl |
| ShaderMetadataVecPtr | _metadata |
Friends | |
| class | ShaderGraph |
Class representing a node in the shader generation DAG.
|
inline |
Return the parent graph that owns this node.
If this node is a root graph it has no parent and nullptr will be returned.
|
inlinevirtual |
Return true if this node is a graph.
Reimplemented in ShaderGraph.
|
inline |
Returns true if a graph input is accessible by users.
Editable inputs are allowed to be published as shader uniforms and hence must be presentable in a user interface.
|
inline |
Returns true if an input is editable by users.
Editable inputs are allowed to be published as shader uniforms and hence must be presentable in a user interface.