6 #ifndef MATERIALX_DEFINITION_H
7 #define MATERIALX_DEFINITION_H
112 const string&
getType()
const override;
164 bool isVersionCompatible(
const string&
version)
const;
307 Element(parent, CATEGORY, name)
366 return addChild<Member>(
name);
372 return getChildOfType<Member>(
name);
378 return getChildrenOfType<Member>();
384 removeChildOfType<Member>(
name);
437 Element(parent, CATEGORY, name)
452 Element(parent, CATEGORY, name)
490 throw Exception(
"A unit definition name cannot be empty");
492 return addChild<Unit>(
name);
498 return getChildOfType<Unit>(
name);
504 return getChildrenOfType<Unit>();
510 removeChildOfType<Unit>(
name);
526 Element(parent, CATEGORY, name)
532 vector<UnitDefPtr> getUnitDefs()
const;
656 setTypedAttribute<bool>(EXPORTABLE_ATTRIBUTE,
value);
663 return getTypedAttribute<bool>(EXPORTABLE_ATTRIBUTE);
static const string CATEGORY
shared_ptr< const UnitDef > ConstUnitDefPtr
A shared pointer to a const UnitDef.
static const string SEMANTIC_ATTRIBUTE
shared_ptr< const TypeDef > ConstTypeDefPtr
A shared pointer to a const TypeDef.
GLuint GLsizei const GLchar * message
static const string FUNCTION_ATTRIBUTE
shared_ptr< const Implementation > ConstImplementationPtr
A shared pointer to a const Implementation.
virtual const string & getType() const
Return the element's type string.
void setType(const string &type)
Set the element's type string.
bool hasFile() const
Return true if the given Implementation has a file string.
static const string VALUE_ATTRIBUTE
const string & getNodeGraph() const
Return the nodegraph string for the Implementation.
const string & getFunction() const
Return the function string for the Implementation.
shared_ptr< TypeDef > TypeDefPtr
A shared pointer to a TypeDef.
UnitDef(ElementPtr parent, const string &name)
shared_ptr< TargetDef > TargetDefPtr
A shared pointer to a TargetDef.
#define MATERIALX_NAMESPACE_BEGIN
vector< string > StringVec
A vector of strings.
void setNodeGroup(const string &category)
Set the node group of the NodeDef.
void setUnitType(const string &type)
Set the element's unittype string.
shared_ptr< const InterfaceElement > ConstInterfaceElementPtr
A shared pointer to a const InterfaceElement.
GLsizei const GLfloat * value
shared_ptr< AttributeDef > AttributeDefPtr
A shared pointer to an AttributeDef.
void setNodeString(const string &node)
Set the node string of the NodeDef.
static const string PROCEDURAL_NODE_GROUP
shared_ptr< Member > MemberPtr
A shared pointer to a Member.
static const string NODE_GROUP_ATTRIBUTE
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
static const string CATEGORY
const string & getAttribute(const string &attrib) const
void setContext(const string &context)
Set the context string of the TypeDef.
TargetDef(ElementPtr parent, const string &name)
__hostdev__ void setValue(uint32_t offset, bool v)
shared_ptr< InterfaceElement > InterfaceElementPtr
A shared pointer to an InterfaceElement.
NodeDef(ElementPtr parent, const string &name)
class OCIOEXPORT Exception
void setFunction(const string &function)
Set the function string for the Implementation.
void setNodeGraph(const string &nodegraph)
Set the nodegraph string for the Implementation.
shared_ptr< UnitTypeDef > UnitTypeDefPtr
A shared pointer to a UnitTypeDef.
MemberPtr getMember(const string &name) const
Return the Member, if any, with the given name.
bool hasValueString() const
Return true if the given element has a value string.
shared_ptr< const Member > ConstMemberPtr
A shared pointer to a const Member.
AttributeDef(ElementPtr parent, const string &name)
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string COLOR_SEMANTIC
const string & getAttrName() const
Return the element's attrname string.
MemberPtr addMember(const string &name=EMPTY_STRING)
void removeMember(const string &name)
Remove the Member, if any, with the given name.
void setValueString(const string &value)
Set the value string of an element.
static const string GEOMETRIC_NODE_GROUP
void setValue(const char *value, const string &type=EMPTY_STRING)
Set the typed value of an element from a C-style string.
void setSemantic(const string &semantic)
Set the semantic string of the TypeDef.
void setValue(const T &value, const string &type=EMPTY_STRING)
Set the typed value of an element.
static const string FILE_ATTRIBUTE
virtual bool validate(string *message=nullptr) const
vector< UnitPtr > getUnits() const
Return a vector of all Unit elements in the UnitDef.
static const string CONTEXT_ATTRIBUTE
bool hasFunction() const
Return true if the given Implementation has a function string.
bool hasNodeGroup() const
Return true if the given NodeDef has a node group.
shared_ptr< Implementation > ImplementationPtr
A shared pointer to an Implementation.
shared_ptr< const UnitTypeDef > ConstUnitTypeDefPtr
A shared pointer to a const UnitTypeDef.
static const string ADJUSTMENT_NODE_GROUP
static const string NODE_GRAPH_ATTRIBUTE
static const string CATEGORY
bool hasUnitType() const
Return true if the given element has a unittype string.
shared_ptr< const Unit > ConstUnitPtr
A shared pointer to a const Unit.
shared_ptr< UnitDef > UnitDefPtr
A shared pointer to a UnitDef.
static const string CATEGORY
static const string EXPORTABLE_ATTRIBUTE
static const string TRANSLATION_NODE_GROUP
vector< MemberPtr > getMembers() const
Return a vector of all Member elements in the TypeDef.
GLuint const GLchar * name
const string & getElements() const
Return the element's elements string.
bool hasNodeString() const
Return true if the given NodeDef has a node string.
static const string UNITTYPE_ATTRIBUTE
MX_CORE_API const string SHADER_SEMANTIC
static ValuePtr createValueFromStrings(const string &value, const string &type)
GT_API const UT_StringHolder version
ValuePtr getValue() const
static const string NODE_ATTRIBUTE
bool hasContext() const
Return true if the given TypeDef has a context string.
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
shared_ptr< const AttributeDef > AttributeDefDefPtr
A shared pointer to a const AttributeDef.
const string & getContext() const
Return the context string of the TypeDef.
static const string CATEGORY
void setElements(const string &elements)
Set the element's elements string.
bool hasNodeGraph() const
Return true if the given Implementation has a nodegraph string.
const string & getNodeString() const
Return the node string of the NodeDef.
static const string CONDITIONAL_NODE_GROUP
shared_ptr< Unit > UnitPtr
A shared pointer to a Unit.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
bool getExportable() const
static const string NODE_GRAPH_ATTRIBUTE
bool hasAttrName() const
Return true if this element has an attrname string.
shared_ptr< const TargetDef > ConstTargetDefPtr
A shared pointer to a const TargetDef.
bool hasSemantic() const
Return true if the given TypeDef has a semantic string.
virtual ~Implementation()
const string & getFile() const
Return the file string for the Implementation.
virtual ConstInterfaceElementPtr getDeclaration(const string &target=EMPTY_STRING) const
const string & getUnitType() const
Return the element's type string.
static const string ORGANIZATION_NODE_GROUP
static const string ATTRNAME_ATTRIBUTE
const string & getSemantic() const
Return the semantic string of the TypeDef.
bool hasValue() const
Return true if the element possesses a typed value.
Unit(ElementPtr parent, const string &name)
static const string CATEGORY
Member(ElementPtr parent, const string &name)
UnitTypeDef(ElementPtr parent, const string &name)
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
const string & getNodeGroup() const
Return the node group of the NodeDef.
#define MATERIALX_NAMESPACE_END
TypeDef(ElementPtr parent, const string &name)
shared_ptr< const NodeDef > ConstNodeDefPtr
A shared pointer to a const NodeDef.
void setAttrName(const string &name)
Set the element's attrname string.
Implementation(ElementPtr parent, const string &name)
void setExportable(bool value)
Set the exportable boolean for the element.
static const string CATEGORY
bool hasElements() const
Return true if the element has an elements string.
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
void setFile(const string &file)
Set the file string for the Implementation.
static const string ELEMENTS_ATTRIBUTE
void removeUnit(const string &name)
Remove the Unit, if any, with the given name.
UnitPtr addUnit(const string &name)
static const string CATEGORY
MX_CORE_API string toValueString(const T &data)
Convert the given data value to a value string.
const string & getValueString() const
Get the value string of a element.
static const string CATEGORY
UnitPtr getUnit(const string &name) const
Return the Unit, if any, with the given name.
static const string TEXTURE_NODE_GROUP
shared_ptr< NodeDef > NodeDefPtr
A shared pointer to a NodeDef.