6#ifndef MATERIALX_PROPERTY_H
7#define MATERIALX_PROPERTY_H
16MATERIALX_NAMESPACE_BEGIN
55 static const string CATEGORY;
143 static const string CATEGORY;
144 static const string PROPERTY_ATTRIBUTE;
145 static const string GEOM_ATTRIBUTE;
146 static const string COLLECTION_ATTRIBUTE;
155 Element(parent, CATEGORY, name)
170 return addChild<Property>(name);
176 return getChildOfType<Property>(name);
182 return getChildrenOfType<Property>();
188 removeChildOfType<Property>(name);
199 const string& type = EMPTY_STRING)
201 PropertyPtr property = getChildOfType<Property>(name);
203 property = addProperty(name);
204 property->setValue(value, type);
215 return property ?
property->getValue() :
ValuePtr();
221 static const string CATEGORY;
265 static const string CATEGORY;
266 static const string PROPERTY_SET_ATTRIBUTE;
269MATERIALX_NAMESPACE_END
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
Definition: Element.h:31
Geometric element subclasses.
shared_ptr< const Collection > ConstCollectionPtr
A shared pointer to a const Collection.
Definition: Geom.h:55
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
Definition: Geom.h:53
Import and export declarations for the Core library.
shared_ptr< const PropertySet > ConstPropertySetPtr
A shared pointer to a const PropertySet.
Definition: Property.h:36
shared_ptr< PropertySet > PropertySetPtr
A shared pointer to a PropertySet.
Definition: Property.h:34
shared_ptr< PropertySetAssign > PropertySetAssignPtr
A shared pointer to a PropertySetAssign.
Definition: Property.h:39
shared_ptr< PropertyAssign > PropertyAssignPtr
A shared pointer to a PropertyAssign.
Definition: Property.h:29
shared_ptr< Property > PropertyPtr
A shared pointer to a Property.
Definition: Property.h:24
shared_ptr< const PropertyAssign > ConstPropertyAssignPtr
A shared pointer to a const PropertyAssign.
Definition: Property.h:31
shared_ptr< const PropertySetAssign > ConstPropertySetAssignPtr
A shared pointer to a const PropertySetAssign.
Definition: Property.h:41
shared_ptr< const Property > ConstPropertyPtr
A shared pointer to a const Property.
Definition: Property.h:26
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition: Value.h:29
The base class for MaterialX elements.
Definition: Element.h:80
const string & getAttribute(const string &attrib) const
Return the value string of the given attribute.
Definition: Element.h:504
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
Definition: Element.h:497
The base class for geometric elements, which support bindings to geometries and geometric collections...
Definition: Geom.h:144
A property assignment element within a Look.
Definition: Property.h:61
const string & getGeom() const
Return the geometry string of this element.
Definition: Property.h:107
CollectionPtr getCollection() const
Return the Collection that is assigned to this element.
const string & getProperty() const
Return the property string of this element.
Definition: Property.h:85
bool hasProperty() const
Return true if this element has a property string.
Definition: Property.h:79
const string & getCollectionString() const
Return the collection string of this element.
Definition: Property.h:129
void setGeom(const string &geom)
Set the geometry string of this element.
Definition: Property.h:95
bool hasCollectionString() const
Return true if this element has a collection string.
Definition: Property.h:123
bool hasGeom() const
Return true if this element has a geometry string.
Definition: Property.h:101
void setCollection(ConstCollectionPtr collection)
Assign a Collection to this element.
void setCollectionString(const string &collection)
Set the collection string of this element.
Definition: Property.h:117
void setProperty(const string &property)
Set the property string of this element.
Definition: Property.h:73
A property element within a PropertySet.
Definition: Property.h:46
A property set assignment element within a Look.
Definition: Property.h:227
const string & getPropertySetString() const
Return the property set string of this element.
Definition: Property.h:251
PropertySetPtr getPropertySet() const
Return the property set that is assigned to this element.
void setPropertySetString(const string &propertySet)
Set the property set string of this element.
Definition: Property.h:239
void setPropertySet(ConstPropertySetPtr propertySet)
Assign a property set to this element.
bool hasPropertySetString() const
Return true if this element has a property set string.
Definition: Property.h:245
A property set element within a Document.
Definition: Property.h:152
PropertyPtr setPropertyValue(const string &name, const T &value, const string &type=EMPTY_STRING)
Set the typed value of a property by its name, creating a child element to hold the property if neede...
Definition: Property.h:197
void removeProperty(const string &name)
Remove the Property with the given name, if present.
Definition: Property.h:186
vector< PropertyPtr > getProperties() const
Return a vector of all Property elements in the set.
Definition: Property.h:180
ValuePtr getPropertyValue(const string &name) const
Return the typed value of a property by its name.
Definition: Property.h:212
PropertyPtr getProperty(const string &name) const
Return the Property, if any, with the given name.
Definition: Property.h:174
PropertyPtr addProperty(const string &name)
Add a Property to the set.
Definition: Property.h:168
The base class for elements that support typed values.
Definition: Element.h:918