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... | |
StringSet | getReferencedSourceUris () const |
Get a list of source URIs referenced by the document. More... | |
NodeDefPtr | addNodeDefFromGraph (NodeGraphPtr nodeGraph, const string &nodeDefName, const string &node, const string &version, bool isDefaultVersion, const string &nodeGroup, const string &newGraphName) |
Data Libraries | |
void | setDataLibrary (ConstDocumentPtr dataLibrary) |
Store a reference to a data library in this document. More... | |
bool | hasDataLibrary () const |
Return true if this document has a data library. More... | |
ConstDocumentPtr | getDataLibrary () const |
Return the data library, if any, referenced by this document. More... | |
void | importLibrary (const ConstDocumentPtr &library) |
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 (NodeGraphPtr nodeGraph, const string &nodeDefName, const string &category, 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... | |
![]() | |
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) |
ElementVec | topologicalSort () const |
NodePtr | addGeomNode (ConstGeomPropDefPtr geomPropDef, const string &namePrefix) |
string | asStringDot () const |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 ElementVec & | 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< T > | getAncestorOfType () |
template<class T > | |
shared_ptr< const T > | getAncestorOfType () const |
bool | isEquivalent (ConstElementPtr rhs, const ElementEquivalenceOptions &options, string *message=nullptr) const |
virtual bool | isAttributeEquivalent (ConstElementPtr rhs, const string &attributeName, const ElementEquivalenceOptions &options, string *message=nullptr) const |
TreeIterator | traverseTree () const |
GraphIterator | traverseGraph () const |
virtual Edge | getUpstreamEdge (size_t index=0) const |
virtual size_t | getUpstreamEdgeCount () const |
Return the number of queryable 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 const string | NODE_DEF_ATTRIBUTE |
static const string | TARGET_ATTRIBUTE |
static const string | VERSION_ATTRIBUTE |
static const string | DEFAULT_VERSION_ATTRIBUTE |
![]() | |
static const string | TYPE_ATTRIBUTE |
![]() | |
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 |
static const string | XPOS_ATTRIBUTE |
static const string | YPOS_ATTRIBUTE |
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 > |
![]() | |
GraphElement (ElementPtr parent, const string &category, const string &name) | |
![]() | |
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) | |
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 |
![]() | |
string | _category |
string | _name |
string | _sourceUri |
ElementMap | _childMap |
ElementVec | _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 398 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 275 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 170 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 526 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 211 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 243 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 343 of file Document.h.
NodeDefPtr Document::addNodeDefFromGraph | ( | NodeGraphPtr | nodeGraph, |
const string & | nodeDefName, | ||
const string & | category, | ||
const string & | newGraphName | ||
) |
NodeDefPtr Document::addNodeDefFromGraph | ( | NodeGraphPtr | nodeGraph, |
const string & | nodeDefName, | ||
const string & | node, | ||
const string & | version, | ||
bool | isDefaultVersion, | ||
const string & | nodeGroup, | ||
const string & | newGraphName | ||
) |
|
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 96 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 462 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 430 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 307 of file Document.h.
|
inline |
Return the UnitDef, if any, with the given name.
Definition at line 558 of file Document.h.
|
inline |
Return the UnitTypeDef, if any, with the given name.
Definition at line 589 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 494 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 404 of file Document.h.
|
inline |
Return a vector of all AttributeDef elements in the document.
Definition at line 410 of file Document.h.
|
inline |
Return the Collection, if any, with the given name.
Definition at line 281 of file Document.h.
|
inline |
Return a vector of all Collection elements in the document.
Definition at line 287 of file Document.h.
|
inline |
Return the color management config string.
Definition at line 666 of file Document.h.
|
inline |
Return the color management system string.
Definition at line 644 of file Document.h.
|
inline |
Return the data library, if any, referenced by this document.
Definition at line 76 of file Document.h.
|
inline |
Return the GeomInfo, if any, with the given name.
Definition at line 142 of file Document.h.
|
inline |
Return a vector of all GeomInfo elements in the document.
Definition at line 148 of file Document.h.
|
inline |
Return the GeomPropDef, if any, with the given name.
Definition at line 178 of file Document.h.
|
inline |
Return a vector of all GeomPropDef elements in the document.
Definition at line 184 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 532 of file Document.h.
|
inline |
Return a vector of all Implementation elements in the document.
Definition at line 538 of file Document.h.
Return the Look, if any, with the given name.
Definition at line 217 of file Document.h.
|
inline |
Return the LookGroup, if any, with the given name.
Definition at line 249 of file Document.h.
|
inline |
Return a vector of all LookGroup elements in the document.
Definition at line 255 of file Document.h.
|
inline |
Return a vector of all Look elements in the document.
Definition at line 223 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 369 of file Document.h.
|
inline |
Return a vector of all NodeDef elements in the document.
Definition at line 375 of file Document.h.
|
inline |
Return the NodeGraph, if any, with the given name.
Definition at line 102 of file Document.h.
|
inline |
Return a vector of all NodeGraph elements in the document.
Definition at line 108 of file Document.h.
|
inline |
Return the PropertySet, if any, with the given name.
Definition at line 468 of file Document.h.
|
inline |
Return a vector of all PropertySet elements in the document.
Definition at line 474 of file Document.h.
StringSet Document::getReferencedSourceUris | ( | ) | const |
Get a list of source URIs referenced by the document.
|
inline |
Return the AttributeDef, if any, with the given name.
Definition at line 436 of file Document.h.
|
inline |
Return a vector of all TargetDef elements in the document.
Definition at line 442 of file Document.h.
|
inline |
Return the TypeDef, if any, with the given name.
Definition at line 313 of file Document.h.
|
inline |
Return a vector of all TypeDef elements in the document.
Definition at line 319 of file Document.h.
|
inline |
Return the UnitDef, if any, with the given name.
Definition at line 568 of file Document.h.
|
inline |
Return a vector of all Member elements in the TypeDef.
Definition at line 574 of file Document.h.
|
inline |
Return the UnitTypeDef, if any, with the given name.
Definition at line 599 of file Document.h.
|
inline |
Return a vector of all UnitTypeDef elements in the document.
Definition at line 605 of file Document.h.
|
inline |
Return the VariantSet, if any, with the given name.
Definition at line 500 of file Document.h.
|
inline |
Return a vector of all VariantSet elements in the document.
Definition at line 506 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 660 of file Document.h.
|
inline |
Return true if a color management system string has been set.
Definition at line 638 of file Document.h.
|
inline |
Return true if this document has a data library.
Definition at line 70 of file Document.h.
void Document::importLibrary | ( | const ConstDocumentPtr & | library | ) |
Import the given data library into this document. The contents of the data library are copied into this one, and are assigned the source URI of the library.
library | The data library 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 416 of file Document.h.
Remove the Collection, if any, with the given name.
Definition at line 293 of file Document.h.
Remove the GeomInfo, if any, with the given name.
Definition at line 154 of file Document.h.
Remove the GeomPropDef, if any, with the given name.
Definition at line 190 of file Document.h.
Remove the Implementation, if any, with the given name.
Definition at line 544 of file Document.h.
Remove the Look, if any, with the given name.
Definition at line 229 of file Document.h.
Remove the LookGroup, if any, with the given name.
Definition at line 261 of file Document.h.
Remove the NodeDef, if any, with the given name.
Definition at line 381 of file Document.h.
Remove the NodeGraph, if any, with the given name.
Definition at line 114 of file Document.h.
Remove the PropertySet, if any, with the given name.
Definition at line 480 of file Document.h.
Remove the TargetDef, if any, with the given name.
Definition at line 448 of file Document.h.
Remove the TypeDef, if any, with the given name.
Definition at line 325 of file Document.h.
Remove the UnitDef, if any, with the given name.
Definition at line 580 of file Document.h.
Remove the UnitTypeDef, if any, with the given name.
Definition at line 611 of file Document.h.
Remove the VariantSet, if any, with the given name.
Definition at line 512 of file Document.h.
Set the color management config string.
Definition at line 654 of file Document.h.
Set the color management system string.
Definition at line 632 of file Document.h.
|
inline |
Store a reference to a data library in this document.
Definition at line 64 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 699 of file Document.h.
|
static |
Definition at line 700 of file Document.h.
|
static |
Definition at line 701 of file Document.h.