HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  GA_AttributeSet(const GA_AttributeSet &set);
72 
73 public:
74  ~GA_AttributeSet();
75 
77  {
78  // Used to certify that a name has already been
79  // screened for validity
80  public:
82  };
83 
85  {
86  // Used to certify that a name has already been
87  // screened for validity and collision.
88  public:
90  };
91 
92  // --- Attribute Management ----
93  /// Create a new named attribute for the @c owner with the given @scope
94  ///
95  /// The @c creation_options are used to pass intrinsic properties to the
96  /// attribute. The @c creation_options are not generally stored with the
97  /// attribute itself, but are used to determine the intrinsic behaviour of
98  /// the attribute (i.e. specifying storage types for numeric attributes).
99  ///
100  /// The @c attribute_options are stored on the attribute.
101  ///
102  /// The @c attribtype argument is used to look up the attribute type. Common
103  /// values include @c numeric, @c "string" and @c "indexpair"
104  GA_Attribute *createAttribute(GA_AttributeOwner owner,
105  GA_AttributeScope scope,
106  const UT_StringHolder &name,
107  const UT_Options *creation_args,
108  const GA_AttributeOptions *attribute_options,
109  const UT_StringRef &attribtype,
110  const GA_ReuseStrategy &r = GA_ReuseStrategy());
111  /// Create a detached attribute.
112  GA_Attribute *createDetachedAttribute(
113  GA_AttributeOwner owner,
114  const UT_StringRef &attribtype,
115  const UT_Options *creation_args,
116  const GA_AttributeOptions *attribute_options) const;
117  GA_Attribute *createDetachedAttribute(
118  GA_AttributeOwner owner,
119  const GA_AttributeType &attribtype,
120  const UT_Options *creation_args,
121  const GA_AttributeOptions *attribute_options) const;
122 
123  /// Convenience method to add a public attribute
126  const UT_StringHolder &name,
127  const UT_Options *creation_args,
128  const GA_AttributeOptions *attribute_options,
129  const UT_StringRef &attribtype,
131  {
132  return createAttribute(owner, GA_SCOPE_PUBLIC,
133  name, creation_args,
134  attribute_options, attribtype);
135  }
136 
137  /// Create an attribute that has the same definition as the source.
138  /// @note This will fail for group attributes!
139  /// @{
140  GA_Attribute *cloneAttribute(GA_AttributeOwner owner,
141  const UT_StringHolder &name, namevalidcertificate,
142  const GA_Attribute &src,
143  bool clone_options,
144  GA_DataIdStrategy data_id_strategy
145  = GA_DATA_ID_BUMP,
146  const GA_ReuseStrategy &reuse = GA_ReuseStrategy());
147  GA_Attribute *cloneAttribute(GA_AttributeOwner owner,
148  const UT_StringHolder &name,
149  const GA_Attribute &src,
150  bool clone_options,
151  GA_DataIdStrategy data_id_strategy
152  = GA_DATA_ID_BUMP,
153  const GA_ReuseStrategy &reuse = GA_ReuseStrategy());
154  /// @}
155 
156  /// Create a temporary attribute.
157  /// See @c createAttribute() for details on arguments
158  GA_Attribute *createTempAttribute(GA_AttributeOwner owner,
159  const UT_Options *creation_args,
160  const GA_AttributeOptions *attribute_options,
161  const UT_StringRef &attribtype);
162  GA_Attribute *cloneTempAttribute(GA_AttributeOwner owner,
163  const GA_Attribute &src,
164  bool clone_options);
165  const GA_Attribute *findAttribute(GA_AttributeScope scope,
166  const UT_StringRef &name,
167  const GA_AttributeOwner search_order[],
168  int search_order_size) const;
171  const UT_StringRef &name,
172  const GA_AttributeOwner search_order[],
173  int search_order_size)
174  {
175  return const_cast<GA_Attribute *>(
176  static_cast<const GA_AttributeSet *>
177  (this)->findAttribute(scope, name,
178  search_order,
179  search_order_size));
180  }
183  const GA_AttributeOwner search_order[],
184  int search_order_size) const
185  {
186  return findAttribute(GA_SCOPE_PUBLIC, name,
187  search_order,
188  search_order_size);
189  }
192  const GA_AttributeOwner search_order[],
193  int search_order_size)
194  {
195  return findAttribute(GA_SCOPE_PUBLIC, name,
196  search_order,
197  search_order_size);
198  }
201  GA_AttributeScope scope,
202  const UT_StringRef &name)
203  { return findAttribute(scope, name, &owner, 1); }
206  const UT_StringRef &name)
207  {
208  return findAttribute(GA_SCOPE_PUBLIC, name,
209  &owner, 1);
210  }
213  GA_AttributeScope scope,
214  const UT_StringRef &name) const
215  { return findAttribute(scope, name, &owner, 1); }
218  const UT_StringRef &name) const
219  {
220  return findAttribute(GA_SCOPE_PUBLIC, name,
221  &owner, 1);
222  }
223  void matchAttributes(const GA_AttributeFilter &filter,
224  const GA_AttributeOwner search_order[],
225  int search_order_size,
227  void matchAttributes(const GA_AttributeFilter &filter,
228  const GA_AttributeOwner search_order[],
229  int search_order_size,
230  UT_Array<const GA_Attribute *> &list) const;
232  GA_AttributeOwner owner,
234  { return matchAttributes(filter, &owner,1, list); }
236  GA_AttributeOwner owner,
237  UT_Array<const GA_Attribute *> &list) const
238  { return matchAttributes(filter, &owner,1, list); }
239  bool destroyAttribute(GA_Attribute *attribute);
240  bool destroyAttribute(GA_AttributeOwner owner,
241  GA_AttributeScope scope,
242  const UT_StringRef &name);
245  const UT_StringRef &name)
246  {
247  return destroyAttribute(owner, GA_SCOPE_PUBLIC,
248  name);
249  }
250 
251  bool destroyAttributeIncludingP(GA_Attribute *attribute);
252 
253  int destroyAttributes(GA_AttributeOwner owner,
254  const GA_AttributeFilter &filter);
256  GA_AttributeScope scope,
257  const UT_StringRef &fromName,
258  const UT_StringHolder &toName);
259  /// Rename an attribute to an unused name. Typically used to make fromName
260  /// available for another attribute.
261  ///
262  /// Returns new name on success, NULL on failure.
263  const char *renameAttributeUnspecified(GA_AttributeOwner owner,
264  GA_AttributeScope scope,
265  const UT_StringRef &fromName);
266 
267  // Convenience attribute methods
268  GA_Attribute *createTupleAttribute(GA_AttributeOwner owner,
269  GA_AttributeScope scope,
270  const UT_StringHolder &name,
272  int tuple_size,
273  const GA_Defaults &defaults,
274  const UT_Options *creation_args = NULL,
275  const GA_AttributeOptions *attribute_options = NULL,
276  const GA_ReuseStrategy &r = GA_ReuseStrategy());
279  const UT_StringHolder &name,
280  GA_Storage storage,
281  int tuple_size,
282  const GA_Defaults &defaults,
283  const UT_Options *creation_args = NULL,
284  const GA_AttributeOptions *attribute_options = NULL,
286  {
287  return createTupleAttribute(owner, GA_SCOPE_PUBLIC, name, storage,
288  tuple_size, defaults, creation_args,
289  attribute_options, r);
290  }
291  GA_ATINumeric *createDetachedTupleAttribute(
292  GA_AttributeOwner owner,
293  GA_Storage storage,
294  int tuple_size,
295  const GA_Defaults &defaults=GA_Defaults(0.0f),
296  const GA_AttributeOptions *attribute_options=NULL) const;
297  GA_Attribute *createArrayAttribute(GA_AttributeOwner owner,
298  GA_AttributeScope scope,
299  const UT_StringHolder &name,
300  GA_Storage storage,
301  int tuple_size,
302  const UT_Options *creation_args = NULL,
303  const GA_AttributeOptions *attribute_options = NULL,
304  const UT_StringRef &attribtype="arraydata",
305  const GA_ReuseStrategy &r = GA_ReuseStrategy());
306  GA_Attribute *createTempTupleAttribute(GA_AttributeOwner owner,
307  GA_Storage storage,
308  int tuple_size,
309  const GA_Defaults &defaults,
310  const UT_Options *creation_args = NULL,
311  const GA_AttributeOptions *attribute_options = NULL);
312  GA_Attribute *createStringAttribute(GA_AttributeOwner owner,
313  GA_AttributeScope scope,
314  const UT_StringHolder &name,
315  int tuple_size=1,
316  const UT_Options *creation_args = NULL,
317  const GA_AttributeOptions *attribute_options = NULL,
318  const UT_StringRef &attribtype="string",
319  const GA_ReuseStrategy &r = GA_ReuseStrategy());
322  const UT_StringHolder &name,
323  int tuple_size=1,
324  const UT_Options *creation_args = NULL,
325  const GA_AttributeOptions *attribute_options = NULL,
326  const UT_StringRef &attribtype="string",
328  {
329  return createStringAttribute(owner, GA_SCOPE_PUBLIC, name, tuple_size,
330  creation_args, attribute_options, attribtype,
331  r);
332  }
333  GA_Attribute *createTempStringAttribute(GA_AttributeOwner owner,
334  int tuple_size=1);
337  const UT_StringRef &name)
338  {
339  return findAttribute(GA_ATTRIB_POINT, scope,
340  name);
341  }
344  {
345  return findPointAttribute(GA_SCOPE_PUBLIC,
346  name);
347  }
350  const UT_StringRef &name)
351  {
352  return findAttribute(GA_ATTRIB_VERTEX, scope,
353  name);
354  }
357  {
358  return findVertexAttribute(GA_SCOPE_PUBLIC,
359  name);
360  }
363  const UT_StringRef &name)
364  {
365  return findAttribute(GA_ATTRIB_PRIMITIVE,
366  scope, name);
367  }
370  {
371  return findPrimitiveAttribute(GA_SCOPE_PUBLIC,
372  name);
373  }
376  const UT_StringRef &name)
377  {
378  return findAttribute(GA_ATTRIB_GLOBAL, scope,
379  name);
380  }
383  {
384  return findGlobalAttribute(GA_SCOPE_PUBLIC,
385  name);
386  }
387 
388  /// NOTE: These should ONLY be called by the GA_ElementGroup constructor & destructor.
389  /// @{
390  void registerGroup(GA_ElementGroup &group);
391  void unregisterGroup(GA_ElementGroup &group);
392  /// @}
393 
394  GA_ElementGroup *findGroup(GA_AttributeOwner owner,
395  const UT_StringRef &name);
396  // Convenience group methods
398  { return findGroup(GA_ATTRIB_POINT, name); }
400  { return findGroup(GA_ATTRIB_VERTEX, name); }
402  { return findGroup(GA_ATTRIB_PRIMITIVE, name); }
403 
404  /// Try to compress data pages
405  /// Will try to compress *all* pages overlapping the specified offset
406  /// range.
407  void tryCompressAllPages(GA_AttributeOwner owner,
408  GA_Offset start_offset = GA_Offset(0),
409  GA_Offset end_offset = GA_INVALID_OFFSET);
410 
411  /// Harden data pages
412  /// Will harden *all* pages overlapping the specified offset range.
413  /// Once this is done, multiple threads can write to an attribute in
414  /// parallel at a finer granularity than pages.
415  void hardenAllPages(GA_AttributeOwner owner,
416  GA_Offset start_offset = GA_Offset(0),
417  GA_Offset end_offset = GA_INVALID_OFFSET);
418 
419  /// Bumps all data IDs of attributes of the specified owner.
420  void bumpAllDataIds(GA_AttributeOwner owner);
421 
422  /// Save attribute sets to a JSON stream.
423  /// @section JSON-GA_AttributeSet JSON Schema: GA_AttributeSet
424  ///
425  /// Storage for a set of attributes.
426  ///
427  /// @code
428  /// {
429  /// "name" : "GA_AttributeSet",
430  /// "description" : "Attribute storage",
431  /// "type" : "orderedmap",
432  /// "properties": {
433  /// "vertexattributes": {
434  /// "type" : "array",
435  /// "items" : { "$ref" : "GA_Attribute" } ,
436  /// "description" : "Vertex attributes",
437  /// "optional" : true,
438  /// }
439  /// "pointattributes": {
440  /// "type" : "array",
441  /// "items" : { "$ref" : "GA_Attribute" } ,
442  /// "description" : "Point attributes",
443  /// "optional" : true,
444  /// }
445  /// "primitiveattributes": {
446  /// "type" : "array",
447  /// "items" : { "$ref" : "GA_Attribute" },
448  /// "description" : "Primitive attributes",
449  /// "optional" : true,
450  /// }
451  /// "globalattributes": {
452  /// "type" : "array",
453  /// "items" : { "$ref" : "GA_Attribute" } ,
454  /// "description" : "Global attributes",
455  /// "optional" : true,
456  /// }
457  /// }
458  /// }
459  /// @endcode
460  /// @see @ref JSON_FileFormat, GA_AIFJSON, GA_Attribute
461  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s) const;
462 
463  /// Load attribute sets from a JSON stream
464  bool jsonLoad(UT_JSONParser &p, GA_LoadMap &m);
465 
466  /// Stat attribute stats from a JSON stream
467  static bool jsonStat(UT_JSONParser &p, GA_Stat &sbuf);
468 
469  // --- Query methods ----
470  int64 getMemoryUsage(bool inclusive) const;
471 
472  /// Count memory usage using a UT_MemoryCounter in order to count
473  /// shared memory correctly.
474  /// If inclusive is true, the size of this object is counted,
475  /// else only memory owned by this object is counted.
476  /// If this is pointed to by the calling object, inclusive should be true.
477  /// If this is contained in the calling object, inclusive should be false.
478  /// (Its memory was already counted in the size of the calling object.)
479  void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
480 
481 
482  bool loadDictH9(UT_IStream &is,
483  GA_AttributeOwner owner,
484  int tbl_size,
486  &definition,
488  &list,
489  const GA_AttribXlateH9 *xlate);
490  static bool saveDictH9(std::ostream &os, const char *label,
492  &list);
493 
494  /// Get information about attributes
495  bool stat(GA_Stat &stat, uint level) const;
496 
497  // Private to GA_AttributeRefMap methods --------------------
498  GA_Detail *getDetail() const { return myDetail; }
499 
500  // Private to GA_Detail methods ----------------------------------
501  void clearAllAttributes(bool for_deletion); // Called on detail deletion
502  void clearAllAttributes(GA_AttributeOwner owner, bool for_deletion); // Called in replaceWithPoints
503  // Reserve some additional space in a symbol table for batch addition.
504 #if GA_SEPARATE_ATTRIB_SCOPES
505  void reserveNewSymbolTableSpace(GA_AttributeOwner owner,
506  GA_AttributeScope scope,
507  int size);
508 #else
509  void reserveNewSymbolTableSpace(GA_AttributeOwner owner,
510  int size);
511 #endif
512  GA_ATITopology *createTopologyAttribute(GA_AttributeOwner owner,
513  const UT_StringHolder &name,
514  GA_AttributeOwner linkowner);
515 
516  /// Raw access to the GA_AttributeDict for a particular owner
519  {
520  UT_ASSERT_P(int(owner) >= 0 && int(owner) < int(GA_ATTRIB_OWNER_N));
521  return myAttributes[owner];
522  }
523 
524  /// Query whether a given string is a valid variable name.
525  static bool isValidName(const char *name,
527 
528 #if !GA_SEPARATE_ATTRIB_SCOPES
529  /// Build the appropriate full attribute name from an validated base
530  /// name for the given scope.
531  /// May either return a pointer into the workbuffer (if there was
532  /// a prefix) or to the basename itself (if none)
533  static UT_StringRef makeFullName(UT_WorkBuffer &storage,
534  GA_AttributeScope scope,
535  const UT_StringRef &validated_base_name);
536  /// Returns true if the given UT_StringRef doesn't need to have
537  /// makeFullName called on it to make it a full name.
538  static bool isFullName(GA_AttributeScope scope,
539  const UT_StringRef &validated_base_name);
540 #endif
541 
542  /// @private Function used in GA_Detail::replace to replace all attributes
543  void replace(const GA_AttributeSet &src, GA_AttributeOwner owner, bool replaceindexmap);
544 
545  /// @private Method used by merging to destroy attributes before merging
546  void mergeDestroyDestination(GA_MergeMap &map);
547  /// @private Method used by merging to add attributes during merging
548  void mergeAddDestination(GA_MergeMap &map);
549 
550  /// @private Method used by merging detail attributes
551  void mergeDestroyGlobalDestination(GA_MergeMap &map)
552  { mergeDestroyDestination(GA_ATTRIB_DETAIL, map); }
553  /// @private Method used by merging detail attributes
554  void mergeAddGlobalDestination(GA_MergeMap &map)
555  { mergeAddDestination(GA_ATTRIB_DETAIL, map); }
556 
558  {
559  return myAttributes[owner].begin();
560  }
562  GA_AttributeScope scope) const
563  {
564  return myAttributes[owner].begin(scope);
565  }
567  { return myAttributes[owner].end(); }
569  GA_AttributeScope scope) const
570  { return myAttributes[owner].end(scope); }
571 
572  /// Called by GA_Detail::defragment when defragmenting a particular
573  /// index map. Topology attributes won't be modified; they're
574  /// handled separately.
575  /// NOTE: This bumps all data IDs of attributes whose owner is that of the
576  /// index map being defragmented, including topology attributes.
577  void defragment(const GA_Defragment &defrag);
578 
579  /// By default, data IDs are not generated for new attributes to force
580  /// callers to explicitly opt-in. It is very easy for data IDs to
581  /// become stale in code that is not explicitly notifying modified
582  /// attributes.
583  void enableDataIdGeneration();
584 
585  /// Query whether generation of data IDs has been enabled.
586  bool isGeneratingDataIds() const
587  { return myGenerateDataIds; }
588 
589 private:
590  /// @private
591  /// Used only by GA_Detail
592 #if GA_SEPARATE_ATTRIB_SCOPES
593  void setNumBuckets(GA_AttributeOwner owner, GA_AttributeScope scope, size_t nbuckets)
594  {
595  myAttributes[owner].setNumBuckets(scope, nbuckets);
596  }
597 #else
598  void setNumBuckets(GA_AttributeOwner owner, size_t nbuckets)
599  {
600  myAttributes[owner].setNumBuckets(nbuckets);
601  }
602 #endif
603 
604  void adjustArraySize(GA_AttributeOwner owner, GA_Offset size);
605  /// When a previously deleted element is reallocated, we need to reset the
606  /// attribute data to its default values. The constructElement() assumes
607  /// that there are no current values.
608  void constructElementBlock(GA_AttributeOwner owner, GA_Offset offset, GA_Offset nelements);
609  /// When an element is destroyed, the destructElement() method is called
610  /// so that the attribute data can be cleaned up properly (i.e. string
611  /// references or group data).
612  void destructElement(GA_AttributeOwner owner, GA_Offset offset);
613  void batchDeletion(GA_AttributeOwner owner);
614 
615  /// @private Method to grow arrays prior to merging
616  void mergeGrowData(GA_AttributeOwner owner, GA_MergeMap &map);
617 
618  /// @private Method to copy data from the source to the destination for all
619  /// attribute types.
620  void mergeCopyData(const GA_MergeMap &map);
621 
622  /// @private Method to copy data from source to dest for detail attributes
623  void mergeCopyGlobalData(const GA_MergeMap &map)
624  { mergeCopyData(GA_ATTRIB_DETAIL, map); }
625 
626  /// @private Method to copy data from the source to the destination
627  void mergeCopyData(GA_AttributeOwner owner, const GA_MergeMap &map);
628 
629  void mergeDestroyDestination(GA_AttributeOwner owner,
630  GA_MergeMap &map);
631  void mergeAddDestination(GA_AttributeOwner owner,
632  GA_MergeMap &map);
633 
634  const GA_IndexMap &getIndexMap(GA_AttributeOwner type) const;
635  UT_StringRef makeUniqueName(GA_AttributeOwner owner,
636  GA_AttributeScope scope,
637  UT_WorkBuffer &name_buffer) const;
638  UT_StringRef makeUniqueName(GA_AttributeOwner owner,
639  GA_AttributeScope scope,
640  const char *prefix,
641  UT_WorkBuffer &name_buffer) const;
642 
643  /// This method, unlike createAttribute(), merely allocates the requested
644  /// attribute. The allocated attribute is not registered in our tables
645  /// nor with our detail. Consequently name collisions are ignored, and it
646  /// is up to the caller to resolve any such collisions before registering
647  /// this attribute.
648  GA_Attribute *allocAttribute(GA_AttributeOwner owner,
649  const UT_StringHolder &name,
650  const UT_Options *creation_args,
651  const GA_AttributeOptions *attribute_options,
652  const UT_StringRef &attribtype) const;
653 
654  inline GA_AttributeProxy *findProxy(GA_AttributeOwner owner,
655  GA_AttributeScope scope,
656  const UT_StringRef &name) const
657  {
658  UT_ASSERT_P(owner >= GA_AttributeOwner(0) && owner < GA_ATTRIB_OWNER_N);
659  return myAttributes[owner].findProxy(scope, name);
660  }
661  inline GA_Attribute *find(GA_AttributeOwner owner,
662  GA_AttributeScope scope,
663  const UT_StringRef &name) const
664  {
665  GA_AttributeProxy *p = findProxy(owner, scope, name);
666  return p ? p->getAttribute() : NULL;
667  }
668  void add(GA_AttributeOwner owner, GA_Attribute *atr);
669  void invalidateProxyAndDestroyAttribute( GA_AttributeProxy *proxy);
670  bool destroy(GA_AttributeOwner owner, GA_Attribute *atr);
671  bool destroy(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name)
672  { return destroy(owner, find(owner, scope, name)); }
673  int destroy(GA_AttributeOwner owner, const GA_AttributeFilter &filter);
674  /// Avoids the safety check on P.
675  bool destroyIncludingP(GA_AttributeOwner owner, GA_Attribute *atr);
676  void clear(GA_AttributeOwner owner, bool for_deletion);
677 
678  template<typename OP,typename FILL_OPT_OP>
679  GA_Attribute *createAttributeImpl(
680  OP &creation_op,
681  FILL_OPT_OP &fill_opt_op,
682  GA_AttributeOwner owner,
683  GA_AttributeScope scope,
684  const UT_StringHolder &name,
685  const UT_Options *create_args,
686  const GA_AttributeOptions *attribute_options,
687  const GA_AttributeType &attribtype,
688  const GA_ReuseStrategy &reuse);
689 
690  GA_Detail *myDetail;
691  GA_AttributeDict myAttributes[GA_ATTRIB_OWNER_N];
692  UT_Array<GA_Attribute *> *myDestructorCache[GA_ATTRIB_OWNER_N];
693  bool myGenerateDataIds;
694 };
695 
696 #endif
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:189
SYS_FORCE_INLINE GA_Attribute * findPointAttribute(const UT_StringRef &name)
Specify when and how to reuse an existing attribute.
SYS_FORCE_INLINE GA_Attribute * findAttribute(GA_AttributeOwner owner, const UT_StringRef &name)
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
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
GA_DataIdStrategy
Definition: GA_Types.h:186
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
GLint level
Definition: glcorearb.h:107
GA_AttributeDict::iterator begin(GA_AttributeOwner owner) const
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
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
#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:127
SYS_FORCE_INLINE GA_Attribute * findPrimitiveAttribute(const UT_StringRef &name)
GA_ElementGroup * findVertexGroup(const UT_StringRef &name)
GLsizeiptr size
Definition: glcorearb.h:663
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:101
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:617
long long int64
Definition: SYS_Types.h:100
GA_AttributeScope
Definition: GA_Types.h:121
GLfloat f
Definition: glcorearb.h:1925
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)
GA_AttributeDict::iterator end(GA_AttributeOwner owner) const
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
SYS_FORCE_INLINE GA_Attribute * findVertexAttribute(const UT_StringRef &name)
GLintptr offset
Definition: glcorearb.h:664
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 const GLchar * name
Definition: glcorearb.h:785
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:33
GA_ElementGroup * findPrimitiveGroup(const UT_StringRef &name)
Attribute Interface for file I/O.
Definition: GA_AIFFileH9.h:43
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
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)
Class used to map the GA attribute into a form for H9 geometry files.
Definition: GA_AIFFileH9.h:261
void renameAttribute(PointDataTree &tree, const Name &oldName, const Name &newName)
Rename an attribute in a VDB tree.
SYS_FORCE_INLINE GA_Attribute * findGlobalAttribute(GA_AttributeScope scope, const UT_StringRef &name)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
Container class for all geometry.
Definition: GA_Detail.h:96
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
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.
GLboolean r
Definition: glcorearb.h:1221
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)
GA_Storage
Definition: GA_Types.h:48
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)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296
GLenum src
Definition: glcorearb.h:1792