6 #ifndef MATERIALX_DOCUMENT
7 #define MATERIALX_DOCUMENT
52 doc->copyContentFrom(
getSelf());
63 StringSet getReferencedSourceUris()
const;
75 return addChild<NodeGraph>(
name);
81 return getChildOfType<NodeGraph>(
name);
87 return getChildrenOfType<NodeGraph>();
93 removeChildOfType<NodeGraph>(
name);
99 vector<PortElementPtr> getMatchingPorts(
const string& nodeName)
const;
114 geomInfo->setGeom(geom);
121 return getChildOfType<GeomInfo>(
name);
127 return getChildrenOfType<GeomInfo>();
133 removeChildOfType<GeomInfo>(
name);
150 geomPropDef->setGeomProp(geomprop);
157 return getChildOfType<GeomPropDef>(
name);
163 return getChildrenOfType<GeomPropDef>();
169 removeChildOfType<GeomPropDef>(
name);
177 vector<OutputPtr> getMaterialOutputs()
const;
190 return addChild<Look>(
name);
196 return getChildOfType<Look>(
name);
202 return getChildrenOfType<Look>();
208 removeChildOfType<Look>(
name);
222 return addChild<LookGroup>(
name);
228 return getChildOfType<LookGroup>(
name);
234 return getChildrenOfType<LookGroup>();
240 removeChildOfType<LookGroup>(
name);
254 return addChild<Collection>(
name);
260 return getChildOfType<Collection>(
name);
266 return getChildrenOfType<Collection>();
272 removeChildOfType<Collection>(
name);
286 return addChild<TypeDef>(
name);
292 return getChildOfType<TypeDef>(
name);
298 return getChildrenOfType<TypeDef>();
304 removeChildOfType<TypeDef>(
name);
327 child->addOutput(
"out",
type);
331 child->setNodeString(node);
347 bool isDefaultVersion,
const string& nodeGroup,
const string& newGraphName);
352 return getChildOfType<NodeDef>(
name);
358 return getChildrenOfType<NodeDef>();
364 removeChildOfType<NodeDef>(
name);
368 vector<NodeDefPtr> getMatchingNodeDefs(
const string& nodeName)
const;
381 return addChild<AttributeDef>(
name);
387 return getChildOfType<AttributeDef>(
name);
393 return getChildrenOfType<AttributeDef>();
399 removeChildOfType<AttributeDef>(
name);
413 return addChild<TargetDef>(
name);
419 return getChildOfType<TargetDef>(
name);
425 return getChildrenOfType<TargetDef>();
431 removeChildOfType<TargetDef>(
name);
445 return addChild<PropertySet>(
name);
451 return getChildOfType<PropertySet>(
name);
457 return getChildrenOfType<PropertySet>();
463 removeChildOfType<PropertySet>(
name);
477 return addChild<VariantSet>(
name);
483 return getChildOfType<VariantSet>(
name);
489 return getChildrenOfType<VariantSet>();
495 removeChildOfType<VariantSet>(
name);
509 return addChild<Implementation>(
name);
515 return getChildOfType<Implementation>(
name);
521 return getChildrenOfType<Implementation>();
527 removeChildOfType<Implementation>(
name);
533 vector<InterfaceElementPtr> getMatchingImplementations(
const string& nodeDef)
const;
543 throw Exception(
"A unit definition name cannot be empty");
545 return addChild<UnitDef>(
name);
551 return getChildOfType<UnitDef>(
name);
557 return getChildrenOfType<UnitDef>();
563 removeChildOfType<UnitDef>(
name);
574 throw Exception(
"A unit type definition name cannot be empty");
576 return addChild<UnitTypeDef>(
name);
582 return getChildOfType<UnitTypeDef>(
name);
588 return getChildrenOfType<UnitTypeDef>();
594 removeChildOfType<UnitTypeDef>(
name);
606 void upgradeVersion();
668 void invalidateCache();
679 std::unique_ptr<Cache> _cache;
GLuint GLsizei const GLchar * message
static const string CMS_ATTRIBUTE
ImplementationPtr addImplementation(const string &name=EMPTY_STRING)
shared_ptr< NodeDef > NodeDefPtr
bool hasColorManagementConfig() const
Return true if a color management config string has been set.
vector< ImplementationPtr > getImplementations() const
Return a vector of all Implementation elements in the document.
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
TypeDefPtr getTypeDef(const string &name) const
Return the TypeDef, if any, with the given name.
ElementPtr getSelf()
Return our self pointer.
LookGroupPtr getLookGroup(const string &name) const
Return the LookGroup, if any, with the given name.
void removeTargetDef(const string &name)
Remove the TargetDef, if any, with the given name.
shared_ptr< TargetDef > TargetDefPtr
A shared pointer to a TargetDef.
#define MATERIALX_NAMESPACE_BEGIN
vector< TypeDefPtr > getTypeDefs() const
Return a vector of all TypeDef elements in the document.
shared_ptr< AttributeDef > AttributeDefPtr
A shared pointer to an AttributeDef.
GeomInfoPtr addGeomInfo(const string &name=EMPTY_STRING, const string &geom=UNIVERSAL_GEOM_NAME)
static const string CATEGORY
vector< LookPtr > getLooks() const
Return a vector of all Look elements in the document.
shared_ptr< Look > LookPtr
A shared pointer to a Look.
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
vector< UnitTypeDefPtr > getUnitTypeDefs() const
Return a vector of all UnitTypeDef elements in the document.
const string & getAttribute(const string &attrib) const
void removeUnitTypeDef(const string &name)
Remove the UnitTypeDef, if any, with the given name.
void removeLookGroup(const string &name)
Remove the LookGroup, if any, with the given name.
AttributeDefPtr getAttributeDef(const string &name) const
Return the AttributeDef, if any, with the given name.
vector< UnitDefPtr > getUnitDefs() const
Return a vector of all Member elements in the TypeDef.
const string & getColorManagementConfig() const
Return the color management config string.
class OCIOEXPORT Exception
shared_ptr< GeomInfo > GeomInfoPtr
A shared pointer to a GeomInfo.
static const string CMS_CONFIG_ATTRIBUTE
bool hasColorManagementSystem() const
Return true if a color management system string has been set.
shared_ptr< VariantSet > VariantSetPtr
A shared pointer to a VariantSet.
void removeCollection(const string &name)
Remove the Collection, if any, with the given name.
shared_ptr< UnitTypeDef > UnitTypeDefPtr
A shared pointer to a UnitTypeDef.
TypeDefPtr addTypeDef(const string &name)
shared_ptr< PropertySet > PropertySetPtr
A shared pointer to a PropertySet.
vector< NodeDefPtr > getNodeDefs() const
Return a vector of all NodeDef elements in the document.
virtual std::pair< int, int > getVersionIntegers() const
Return the major and minor versions as an integer pair.
shared_ptr< LookGroup > LookGroupPtr
A shared pointer to a LookGroup.
void removeGeomInfo(const string &name)
Remove the GeomInfo, if any, with the given name.
LookPtr getLook(const string &name) const
Return the Look, if any, with the given name.
NodeDefPtr addNodeDef(const string &name=EMPTY_STRING, const string &type=DEFAULT_TYPE_STRING, const string &node=EMPTY_STRING)
vector< VariantSetPtr > getVariantSets() const
Return a vector of all VariantSet elements in the document.
virtual bool validate(string *message=nullptr) const
shared_ptr< Implementation > ImplementationPtr
A shared pointer to an Implementation.
vector< TargetDefPtr > getTargetDefs() const
Return a vector of all TargetDef elements in the document.
virtual DocumentPtr copy() const
Create a deep copy of the document.
PropertySetPtr addPropertySet(const string &name=EMPTY_STRING)
void removeImplementation(const string &name)
Remove the Implementation, if any, with the given name.
NodeDefPtr getNodeDef(const string &name) const
Return the NodeDef, if any, with the given name.
MX_CORE_API const string UNIVERSAL_GEOM_NAME
void removeNodeDef(const string &name)
Remove the NodeDef, if any, with the given name.
vector< AttributeDefPtr > getAttributeDefs() const
Return a vector of all AttributeDef elements in the document.
UnitTypeDefPtr getUnitTypeDef(const string &name) const
Return the UnitTypeDef, if any, with the given name.
MX_CORE_API const string MULTI_OUTPUT_TYPE_STRING
void removeAttributeDef(const string &name)
Remove the AttributeDef, if any, with the given name.
GeomInfoPtr getGeomInfo(const string &name) const
Return the GeomInfo, if any, with the given name.
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
void removePropertySet(const string &name)
Remove the PropertySet, if any, with the given name.
shared_ptr< UnitDef > UnitDefPtr
A shared pointer to a UnitDef.
shared_ptr< GeomPropDef > GeomPropDefPtr
A shared pointer to a GeomPropDef.
vector< CollectionPtr > getCollections() const
Return a vector of all Collection elements in the document.
void removeGeomPropDef(const string &name)
Remove the GeomPropDef, if any, with the given name.
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
LookPtr addLook(const string &name=EMPTY_STRING)
CollectionPtr getCollection(const string &name) const
Return the Collection, if any, with the given name.
void setColorManagementConfig(const string &cmsConfig)
Set the color management config string.
vector< LookGroupPtr > getLookGroups() const
Return a vector of all LookGroup elements in the document.
void removeUnitDef(const string &name)
Remove the UnitDef, if any, with the given name.
const string & getColorManagementSystem() const
Return the color management system string.
GT_API const UT_StringHolder version
ImplementationPtr getImplementation(const string &name) const
Return the Implementation, if any, with the given name.
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
void setColorManagementSystem(const string &cms)
Set the color management system string.
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string DEFAULT_TYPE_STRING
shared_ptr< Document > DocumentPtr
GeomPropDefPtr addGeomPropDef(const string &name, const string &geomprop)
vector< GeomPropDefPtr > getGeomPropDefs() const
Return a vector of all GeomPropDef elements in the document.
vector< PropertySetPtr > getPropertySets() const
Return a vector of all PropertySet elements in the document.
TargetDefPtr getTargetDef(const string &name) const
Return the AttributeDef, if any, with the given name.
NodeGraphPtr getNodeGraph(const string &name) const
Return the NodeGraph, if any, with the given name.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
vector< GeomInfoPtr > getGeomInfos() const
Return a vector of all GeomInfo elements in the document.
void removeLook(const string &name)
Remove the Look, if any, with the given name.
static shared_ptr< T > createDocument()
Create a new document of the given subclass.
vector< NodeGraphPtr > getNodeGraphs() const
Return a vector of all NodeGraph elements in the document.
UnitDefPtr addUnitDef(const string &name)
Return the UnitDef, if any, with the given name.
UnitTypeDefPtr addUnitTypeDef(const string &name)
Return the UnitTypeDef, if any, with the given name.
std::set< string > StringSet
A set of strings.
NodeGraphPtr addNodeGraph(const string &name=EMPTY_STRING)
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
void removeTypeDef(const string &name)
Remove the TypeDef, if any, with the given name.
UnitDefPtr getUnitDef(const string &name) const
Return the UnitDef, if any, with the given name.
#define MATERIALX_NAMESPACE_END
LookGroupPtr addLookGroup(const string &name=EMPTY_STRING)
VariantSetPtr getVariantSet(const string &name) const
Return the VariantSet, if any, with the given name.
GeomPropDefPtr getGeomPropDef(const string &name) const
Return the GeomPropDef, if any, with the given name.
PropertySetPtr getPropertySet(const string &name) const
Return the PropertySet, if any, with the given name.
CollectionPtr addCollection(const string &name=EMPTY_STRING)
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
AttributeDefPtr addAttributeDef(const string &name=EMPTY_STRING)
TargetDefPtr addTargetDef(const string &name=EMPTY_STRING)
shared_ptr< const Document > ConstDocumentPtr
A shared pointer to a const Document.
shared_ptr< NodeGraph > NodeGraphPtr
A shared pointer to a NodeGraph.
shared_ptr< class TypeDef > TypeDefPtr
void removeNodeGraph(const string &name)
Remove the NodeGraph, if any, with the given name.
VariantSetPtr addVariantSet(const string &name=EMPTY_STRING)
void removeVariantSet(const string &name)
Remove the VariantSet, if any, with the given name.
shared_ptr< NodeDef > NodeDefPtr
A shared pointer to a NodeDef.