HDK
|
#include <Definition.h>
Public Member Functions | |
NodeDef (ElementPtr parent, const string &name) | |
virtual | ~NodeDef () |
Node String | |
void | setNodeString (const string &node) |
Set the node string of the NodeDef. More... | |
bool | hasNodeString () const |
Return true if the given NodeDef has a node string. More... | |
const string & | getNodeString () const |
Return the node string of the NodeDef. More... | |
const string & | getType () const override |
Return the element's output type. More... | |
Node Group | |
void | setNodeGroup (const string &category) |
Set the node group of the NodeDef. More... | |
bool | hasNodeGroup () const |
Return true if the given NodeDef has a node group. More... | |
const string & | getNodeGroup () const |
Return the node group of the NodeDef. More... | |
Implementation References | |
InterfaceElementPtr | getImplementation (const string &target=EMPTY_STRING) const |
Validation | |
bool | validate (string *message=nullptr) const override |
Utility | |
bool | isVersionCompatible (const string &version) const |
ConstNodeDefPtr | getDeclaration (const string &target=EMPTY_STRING) const override |
![]() | |
virtual | ~InterfaceElement () |
void | setNodeDefString (const string &nodeDef) |
Set the NodeDef string for the interface. More... | |
bool | hasNodeDefString () const |
Return true if the given interface has a NodeDef string. More... | |
const string & | getNodeDefString () const |
Return the NodeDef string for the interface. More... | |
InputPtr | addInput (const string &name=EMPTY_STRING, const string &type=DEFAULT_TYPE_STRING) |
InputPtr | getInput (const string &name) const |
Return the Input, if any, with the given name. More... | |
vector< InputPtr > | getInputs () const |
Return a vector of all Input elements. More... | |
size_t | getInputCount () const |
Return the number of Input elements. More... | |
void | removeInput (const string &name) |
Remove the Input, if any, with the given name. More... | |
InputPtr | getActiveInput (const string &name) const |
vector< InputPtr > | getActiveInputs () const |
OutputPtr | addOutput (const string &name=EMPTY_STRING, const string &type=DEFAULT_TYPE_STRING) |
OutputPtr | getOutput (const string &name) const |
Return the Output, if any, with the given name. More... | |
vector< OutputPtr > | getOutputs () const |
Return a vector of all Output elements. More... | |
size_t | getOutputCount () const |
Return the number of Output elements. More... | |
void | removeOutput (const string &name) |
Remove the Output, if any, with the given name. More... | |
OutputPtr | getActiveOutput (const string &name) const |
vector< OutputPtr > | getActiveOutputs () const |
void | setConnectedOutput (const string &inputName, OutputPtr output) |
OutputPtr | getConnectedOutput (const string &inputName) const |
TokenPtr | addToken (const string &name=EMPTY_STRING) |
TokenPtr | getToken (const string &name) const |
Return the Token, if any, with the given name. More... | |
vector< TokenPtr > | getTokens () const |
Return a vector of all Token elements. More... | |
void | removeToken (const string &name) |
Remove the Token, if any, with the given name. More... | |
TokenPtr | getActiveToken (const string &name) const |
vector< TokenPtr > | getActiveTokens () const |
ValueElementPtr | getValueElement (const string &name) const |
Return the ValueElement, if any, with the given name. More... | |
ValueElementPtr | getActiveValueElement (const string &name) const |
vector< ValueElementPtr > | getActiveValueElements () const |
template<class T > | |
InputPtr | setInputValue (const string &name, const T &value, const string &type=EMPTY_STRING) |
ValuePtr | getInputValue (const string &name, const string &target=EMPTY_STRING) const |
TokenPtr | setTokenValue (const string &name, const string &value) |
string | getTokenValue (const string &name) |
void | setTarget (const string &target) |
Set the target string of this interface. More... | |
bool | hasTarget () const |
Return true if the given interface has a target string. More... | |
const string & | getTarget () const |
Return the target string of this interface. More... | |
void | setVersionString (const string &version) |
Set the version string of this interface. More... | |
bool | hasVersionString () const |
Return true if this interface has a version string. More... | |
const string & | getVersionString () const |
Return the version string of this interface. More... | |
void | setVersionIntegers (int majorVersion, int minorVersion) |
Set the major and minor versions as an integer pair. More... | |
virtual std::pair< int, int > | getVersionIntegers () const |
Return the major and minor versions as an integer pair. More... | |
void | setDefaultVersion (bool defaultVersion) |
Set the default version flag of this element. More... | |
bool | getDefaultVersion () const |
Return the default version flag of this element. More... | |
bool | hasExactInputMatch (ConstInterfaceElementPtr declaration, string *message=nullptr) const |
![]() | |
virtual | ~TypedElement () |
void | setType (const string &type) |
Set the element's type string. More... | |
bool | hasType () const |
Return true if the given element has a type string. More... | |
bool | isMultiOutputType () const |
Return true if the element is of multi-output type. More... | |
TypeDefPtr | getTypeDef () const |
![]() | |
virtual | ~Element () |
Element (const Element &)=delete | |
Element & | operator= (const Element &)=delete |
bool | operator== (const Element &rhs) const |
bool | operator!= (const Element &rhs) const |
void | setCategory (const string &category) |
Set the element's category string. More... | |
const string & | getCategory () const |
void | setName (const string &name) |
const string & | getName () const |
Return the element's name string. More... | |
string | getNamePath (ConstElementPtr relativeTo=nullptr) const |
ElementPtr | getDescendant (const string &namePath) const |
void | setFilePrefix (const string &prefix) |
Set the element's file prefix string. More... | |
bool | hasFilePrefix () const |
Return true if the given element has a file prefix string. More... | |
const string & | getFilePrefix () const |
Return the element's file prefix string. More... | |
const string & | getActiveFilePrefix () const |
void | setGeomPrefix (const string &prefix) |
Set the element's geom prefix string. More... | |
bool | hasGeomPrefix () const |
Return true if the given element has a geom prefix string. More... | |
const string & | getGeomPrefix () const |
Return the element's geom prefix string. More... | |
const string & | getActiveGeomPrefix () const |
void | setColorSpace (const string &colorSpace) |
Set the element's color space string. More... | |
bool | hasColorSpace () const |
Return true if the given element has a color space string. More... | |
const string & | getColorSpace () const |
Return the element's color space string. More... | |
const string & | getActiveColorSpace () const |
void | setInheritString (const string &inherit) |
Set the inherit string of this element. More... | |
bool | hasInheritString () const |
Return true if this element has an inherit string. More... | |
const string & | getInheritString () const |
Return the inherit string of this element. More... | |
void | setInheritsFrom (ConstElementPtr super) |
Set the element that this one directly inherits from. More... | |
ElementPtr | getInheritsFrom () const |
Return the element, if any, that this one directly inherits from. More... | |
bool | hasInheritedBase (ConstElementPtr base) const |
bool | hasInheritanceCycle () const |
Return true if the inheritance chain for this element contains a cycle. More... | |
void | setNamespace (const string &space) |
Set the namespace string of this element. More... | |
bool | hasNamespace () const |
Return true if this element has a namespace string. More... | |
const string & | getNamespace () const |
Return the namespace string of this element. More... | |
string | getQualifiedName (const string &name) const |
void | setDocString (const string &doc) |
Set the documentation string of this element. More... | |
string | getDocString () const |
Return the documentation string of this element. More... | |
template<class T > | |
bool | isA (const string &category=EMPTY_STRING) const |
template<class T > | |
shared_ptr< T > | asA () |
Dynamic cast to an instance of the given subclass. More... | |
template<class T > | |
shared_ptr< const T > | asA () const |
Dynamic cast to a const instance of the given subclass. More... | |
template<class T > | |
shared_ptr< T > | addChild (const string &name=EMPTY_STRING) |
ElementPtr | addChildOfCategory (const string &category, string name=EMPTY_STRING) |
ElementPtr | changeChildCategory (ElementPtr child, const string &category) |
ElementPtr | getChild (const string &name) const |
Return the child element, if any, with the given name. More... | |
template<class T > | |
shared_ptr< T > | getChildOfType (const string &name) const |
const vector< ElementPtr > & | getChildren () const |
template<class T > | |
vector< shared_ptr< T > > | getChildrenOfType (const string &category=EMPTY_STRING) const |
void | setChildIndex (const string &name, int index) |
int | getChildIndex (const string &name) const |
void | removeChild (const string &name) |
Remove the child element, if any, with the given name. More... | |
template<class T > | |
void | removeChildOfType (const string &name) |
void | setAttribute (const string &attrib, const string &value) |
Set the value string of the given attribute. More... | |
bool | hasAttribute (const string &attrib) const |
Return true if the given attribute is present. More... | |
const string & | getAttribute (const string &attrib) const |
const StringVec & | getAttributeNames () const |
Return a vector of stored attribute names, in the order they were set. More... | |
template<class T > | |
void | setTypedAttribute (const string &attrib, const T &data) |
template<class T > | |
T | getTypedAttribute (const string &attrib) const |
void | removeAttribute (const string &attrib) |
Remove the given attribute, if present. More... | |
ElementPtr | getSelf () |
Return our self pointer. More... | |
ConstElementPtr | getSelf () const |
Return our self pointer. More... | |
ElementPtr | getParent () |
Return our parent element. More... | |
ConstElementPtr | getParent () const |
Return our parent element. More... | |
ElementPtr | getRoot () |
Return the root element of our tree. More... | |
ConstElementPtr | getRoot () const |
Return the root element of our tree. More... | |
DocumentPtr | getDocument () |
Return the root document of our tree. More... | |
ConstDocumentPtr | getDocument () const |
Return the root document of our tree. More... | |
template<class T > | |
shared_ptr< const T > | getAncestorOfType () const |
TreeIterator | traverseTree () const |
GraphIterator | traverseGraph () const |
virtual Edge | getUpstreamEdge (size_t index=0) const |
virtual size_t | getUpstreamEdgeCount () const |
Return the number of queriable upstream edges for this element. More... | |
ElementPtr | getUpstreamElement (size_t index=0) const |
InheritanceIterator | traverseInheritance () const |
void | setSourceUri (const string &sourceUri) |
bool | hasSourceUri () const |
Return true if this element has a source URI. More... | |
const string & | getSourceUri () const |
Return the element's source URI. More... | |
const string & | getActiveSourceUri () const |
void | copyContentFrom (const ConstElementPtr &source) |
void | clearContent () |
Clear all attributes and descendants from this element. More... | |
string | createValidChildName (string name) const |
StringResolverPtr | createStringResolver (const string &geom=EMPTY_STRING) const |
string | asString () const |
template<class T > | |
shared_ptr< T > | resolveRootNameReference (const string &name) const |
Additional Inherited Members | |
![]() | |
using | NodeDefPtr = shared_ptr< NodeDef > |
using | ConstNodeDefPtr = shared_ptr< const NodeDef > |
![]() | |
using | TypeDefPtr = shared_ptr< class TypeDef > |
![]() | |
using | DocumentPtr = shared_ptr< Document > |
using | ConstDocumentPtr = shared_ptr< const Document > |
![]() | |
InterfaceElement (ElementPtr parent, const string &category, const string &name) | |
void | registerChildElement (ElementPtr child) override |
void | unregisterChildElement (ElementPtr child) override |
![]() | |
TypedElement (ElementPtr parent, const string &category, const string &name) | |
![]() | |
Element (ElementPtr parent, const string &category, const string &name) | |
void | validateRequire (bool expression, bool &res, string *message, string errorDesc) const |
ElementPtr | getSelfNonConst () const |
![]() | |
string | _category |
string | _name |
string | _sourceUri |
ElementMap | _childMap |
vector< ElementPtr > | _childOrder |
StringMap | _attributeMap |
StringVec | _attributeOrder |
weak_ptr< Element > | _parent |
weak_ptr< Element > | _root |
A node definition element within a Document.
A NodeDef provides the declaration of a node interface, which may then be instantiated as a Node.
Definition at line 81 of file Definition.h.
|
inline |
Definition at line 84 of file Definition.h.
|
inlinevirtual |
Definition at line 88 of file Definition.h.
|
overridevirtual |
Return the first declaration of this interface, optionally filtered by the given target name.
Reimplemented from InterfaceElement.
InterfaceElementPtr NodeDef::getImplementation | ( | const string & | target = EMPTY_STRING | ) | const |
Return the first implementation for this nodedef, optionally filtered by the given target name.
target | An optional target name, which will be used to filter the implementations that are considered. |
Return the node group of the NodeDef.
Definition at line 131 of file Definition.h.
Return the node string of the NodeDef.
Definition at line 106 of file Definition.h.
Return the element's output type.
Reimplemented from TypedElement.
|
inline |
Return true if the given NodeDef has a node group.
Definition at line 125 of file Definition.h.
|
inline |
Return true if the given NodeDef has a node string.
Definition at line 100 of file Definition.h.
Set the node group of the NodeDef.
Definition at line 119 of file Definition.h.
Set the node string of the NodeDef.
Definition at line 94 of file Definition.h.
|
overridevirtual |
Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.
Reimplemented from Element.
Definition at line 180 of file Definition.h.
Definition at line 173 of file Definition.h.
Definition at line 181 of file Definition.h.
Definition at line 179 of file Definition.h.
Definition at line 174 of file Definition.h.
Definition at line 175 of file Definition.h.
Definition at line 182 of file Definition.h.
Definition at line 178 of file Definition.h.
Definition at line 177 of file Definition.h.
Definition at line 183 of file Definition.h.