6#ifndef MATERIALX_PROPERTY_H
7#define MATERIALX_PROPERTY_H
16MATERIALX_NAMESPACE_BEGIN
45class MX_CORE_API Property :
public ValueElement
48 Property(
ElementPtr parent,
const string& name) :
49 ValueElement(parent, CATEGORY, name)
52 virtual ~Property() { }
55 static const string CATEGORY;
60class MX_CORE_API PropertyAssign :
public ValueElement
63 PropertyAssign(
ElementPtr parent,
const string& name) :
64 ValueElement(parent, CATEGORY, name)
67 virtual ~PropertyAssign() { }
143 static const string CATEGORY;
144 static const string PROPERTY_ATTRIBUTE;
145 static const string GEOM_ATTRIBUTE;
146 static const string COLLECTION_ATTRIBUTE;
151class MX_CORE_API PropertySet :
public Element
154 PropertySet(
ElementPtr parent,
const string& name) :
155 Element(parent, CATEGORY, name)
158 virtual ~PropertySet() { }
199 const string& type = EMPTY_STRING)
204 property->setValue(value, type);
215 return property ?
property->getValue() :
ValuePtr();
221 static const string CATEGORY;
226class MX_CORE_API PropertySetAssign :
public GeomElement
229 PropertySetAssign(
ElementPtr parent,
const string& name) :
230 GeomElement(parent, CATEGORY, name)
233 virtual ~PropertySetAssign() { }
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:30
const string & getAttribute(const string &attrib) const
Return the value string of the given attribute.
Definition Element.h:489
shared_ptr< T > addChild(const string &name=EMPTY_STRING)
Add a child element of the given subclass and name.
Definition Element.h:1399
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
shared_ptr< T > getChildOfType(const string &name) const
Return the child element, if any, with the given name and subclass.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
Definition Element.h:482
void removeChildOfType(const string &name)
Remove the child element, if any, with the given name and subclass.
Definition Element.h:468
vector< shared_ptr< T > > getChildrenOfType(const string &category=EMPTY_STRING) const
Return a vector of all child elements that are instances of the given subclass, optionally filtered b...
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