HDK
|
#include <ShaderNode.h>
Classes | |
class | Classification |
Flags for classifying nodes into different categories. More... | |
Public Member Functions | |
virtual | ~ShaderNode () |
ShaderNode (const ShaderGraph *parent, const string &name) | |
Constructor. More... | |
virtual bool | isAGraph () const |
Return true if this node is a graph. More... | |
const ShaderGraph * | getParent () const |
void | setClassification (uint32_t c) |
uint32_t | getClassification () const |
Get classification bits set for this node. More... | |
void | addClassification (uint32_t c) |
Add classification bits to this node. More... | |
bool | hasClassification (uint32_t c) const |
Return true if this node matches the given classification. More... | |
const string & | getName () const |
Return the name of this node. More... | |
const ShaderNodeImpl & | getImplementation () const |
Return the implementation used for this node. More... | |
void | initialize (const Node &node, const NodeDef &nodeDef, GenContext &context) |
ShaderInput * | addInput (const string &name, const TypeDesc *type) |
Add inputs/outputs. More... | |
ShaderOutput * | addOutput (const string &name, const TypeDesc *type) |
size_t | numInputs () const |
Get number of inputs/outputs. More... | |
size_t | numOutputs () const |
ShaderInput * | getInput (size_t index) |
Get inputs/outputs by index. More... | |
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. More... | |
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. More... | |
const vector< ShaderOutput * > & | getOutputs () const |
void | setMetadata (ShaderMetadataVecPtr metadata) |
Set the metadata vector. More... | |
ShaderMetadataVecPtr | getMetadata () |
Get the metadata vector. More... | |
const ShaderMetadataVecPtr & | getMetadata () const |
Get the metadata vector. More... | |
bool | isEditable (const ShaderInput &input) const |
bool | isEditable (const ShaderGraphInputSocket &input) const |
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. More... | |
static ShaderNodePtr | create (const ShaderGraph *parent, const string &name, ShaderNodeImplPtr impl, unsigned int classification=Classification::TEXTURE) |
Create a new node from a node implementation. More... | |
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 | SCATTER_MODE |
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. More... | |
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
Definition at line 325 of file ShaderNode.h.
|
inlinevirtual |
Definition at line 328 of file ShaderNode.h.
ShaderNode::ShaderNode | ( | const ShaderGraph * | parent, |
const string & | name | ||
) |
Constructor.
|
inline |
Add classification bits to this node.
Definition at line 418 of file ShaderNode.h.
ShaderInput* ShaderNode::addInput | ( | const string & | name, |
const TypeDesc * | type | ||
) |
Add inputs/outputs.
ShaderOutput* ShaderNode::addOutput | ( | const string & | name, |
const TypeDesc * | type | ||
) |
|
static |
Create a new node from a nodedef.
|
static |
Create a new node from a node implementation.
|
protected |
Create metadata from the nodedef according to registered metadata.
|
inline |
Get classification bits set for this node.
Definition at line 412 of file ShaderNode.h.
|
inline |
Return the implementation used for this node.
Definition at line 436 of file ShaderNode.h.
|
inline |
Get inputs/outputs by index.
Definition at line 454 of file ShaderNode.h.
|
inline |
Definition at line 456 of file ShaderNode.h.
ShaderInput* ShaderNode::getInput | ( | const string & | name | ) |
Get inputs/outputs by name.
const ShaderInput* ShaderNode::getInput | ( | const string & | name | ) | const |
|
inline |
Get vector of inputs/outputs.
Definition at line 466 of file ShaderNode.h.
|
inline |
Get the metadata vector.
Definition at line 473 of file ShaderNode.h.
|
inline |
Get the metadata vector.
Definition at line 476 of file ShaderNode.h.
|
inline |
Return the name of this node.
Definition at line 430 of file ShaderNode.h.
|
inline |
Definition at line 455 of file ShaderNode.h.
|
inline |
Definition at line 457 of file ShaderNode.h.
ShaderOutput* ShaderNode::getOutput | ( | const string & | name | ) |
const ShaderOutput* ShaderNode::getOutput | ( | const string & | name | ) | const |
|
inline |
Definition at line 467 of file ShaderNode.h.
|
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.
Definition at line 399 of file ShaderNode.h.
|
inline |
Return true if this node matches the given classification.
Definition at line 424 of file ShaderNode.h.
void ShaderNode::initialize | ( | const Node & | node, |
const NodeDef & | nodeDef, | ||
GenContext & | context | ||
) |
Initialize this shader node with all required data from the given node and nodedef.
|
inlinevirtual |
Return true if this node is a graph.
Reimplemented in ShaderGraph.
Definition at line 394 of file ShaderNode.h.
|
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.
Definition at line 481 of file ShaderNode.h.
|
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.
Definition at line 489 of file ShaderNode.h.
|
inline |
Get number of inputs/outputs.
Definition at line 450 of file ShaderNode.h.
|
inline |
Definition at line 451 of file ShaderNode.h.
|
inline |
Set classification bits for this node, replacing any previous set bits.
Definition at line 406 of file ShaderNode.h.
|
inline |
Set the metadata vector.
Definition at line 470 of file ShaderNode.h.
|
friend |
Definition at line 511 of file ShaderNode.h.
|
protected |
Definition at line 500 of file ShaderNode.h.
|
protected |
Definition at line 508 of file ShaderNode.h.
|
protected |
Definition at line 502 of file ShaderNode.h.
|
protected |
Definition at line 503 of file ShaderNode.h.
|
protected |
Definition at line 509 of file ShaderNode.h.
|
protected |
Definition at line 499 of file ShaderNode.h.
|
protected |
Definition at line 505 of file ShaderNode.h.
|
protected |
Definition at line 506 of file ShaderNode.h.
|
protected |
Definition at line 498 of file ShaderNode.h.
|
static |
Definition at line 370 of file ShaderNode.h.
|
static |
Definition at line 371 of file ShaderNode.h.
|
static |
Definition at line 365 of file ShaderNode.h.
|
static |
Definition at line 366 of file ShaderNode.h.
|
static |
Definition at line 379 of file ShaderNode.h.
|
static |
Definition at line 367 of file ShaderNode.h.
|
static |
Definition at line 363 of file ShaderNode.h.
|
static |
Definition at line 377 of file ShaderNode.h.
|
static |
Definition at line 378 of file ShaderNode.h.
|
static |
Definition at line 369 of file ShaderNode.h.
|
static |
Definition at line 368 of file ShaderNode.h.
|
static |
Definition at line 375 of file ShaderNode.h.
|
static |
Definition at line 376 of file ShaderNode.h.
|
static |
Definition at line 374 of file ShaderNode.h.
|
static |
Definition at line 372 of file ShaderNode.h.
|
static |
Definition at line 373 of file ShaderNode.h.