HDK
|
#include <Document.h>
Public Member Functions | |
Document (ElementPtr parent, const string &name) | |
virtual | ~Document () |
virtual void | initialize () |
Initialize the document, removing any existing content. More... | |
virtual DocumentPtr | copy () const |
Create a deep copy of the document. More... | |
void | importLibrary (const ConstDocumentPtr &library) |
StringSet | getReferencedSourceUris () const |
Get a list of source URI's referenced by the document. More... | |
NodeGraph Elements | |
NodeGraphPtr | addNodeGraph (const string &name=EMPTY_STRING) |
NodeGraphPtr | getNodeGraph (const string &name) const |
Return the NodeGraph, if any, with the given name. More... | |
vector< NodeGraphPtr > | getNodeGraphs () const |
Return a vector of all NodeGraph elements in the document. More... | |
void | removeNodeGraph (const string &name) |
Remove the NodeGraph, if any, with the given name. More... | |
vector< PortElementPtr > | getMatchingPorts (const string &nodeName) const |
GeomInfo Elements | |
GeomInfoPtr | addGeomInfo (const string &name=EMPTY_STRING, const string &geom=UNIVERSAL_GEOM_NAME) |
GeomInfoPtr | getGeomInfo (const string &name) const |
Return the GeomInfo, if any, with the given name. More... | |
vector< GeomInfoPtr > | getGeomInfos () const |
Return a vector of all GeomInfo elements in the document. More... | |
void | removeGeomInfo (const string &name) |
Remove the GeomInfo, if any, with the given name. More... | |
ValuePtr | getGeomPropValue (const string &geomPropName, const string &geom=UNIVERSAL_GEOM_NAME) const |
Return the value of a geometric property for the given geometry string. More... | |
GeomPropDef Elements | |
GeomPropDefPtr | addGeomPropDef (const string &name, const string &geomprop) |
GeomPropDefPtr | getGeomPropDef (const string &name) const |
Return the GeomPropDef, if any, with the given name. More... | |
vector< GeomPropDefPtr > | getGeomPropDefs () const |
Return a vector of all GeomPropDef elements in the document. More... | |
void | removeGeomPropDef (const string &name) |
Remove the GeomPropDef, if any, with the given name. More... | |
Material Outputs | |
vector< OutputPtr > | getMaterialOutputs () const |
Return material-type outputs for all nodegraphs in the document. More... | |
Look Elements | |
LookPtr | addLook (const string &name=EMPTY_STRING) |
LookPtr | getLook (const string &name) const |
Return the Look, if any, with the given name. More... | |
vector< LookPtr > | getLooks () const |
Return a vector of all Look elements in the document. More... | |
void | removeLook (const string &name) |
Remove the Look, if any, with the given name. More... | |
LookGroup Elements | |
LookGroupPtr | addLookGroup (const string &name=EMPTY_STRING) |
LookGroupPtr | getLookGroup (const string &name) const |
Return the LookGroup, if any, with the given name. More... | |
vector< LookGroupPtr > | getLookGroups () const |
Return a vector of all LookGroup elements in the document. More... | |
void | removeLookGroup (const string &name) |
Remove the LookGroup, if any, with the given name. More... | |
Collection Elements | |
CollectionPtr | addCollection (const string &name=EMPTY_STRING) |
CollectionPtr | getCollection (const string &name) const |
Return the Collection, if any, with the given name. More... | |
vector< CollectionPtr > | getCollections () const |
Return a vector of all Collection elements in the document. More... | |
void | removeCollection (const string &name) |
Remove the Collection, if any, with the given name. More... | |
TypeDef Elements | |
TypeDefPtr | addTypeDef (const string &name) |
TypeDefPtr | getTypeDef (const string &name) const |
Return the TypeDef, if any, with the given name. More... | |
vector< TypeDefPtr > | getTypeDefs () const |
Return a vector of all TypeDef elements in the document. More... | |
void | removeTypeDef (const string &name) |
Remove the TypeDef, if any, with the given name. More... | |
NodeDef Elements | |
NodeDefPtr | addNodeDef (const string &name=EMPTY_STRING, const string &type=DEFAULT_TYPE_STRING, const string &node=EMPTY_STRING) |
NodeDefPtr | addNodeDefFromGraph (const NodeGraphPtr nodeGraph, const string &nodeDefName, const string &node, const string &version, bool isDefaultVersion, const string &nodeGroup, const string &newGraphName) |
NodeDefPtr | getNodeDef (const string &name) const |
Return the NodeDef, if any, with the given name. More... | |
vector< NodeDefPtr > | getNodeDefs () const |
Return a vector of all NodeDef elements in the document. More... | |
void | removeNodeDef (const string &name) |
Remove the NodeDef, if any, with the given name. More... | |
vector< NodeDefPtr > | getMatchingNodeDefs (const string &nodeName) const |
Return a vector of all NodeDef elements that match the given node name. More... | |
AttributeDef Elements | |
AttributeDefPtr | addAttributeDef (const string &name=EMPTY_STRING) |
AttributeDefPtr | getAttributeDef (const string &name) const |
Return the AttributeDef, if any, with the given name. More... | |
vector< AttributeDefPtr > | getAttributeDefs () const |
Return a vector of all AttributeDef elements in the document. More... | |
void | removeAttributeDef (const string &name) |
Remove the AttributeDef, if any, with the given name. More... | |
TargetDef Elements | |
TargetDefPtr | addTargetDef (const string &name=EMPTY_STRING) |
TargetDefPtr | getTargetDef (const string &name) const |
Return the AttributeDef, if any, with the given name. More... | |
vector< TargetDefPtr > | getTargetDefs () const |
Return a vector of all TargetDef elements in the document. More... | |
void | removeTargetDef (const string &name) |
Remove the TargetDef, if any, with the given name. More... | |
PropertySet Elements | |
PropertySetPtr | addPropertySet (const string &name=EMPTY_STRING) |
PropertySetPtr | getPropertySet (const string &name) const |
Return the PropertySet, if any, with the given name. More... | |
vector< PropertySetPtr > | getPropertySets () const |
Return a vector of all PropertySet elements in the document. More... | |
void | removePropertySet (const string &name) |
Remove the PropertySet, if any, with the given name. More... | |
VariantSet Elements | |
VariantSetPtr | addVariantSet (const string &name=EMPTY_STRING) |
VariantSetPtr | getVariantSet (const string &name) const |
Return the VariantSet, if any, with the given name. More... | |
vector< VariantSetPtr > | getVariantSets () const |
Return a vector of all VariantSet elements in the document. More... | |
void | removeVariantSet (const string &name) |
Remove the VariantSet, if any, with the given name. More... | |
Implementation Elements | |
ImplementationPtr | addImplementation (const string &name=EMPTY_STRING) |
ImplementationPtr | getImplementation (const string &name) const |
Return the Implementation, if any, with the given name. More... | |
vector< ImplementationPtr > | getImplementations () const |
Return a vector of all Implementation elements in the document. More... | |
void | removeImplementation (const string &name) |
Remove the Implementation, if any, with the given name. More... | |
vector< InterfaceElementPtr > | getMatchingImplementations (const string &nodeDef) const |
UnitDef Elements | |
UnitDefPtr | addUnitDef (const string &name) |
Return the UnitDef, if any, with the given name. More... | |
UnitDefPtr | getUnitDef (const string &name) const |
Return the UnitDef, if any, with the given name. More... | |
vector< UnitDefPtr > | getUnitDefs () const |
Return a vector of all Member elements in the TypeDef. More... | |
void | removeUnitDef (const string &name) |
Remove the UnitDef, if any, with the given name. More... | |
UnitTypeDef Elements | |
UnitTypeDefPtr | addUnitTypeDef (const string &name) |
Return the UnitTypeDef, if any, with the given name. More... | |
UnitTypeDefPtr | getUnitTypeDef (const string &name) const |
Return the UnitTypeDef, if any, with the given name. More... | |
vector< UnitTypeDefPtr > | getUnitTypeDefs () const |
Return a vector of all UnitTypeDef elements in the document. More... | |
void | removeUnitTypeDef (const string &name) |
Remove the UnitTypeDef, if any, with the given name. More... | |
Version | |
std::pair< int, int > | getVersionIntegers () const override |
Return the major and minor versions as an integer pair. More... | |
void | upgradeVersion () |
Color Management System | |
void | setColorManagementSystem (const string &cms) |
Set the color management system string. More... | |
bool | hasColorManagementSystem () const |
Return true if a color management system string has been set. More... | |
const string & | getColorManagementSystem () const |
Return the color management system string. More... | |
Color Management Config | |
void | setColorManagementConfig (const string &cmsConfig) |
Set the color management config string. More... | |
bool | hasColorManagementConfig () const |
Return true if a color management config string has been set. More... | |
const string & | getColorManagementConfig () const |
Return the color management config string. More... | |
Validation | |
bool | validate (string *message=nullptr) const override |
Utility | |
void | invalidateCache () |
Invalidate cached data for optimized lookups within the given document. More... | |
Public Member Functions inherited from GraphElement | |
virtual | ~GraphElement () |
NodePtr | addNode (const string &category, const string &name=EMPTY_STRING, const string &type=DEFAULT_TYPE_STRING) |
NodePtr | addNodeInstance (ConstNodeDefPtr nodeDef, const string &name=EMPTY_STRING) |
Add a Node that is an instance of the given NodeDef. More... | |
NodePtr | getNode (const string &name) const |
Return the Node, if any, with the given name. More... | |
vector< NodePtr > | getNodes (const string &category=EMPTY_STRING) const |
vector< NodePtr > | getNodesOfType (const string &nodeType) const |
Return a vector of nodes in the graph which have a given type. More... | |
void | removeNode (const string &name) |
Remove the Node, if any, with the given name. More... | |
NodePtr | addMaterialNode (const string &name=EMPTY_STRING, ConstNodePtr shaderNode=nullptr) |
vector< NodePtr > | getMaterialNodes () const |
Return a vector of all material nodes. More... | |
BackdropPtr | addBackdrop (const string &name=EMPTY_STRING) |
Add a Backdrop to the graph. More... | |
BackdropPtr | getBackdrop (const string &name) const |
Return the Backdrop, if any, with the given name. More... | |
vector< BackdropPtr > | getBackdrops () const |
Return a vector of all Backdrop elements in the graph. More... | |
void | removeBackdrop (const string &name) |
Remove the Backdrop, if any, with the given name. More... | |
void | flattenSubgraphs (const string &target=EMPTY_STRING, NodePredicate filter=nullptr) |
vector< ElementPtr > | topologicalSort () const |
NodePtr | addGeomNode (ConstGeomPropDefPtr geomPropDef, const string &namePrefix) |
string | asStringDot () const |
Public Member Functions inherited from InterfaceElement | |
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... | |
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... | |
virtual ConstInterfaceElementPtr | getDeclaration (const string &target=EMPTY_STRING) const |
void | clearContent () override |
Clear all attributes and descendants from this element. More... | |
bool | hasExactInputMatch (ConstInterfaceElementPtr declaration, string *message=nullptr) const |
Public Member Functions inherited from TypedElement | |
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... | |
virtual const string & | getType () const |
Return the element's type string. More... | |
bool | isColorType () const |
Return true if the element is of color type. More... | |
bool | isMultiOutputType () const |
Return true if the element is of multi-output type. More... | |
TypeDefPtr | getTypeDef () const |
Public Member Functions inherited from Element | |
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) |
string | createValidChildName (string name) const |
StringResolverPtr | createStringResolver (const string &geom=EMPTY_STRING) const |
string | asString () const |
Static Public Member Functions | |
template<class T > | |
static shared_ptr< T > | createDocument () |
Create a new document of the given subclass. More... | |
Static Public Attributes | |
static const string | CATEGORY |
static const string | CMS_ATTRIBUTE |
static const string | CMS_CONFIG_ATTRIBUTE |
Static Public Attributes inherited from InterfaceElement | |
static const string | NODE_DEF_ATTRIBUTE |
static const string | TARGET_ATTRIBUTE |
static const string | VERSION_ATTRIBUTE |
static const string | DEFAULT_VERSION_ATTRIBUTE |
Static Public Attributes inherited from TypedElement | |
static const string | TYPE_ATTRIBUTE |
Static Public Attributes inherited from Element | |
static const string | NAME_ATTRIBUTE |
static const string | FILE_PREFIX_ATTRIBUTE |
static const string | GEOM_PREFIX_ATTRIBUTE |
static const string | COLOR_SPACE_ATTRIBUTE |
static const string | INHERIT_ATTRIBUTE |
static const string | NAMESPACE_ATTRIBUTE |
static const string | DOC_ATTRIBUTE |
Additional Inherited Members | |
Protected Types inherited from InterfaceElement | |
using | NodeDefPtr = shared_ptr< NodeDef > |
using | ConstNodeDefPtr = shared_ptr< const NodeDef > |
Protected Types inherited from TypedElement | |
using | TypeDefPtr = shared_ptr< class TypeDef > |
Protected Types inherited from Element | |
using | DocumentPtr = shared_ptr< Document > |
using | ConstDocumentPtr = shared_ptr< const Document > |
Protected Member Functions inherited from GraphElement | |
GraphElement (ElementPtr parent, const string &category, const string &name) | |
Protected Member Functions inherited from InterfaceElement | |
InterfaceElement (ElementPtr parent, const string &category, const string &name) | |
void | registerChildElement (ElementPtr child) override |
void | unregisterChildElement (ElementPtr child) override |
Protected Member Functions inherited from TypedElement | |
TypedElement (ElementPtr parent, const string &category, const string &name) | |
Protected Member Functions inherited from Element | |
Element (ElementPtr parent, const string &category, const string &name) | |
template<class T > | |
shared_ptr< T > | resolveNameReference (const string &name, ConstElementPtr parent=nullptr) const |
void | validateRequire (bool expression, bool &res, string *message, const string &errorDesc) const |
ElementPtr | getSelfNonConst () const |
Protected Attributes inherited from Element | |
string | _category |
string | _name |
string | _sourceUri |
ElementMap | _childMap |
vector< ElementPtr > | _childOrder |
StringMap | _attributeMap |
StringVec | _attributeOrder |
weak_ptr< Element > | _parent |
weak_ptr< Element > | _root |
A MaterialX document, which represents the top-level element in the MaterialX ownership hierarchy.
Use the factory function createDocument() to create a Document instance.
Definition at line 31 of file Document.h.
Document::Document | ( | ElementPtr | parent, |
const string & | name | ||
) |
|
virtual |
|
inline |
Add an AttributeDef to the document.
name | The name of the new AttributeDef. If no name is specified, then a unique name will automatically be generated. |
Definition at line 379 of file Document.h.
|
inline |
Add a Collection to the document.
name | The name of the new Collection. If no name is specified, then a unique name will automatically be generated. |
Definition at line 252 of file Document.h.
|
inline |
|
inline |
Add a GeomPropDef to the document.
name | The name of the new GeomPropDef. |
geomprop | The geometric property to use for the GeomPropDef. |
Definition at line 147 of file Document.h.
|
inline |
Add an Implementation to the document.
name | The name of the new Implementation. If no name is specified, then a unique name will automatically be generated. |
Definition at line 507 of file Document.h.
|
inline |
Add a Look to the document.
name | The name of the new Look. If no name is specified, then a unique name will automatically be generated. |
Definition at line 188 of file Document.h.
|
inline |
Add a LookGroup to the document.
name | The name of the new LookGroup. If no name is specified, then a unique name will automatically be generated. |
Definition at line 220 of file Document.h.
|
inline |
Add a NodeDef to the document.
name | The name of the new NodeDef. If no name is specified, then a unique name will automatically be generated. |
type | An optional type string. If specified, then the new NodeDef will be assigned an Output of the given type. |
node | An optional node string. |
Definition at line 320 of file Document.h.
NodeDefPtr Document::addNodeDefFromGraph | ( | const NodeGraphPtr | nodeGraph, |
const string & | nodeDefName, | ||
const string & | node, | ||
const string & | version, | ||
bool | isDefaultVersion, | ||
const string & | nodeGroup, | ||
const string & | newGraphName | ||
) |
Create a NodeDef declaration which is based on a NodeGraph.
nodeGraph | NodeGraph used to create NodeDef |
nodeDefName | Declaration name |
node | Node type for the new declaration |
version | Version for the new declaration |
isDefaultVersion | If a version is specified is thie definition the default version |
newGraphName | Make a copy of this NodeGraph with the given name if a non-empty name is provided. Otherwise modify the existing NodeGraph. Default value is an empty string. |
nodeGroup | Optional node group for the new declaration. The Default value is an emptry string. |
|
inline |
Add a NodeGraph to the document.
name | The name of the new NodeGraph. If no name is specified, then a unique name will automatically be generated. |
Definition at line 73 of file Document.h.
|
inline |
Add a PropertySet to the document.
name | The name of the new PropertySet. If no name is specified, then a unique name will automatically be generated. |
Definition at line 443 of file Document.h.
|
inline |
Add an TargetDef to the document.
name | The name of the new TargetDef. If no name is specified, then a unique name will automatically be generated. |
Definition at line 411 of file Document.h.
|
inline |
Add a TypeDef to the document.
name | The name of the new TypeDef. If no name is specified, then a unique name will automatically be generated. |
Definition at line 284 of file Document.h.
|
inline |
Return the UnitDef, if any, with the given name.
Definition at line 539 of file Document.h.
|
inline |
Return the UnitTypeDef, if any, with the given name.
Definition at line 570 of file Document.h.
|
inline |
Add a VariantSet to the document.
name | The name of the new VariantSet. If no name is specified, then a unique name will automatically be generated. |
Definition at line 475 of file Document.h.
|
inlinevirtual |
Create a deep copy of the document.
Definition at line 49 of file Document.h.
|
inlinestatic |
Create a new document of the given subclass.
Create a new Document.
Definition at line 38 of file Document.h.
|
inline |
Return the AttributeDef, if any, with the given name.
Definition at line 385 of file Document.h.
|
inline |
Return a vector of all AttributeDef elements in the document.
Definition at line 391 of file Document.h.
|
inline |
Return the Collection, if any, with the given name.
Definition at line 258 of file Document.h.
|
inline |
Return a vector of all Collection elements in the document.
Definition at line 264 of file Document.h.
|
inline |
Return the color management config string.
Definition at line 647 of file Document.h.
|
inline |
Return the color management system string.
Definition at line 625 of file Document.h.
|
inline |
Return the GeomInfo, if any, with the given name.
Definition at line 119 of file Document.h.
|
inline |
Return a vector of all GeomInfo elements in the document.
Definition at line 125 of file Document.h.
|
inline |
Return the GeomPropDef, if any, with the given name.
Definition at line 155 of file Document.h.
|
inline |
Return a vector of all GeomPropDef elements in the document.
Definition at line 161 of file Document.h.
ValuePtr Document::getGeomPropValue | ( | const string & | geomPropName, |
const string & | geom = UNIVERSAL_GEOM_NAME |
||
) | const |
Return the value of a geometric property for the given geometry string.
|
inline |
Return the Implementation, if any, with the given name.
Definition at line 513 of file Document.h.
|
inline |
Return a vector of all Implementation elements in the document.
Definition at line 519 of file Document.h.
Return the Look, if any, with the given name.
Definition at line 194 of file Document.h.
|
inline |
Return the LookGroup, if any, with the given name.
Definition at line 226 of file Document.h.
|
inline |
Return a vector of all LookGroup elements in the document.
Definition at line 232 of file Document.h.
|
inline |
Return a vector of all Look elements in the document.
Definition at line 200 of file Document.h.
vector<InterfaceElementPtr> Document::getMatchingImplementations | ( | const string & | nodeDef | ) | const |
Return a vector of all node implementations that match the given NodeDef string. Note that a node implementation may be either an Implementation element or NodeGraph element.
vector<NodeDefPtr> Document::getMatchingNodeDefs | ( | const string & | nodeName | ) | const |
Return a vector of all NodeDef elements that match the given node name.
vector<PortElementPtr> Document::getMatchingPorts | ( | const string & | nodeName | ) | const |
vector<OutputPtr> Document::getMaterialOutputs | ( | ) | const |
Return material-type outputs for all nodegraphs in the document.
|
inline |
Return the NodeDef, if any, with the given name.
Definition at line 350 of file Document.h.
|
inline |
Return a vector of all NodeDef elements in the document.
Definition at line 356 of file Document.h.
|
inline |
Return the NodeGraph, if any, with the given name.
Definition at line 79 of file Document.h.
|
inline |
Return a vector of all NodeGraph elements in the document.
Definition at line 85 of file Document.h.
|
inline |
Return the PropertySet, if any, with the given name.
Definition at line 449 of file Document.h.
|
inline |
Return a vector of all PropertySet elements in the document.
Definition at line 455 of file Document.h.
StringSet Document::getReferencedSourceUris | ( | ) | const |
Get a list of source URI's referenced by the document.
|
inline |
Return the AttributeDef, if any, with the given name.
Definition at line 417 of file Document.h.
|
inline |
Return a vector of all TargetDef elements in the document.
Definition at line 423 of file Document.h.
|
inline |
Return the TypeDef, if any, with the given name.
Definition at line 290 of file Document.h.
|
inline |
Return a vector of all TypeDef elements in the document.
Definition at line 296 of file Document.h.
|
inline |
Return the UnitDef, if any, with the given name.
Definition at line 549 of file Document.h.
|
inline |
Return a vector of all Member elements in the TypeDef.
Definition at line 555 of file Document.h.
|
inline |
Return the UnitTypeDef, if any, with the given name.
Definition at line 580 of file Document.h.
|
inline |
Return a vector of all UnitTypeDef elements in the document.
Definition at line 586 of file Document.h.
|
inline |
Return the VariantSet, if any, with the given name.
Definition at line 481 of file Document.h.
|
inline |
Return a vector of all VariantSet elements in the document.
Definition at line 487 of file Document.h.
Return the major and minor versions as an integer pair.
Reimplemented from InterfaceElement.
|
inline |
Return true if a color management config string has been set.
Definition at line 641 of file Document.h.
|
inline |
Return true if a color management system string has been set.
Definition at line 619 of file Document.h.
void Document::importLibrary | ( | const ConstDocumentPtr & | library | ) |
Import the given document as a library within this document. The contents of the library document are copied into this one, and are assigned the source URI of the library.
library | The library document to be imported. |
|
virtual |
Initialize the document, removing any existing content.
void Document::invalidateCache | ( | ) |
Invalidate cached data for optimized lookups within the given document.
Remove the AttributeDef, if any, with the given name.
Definition at line 397 of file Document.h.
Remove the Collection, if any, with the given name.
Definition at line 270 of file Document.h.
Remove the GeomInfo, if any, with the given name.
Definition at line 131 of file Document.h.
Remove the GeomPropDef, if any, with the given name.
Definition at line 167 of file Document.h.
Remove the Implementation, if any, with the given name.
Definition at line 525 of file Document.h.
Remove the Look, if any, with the given name.
Definition at line 206 of file Document.h.
Remove the LookGroup, if any, with the given name.
Definition at line 238 of file Document.h.
Remove the NodeDef, if any, with the given name.
Definition at line 362 of file Document.h.
Remove the NodeGraph, if any, with the given name.
Definition at line 91 of file Document.h.
Remove the PropertySet, if any, with the given name.
Definition at line 461 of file Document.h.
Remove the TargetDef, if any, with the given name.
Definition at line 429 of file Document.h.
Remove the TypeDef, if any, with the given name.
Definition at line 302 of file Document.h.
Remove the UnitDef, if any, with the given name.
Definition at line 561 of file Document.h.
Remove the UnitTypeDef, if any, with the given name.
Definition at line 592 of file Document.h.
Remove the VariantSet, if any, with the given name.
Definition at line 493 of file Document.h.
Set the color management config string.
Definition at line 635 of file Document.h.
Set the color management system string.
Definition at line 613 of file Document.h.
void Document::upgradeVersion | ( | ) |
Upgrade the content of this document from earlier supported versions to the library version.
|
overridevirtual |
Validate that the given document is consistent with the MaterialX specification.
message | An optional output string, to which a description of each error will be appended. |
Reimplemented from Element.
|
static |
Definition at line 673 of file Document.h.
|
static |
Definition at line 674 of file Document.h.
|
static |
Definition at line 675 of file Document.h.