6 #ifndef MATERIALX_GEOM_H
7 #define MATERIALX_GEOM_H
30 class CollectionRemove;
71 return _vec == rhs._vec &&
76 return !(*
this == rhs);
102 if (_empty || rhs._empty)
106 if (
contains && _vec.size() > rhs._vec.size())
110 size_t minSize =
std::min(_vec.size(), rhs._vec.size());
111 for (
size_t i = 0; i < minSize; i++)
113 if (_vec[i] != rhs._vec[i])
132 return _vec.empty() && !_empty;
147 Element(parent, category, name)
248 return addChild<GeomProp>(
name);
254 return getChildOfType<GeomProp>(
name);
260 return getChildrenOfType<GeomProp>();
266 removeChildOfType<GeomProp>(
name);
280 return addChild<Token>(
name);
286 return getChildOfType<Token>(
name);
292 return getChildrenOfType<Token>();
298 removeChildOfType<Token>(
name);
317 token = addToken(name);
318 token->setValue<
string>(
value);
440 Element(parent, CATEGORY, name)
470 return hasIncludeGeom() ?
501 return hasExcludeGeom() ?
533 void setIncludeCollections(
const vector<ConstCollectionPtr>& collections);
537 vector<CollectionPtr> getIncludeCollections()
const;
540 bool hasIncludeCycle()
const;
549 bool matchesGeomString(
const string& geom)
const;
575 geomProp->setValue(value, type);
bool operator!=(const GeomPath &rhs) const
bool hasIncludeCollectionString() const
Return true if this element has an include collection string.
bool hasIncludeGeom() const
Return true if this element has an include geometry string.
GLuint GLsizei const GLchar * message
const string & getIncludeGeom() const
Return the include geometry string of this element.
static const string GEOM_PROP_ATTRIBUTE
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
void removeToken(const string &name)
Remove the Token, if any, with the given name.
static const string INCLUDE_COLLECTION_ATTRIBUTE
vector< GeomPropPtr > getGeomProps() const
Return a vector of all GeomProp elements.
static const string CATEGORY
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string GEOM_PATH_SEPARATOR
#define MATERIALX_NAMESPACE_BEGIN
vector< string > StringVec
A vector of strings.
TokenPtr getToken(const string &name) const
Return the Token, if any, with the given name.
bool isMatching(const GeomPath &rhs, bool contains=false) const
const string & getGeom() const
Return the geometry string of this element.
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
void setCollectionString(const string &collection)
Set the collection string of this element.
const string & getAttribute(const string &attrib) const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool hasGeom() const
Return true if this element has a geometry string.
const string & getGeomProp() const
Return the geometric property string of this element.
shared_ptr< Token > TokenPtr
A shared pointer to a Token.
shared_ptr< const GeomProp > ConstGeomPropPtr
A shared pointer to a const GeomProp.
shared_ptr< const GeomPropDef > ConstGeomPropDefPtr
A shared pointer to a const GeomPropDef.
StringResolverPtr createStringResolver(const string &geom=EMPTY_STRING) const
shared_ptr< GeomInfo > GeomInfoPtr
A shared pointer to a GeomInfo.
TokenPtr addToken(const string &name=EMPTY_STRING)
GeomPropPtr addGeomProp(const string &name=EMPTY_STRING)
shared_ptr< const GeomInfo > ConstGeomInfoPtr
A shared pointer to a const GeomInfo.
MX_CORE_API const string UV_TILE_TOKEN
void removeGeomProp(const string &name)
Remove the GeomProp, if any, with the given name.
GeomPropPtr getGeomProp(const string &name) const
Return the GeomProp, if any, with the given name.
bool hasExcludeGeom() const
Return true if this element has an exclude geometry string.
TokenPtr setTokenValue(const string &name, const string &value)
GeomInfo(ElementPtr parent, const string &name)
bool hasGeomProp() const
Return true if this element has a geometric property string.
virtual bool validate(string *message=nullptr) const
const string & getIncludeCollectionString() const
Return the include collection string of this element.
static const string CATEGORY
string getActiveGeom() const
GeomElement(ElementPtr parent, const string &category, const string &name)
string getActiveIncludeGeom() const
MX_CORE_API const string GEOMNAME_TYPE_STRING
static const string INCLUDE_GEOM_ATTRIBUTE
MX_CORE_API const string UNIVERSAL_GEOM_NAME
static const string CATEGORY
const string & getSpace() const
Return the geometric space string of this element.
void setIncludeCollectionString(const string &collection)
Set the include collection string of this element.
shared_ptr< GeomPropDef > GeomPropDefPtr
A shared pointer to a GeomPropDef.
void setSpace(const string &space)
Set the geometric space string of this element.
void setIncludeGeom(const string &geom)
Set the include geometry string of this element.
GLuint const GLchar * name
bool operator==(const GeomPath &rhs) const
Collection(ElementPtr parent, const string &name)
GeomPath(const string &geom)
Construct a path from a geometry name string.
void setGeomProp(const string &node)
Set the geometric property string of this element.
SYS_FORCE_INLINE UT_StringHolder getToken(Add enum_value)
GeomProp(ElementPtr parent, const string &name)
GeomPropPtr setGeomPropValue(const string &name, const T &value, const string &type=EMPTY_STRING)
static const string EXCLUDE_GEOM_ATTRIBUTE
string getActiveExcludeGeom() const
vector< TokenPtr > getTokens() const
Return a vector of all Token elements.
GeomPropDef(ElementPtr parent, const string &name)
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
const string & getIndex() const
Return the index string of this element.
void setExcludeGeom(const string &geom)
Set the exclude geometry string of this element.
shared_ptr< GeomProp > GeomPropPtr
A shared pointer to a GeomProp.
shared_ptr< const GeomElement > ConstGeomElementPtr
A shared pointer to a const GeomElement.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
static const string COLLECTION_ATTRIBUTE
static const string CATEGORY
const string & getExcludeGeom() const
Return the exclude geometry string of this element.
const string & getCollectionString() const
Return the collection string of this element.
MX_CORE_API string joinStrings(const StringVec &strVec, const string &sep)
void setGeom(const string &geom)
Set the geometry string of this element.
shared_ptr< GeomElement > GeomElementPtr
A shared pointer to a GeomElement.
void setIndex(const string &space)
Set the index string of this element.
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
static const string INDEX_ATTRIBUTE
shared_ptr< const Collection > ConstCollectionPtr
A shared pointer to a const Collection.
#define MATERIALX_NAMESPACE_END
bool hasCollectionString() const
Return true if this element has a collection string.
MX_CORE_API bool geomStringsMatch(const string &geom1, const string &geom2, bool contains=false)
bool hasSpace() const
Return true if this element has a geometric space string.
MX_CORE_API const string UDIM_TOKEN
static const string SPACE_ATTRIBUTE
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
bool hasIndex() const
Return true if this element has an index string.
MX_CORE_API const string UDIM_SET_PROPERTY
static const string GEOM_ATTRIBUTE
MX_CORE_API StringVec splitString(const string &str, const string &sep)