6#ifndef MATERIALX_PROPERTY_H
7#define MATERIALX_PROPERTY_H
22class PropertySetAssign;
56 static const string CATEGORY;
76 setAttribute(PROPERTY_ATTRIBUTE, property);
82 return hasAttribute(PROPERTY_ATTRIBUTE);
88 return getAttribute(PROPERTY_ATTRIBUTE);
98 setAttribute(GEOM_ATTRIBUTE, geom);
104 return hasAttribute(GEOM_ATTRIBUTE);
110 return getAttribute(GEOM_ATTRIBUTE);
120 setAttribute(COLLECTION_ATTRIBUTE, collection);
126 return hasAttribute(COLLECTION_ATTRIBUTE);
132 return getAttribute(COLLECTION_ATTRIBUTE);
144 static const string CATEGORY;
145 static const string PROPERTY_ATTRIBUTE;
146 static const string GEOM_ATTRIBUTE;
147 static const string COLLECTION_ATTRIBUTE;
156 Element(parent, CATEGORY, name)
171 return addChild<Property>(name);
177 return getChildOfType<Property>(name);
183 return getChildrenOfType<Property>();
189 removeChildOfType<Property>(name);
200 const string& type = EMPTY_STRING)
202 PropertyPtr property = getChildOfType<Property>(name);
204 property = addProperty(name);
205 property->setValue(value, type);
216 return property ?
property->getValue() :
ValuePtr();
222 static const string CATEGORY;
242 setAttribute(PROPERTY_SET_ATTRIBUTE, propertySet);
248 return hasAttribute(PROPERTY_SET_ATTRIBUTE);
254 return getAttribute(PROPERTY_SET_ATTRIBUTE);
266 static const string CATEGORY;
267 static const string PROPERTY_SET_ATTRIBUTE;
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:56
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
Definition: Geom.h:54
Import and export declarations for the Core library.
shared_ptr< const PropertySet > ConstPropertySetPtr
A shared pointer to a const PropertySet.
Definition: Property.h:37
shared_ptr< PropertySet > PropertySetPtr
A shared pointer to a PropertySet.
Definition: Property.h:35
shared_ptr< PropertySetAssign > PropertySetAssignPtr
A shared pointer to a PropertySetAssign.
Definition: Property.h:40
shared_ptr< PropertyAssign > PropertyAssignPtr
A shared pointer to a PropertyAssign.
Definition: Property.h:30
shared_ptr< Property > PropertyPtr
A shared pointer to a Property.
Definition: Property.h:25
shared_ptr< const PropertyAssign > ConstPropertyAssignPtr
A shared pointer to a const PropertyAssign.
Definition: Property.h:32
shared_ptr< const PropertySetAssign > ConstPropertySetAssignPtr
A shared pointer to a const PropertySetAssign.
Definition: Property.h:42
shared_ptr< const Property > ConstPropertyPtr
A shared pointer to a const Property.
Definition: Property.h:27
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition: Value.h:30
The base class for MaterialX elements.
Definition: Element.h:75
The base class for geometric elements, which support bindings to geometries and geometric collections...
Definition: Geom.h:154
A property assignment element within a Look.
Definition: Property.h:62
const string & getGeom() const
Return the geometry string of this element.
Definition: Property.h:108
const string & getProperty() const
Return the property string of this element.
Definition: Property.h:86
bool hasProperty() const
Return true if this element has a property string.
Definition: Property.h:80
const string & getCollectionString() const
Return the collection string of this element.
Definition: Property.h:130
void setGeom(const string &geom)
Set the geometry string of this element.
Definition: Property.h:96
bool hasCollectionString() const
Return true if this element has a collection string.
Definition: Property.h:124
bool hasGeom() const
Return true if this element has a geometry string.
Definition: Property.h:102
void setCollectionString(const string &collection)
Set the collection string of this element.
Definition: Property.h:118
void setProperty(const string &property)
Set the property string of this element.
Definition: Property.h:74
A property element within a PropertySet.
Definition: Property.h:47
A property set assignment element within a Look.
Definition: Property.h:228
const string & getPropertySetString() const
Return the property set string of this element.
Definition: Property.h:252
void setPropertySetString(const string &propertySet)
Set the property set string of this element.
Definition: Property.h:240
bool hasPropertySetString() const
Return true if this element has a property set string.
Definition: Property.h:246
A property set element within a Document.
Definition: Property.h:153
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:198
void removeProperty(const string &name)
Remove the Property with the given name, if present.
Definition: Property.h:187
vector< PropertyPtr > getProperties() const
Return a vector of all Property elements in the set.
Definition: Property.h:181
ValuePtr getPropertyValue(const string &name) const
Return the typed value of a property by its name.
Definition: Property.h:213
PropertyPtr getProperty(const string &name) const
Return the Property, if any, with the given name.
Definition: Property.h:175
PropertyPtr addProperty(const string &name)
Add a Property to the set.
Definition: Property.h:169
The base class for elements that support typed values.
Definition: Element.h:899