HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AttributeSet.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_AttributeSet.h ( GA Library, C++)
7  *
8  * COMMENTS: A set of attributes.
9  */
10 
11 #pragma once
12 
13 #ifndef __GA_AttributeSet__
14 #define __GA_AttributeSet__
15 
16 #include "GA_API.h"
17 #include "GA_AttributeProxy.h"
18 #include "GA_AttributeDict.h"
19 #include "GA_Defaults.h"
20 #include "GA_ReuseStrategy.h"
21 #include "GA_Types.h"
22 
23 #include <SYS/SYS_Inline.h>
24 #include <SYS/SYS_Types.h>
25 
26 #include <iosfwd>
27 #include <stddef.h>
28 
29 
30 class GA_AIFFileH9;
31 class GA_ATINumeric;
32 class GA_ATITopology;
35 class GA_AttribXlateH9;
36 class GA_Attribute;
37 class GA_AttributeFilter;
38 class GA_AttributeType;
39 class GA_Defragment;
40 class GA_Detail;
41 class GA_ElementGroup;
42 class GA_IndexMap;
43 class GA_LoadMap;
44 class GA_MergeMap;
45 class GA_SaveMap;
46 class GA_Stat;
47 template <typename AIF_TYPE> class GA_AIFDefinition;
48 
49 class UT_IStream;
50 class UT_JSONParser;
51 class UT_JSONWriter;
52 class UT_MemoryCounter;
53 class UT_Options;
54 class UT_StringHolder;
55 class UT_StringRef;
56 class UT_WorkBuffer;
57 template <typename T> class UT_Array;
58 
59 
61 {
62 private:
63  /// Only GA_Detail can create attribute sets because the attributes
64  /// rely on the existense of the detail for index maps and otherwise it
65  /// may be too easy to create a attributes without a detail.
66  friend class GA_Detail;
67  /// Group table requires friendship to be able to reach the
68  /// GA_AttributeDict that it is tightly coupled to.
69  friend class GA_GroupTable;
70  GA_AttributeSet(GA_Detail &detail);
71 
72  GA_AttributeSet(const GA_AttributeSet &set) = delete;
73  GA_AttributeSet &operator=(const GA_AttributeSet &set) = delete;
74 
75 public:
76  ~GA_AttributeSet();
77 
79  {
80  // Used to certify that a name has already been
81  // screened for validity
82  public:
84  };
85 
87  {
88  // Used to certify that a name has already been
89  // screened for validity and collision.
90  public:
92  };
93 
94  // --- Attribute Management ----
95  /// Create a new named attribute for the @c owner with the given @scope
96  ///
97  /// The @c creation_options are used to pass intrinsic properties to the
98  /// attribute. The @c creation_options are not generally stored with the
99  /// attribute itself, but are used to determine the intrinsic behaviour of
100  /// the attribute (i.e. specifying storage types for numeric attributes).
101  ///
102  /// The @c attribute_options are stored on the attribute.
103  ///
104  /// The @c attribtype argument is used to look up the attribute type. Common
105  /// values include @c numeric, @c "string" and @c "indexpair"
106  GA_Attribute *createAttribute(GA_AttributeOwner owner,
107  GA_AttributeScope scope,
108  const UT_StringHolder &name,
109  const UT_Options *creation_args,
110  const GA_AttributeOptions *attribute_options,
111  const UT_StringRef &attribtype,
112  const GA_ReuseStrategy &r = GA_ReuseStrategy());
113  /// Create a detached attribute.
114  GA_Attribute *createDetachedAttribute(
115  GA_AttributeOwner owner,
116  const UT_StringRef &attribtype,
117  const UT_Options *creation_args,
118  const GA_AttributeOptions *attribute_options) const;
119  GA_Attribute *createDetachedAttribute(
120  GA_AttributeOwner owner,
121  const GA_AttributeType &attribtype,
122  const UT_Options *creation_args,
123  const GA_AttributeOptions *attribute_options) const;
124 
125  /// Convenience method to add a public attribute
128  const UT_StringHolder &name,
129  const UT_Options *creation_args,
130  const GA_AttributeOptions *attribute_options,
131  const UT_StringRef &attribtype,
133  {
134  return createAttribute(owner, GA_SCOPE_PUBLIC,
135  name, creation_args,
136  attribute_options, attribtype);
137  }
138 
139  /// Create an attribute that has the same definition as the source.
140  /// @note This will fail for group attributes!
141  /// @{
142  GA_Attribute *cloneAttribute(GA_AttributeOwner owner,
143  const UT_StringHolder &name, namevalidcertificate,
144  const GA_Attribute &src,
145  bool clone_options,
146  GA_DataIdStrategy data_id_strategy
147  = GA_DATA_ID_BUMP,
148  const GA_ReuseStrategy &reuse = GA_ReuseStrategy());
149  GA_Attribute *cloneAttribute(GA_AttributeOwner owner,
150  const UT_StringHolder &name,
151  const GA_Attribute &src,
152  bool clone_options,
153  GA_DataIdStrategy data_id_strategy
154  = GA_DATA_ID_BUMP,
155  const GA_ReuseStrategy &reuse = GA_ReuseStrategy());
156  /// @}
157 
158  /// Create a temporary attribute.
159  /// See @c createAttribute() for details on arguments
160  GA_Attribute *createTempAttribute(GA_AttributeOwner owner,
161  const UT_Options *creation_args,
162  const GA_AttributeOptions *attribute_options,
163  const UT_StringRef &attribtype);
164  GA_Attribute *cloneTempAttribute(GA_AttributeOwner owner,
165  const GA_Attribute &src,
166  bool clone_options);
167  const GA_Attribute *findAttribute(GA_AttributeScope scope,
168  const UT_StringRef &name,
169  const GA_AttributeOwner search_order[],
170  int search_order_size) const;
173  const UT_StringRef &name,
174  const GA_AttributeOwner search_order[],
175  int search_order_size)
176  {
177  return const_cast<GA_Attribute *>(
178  static_cast<const GA_AttributeSet *>
179  (this)->findAttribute(scope, name,
180  search_order,
181  search_order_size));
182  }
185  const GA_AttributeOwner search_order[],
186  int search_order_size) const
187  {
188  return findAttribute(GA_SCOPE_PUBLIC, name,
189  search_order,
190  search_order_size);
191  }
194  const GA_AttributeOwner search_order[],
195  int search_order_size)
196  {
197  return findAttribute(GA_SCOPE_PUBLIC, name,
198  search_order,
199  search_order_size);
200  }
203  GA_AttributeScope scope,
204  const UT_StringRef &name)
205  { return findAttribute(scope, name, &owner, 1); }
208  const UT_StringRef &name)
209  {
210  return findAttribute(GA_SCOPE_PUBLIC, name,
211  &owner, 1);
212  }
215  GA_AttributeScope scope,
216  const UT_StringRef &name) const
217  { return findAttribute(scope, name, &owner, 1); }
220  const UT_StringRef &name) const
221  {
222  return findAttribute(GA_SCOPE_PUBLIC, name,
223  &owner, 1);
224  }
225  void matchAttributes(const GA_AttributeFilter &filter,
226  const GA_AttributeOwner search_order[],
227  int search_order_size,
229  void matchAttributes(const GA_AttributeFilter &filter,
230  const GA_AttributeOwner search_order[],
231  int search_order_size,
232  UT_Array<const GA_Attribute *> &list) const;
234  GA_AttributeOwner owner,
236  { return matchAttributes(filter, &owner,1, list); }
238  GA_AttributeOwner owner,
239  UT_Array<const GA_Attribute *> &list) const
240  { return matchAttributes(filter, &owner,1, list); }
241  bool destroyAttribute(GA_Attribute *attribute);
242  bool destroyAttribute(GA_AttributeOwner owner,
243  GA_AttributeScope scope,
244  const UT_StringRef &name);
247  const UT_StringRef &name)
248  {
249  return destroyAttribute(owner, GA_SCOPE_PUBLIC,
250  name);
251  }
252 
253  bool destroyAttributeIncludingP(GA_Attribute *attribute);
254 
255  int destroyAttributes(GA_AttributeOwner owner,
256  const GA_AttributeFilter &filter);
258  GA_AttributeScope scope,
259  const UT_StringRef &fromName,
260  const UT_StringHolder &toName);
261  /// Rename an attribute to an unused name. Typically used to make fromName
262  /// available for another attribute.
263  ///
264  /// Returns new name on success, NULL on failure.
265  const char *renameAttributeUnspecified(GA_AttributeOwner owner,
266  GA_AttributeScope scope,
267  const UT_StringRef &fromName);
268 
269  // Convenience attribute methods
270  GA_Attribute *createTupleAttribute(GA_AttributeOwner owner,
271  GA_AttributeScope scope,
272  const UT_StringHolder &name,
274  int tuple_size,
275  const GA_Defaults &defaults,
276  const UT_Options *creation_args = NULL,
277  const GA_AttributeOptions *attribute_options = NULL,
278  const GA_ReuseStrategy &r = GA_ReuseStrategy());
281  const UT_StringHolder &name,
282  GA_Storage storage,
283  int tuple_size,
284  const GA_Defaults &defaults,
285  const UT_Options *creation_args = NULL,
286  const GA_AttributeOptions *attribute_options = NULL,
288  {
289  return createTupleAttribute(owner, GA_SCOPE_PUBLIC, name, storage,
290  tuple_size, defaults, creation_args,
291  attribute_options, r);
292  }
293  GA_ATINumeric *createDetachedTupleAttribute(
294  GA_AttributeOwner owner,
295  GA_Storage storage,
296  int tuple_size,
297  const GA_Defaults &defaults=GA_Defaults(0.0f),
298  const GA_AttributeOptions *attribute_options=NULL) const;
299  GA_Attribute *createArrayAttribute(GA_AttributeOwner owner,
300  GA_AttributeScope scope,
301  const UT_StringHolder &name,
302  GA_Storage storage,
303  int tuple_size,
304  const UT_Options *creation_args = NULL,
305  const GA_AttributeOptions *attribute_options = NULL,
306  const UT_StringRef &attribtype="arraydata",
307  const GA_ReuseStrategy &r = GA_ReuseStrategy());
308  GA_Attribute *createTempTupleAttribute(GA_AttributeOwner owner,
309  GA_Storage storage,
310  int tuple_size,
311  const GA_Defaults &defaults,
312  const UT_Options *creation_args = NULL,
313  const GA_AttributeOptions *attribute_options = NULL);
314  GA_Attribute *createStringAttribute(GA_AttributeOwner owner,
315  GA_AttributeScope scope,
316  const UT_StringHolder &name,
317  int tuple_size=1,
318  const UT_Options *creation_args = NULL,
319  const GA_AttributeOptions *attribute_options = NULL,
320  const UT_StringRef &attribtype="string",
321  const GA_ReuseStrategy &r = GA_ReuseStrategy());
324  const UT_StringHolder &name,
325  int tuple_size=1,
326  const UT_Options *creation_args = NULL,
327  const GA_AttributeOptions *attribute_options = NULL,
328  const UT_StringRef &attribtype="string",
330  {
331  return createStringAttribute(owner, GA_SCOPE_PUBLIC, name, tuple_size,
332  creation_args, attribute_options, attribtype,
333  r);
334  }
335  GA_Attribute *createTempStringAttribute(GA_AttributeOwner owner,
336  int tuple_size=1);
339  const UT_StringRef &name)
340  {
341  return findAttribute(GA_ATTRIB_POINT, scope,
342  name);
343  }
346  {
347  return findPointAttribute(GA_SCOPE_PUBLIC,
348  name);
349  }
352  const UT_StringRef &name)
353  {
354  return findAttribute(GA_ATTRIB_VERTEX, scope,
355  name);
356  }
359  {
360  return findVertexAttribute(GA_SCOPE_PUBLIC,
361  name);
362  }
365  const UT_StringRef &name)
366  {
367  return findAttribute(GA_ATTRIB_PRIMITIVE,
368  scope, name);
369  }
372  {
373  return findPrimitiveAttribute(GA_SCOPE_PUBLIC,
374  name);
375  }
378  const UT_StringRef &name)
379  {
380  return findAttribute(GA_ATTRIB_GLOBAL, scope,
381  name);
382  }
385  {
386  return findGlobalAttribute(GA_SCOPE_PUBLIC,
387  name);
388  }
389 
390  /// NOTE: These should ONLY be called by the GA_ElementGroup constructor & destructor.
391  /// @{
392  void registerGroup(GA_ElementGroup &group);
393  void unregisterGroup(GA_ElementGroup &group);
394  /// @}
395 
396  GA_ElementGroup *findGroup(GA_AttributeOwner owner,
397  const UT_StringRef &name);
398  // Convenience group methods
400  { return findGroup(GA_ATTRIB_POINT, name); }
402  { return findGroup(GA_ATTRIB_VERTEX, name); }
404  { return findGroup(GA_ATTRIB_PRIMITIVE, name); }
405 
406  /// Try to compress data pages
407  /// Will try to compress *all* pages overlapping the specified offset
408  /// range.
409  void tryCompressAllPages(GA_AttributeOwner owner,
410  GA_Offset start_offset = GA_Offset(0),
411  GA_Offset end_offset = GA_INVALID_OFFSET);
412 
413  /// Harden data pages
414  /// Will harden *all* pages overlapping the specified offset range.
415  /// Once this is done, multiple threads can write to an attribute in
416  /// parallel at a finer granularity than pages.
417  void hardenAllPages(GA_AttributeOwner owner,
418  GA_Offset start_offset = GA_Offset(0),
419  GA_Offset end_offset = GA_INVALID_OFFSET);
420 
421  /// Bumps all data IDs of attributes of the specified owner.
422  void bumpAllDataIds(GA_AttributeOwner owner);
423 
424  /// Save attribute sets to a JSON stream.
425  /// @section JSON-GA_AttributeSet JSON Schema: GA_AttributeSet
426  ///
427  /// Storage for a set of attributes.
428  ///
429  /// @code
430  /// {
431  /// "name" : "GA_AttributeSet",
432  /// "description" : "Attribute storage",
433  /// "type" : "orderedmap",
434  /// "properties": {
435  /// "vertexattributes": {
436  /// "type" : "array",
437  /// "items" : { "$ref" : "GA_Attribute" } ,
438  /// "description" : "Vertex attributes",
439  /// "optional" : true,
440  /// }
441  /// "pointattributes": {
442  /// "type" : "array",
443  /// "items" : { "$ref" : "GA_Attribute" } ,
444  /// "description" : "Point attributes",
445  /// "optional" : true,
446  /// }
447  /// "primitiveattributes": {
448  /// "type" : "array",
449  /// "items" : { "$ref" : "GA_Attribute" },
450  /// "description" : "Primitive attributes",
451  /// "optional" : true,
452  /// }
453  /// "globalattributes": {
454  /// "type" : "array",
455  /// "items" : { "$ref" : "GA_Attribute" } ,
456  /// "description" : "Global attributes",
457  /// "optional" : true,
458  /// }
459  /// }
460  /// }
461  /// @endcode
462  /// @see @ref JSON_FileFormat, GA_AIFJSON, GA_Attribute
463  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s) const;
464 
465  /// Load attribute sets from a JSON stream
466  bool jsonLoad(UT_JSONParser &p, GA_LoadMap &m);
467 
468  /// Stat attribute stats from a JSON stream
469  static bool jsonStat(UT_JSONParser &p, GA_Stat &sbuf);
470 
471  // --- Query methods ----
472  int64 getMemoryUsage(bool inclusive) const;
473 
474  /// Count memory usage using a UT_MemoryCounter in order to count
475  /// shared memory correctly.
476  /// If inclusive is true, the size of this object is counted,
477  /// else only memory owned by this object is counted.
478  /// If this is pointed to by the calling object, inclusive should be true.
479  /// If this is contained in the calling object, inclusive should be false.
480  /// (Its memory was already counted in the size of the calling object.)
481  void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
482 
483 
484  bool loadDictH9(UT_IStream &is,
485  GA_AttributeOwner owner,
486  int tbl_size,
488  &definition,
490  &list,
491  const GA_AttribXlateH9 *xlate);
492  static bool saveDictH9(std::ostream &os, const char *label,
494  &list);
495 
496  /// Get information about attributes
497  bool stat(GA_Stat &stat, uint level) const;
498 
499  // Private to GA_AttributeRefMap methods --------------------
500  GA_Detail *getDetail() const { return myDetail; }
501 
502  // Private to GA_Detail methods ----------------------------------
503  void clearAllAttributes(bool for_deletion); // Called on detail deletion
504  void clearAllAttributes(GA_AttributeOwner owner, bool for_deletion); // Called in replaceWithPoints
505  // Reserve some additional space in a symbol table for batch addition.
506  void reserveNewSymbolTableSpace(GA_AttributeOwner owner,
507  GA_AttributeScope scope,
508  int size);
509  GA_ATITopology *createTopologyAttribute(GA_AttributeOwner owner,
510  const UT_StringHolder &name,
511  GA_AttributeOwner linkowner);
512 
513  /// Raw access to the GA_AttributeDict for a particular owner
516  {
517  UT_ASSERT_P(int(owner) >= 0 && int(owner) < int(GA_ATTRIB_OWNER_N));
518  return myAttributes[owner];
519  }
520 
521  /// Query whether a given string is a valid variable name.
522  static bool isValidName(const char *name,
524 
525  /// @private Function used in GA_Detail::replace to replace all attributes
526  /// If 'skip' is given, we will skip processing any attribute that
527  /// matches it. 'skip' will be called with attributes from the
528  /// destination as well as src geometries.
529  void replace(const GA_AttributeSet &src, GA_AttributeOwner owner,
530  bool replaceindexmap, GA_AttributeFilter *skip);
531 
532  /// @private Method used by merging to destroy attributes before merging
533  void mergeDestroyDestination(GA_MergeMap &map);
534  /// @private Method used by merging to add attributes during merging
535  void mergeAddDestination(GA_MergeMap &map);
536 
537  /// @private Method used by merging detail attributes
538  void mergeDestroyGlobalDestination(GA_MergeMap &map)
539  { mergeDestroyDestination(GA_ATTRIB_DETAIL, map); }
540  /// @private Method used by merging detail attributes
541  void mergeAddGlobalDestination(GA_MergeMap &map)
542  { mergeAddDestination(GA_ATTRIB_DETAIL, map); }
543 
545  {
546  return myAttributes[owner].begin();
547  }
549  GA_AttributeScope scope) const
550  {
551  return myAttributes[owner].begin(scope);
552  }
554  { return myAttributes[owner].end(); }
556  GA_AttributeScope scope) const
557  { return myAttributes[owner].end(scope); }
558 
559  /// Called by GA_Detail::defragment when defragmenting a particular
560  /// index map. Topology attributes won't be modified; they're
561  /// handled separately.
562  /// NOTE: This bumps all data IDs of attributes whose owner is that of the
563  /// index map being defragmented, including topology attributes.
564  void defragment(const GA_Defragment &defrag);
565 
566  /// By default, data IDs are not generated for new attributes to force
567  /// callers to explicitly opt-in. It is very easy for data IDs to
568  /// become stale in code that is not explicitly notifying modified
569  /// attributes.
570  void enableDataIdGeneration();
571 
572  /// Query whether generation of data IDs has been enabled.
573  bool isGeneratingDataIds() const
574  { return myGenerateDataIds; }
575 
576 private:
577  /// @private
578  /// Used only by GA_Detail
579  void setNumBuckets(GA_AttributeOwner owner, GA_AttributeScope scope, size_t nbuckets)
580  {
581  myAttributes[owner].setNumBuckets(scope, nbuckets);
582  }
583 
584  void adjustArraySize(GA_AttributeOwner owner, GA_Offset size);
585  /// When a previously deleted element is reallocated, we need to reset the
586  /// attribute data to its default values. The constructElement() assumes
587  /// that there are no current values.
588  void constructElementBlock(GA_AttributeOwner owner, GA_Offset offset, GA_Offset nelements);
589  /// When an element is destroyed, the destructElement() method is called
590  /// so that the attribute data can be cleaned up properly (i.e. string
591  /// references or group data).
592  void destructElement(GA_AttributeOwner owner, GA_Offset offset);
593  void batchDeletion(GA_AttributeOwner owner);
594 
595  /// @private Method to grow arrays prior to merging
596  void mergeGrowData(GA_AttributeOwner owner, GA_MergeMap &map);
597 
598  /// @private Method to copy data from the source to the destination for all
599  /// attribute types.
600  void mergeCopyData(const GA_MergeMap &map);
601 
602  /// @private Method to copy data from source to dest for detail attributes
603  void mergeCopyGlobalData(const GA_MergeMap &map)
604  { mergeCopyData(GA_ATTRIB_DETAIL, map); }
605 
606  /// @private Method to copy data from the source to the destination
607  void mergeCopyData(GA_AttributeOwner owner, const GA_MergeMap &map);
608 
609  void mergeDestroyDestination(GA_AttributeOwner owner,
610  GA_MergeMap &map);
611  void mergeAddDestination(GA_AttributeOwner owner,
612  GA_MergeMap &map);
613 
614  const GA_IndexMap &getIndexMap(GA_AttributeOwner type) const;
615  UT_StringRef makeUniqueName(GA_AttributeOwner owner,
616  GA_AttributeScope scope,
617  UT_WorkBuffer &name_buffer) const;
618  UT_StringRef makeUniqueName(GA_AttributeOwner owner,
619  GA_AttributeScope scope,
620  const char *prefix,
621  UT_WorkBuffer &name_buffer) const;
622 
623  /// This method, unlike createAttribute(), merely allocates the requested
624  /// attribute. The allocated attribute is not registered in our tables
625  /// nor with our detail. Consequently name collisions are ignored, and it
626  /// is up to the caller to resolve any such collisions before registering
627  /// this attribute.
628  GA_Attribute *allocAttribute(GA_AttributeOwner owner,
629  const UT_StringHolder &name,
630  const UT_Options *creation_args,
631  const GA_AttributeOptions *attribute_options,
632  const UT_StringRef &attribtype) const;
633 
634  inline GA_AttributeProxy *findProxy(GA_AttributeOwner owner,
635  GA_AttributeScope scope,
636  const UT_StringRef &name) const
637  {
638  UT_ASSERT_P(owner >= GA_AttributeOwner(0) && owner < GA_ATTRIB_OWNER_N);
639  return myAttributes[owner].findProxy(scope, name);
640  }
641  inline GA_Attribute *find(GA_AttributeOwner owner,
642  GA_AttributeScope scope,
643  const UT_StringRef &name) const
644  {
645  GA_AttributeProxy *p = findProxy(owner, scope, name);
646  return p ? p->getAttribute() : NULL;
647  }
648  void add(GA_AttributeOwner owner, GA_Attribute *atr);
649  void invalidateProxyAndDestroyAttribute( GA_AttributeProxy *proxy);
650  bool destroy(GA_AttributeOwner owner, GA_Attribute *atr);
651  bool destroy(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name)
652  { return destroy(owner, find(owner, scope, name)); }
653  int destroy(GA_AttributeOwner owner, const GA_AttributeFilter &filter);
654  /// Avoids the safety check on P.
655  bool destroyIncludingP(GA_AttributeOwner owner, GA_Attribute *atr);
656  void clear(GA_AttributeOwner owner, bool for_deletion);
657 
658  template<typename OP,typename FILL_OPT_OP>
659  GA_Attribute *createAttributeImpl(
660  OP &creation_op,
661  FILL_OPT_OP &fill_opt_op,
662  GA_AttributeOwner owner,
663  GA_AttributeScope scope,
664  const UT_StringHolder &name,
665  const UT_Options *create_args,
666  const GA_AttributeOptions *attribute_options,
667  const GA_AttributeType &attribtype,
668  const GA_ReuseStrategy &reuse);
669 
670  GA_Detail *myDetail;
671  GA_AttributeDict myAttributes[GA_ATTRIB_OWNER_N];
672  UT_Array<GA_Attribute *> *myDestructorCache[GA_ATTRIB_OWNER_N];
673  bool myGenerateDataIds : 1;
674  bool myPreferredPrec64 : 1;
675 };
676 
677 #endif
GLdouble s
Definition: glew.h:1390
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
SYS_FORCE_INLINE GA_Attribute * findPointAttribute(const UT_StringRef &name)
Specify when and how to reuse an existing attribute.
GLsizeiptr size
Definition: glew.h:1681
GLenum src
Definition: glew.h:2410
SYS_FORCE_INLINE GA_Attribute * findAttribute(GA_AttributeOwner owner, const UT_StringRef &name)
GLuint const GLchar * name
Definition: glew.h:1814
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
SYS_FORCE_INLINE bool destroyAttribute(GA_AttributeOwner owner, const UT_StringRef &name)
GA_AttributeDict::iterator begin(GA_AttributeOwner owner, GA_AttributeScope scope) const
Class which stores the default values for a GA_Attribute.
Definition: GA_Defaults.h:35
void matchAttributes(const GA_AttributeFilter &filter, GA_AttributeOwner owner, UT_Array< const GA_Attribute * > &list) const
void skip(T &in, int n)
Definition: ImfXdr.h:885
GA_DataIdStrategy
Definition: GA_Types.h:206
SYS_FORCE_INLINE const GA_Attribute * findAttribute(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name) const
GA_AttributeDict::iterator end(GA_AttributeOwner owner, GA_AttributeScope scope) const
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
GA_AttributeDict::iterator begin(GA_AttributeOwner owner) const
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:75
SYS_FORCE_INLINE GA_Attribute * createAttribute(GA_AttributeOwner owner, const UT_StringHolder &name, const UT_Options *creation_args, const GA_AttributeOptions *attribute_options, const UT_StringRef &attribtype, const GA_ReuseStrategy &r=GA_ReuseStrategy())
Convenience method to add a public attribute.
Class used to map H9 geometry files to a form used by GA.
Definition: GA_AIFFileH9.h:317
const GLdouble * m
Definition: glew.h:9124
#define GA_API
Definition: GA_API.h:12
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
Standard user attribute level.
Definition: GA_Types.h:145
SYS_FORCE_INLINE GA_Attribute * findPrimitiveAttribute(const UT_StringRef &name)
GA_ElementGroup * findVertexGroup(const UT_StringRef &name)
#define GA_INVALID_OFFSET
Definition: GA_Types.h:674
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
GA_Size GA_Offset
Definition: GA_Types.h:637
long long int64
Definition: SYS_Types.h:111
GA_AttributeScope
Definition: GA_Types.h:139
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glew.h:2981
SYS_FORCE_INLINE GA_Attribute * findPrimitiveAttribute(GA_AttributeScope scope, const UT_StringRef &name)
GA_Detail * getDetail() const
SYS_FORCE_INLINE GA_Attribute * findAttribute(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name)
GLclampf f
Definition: glew.h:3499
GA_AttributeDict::iterator end(GA_AttributeOwner owner) const
std::string OIIO_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
This class holds a reference to an attribute. Such an indirection level allows an easy way to invalid...
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
SYS_FORCE_INLINE GA_Attribute * findVertexAttribute(const UT_StringRef &name)
SYS_FORCE_INLINE const GA_Attribute * findAttribute(GA_AttributeOwner owner, const UT_StringRef &name) const
GA_Attribute * getAttribute()
GA_ElementGroup * findPointGroup(const UT_StringRef &name)
Options during loading.
Definition: GA_LoadMap.h:42
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
SYS_FORCE_INLINE const GA_AttributeDict & getDict(GA_AttributeOwner owner) const
Raw access to the GA_AttributeDict for a particular owner.
unsigned int uint
Definition: SYS_Types.h:44
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
GA_ElementGroup * findPrimitiveGroup(const UT_StringRef &name)
Attribute Interface for file I/O.
Definition: GA_AIFFileH9.h:43
GLfloat GLfloat p
Definition: glew.h:16321
GA_AttributeOwner
Definition: GA_Types.h:33
A map of string to various well defined value types.
Definition: UT_Options.h:42
Class to return information about a GA_Detail.
Definition: GA_Stat.h:50
GLuint counter
Definition: glew.h:2740
SYS_FORCE_INLINE GA_Attribute * findVertexAttribute(GA_AttributeScope scope, const UT_StringRef &name)
Class to allow custom AIF interfaces to be built.
SYS_FORCE_INLINE GA_Attribute * findPointAttribute(GA_AttributeScope scope, const UT_StringRef &name)
FMT_CONSTEXPR bool find(Ptr first, Ptr last, T value, Ptr &out)
Definition: format.h:2104
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
Class used to map the GA attribute into a form for H9 geometry files.
Definition: GA_AIFFileH9.h:261
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
SYS_FORCE_INLINE GA_Attribute * findGlobalAttribute(GA_AttributeScope scope, const UT_StringRef &name)
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
Container class for all geometry.
Definition: GA_Detail.h:95
SYS_FORCE_INLINE GA_Attribute * createStringAttribute(GA_AttributeOwner owner, const UT_StringHolder &name, int tuple_size=1, const UT_Options *creation_args=NULL, const GA_AttributeOptions *attribute_options=NULL, const UT_StringRef &attribtype="string", const GA_ReuseStrategy &r=GA_ReuseStrategy())
bool isGeneratingDataIds() const
Query whether generation of data IDs has been enabled.
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
SYS_FORCE_INLINE GA_Attribute * createTupleAttribute(GA_AttributeOwner owner, const UT_StringHolder &name, GA_Storage storage, int tuple_size, const GA_Defaults &defaults, const UT_Options *creation_args=NULL, const GA_AttributeOptions *attribute_options=NULL, const GA_ReuseStrategy &r=GA_ReuseStrategy())
void matchAttributes(const GA_AttributeFilter &filter, GA_AttributeOwner owner, UT_Array< GA_Attribute * > &list)
void renameAttribute(PointDataTreeT &tree, const Name &oldName, const Name &newName)
Rename an attribute in a VDB tree.
GLint level
Definition: glew.h:1252
GA_Storage
Definition: GA_Types.h:49
SYS_FORCE_INLINE GA_Attribute * findAttribute(const UT_StringRef &name, const GA_AttributeOwner search_order[], int search_order_size)
SYS_FORCE_INLINE GA_Attribute * findGlobalAttribute(const UT_StringRef &name)
SYS_FORCE_INLINE const GA_Attribute * findAttribute(const UT_StringRef &name, const GA_AttributeOwner search_order[], int search_order_size) const
SYS_FORCE_INLINE GA_Attribute * findAttribute(GA_AttributeScope scope, const UT_StringRef &name, const GA_AttributeOwner search_order[], int search_order_size)
GLboolean GLuint group
Definition: glew.h:2745
GLintptr offset
Definition: glew.h:1682