HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geom.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_GEOM_H
7 #define MATERIALX_GEOM_H
8 
9 /// @file
10 /// Geometric element subclasses
11 
12 #include <MaterialXCore/Export.h>
13 
14 #include <MaterialXCore/Element.h>
15 
17 
18 extern MX_CORE_API const string GEOM_PATH_SEPARATOR;
19 extern MX_CORE_API const string UNIVERSAL_GEOM_NAME;
20 extern MX_CORE_API const string UDIM_TOKEN;
21 extern MX_CORE_API const string UV_TILE_TOKEN;
22 extern MX_CORE_API const string UDIM_SET_PROPERTY;
23 
24 class GeomElement;
25 class GeomInfo;
26 class GeomProp;
27 class GeomPropDef;
28 class Collection;
29 class CollectionAdd;
30 class CollectionRemove;
31 
32 /// A shared pointer to a GeomElement
33 using GeomElementPtr = shared_ptr<GeomElement>;
34 /// A shared pointer to a const GeomElement
35 using ConstGeomElementPtr = shared_ptr<const GeomElement>;
36 
37 /// A shared pointer to a GeomInfo
38 using GeomInfoPtr = shared_ptr<GeomInfo>;
39 /// A shared pointer to a const GeomInfo
40 using ConstGeomInfoPtr = shared_ptr<const GeomInfo>;
41 
42 /// A shared pointer to a GeomProp
43 using GeomPropPtr = shared_ptr<GeomProp>;
44 /// A shared pointer to a const GeomProp
45 using ConstGeomPropPtr = shared_ptr<const GeomProp>;
46 
47 /// A shared pointer to a GeomPropDef
48 using GeomPropDefPtr = shared_ptr<GeomPropDef>;
49 /// A shared pointer to a const GeomPropDef
50 using ConstGeomPropDefPtr = shared_ptr<const GeomPropDef>;
51 
52 /// A shared pointer to a Collection
53 using CollectionPtr = shared_ptr<Collection>;
54 /// A shared pointer to a const Collection
55 using ConstCollectionPtr = shared_ptr<const Collection>;
56 
57 /// @class GeomPath
58 /// A MaterialX geometry path, representing the hierarchical location
59 /// expressed by a geometry name.
61 {
62  public:
64  _empty(true)
65  {
66  }
67  ~GeomPath() { }
68 
69  bool operator==(const GeomPath& rhs) const
70  {
71  return _vec == rhs._vec &&
72  _empty == rhs._empty;
73  }
74  bool operator!=(const GeomPath& rhs) const
75  {
76  return !(*this == rhs);
77  }
78 
79  /// Construct a path from a geometry name string.
80  explicit GeomPath(const string& geom) :
81  _vec(splitString(geom, GEOM_PATH_SEPARATOR)),
82  _empty(geom.empty())
83  {
84  }
85 
86  /// Convert a path to a geometry name string.
87  operator string() const
88  {
89  if (_vec.empty())
90  {
91  return _empty ? EMPTY_STRING : UNIVERSAL_GEOM_NAME;
92  }
94  }
95 
96  /// Return true if there is any geometry in common between the two paths.
97  /// @param rhs A second geometry path to be compared with this one
98  /// @param contains If true, then we require that the first path completely
99  /// contains the second one.
100  bool isMatching(const GeomPath& rhs, bool contains = false) const
101  {
102  if (_empty || rhs._empty)
103  {
104  return false;
105  }
106  if (contains && _vec.size() > rhs._vec.size())
107  {
108  return false;
109  }
110  size_t minSize = std::min(_vec.size(), rhs._vec.size());
111  for (size_t i = 0; i < minSize; i++)
112  {
113  if (_vec[i] != rhs._vec[i])
114  {
115  return false;
116  }
117  }
118  return true;
119  }
120 
121  /// Return true if this geometry path is empty. An empty path matches
122  /// no other geometry paths.
123  bool isEmpty() const
124  {
125  return _empty;
126  }
127 
128  /// Return true if this geometry path is universal. A universal path
129  /// matches all non-empty geometry paths.
130  bool isUniversal() const
131  {
132  return _vec.empty() && !_empty;
133  }
134 
135  private:
136  StringVec _vec;
137  bool _empty;
138 };
139 
140 /// @class GeomElement
141 /// The base class for geometric elements, which support bindings to geometries
142 /// and geometric collections.
144 {
145  protected:
146  GeomElement(ElementPtr parent, const string& category, const string& name) :
147  Element(parent, category, name)
148  {
149  }
150 
151  public:
152  virtual ~GeomElement() { }
153 
154  /// @name Geometry
155  /// @{
156 
157  /// Set the geometry string of this element.
158  void setGeom(const string& geom)
159  {
160  setAttribute(GEOM_ATTRIBUTE, geom);
161  }
162 
163  /// Return true if this element has a geometry string.
164  bool hasGeom() const
165  {
166  return hasAttribute(GEOM_ATTRIBUTE);
167  }
168 
169  /// Return the geometry string of this element.
170  const string& getGeom() const
171  {
172  return getAttribute(GEOM_ATTRIBUTE);
173  }
174 
175  /// Return the active geometry string of this element, taking all geometry
176  /// string substitutions at this scope into account.
177  string getActiveGeom() const
178  {
179  return hasGeom() ?
180  createStringResolver()->resolve(getGeom(), GEOMNAME_TYPE_STRING) :
181  EMPTY_STRING;
182  }
183 
184  /// @}
185  /// @name Collection
186  /// @{
187 
188  /// Set the collection string of this element.
189  void setCollectionString(const string& collection)
190  {
191  setAttribute(COLLECTION_ATTRIBUTE, collection);
192  }
193 
194  /// Return true if this element has a collection string.
195  bool hasCollectionString() const
196  {
197  return hasAttribute(COLLECTION_ATTRIBUTE);
198  }
199 
200  /// Return the collection string of this element.
201  const string& getCollectionString() const
202  {
203  return getAttribute(COLLECTION_ATTRIBUTE);
204  }
205 
206  /// Assign a Collection to this element.
207  void setCollection(ConstCollectionPtr collection);
208 
209  /// Return the Collection that is assigned to this element.
210  CollectionPtr getCollection() const;
211 
212  /// @}
213  /// @name Validation
214  /// @{
215 
216  /// Validate that the given element tree, including all descendants, is
217  /// consistent with the MaterialX specification.
218  bool validate(string* message = nullptr) const override;
219 
220  /// @}
221 
222  public:
223  static const string GEOM_ATTRIBUTE;
224  static const string COLLECTION_ATTRIBUTE;
225 };
226 
227 /// @class GeomInfo
228 /// A geometry info element within a Document.
230 {
231  public:
232  GeomInfo(ElementPtr parent, const string& name) :
233  GeomElement(parent, CATEGORY, name)
234  {
235  }
236  virtual ~GeomInfo() { }
237 
238  /// @name GeomProp Elements
239  /// @{
240 
241  /// Add a GeomProp to this element.
242  /// @param name The name of the new GeomProp.
243  /// If no name is specified, then a unique name will automatically be
244  /// generated.
245  /// @return A shared pointer to the new GeomProp.
247  {
248  return addChild<GeomProp>(name);
249  }
250 
251  /// Return the GeomProp, if any, with the given name.
252  GeomPropPtr getGeomProp(const string& name) const
253  {
254  return getChildOfType<GeomProp>(name);
255  }
256 
257  /// Return a vector of all GeomProp elements.
258  vector<GeomPropPtr> getGeomProps() const
259  {
260  return getChildrenOfType<GeomProp>();
261  }
262 
263  /// Remove the GeomProp, if any, with the given name.
264  void removeGeomProp(const string& name)
265  {
266  removeChildOfType<GeomProp>(name);
267  }
268 
269  /// @}
270  /// @name Tokens
271  /// @{
272 
273  /// Add a Token to this element.
274  /// @param name The name of the new Token.
275  /// If no name is specified, then a unique name will automatically be
276  /// generated.
277  /// @return A shared pointer to the new Token.
279  {
280  return addChild<Token>(name);
281  }
282 
283  /// Return the Token, if any, with the given name.
284  TokenPtr getToken(const string& name) const
285  {
286  return getChildOfType<Token>(name);
287  }
288 
289  /// Return a vector of all Token elements.
290  vector<TokenPtr> getTokens() const
291  {
292  return getChildrenOfType<Token>();
293  }
294 
295  /// Remove the Token, if any, with the given name.
296  void removeToken(const string& name)
297  {
298  removeChildOfType<Token>(name);
299  }
300 
301  /// @}
302  /// @name Values
303  /// @{
304 
305  /// Set the value of a GeomProp by its name, creating a child element
306  /// to hold the GeomProp if needed.
307  template <class T> GeomPropPtr setGeomPropValue(const string& name,
308  const T& value,
309  const string& type = EMPTY_STRING);
310 
311  /// Set the string value of a Token by its name, creating a child element
312  /// to hold the Token if needed.
313  TokenPtr setTokenValue(const string& name, const string& value)
314  {
315  TokenPtr token = getToken(name);
316  if (!token)
317  token = addToken(name);
318  token->setValue<string>(value);
319  return token;
320  }
321 
322  /// @}
323 
324  public:
325  static const string CATEGORY;
326 };
327 
328 /// @class GeomProp
329 /// A geometric property element within a GeomInfo.
331 {
332  public:
333  GeomProp(ElementPtr parent, const string& name) :
334  ValueElement(parent, CATEGORY, name)
335  {
336  }
337  virtual ~GeomProp() { }
338 
339  public:
340  static const string CATEGORY;
341 };
342 
343 /// @class GeomPropDef
344 /// An element representing a declaration of geometric property data.
345 ///
346 /// A GeomPropDef element contains a reference to a geometric node and a set of
347 /// modifiers for that node. For example, a world-space normal can be declared
348 /// as a reference to the "normal" geometric node with a space setting of
349 /// "world", or a specific set of texture coordinates can be declared as a
350 /// reference to the "texcoord" geometric node with an index setting of "1".
352 {
353  public:
354  GeomPropDef(ElementPtr parent, const string& name) :
355  TypedElement(parent, CATEGORY, name)
356  {
357  }
358  virtual ~GeomPropDef() { }
359 
360  /// @name Geometric Property
361  /// @{
362 
363  /// Set the geometric property string of this element.
364  void setGeomProp(const string& node)
365  {
366  setAttribute(GEOM_PROP_ATTRIBUTE, node);
367  }
368 
369  /// Return true if this element has a geometric property string.
370  bool hasGeomProp() const
371  {
372  return hasAttribute(GEOM_PROP_ATTRIBUTE);
373  }
374 
375  /// Return the geometric property string of this element.
376  const string& getGeomProp() const
377  {
378  return getAttribute(GEOM_PROP_ATTRIBUTE);
379  }
380 
381  /// @}
382  /// @name Geometric Space
383  /// @{
384 
385  /// Set the geometric space string of this element.
386  void setSpace(const string& space)
387  {
388  setAttribute(SPACE_ATTRIBUTE, space);
389  }
390 
391  /// Return true if this element has a geometric space string.
392  bool hasSpace() const
393  {
394  return hasAttribute(SPACE_ATTRIBUTE);
395  }
396 
397  /// Return the geometric space string of this element.
398  const string& getSpace() const
399  {
400  return getAttribute(SPACE_ATTRIBUTE);
401  }
402 
403  /// @}
404  /// @name Geometric Index
405  /// @{
406 
407  /// Set the index string of this element.
408  void setIndex(const string& space)
409  {
410  setAttribute(INDEX_ATTRIBUTE, space);
411  }
412 
413  /// Return true if this element has an index string.
414  bool hasIndex() const
415  {
416  return hasAttribute(INDEX_ATTRIBUTE);
417  }
418 
419  /// Return the index string of this element.
420  const string& getIndex() const
421  {
422  return getAttribute(INDEX_ATTRIBUTE);
423  }
424 
425  /// @}
426 
427  public:
428  static const string CATEGORY;
429  static const string GEOM_PROP_ATTRIBUTE;
430  static const string SPACE_ATTRIBUTE;
431  static const string INDEX_ATTRIBUTE;
432 };
433 
434 /// @class Collection
435 /// A collection element within a Document.
437 {
438  public:
439  Collection(ElementPtr parent, const string& name) :
440  Element(parent, CATEGORY, name)
441  {
442  }
443  virtual ~Collection() { }
444 
445  /// @name Include Geometry
446  /// @{
447 
448  /// Set the include geometry string of this element.
449  void setIncludeGeom(const string& geom)
450  {
451  setAttribute(INCLUDE_GEOM_ATTRIBUTE, geom);
452  }
453 
454  /// Return true if this element has an include geometry string.
455  bool hasIncludeGeom() const
456  {
457  return hasAttribute(INCLUDE_GEOM_ATTRIBUTE);
458  }
459 
460  /// Return the include geometry string of this element.
461  const string& getIncludeGeom() const
462  {
463  return getAttribute(INCLUDE_GEOM_ATTRIBUTE);
464  }
465 
466  /// Return the active include geometry string of this element, taking all
467  /// geometry string substitutions at this scope into account.
468  string getActiveIncludeGeom() const
469  {
470  return hasIncludeGeom() ?
471  createStringResolver()->resolve(getIncludeGeom(), GEOMNAME_TYPE_STRING) :
472  EMPTY_STRING;
473  }
474 
475  /// @}
476  /// @name Exclude Geometry
477  /// @{
478 
479  /// Set the exclude geometry string of this element.
480  void setExcludeGeom(const string& geom)
481  {
482  setAttribute(EXCLUDE_GEOM_ATTRIBUTE, geom);
483  }
484 
485  /// Return true if this element has an exclude geometry string.
486  bool hasExcludeGeom() const
487  {
488  return hasAttribute(EXCLUDE_GEOM_ATTRIBUTE);
489  }
490 
491  /// Return the exclude geometry string of this element.
492  const string& getExcludeGeom() const
493  {
494  return getAttribute(EXCLUDE_GEOM_ATTRIBUTE);
495  }
496 
497  /// Return the active exclude geometry string of this element, taking all
498  /// geometry string substitutions at this scope into account.
499  string getActiveExcludeGeom() const
500  {
501  return hasExcludeGeom() ?
502  createStringResolver()->resolve(getExcludeGeom(), GEOMNAME_TYPE_STRING) :
503  EMPTY_STRING;
504  }
505 
506  /// @}
507  /// @name Include Collection
508  /// @{
509 
510  /// Set the include collection string of this element.
511  void setIncludeCollectionString(const string& collection)
512  {
513  setAttribute(INCLUDE_COLLECTION_ATTRIBUTE, collection);
514  }
515 
516  /// Return true if this element has an include collection string.
518  {
519  return hasAttribute(INCLUDE_COLLECTION_ATTRIBUTE);
520  }
521 
522  /// Return the include collection string of this element.
523  const string& getIncludeCollectionString() const
524  {
525  return getAttribute(INCLUDE_COLLECTION_ATTRIBUTE);
526  }
527 
528  /// Set the collection that is directly included by this element.
529  void setIncludeCollection(ConstCollectionPtr collection);
530 
531  /// Set the vector of collections that are directly included by
532  /// this element.
533  void setIncludeCollections(const vector<ConstCollectionPtr>& collections);
534 
535  /// Return the vector of collections that are directly included by
536  /// this element.
537  vector<CollectionPtr> getIncludeCollections() const;
538 
539  /// Return true if the include chain for this element contains a cycle.
540  bool hasIncludeCycle() const;
541 
542  /// @}
543  /// @name Geometry Matching
544  /// @{
545 
546  /// Return true if this collection and the given geometry string have any
547  /// geometries in common.
548  /// @throws ExceptionFoundCycle if a cycle is encountered.
549  bool matchesGeomString(const string& geom) const;
550 
551  /// @}
552  /// @name Validation
553  /// @{
554 
555  /// Validate that the given element tree, including all descendants, is
556  /// consistent with the MaterialX specification.
557  bool validate(string* message = nullptr) const override;
558 
559  /// @}
560 
561  public:
562  static const string CATEGORY;
563  static const string INCLUDE_GEOM_ATTRIBUTE;
564  static const string EXCLUDE_GEOM_ATTRIBUTE;
565  static const string INCLUDE_COLLECTION_ATTRIBUTE;
566 };
567 
568 template <class T> GeomPropPtr GeomInfo::setGeomPropValue(const string& name,
569  const T& value,
570  const string& type)
571 {
572  GeomPropPtr geomProp = getChildOfType<GeomProp>(name);
573  if (!geomProp)
574  geomProp = addGeomProp(name);
575  geomProp->setValue(value, type);
576  return geomProp;
577 }
578 
579 /// Given two geometry strings, each containing an array of geom names, return
580 /// true if they have any geometries in common.
581 ///
582 /// An empty geometry string matches no geometries, while the universal geometry
583 /// string "/" matches all non-empty geometries.
584 ///
585 /// If the contains argument is set to true, then we require that a geom path
586 /// in the first string completely contains a geom path in the second string.
587 ///
588 /// @todo Geometry name expressions are not yet supported.
589 MX_CORE_API bool geomStringsMatch(const string& geom1, const string& geom2, bool contains = false);
590 
592 
593 #endif
bool operator!=(const GeomPath &rhs) const
Definition: Geom.h:74
bool hasIncludeCollectionString() const
Return true if this element has an include collection string.
Definition: Geom.h:517
bool hasIncludeGeom() const
Return true if this element has an include geometry string.
Definition: Geom.h:455
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
const string & getIncludeGeom() const
Return the include geometry string of this element.
Definition: Geom.h:461
~GeomPath()
Definition: Geom.h:67
static const string GEOM_PROP_ATTRIBUTE
Definition: Geom.h:429
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
Definition: Geom.h:53
void removeToken(const string &name)
Remove the Token, if any, with the given name.
Definition: Geom.h:296
static const string INCLUDE_COLLECTION_ATTRIBUTE
Definition: Geom.h:565
vector< GeomPropPtr > getGeomProps() const
Return a vector of all GeomProp elements.
Definition: Geom.h:258
static const string CATEGORY
Definition: Geom.h:428
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string GEOM_PATH_SEPARATOR
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
vector< string > StringVec
A vector of strings.
Definition: Library.h:57
TokenPtr getToken(const string &name) const
Return the Token, if any, with the given name.
Definition: Geom.h:284
bool isMatching(const GeomPath &rhs, bool contains=false) const
Definition: Geom.h:100
const string & getGeom() const
Return the geometry string of this element.
Definition: Geom.h:170
Definition: Geom.h:60
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLsizei const GLfloat * value
Definition: glcorearb.h:824
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
void setCollectionString(const string &collection)
Set the collection string of this element.
Definition: Geom.h:189
const string & getAttribute(const string &attrib) const
Definition: Element.h:504
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.
Definition: Geom.h:164
const string & getGeomProp() const
Return the geometric property string of this element.
Definition: Geom.h:376
shared_ptr< Token > TokenPtr
A shared pointer to a Token.
Definition: Element.h:46
shared_ptr< const GeomProp > ConstGeomPropPtr
A shared pointer to a const GeomProp.
Definition: Geom.h:45
shared_ptr< const GeomPropDef > ConstGeomPropDefPtr
A shared pointer to a const GeomPropDef.
Definition: Geom.h:50
StringResolverPtr createStringResolver(const string &geom=EMPTY_STRING) const
shared_ptr< GeomInfo > GeomInfoPtr
A shared pointer to a GeomInfo.
Definition: Geom.h:38
#define MX_CORE_API
Definition: Export.h:18
TokenPtr addToken(const string &name=EMPTY_STRING)
Definition: Geom.h:278
GeomPropPtr addGeomProp(const string &name=EMPTY_STRING)
Definition: Geom.h:246
shared_ptr< const GeomInfo > ConstGeomInfoPtr
A shared pointer to a const GeomInfo.
Definition: Geom.h:40
MX_CORE_API const string UV_TILE_TOKEN
void removeGeomProp(const string &name)
Remove the GeomProp, if any, with the given name.
Definition: Geom.h:264
GeomPropPtr getGeomProp(const string &name) const
Return the GeomProp, if any, with the given name.
Definition: Geom.h:252
bool hasExcludeGeom() const
Return true if this element has an exclude geometry string.
Definition: Geom.h:486
GeomPath()
Definition: Geom.h:63
TokenPtr setTokenValue(const string &name, const string &value)
Definition: Geom.h:313
GeomInfo(ElementPtr parent, const string &name)
Definition: Geom.h:232
bool hasGeomProp() const
Return true if this element has a geometric property string.
Definition: Geom.h:370
virtual bool validate(string *message=nullptr) const
const string & getIncludeCollectionString() const
Return the include collection string of this element.
Definition: Geom.h:523
static const string CATEGORY
Definition: Geom.h:325
string getActiveGeom() const
Definition: Geom.h:177
GeomElement(ElementPtr parent, const string &category, const string &name)
Definition: Geom.h:146
string getActiveIncludeGeom() const
Definition: Geom.h:468
MX_CORE_API const string GEOMNAME_TYPE_STRING
static const string INCLUDE_GEOM_ATTRIBUTE
Definition: Geom.h:563
virtual ~Collection()
Definition: Geom.h:443
virtual ~GeomElement()
Definition: Geom.h:152
Definition: Geom.h:229
MX_CORE_API const string UNIVERSAL_GEOM_NAME
static const string CATEGORY
Definition: Geom.h:340
const string & getSpace() const
Return the geometric space string of this element.
Definition: Geom.h:398
void setIncludeCollectionString(const string &collection)
Set the include collection string of this element.
Definition: Geom.h:511
shared_ptr< GeomPropDef > GeomPropDefPtr
A shared pointer to a GeomPropDef.
Definition: Geom.h:48
void setSpace(const string &space)
Set the geometric space string of this element.
Definition: Geom.h:386
void setIncludeGeom(const string &geom)
Set the include geometry string of this element.
Definition: Geom.h:449
GLuint const GLchar * name
Definition: glcorearb.h:786
bool operator==(const GeomPath &rhs) const
Definition: Geom.h:69
Collection(ElementPtr parent, const string &name)
Definition: Geom.h:439
GeomPath(const string &geom)
Construct a path from a geometry name string.
Definition: Geom.h:80
void setGeomProp(const string &node)
Set the geometric property string of this element.
Definition: Geom.h:364
SYS_FORCE_INLINE UT_StringHolder getToken(Add enum_value)
Definition: SOP_Add.proto.h:35
GeomProp(ElementPtr parent, const string &name)
Definition: Geom.h:333
virtual ~GeomInfo()
Definition: Geom.h:236
GeomPropPtr setGeomPropValue(const string &name, const T &value, const string &type=EMPTY_STRING)
Definition: Geom.h:568
static const string EXCLUDE_GEOM_ATTRIBUTE
Definition: Geom.h:564
bool isEmpty() const
Definition: Geom.h:123
string getActiveExcludeGeom() const
Definition: Geom.h:499
vector< TokenPtr > getTokens() const
Return a vector of all Token elements.
Definition: Geom.h:290
virtual ~GeomPropDef()
Definition: Geom.h:358
GeomPropDef(ElementPtr parent, const string &name)
Definition: Geom.h:354
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.
Definition: Geom.h:420
void setExcludeGeom(const string &geom)
Set the exclude geometry string of this element.
Definition: Geom.h:480
shared_ptr< GeomProp > GeomPropPtr
A shared pointer to a GeomProp.
Definition: Geom.h:43
bool isUniversal() const
Definition: Geom.h:130
shared_ptr< const GeomElement > ConstGeomElementPtr
A shared pointer to a const GeomElement.
Definition: Geom.h:35
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
Definition: Element.h:497
static const string COLLECTION_ATTRIBUTE
Definition: Geom.h:224
static const string CATEGORY
Definition: Geom.h:562
const string & getExcludeGeom() const
Return the exclude geometry string of this element.
Definition: Geom.h:492
const string & getCollectionString() const
Return the collection string of this element.
Definition: Geom.h:201
MX_CORE_API string joinStrings(const StringVec &strVec, const string &sep)
void setGeom(const string &geom)
Set the geometry string of this element.
Definition: Geom.h:158
shared_ptr< GeomElement > GeomElementPtr
A shared pointer to a GeomElement.
Definition: Geom.h:33
void setIndex(const string &space)
Set the index string of this element.
Definition: Geom.h:408
Definition: core.h:1131
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
Definition: Element.h:31
static const string INDEX_ATTRIBUTE
Definition: Geom.h:431
shared_ptr< const Collection > ConstCollectionPtr
A shared pointer to a const Collection.
Definition: Geom.h:55
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
virtual ~GeomProp()
Definition: Geom.h:337
bool hasCollectionString() const
Return true if this element has a collection string.
Definition: Geom.h:195
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.
Definition: Geom.h:392
MX_CORE_API const string UDIM_TOKEN
static const string SPACE_ATTRIBUTE
Definition: Geom.h:430
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
type
Definition: core.h:1059
bool hasIndex() const
Return true if this element has an index string.
Definition: Geom.h:414
MX_CORE_API const string UDIM_SET_PROPERTY
static const string GEOM_ATTRIBUTE
Definition: Geom.h:223
MX_CORE_API StringVec splitString(const string &str, const string &sep)
Definition: Geom.h:330