HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_Attribute.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_Attribute.h ( GA Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #pragma once
12 
13 #ifndef __GA_Attribute__
14 #define __GA_Attribute__
15 
16 #include "GA_API.h"
17 #include "GA_AttributeProxy.h"
18 #include "GA_AttributeType.h"
19 #include "GA_IndexMap.h"
20 #include "GA_Types.h"
21 
22 #include <UT/UT_Assert.h>
23 #include <UT/UT_StringHolder.h>
24 #include <UT/UT_UniquePtr.h>
25 #include <UT/UT_SharedPtr.h>
26 
27 #include <SYS/SYS_StaticAssert.h>
28 #include <SYS/SYS_Inline.h>
29 #include <SYS/SYS_Types.h>
30 
31 #include <string>
32 #include <string.h>
33 
34 class GA_AIFBlindData;
35 class GA_AIFBlob;
36 class GA_AIFBlobArray;
37 class GA_AIFCompare;
38 class GA_AIFCopyData;
39 class GA_AIFDelta;
40 class GA_AIFEdit;
41 class GA_AIFIndexPair;
42 class GA_AIFInterp;
43 class GA_AIFJSON;
44 class GA_AIFMath;
45 class GA_AIFMerge;
46 class GA_AIFNumericArray;
51 class GA_AIFStat;
52 class GA_AIFStringTuple;
53 class GA_AIFTuple;
54 class GA_Attribute;
55 class GA_CEAttribute;
60 class GA_Defragment;
61 class GA_Detail;
62 class GA_IndexMap;
63 class GA_Range;
64 class GA_MergeMap;
65 
66 class UT_JSONParser;
67 class UT_JSONWriter;
68 class UT_MemoryCounter;
69 class UT_OptionEntry;
70 class UT_Options;
71 class UT_String;
72 class UT_WorkBuffer;
73 
75 {
76 public:
79 
81 
83 
84  /// Reset to default.
85  void clear();
86 
87  /// Constructs a full UT_Options that includes all symbols that
88  /// are otherwise handled with member variables.
89  void buildFullOptions(UT_Options &fulloptions) const;
90 
91  /// Removes from our myOptions list any options that aren't custom
92  /// and assigns them to local variables. May then delete myOptions
93  /// if it is empty.
94  void extractBuiltinOptions();
95 
96  /// If no custom options are present, create it.
97  UT_Options &createOptions();
98 
99  /// Merges option list on top of our own
100  void mergeOptions(const GA_AttributeOptions &src);
101 
102  /// @{
103  /// Accessors
104  GA_TypeInfo typeInfo() const { return myTypeInfo; }
105  void setTypeInfo(GA_TypeInfo t) { myTypeInfo = t; }
106  bool isNonTransforming() const { return myIsNonTransforming; }
107  void setIsNonTransforming(bool v) { myIsNonTransforming = v; }
108  bool exportToInfoBlock() const { return myExportToInfoBlock; }
109  void setExportToInfoBlock(bool v) { myExportToInfoBlock = v; }
110  bool leaveOnGPU() const { return myLeaveOnGPU; }
111  void setLeaveOnGPU(bool v) { myLeaveOnGPU = v; }
112  /// @}
113 
114  /// Check whether the exportOnMerge() flag has been set, or whether it's at
115  /// its default.
116  bool exportOnMergeSet() const { return myExportOnMergeValid; }
117  /// Check to see whether the export on merge is enabled. If the flag
118  /// hasn't been set, the default value will be used.
119  bool exportOnMerge(bool defval=false) const
120  { return myExportOnMergeValid ? myExportOnMerge : defval; }
121  /// Set the export on merge flag
122  void setExportOnMerge(bool v)
123  {
124  myExportOnMergeValid = true;
125  myExportOnMerge = v;
126  }
127 
128  /// Check whether the exportOnSave() flag has been set, or whether it's at
129  /// its default.
130  bool exportOnSaveSet() const { return myExportOnSaveValid; }
131  /// Check to see whether the export on save is enabled. If the flag
132  /// hasn't been set, the default value will be used.
133  bool exportOnSave(bool defval=false) const
134  { return myExportOnSaveValid ? myExportOnSave : defval; }
135  /// Set the export on save flag
136  void setExportOnSave(bool v)
137  {
138  myExportOnSaveValid = true;
139  myExportOnSave = v;
140  }
141 
142  /// Check to see whether the attribute is a "string set". If the flag
143  /// hasn't been set, the default value will be used.
144  bool isStringSet(bool defval=false) const
145  { return myIsStringSetValid ? myIsStringSet : defval; }
146  /// Set the "string set" flag
147  void setIsStringSet(bool v)
148  {
149  myIsStringSetValid = true;
150  myIsStringSet = v;
151  }
152 
153  /// @{
154  /// Access to options
155  const UT_Options *options() const { return myOptions; }
156  void setOptions(const UT_Options &o);
157  void mergeOptions(const UT_Options &o);
158  void mergeOptions(const UT_Options &o,
159  bool (*match)(const UT_StringHolder &name,
160  const UT_OptionEntry *, void *),
161  void *data);
162  void clearOptions();
163  bool removeOption(const char *name);
164  /// @}
165 
166 private:
167  // Our custom options.
168  UT_Options *myOptions;
169 
170  GA_TypeInfo myTypeInfo;
171 
172  bool myIsNonTransforming : 1;
173  bool myExportOnMergeValid : 1, myExportOnMerge : 1;
174  bool myExportOnSaveValid : 1, myExportOnSave : 1;
175 
176  bool myIsStringSetValid : 1, myIsStringSet : 1;
177 
178  bool myExportToInfoBlock : 1;
179  bool myLeaveOnGPU : 1;
180 
181  bool myDetached : 1;
182 
183  friend class GA_Attribute;
184 };
185 
186 template<typename T>
187 static inline const T *GAgetAIF(const GA_Attribute &attrib)
188 {
190  return NULL;
191 }
192 
193 
194 /// @brief Definition of a geometry attribute
195 ///
196 /// An attribute can be attached to points, vertices, primitives or the detail
197 /// itself. The attribute is responsible for maintaining the data array.
198 ///
199 /// @see @ref Iterators for implications of paged allocation strategies.
200 ///
201 /// The attribute is responsible for providing interfaces (@ref AIF).
202 ///
204 {
205 public:
206  GA_Attribute(
207  const GA_AttributeType &type, const GA_IndexMap &index_map,
208  GA_AttributeScope scope, const UT_StringHolder &name);
209  virtual ~GA_Attribute();
210 
211  SYS_FORCE_INLINE const GA_AttributeType &getType() const { return myType; }
212  SYS_FORCE_INLINE const GA_IndexMap &getIndexMap() const { return myIndexMap; }
213  SYS_FORCE_INLINE const GA_Detail &getDetail() const { return myIndexMap.getDetail(); }
214  SYS_FORCE_INLINE GA_Detail &getDetail() { return myIndexMap.getDetail(); }
215  SYS_FORCE_INLINE GA_AttributeOwner getOwner() const { return myIndexMap.getOwner(); }
216 
217  SYS_FORCE_INLINE GA_AttributeScope getScope() const { return myScope; }
218  SYS_FORCE_INLINE bool isGroup() const { return myScope == GA_SCOPE_GROUP; }
219 
220  /// @{
221  /// Obtains the proxy representative used as a reference holder to this
222  /// attribute. This proxy gets invalidated when the attribute gets deleted.
223  /// Invalidation clears the proxy's pointer to NULL, but the proxy's memory
224  /// stays valid, unlike the memory of the attribute object.
226  { return GA_AttributeProxyHandle(myProxy); }
228  { return GA_ConstAttributeProxyHandle(myProxy); }
229  /// @}
230 
231  /// @{
232  /// Attribute flags store certain mutable properties of the attribute,
233  /// largely used for internal book keeping and semantic error detection
234 
235  enum AttribFlag {
236  FLAG_TAIL_INITIALIZE = 1,
237  FLAG_STREAM_ACTIVE = 2,
238  FLAG_STREAM_NOPREEXIST = 4 // Note inversion of sense!
239  };
240 
241  bool hasFlag(AttribFlag flag) const
242  { return (myAttribFlags & flag) ? true : false; }
243 
244  void setFlag(AttribFlag flag, bool onoff)
245  {
246  if (onoff)
247  myAttribFlags |= (int)flag;
248  else
249  myAttribFlags &= ~(int)flag;
250  }
251 
252  /// @}
253 
254  /// Uses the "type" option to determine type information
255  /// @see getOptions()
258  {
259  return myOptions.myTypeInfo;
260  }
261 
262  /// Set the option. This sets the "type" option on the attribute
263  /// @see getOptions()
266  {
267  myOptions.myTypeInfo = type;
268  }
269 
270  /// Checks if an attribute should be treated as a texture coordinate attribute.
271  /// Ideally, we could rely on the type info being GA_TYPE_TEXTURE_COORD,
272  /// but old files don't have this, and various importers don't set this.
273  /// If a float[3] (optionnally float[2]) attribute's name starts with "uv"
274  /// and is followed by zero or more digits (and nothing else), it's probably
275  /// safe to assume that it should be treated as a texture attribute.
276  bool shouldInterpretAsTexCoord(bool allow_float2=false) const;
277 
278  /// Returns the approximate type of the attribute
279  GA_StorageClass getStorageClass() const;
280 
281  /// Size of the AIFTuple, if it exists. If it doesn't, 1.
282  int getTupleSize() const;
283 
284  /// Whether this is an array attribute, ie, a ragged number of
285  /// values per element.
286  bool getIsArray() const;
287 
288  // Methods to get intrinsic data
289  // getName() returns the unprefixed name (as opposed to getFullName())
290  // We have separate const char * versions as this is often passed
291  // to sprintf().
292  SYS_FORCE_INLINE const UT_StringHolder &getName() const { return myName; }
293  SYS_FORCE_INLINE const UT_StringHolder &getFullName() const { return myName; }
294 
295  /// The data ID is shared by attributes that represent the same underlying
296  /// data and is used by cache mechanisms to avoid rebuilding when data has
297  /// not really changed. An ID of -1 indicates that this attribute is not
298  /// going to get a new ID when its data is changed, and therefore is not
299  /// participating in this scheme.
300  ///
301  /// Two attributes can share the same data ID even when they don't share
302  /// the same internal data pages or even fragmentation patterns. Note
303  /// however that the data ID is not necessarily changed for topology
304  /// changes, so it is necessary to also compare topology data IDs in order
305  /// to be absolutely sure that two attributes sharing the same data ID
306  /// represent the same data (taking into account defragmentation).
308  GA_DataId getDataId() const { return myDataId; }
311  {
312  myDataId = nextDataId();
313  }
315  void bumpDataId()
316  {
317  if (myDataId != GA_INVALID_DATAID)
318  assignNewDataId();
319  }
321  void clearDataId() { myDataId = GA_INVALID_DATAID; }
322 
323  /// This clones the data ID from src. If src has an invalid data ID,
324  /// which can be the case for details not created by SOP_Node or
325  /// SIM_GeometryCopy, we default to bumping the destination data ID.
326  /// This should be used by functions like GA_Attribute::replace()
327  /// when an attribute's data is replaced with that of src.
328  ///
329  /// NOTE: We must always either clone or bump the data ID if we've
330  /// copied from another attribute, even if that src attribute
331  /// has an invalid data ID. See Bug 79446 and 79438.
333  void cloneDataId(const GA_Attribute &src,
334  bool allow_clear = false)
335  {
336  if (allow_clear || src.myDataId != -1)
337  myDataId = src.myDataId;
338  else
339  bumpDataId();
340  }
341  /// NOTE: Just call cloneDataId(src).
344  bool allow_clear = false)
345  {
346  cloneDataId(src, allow_clear);
347  }
348 
349  /// The method to set array size
350  /// *Must* be implemented in subclasses
351  /// Return true if the attribute was resized.
352  virtual bool setArraySize(GA_Offset size) = 0;
353 
354  /// Try to compress data pages
355  /// Will try to compress *all* pages overlapping the specified offset range.
356  /// *Must* be implemented in subclasses
357  virtual void tryCompressAllPages(
358  GA_Offset start_offset = GA_Offset(0),
359  GA_Offset end_offset = GA_INVALID_OFFSET) = 0;
360 
361  /// Harden data pages
362  /// Will harden *all* pages overlapping the specified offset range.
363  /// Once this is done, multiple threads can write to an attribute in
364  /// parallel at a finer granularity than pages.
365  /// *Must* be implemented in subclasses
366  virtual void hardenAllPages(
367  GA_Offset start_offset = GA_Offset(0),
368  GA_Offset end_offset = GA_INVALID_OFFSET) = 0;
369 
370  /// The various concurrency levels supported by attributes for writing
371  /// per-element data.
373  /// No concurrent writes supported.
375  /// Concurrent writes to separate pages supported.
377  /// Concurrent writes to separate elements supported.
378  WRITE_CONCURRENCE_ELEMENT
379  };
380 
381  virtual WriteConcurrence getSupportedWriteConcurrence() const = 0;
382 
383  /// Return the attribute's copy interface or NULL
384  virtual const GA_AIFCopyData *getAIFCopyData() const;
385  /// Return the attribute's delta interface or NULL
386  virtual const GA_AIFDelta *getAIFDelta() const;
387  /// Return the attribute's tuple interface or NULL
388  virtual const GA_AIFTuple *getAIFTuple() const;
389  /// Return the attribute's math interface or NULL
390  virtual const GA_AIFMath *getAIFMath() const;
391  /// Return the attribute's merge interface or NULL
392  virtual const GA_AIFMerge *getAIFMerge() const;
393  /// Return the attribute's interpolation interface or NULL
394  virtual const GA_AIFInterp *getAIFInterp() const;
395  /// Return the attribute's blob interface or NULL
396  virtual const GA_AIFBlob *getAIFBlob() const;
397  /// Return the attribute's blob array interface or NULL
398  virtual const GA_AIFBlobArray *getAIFBlobArray() const;
399  /// Return the attribute's string tuple interface or NULL
400  virtual const GA_AIFStringTuple *getAIFStringTuple() const;
401  /// Return the attribute's shared string tuple interface or NULL
402  virtual const GA_AIFSharedStringTuple *getAIFSharedStringTuple() const;
403  /// Return the attribute's shared string array interface or NULL
404  virtual const GA_AIFSharedStringArray *getAIFSharedStringArray() const;
405  /// Return the attribute's shared options tuple interface or NULL
406  virtual const GA_AIFSharedDictTuple *getAIFSharedDictTuple() const;
407  /// Return the attribute's shared options tuple interface or NULL
408  virtual const GA_AIFSharedDictArray *getAIFSharedDictArray() const;
409  /// Return the attribute's index pair interface or NULL
410  virtual const GA_AIFIndexPair *getAIFIndexPair() const;
411  /// Return the attribute's blind data interface or NULL
412  virtual const GA_AIFBlindData *getAIFBlindData() const;
413  /// Return the attribute's edit interface or NULL
414  virtual const GA_AIFEdit *getAIFEdit() const;
415  /// Return the attribute's comparison interface or NULL
416  virtual const GA_AIFCompare *getAIFCompare() const;
417  /// Return the attribute's arraydata interface or NULL
418  virtual const GA_AIFNumericArray *getAIFNumericArray() const;
419 
420  /// Return the attribute's stat interface. Unlike other interfaces, this
421  /// method has default behaviour.
422  virtual const GA_AIFStat *getAIFStat() const;
423 
424  /// Generic method for getting an AIF by type
425  template <typename T> const T *getAIF() const { return GAgetAIF<T>(*this); }
426 
427  // Options can be used to associated arbitrary data with an attribute.
428  // Common options are defined in GA_Options.h
429  const GA_AttributeOptions &getOptions() const { return myOptions; }
430  GA_AttributeOptions &getOptions() { return myOptions; }
431 
432  /// Although an attribute may be a "point" or "normal", we may not want to
433  /// transform the point. This is the case with "rest" for example.
434  /// At the current time, this sets the flag corresponding with
435  /// "attribute:non_transforming" in the options.
436  /// @see needsTransform()
437  /// @see getTypeInfo()
439  {
440  myOptions.setIsNonTransforming(val);
441  }
442 
443  /// needTransform() checks whether the attribute is a
444  /// floating-point attribute whose type info is a transforming
445  /// type and whose non-transforming flag is false.
446  bool needsTransform(bool include_P = true) const
447  {
448  return getStorageClass() == GA_STORECLASS_FLOAT
449  && !myOptions.isNonTransforming()
450  && GAisTransformingType(getTypeInfo())
451  && (include_P || strcmp(getName(), "P") != 0);
452  }
453 
454  bool isDetached() const
455  {
456  return myOptions.myDetached;
457  }
458 
459  /// @{
460  /// Houdini forces certain restrictions on attribute names. However,
461  /// external software doesn't always have these restrictions. When
462  /// importing attributes, you can store the "real" attribute name, or use
463  /// the "export" name when exporting.
464  ///
465  /// @c getExportName() will return the attribute name if there's no export
466  /// name set.
467  void setExportName(const char *external_name);
468  bool hasExportName() const;
469  std::string getExportName() const;
470  /// @}
471 
472  /// Merge the options passed in with the options in the attribute
474  { myOptions.mergeOptions(src); }
475 
476  // Check to see the value of a specific option
477  bool importOption(const char *name, int &v) const;
478  bool importOption(const char *name, bool &v) const;
479  bool importOption(const char *name, fpreal32 &v) const;
480  bool importOption(const char *name, fpreal64 &v) const;
481  bool importOption(const char *name, UT_String &v) const;
482 
483  /// Methods which can be overridden from GA_Attribute
484 
485  /// Element destruction event. When an element is destroyed, the attribute
486  /// may be notified of this event.
487  virtual bool needDestruction() const;
488  /// Callback invoked if needsDestruction() returns true
489  virtual void destructElement(GA_Offset offset);
490 
491  /// The GA library expects any elements allocated at the end of the array
492  /// to be set to their default values. If this is not the case, then the
493  /// attribute can register itself for special initialization.
494  void setTailInitialization(bool onoff);
495 
496  /// Check whether the attribute is set to tail initialization
497  bool isTailInitialization() const
498  { return hasFlag(FLAG_TAIL_INITIALIZE); }
499 
500  /// When the array size is grown, attributes should initialize the value
501  /// appropriately. When an element is reused, however, the
502  /// reconstructElement is called. This happens if an element is deleted
503  /// then a new element is allocated (using the existing slot)
505  { reconstructElementBlock(offset, GA_Offset(1)); }
506 
507  /// When the array size is grown, attributes should initialize the value
508  /// appropriately. When elements are reused, however,
509  /// reconstructElementBlock is called. This happens if an element is
510  /// deleted and then a new element is allocated (using the existing slot)
511  virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements) = 0;
512 
513  /// A method to "compact" any storage. For example, if there's a string
514  /// table associated with the attribute, this gives the attribute the option
515  /// to adjust the table to be more compact.
516  virtual void compactStorage();
517 
518  /// This method is called before a batch deletion operation. It allows the
519  /// attribute to mark objects as dirty so that there can be lazy computation
520  /// of data. For example, re-computing the number of elements in a group.
521  /// This method may be called multiple times, and so should typically just
522  /// set a flag (not perform a lot of computation).
523  virtual void batchDeletion();
524 
525  /// This method returns a new attribute of the same type with identical
526  /// settings. Attribute data is not copied. Derived classes implement
527  /// this method by overriding the virtual doClone(). Those classes not
528  /// supporting cloning are permitted to return NULL.
529  GA_Attribute *clone(const GA_IndexMap &index_map,
530  const UT_StringHolder &name,
531  bool clone_options) const;
532 
533  /// @section JSON-GA_Attribute JSON Schema: GA_Attribute
534  ///
535  /// The schema for an attribute consists of an array of two items. The
536  /// first entry contains of the definition of the attribute. The second
537  /// entry is the "private" data for the attribute. If there is no data for
538  /// the attribute (i.e. the attribute doesn't provide an AIFJSON), then a
539  /// null will be saved as the second element.
540  ///
541  /// The private data is saved/loaded by the GA_AIFJSON class for the
542  /// attribute.
543  ///
544  /// @code
545  /// [
546  /// "name" : "GA_Attribute",
547  /// "description" :
548  /// "An attribute is defined by an array with two items. The
549  /// first item is the definition of the attribute, the second
550  /// is private data associated with the attribute (may be null).",
551  /// "type" : "array",
552  /// "items" : [
553  /// { "$ref" : "GA_Attribute-Definition" }, // Attribute Definition
554  /// { "$ref" : "GA_Attribute-Data" }, // Specific type data
555  /// ],
556  /// ]
557  /// @endcode
558  ///
559  /// @section JSON-GA_Attribute-Definition JSON Schema: GA_Attribute-Definition
560  /// The attribute definition is a map containing the fields required to
561  /// recreate the attribute.
562  /// @code
563  /// {
564  /// "name" : "GA_Attribute-Definition",
565  /// "description" : "An map defining the attribute",
566  /// "type" : "orderedmap",
567  /// "properties": {
568  /// "scope": {
569  /// "type" : "string",
570  /// "optional" : true,
571  /// "default" : "public",
572  /// "description" : "Scope of the attribute",
573  /// },
574  /// "type": {
575  /// "type" : "string",
576  /// "description" : "Attribute type (ATI name)",
577  /// },
578  /// "name": {
579  /// "type" : "string",
580  /// "description" : "Name of the attribute",
581  /// },
582  /// "version": {
583  /// "type" : "integer",
584  /// "optional" : true,
585  /// "description" : "Version level for save",
586  /// },
587  /// "options": {
588  /// "type" : { "$ref" : "UT_Options" }
589  /// "description" : "Arbitrary options on the attribute",
590  /// },
591  /// },
592  /// }
593  /// @endcode
594  /// @see @ref JSON_FileFormat, GA_AttributeSet, GA_AttributeType
595 
596  /// Save the GA_Attribute-Definition section
597  bool jsonSaveDefinition(UT_JSONWriter &w) const;
598 
599  /// Load the GA_Attribute-Definition section
600  static bool jsonLoadDefinition(UT_JSONParser &p,
601  GA_AttributeScope &scope,
602  UT_WorkBuffer &type,
603  UT_WorkBuffer &name,
604  int64 &version,
605  GA_AttributeOptions &options);
606 
607  /// Return the AIF to handle saving/loading of the private data section
608  virtual const GA_AIFJSON *getAIFJSON() const;
609 
610  /// Return the optional "save" version number. This is passed to the JSON
611  /// attribute loader. If the version is <= 0, the version is not saved to
612  /// the file and 0 will be passed to the loader.
613  virtual int getSaveVersion() const;
614 
615  /// Debug validation of allocated array size
616  virtual bool debugValidateArrayCapacity(GA_Offset sz) const;
617 
618  /// Report the memory usage
619  ///
620  /// NOTE: If you're implementing this in a direct subclass of GA_Attribute,
621  /// call getBaseMemoryUsage() to get the amount of memory in the base
622  /// class. If in a more distant descendant class, call
623  /// Base::getMemoryUsage(false) to count the memory in Base and
624  /// above, excluding sizeof(Base).
625  virtual int64 getMemoryUsage(bool inclusive) const = 0;
626  virtual int64 getDeviceMemoryUsage() const;
627 
628  /// Count memory usage using a UT_MemoryCounter in order to count
629  /// shared memory correctly.
630  /// If inclusive is true, the size of this object is counted,
631  /// else only memory owned by this object is counted.
632  /// If this is pointed to by the calling object, inclusive should be true.
633  /// If this is contained in the calling object, inclusive should be false.
634  /// (Its memory was already counted in the size of the calling object.)
635  ///
636  /// NOTE: If you're implementing this in a direct subclass of GA_Attribute,
637  /// call getBaseMemoryUsage() to get the amount of memory in the base
638  /// class. If in a more distant descendant class, call
639  /// Base::countMemory(counter, false) to count the memory in Base and
640  /// above, excluding sizeof(Base).
641  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const = 0;
642 
643  /// @{
644  /// @c defragment() defragments the memory used to store data elements
645  virtual void defragment(const GA_Defragment &defrag) = 0;
646  /// @}
647 
648  /// @private
649  /// Used only for optimizing merging of attributes
650  const GA_Attribute *getMergeSource() const { return myMergeSource; }
651 
652  /// This is only here so that select data outside of GA_Attribute
653  /// can also have data IDs, like GA_PrimitiveList and GA_EdgeGroup.
654  static GA_DataId nextDataId();
655 
656  /// @{
657  /// The attribute data may be moved to the GPU, and hence backed
658  /// by a compute buffer (GA_CEAttribute). Flushing will delete
659  /// our buffer & copy it back from the GPU if it has been marked
660  /// as modified.
661 
662  /// Caches a CE Attribute. If a cache already exists, the cached
663  /// data is returned and the write flag updated. If the cache
664  /// does not exist, an attempt is made to build a buffer. If
665  /// read is true, the buffer is initialized with the geometry data.
666  /// This can return NULL if a failure to build an attribute occurs
667  /// (for example, unsupported type or no GPU)
669  bool isarray, bool read, bool write)
670  { return getCEAttribute(storage, GA_PRECISION_32, tuplesize, isarray,
671  read, write); }
674  int &tuplesize, bool isarray,
675  bool read, bool write);
676 
677  /// Caches a CE Attribute onto this GA_Attribute and binds a GPU
678  /// accessor to it. If not null; has successfully created GPU
679  /// buffers with the provided access pattern.
680  /// NOTE: The GA_CEAttributeAccessor should have its lifetime go until
681  /// *after* the kernel has been dispatched.
683  bool isarray, bool read, bool write)
684  { return getCEAttributeAccessor(storage, GA_PRECISION_32, tuplesize, isarray,
685  read, write); }
687  bool isarray)
688  { return getCEAttributeAccessor(storage, GA_PRECISION_32, tuplesize, isarray,
689  true, false); }
691  bool isarray)
692  { return getCEAttributeAccessor(storage, GA_PRECISION_32, tuplesize, isarray,
693  false, true); }
695  bool isarray)
696  { return getCEAttributeAccessor(storage, GA_PRECISION_32, tuplesize, isarray,
697  true, true); }
698  GA_CEAttributeAccessorPtr getCEAttributeAccessor(GA_StorageClass storage,
700  int &tuplesize, bool isarray,
701  bool read, bool write);
702 
703  /// Returns the existing GA_CEAttribute only if one already is bound.
704  GA_CEAttributePtr getCEAttribute() const;
705 
706  /// Returns true if a CEAttribute has been cached and also matches
707  /// the provided configuration
708  bool hasCEAttribute(GA_StorageClass storage,
710  int tuplesize,
711  bool isarray) const;
712 
713  /// Replace any cached CE Attribute with the provided one.
714  /// Will set the WriteBack flag unless "leave_on_gpu" is set.
715  /// Leave on gpu also prevents any write-backs from occurring even
716  /// if the attribute is bound for writing later.
717  /// This GA_Attribute now has ownership of the ceattrib.
718  void setCEAttribute(GA_CEAttributePtr ceattrib, bool leave_on_gpu=false);
719 
720  /// Any CE cache which was marked as written to will be copied
721  /// back to the CPU. It will be left on the GPU, however.
722  void flushCEWriteCaches(bool clearwriteback=true);
723  bool hasPendingCEWriteBack() const;
724 
725  /// Remove all CE Caches, copying back any marked as written to.
726  void flushCECaches();
727 
728  /// Remove all CE caches, without copying back any data.
729  void clearCECaches();
730 
731  /// Steal the CE attribute from the source attribute, leaving the
732  /// src with a null CE attribute.
733  /// NOTE: this is only safe to call immediately after calling replace.
734  void stealCEAttribute(const GA_Attribute &src);
735 
736  /// Copy the CE attribute from the source attribute, sharing its buffers.
737  /// NOTE: this is only safe to call immediately after calling replace.
738  void copyCEAttribute(const GA_Attribute &src);
739  /// @}
740 
741  /// @{
742  /// During streaming operations it can be important to flag which
743  /// attributes are in the process of being modified. This way
744  /// attempts to random-access read them can be detected and thwarted
745  /// as they won't be valid.
746 
747  /// Is this attribute is currently being streamed? No random
748  /// reads should be done to this attribute. Default is that
749  /// it is not streaming.
750  bool isActivelyStreamed() const
751  { return hasFlag(FLAG_STREAM_ACTIVE); }
752 
753  void setActivelyStreamed(bool isstreaming)
754  { setFlag(FLAG_STREAM_ACTIVE, isstreaming); }
755 
756  /// Was this attribute created as a result of the stream operation?
757  /// This allows detection of attributes that only exist as a result
758  /// of the stream beginning. Default is that it existed.
759  bool existedPriorToStream() const
760  { return !hasFlag(FLAG_STREAM_NOPREEXIST); }
761 
762  void setExistedPriorToStream(bool preexisted)
763  { setFlag(FLAG_STREAM_NOPREEXIST, !preexisted); }
764  /// @}
765 
766 protected:
767  /// For use by getMemoryUsage and countMemory in subclasses to count the
768  /// amount of memory used by this base class (NOTE: *always* exclusive)
769  int64 getBaseMemoryUsage() const;
770 
771  /// Only called by GA_AttributeSet and GA_ElementGroup
772  void setDetached(bool detached)
773  {
774  myOptions.myDetached = detached;
775  }
776 
777  /// Determine if we should overwrite our attribute on merge, off for
778  /// detail attributes so the first will win.
779  static bool checkGlobalOverwrite(const GA_MergeMap &map, const GA_Attribute *attrib);
780 
781 private:
782  /// Method called by the GA_AttributeType::create() factory method to
783  /// initialize the object by calling virtual overrides not accessible
784  /// in our constructor.
785  void initialize();
786 
787  /// Create a new attribute of this type.
788  virtual GA_Attribute *doClone(const GA_IndexMap &index_map,
789  const UT_StringHolder &name) const;
790 
793  const UT_StringHolder &,
794  const UT_Options *,
795  const GA_AttributeOptions *) const;
796 
797  /// @{
798  /// @private
799  /// Only called by GA_AttributeSet and GA_ElementGroup.
800  bool setName(const UT_StringHolder &newname);
801  void setProxy(GA_AttributeProxy *proxy);
802  friend class GA_AttributeSet;
803  friend class GA_ElementGroup;
804  friend class GA_MergeMap;
805  /// @}
806 
807 public:
808 
809  /// Returns true iff that is an attribute whose content can be copied
810  /// from this without any type conversions. This is important to
811  /// avoid reallocation of an attribute if its storage type,
812  /// including tuple size, matches the source attribute exactly.
813  /// Subclasses should call this first and return false if
814  /// this returns false.
815  virtual bool matchesStorage(const GA_Attribute *that) const
816  {
817  if (that == NULL)
818  return false;
819  if (getType().getTypeId() != that->getType().getTypeId())
820  return false;
821  return true;
822  }
823  /// In the case that we're copying from an attribute whose storage
824  /// type matches this exactly, this function copies the metadata
825  /// not associated with the storage, e.g. myOptions,
826  /// *excluding* the name and the data ID.
827  /// The attribute class of that must match the attribute class of that.
828  /// Subclasses must call this.
829  virtual void copyNonStorageMetadata(const GA_Attribute *that)
830  {
831  // NOTE: We shouldn't change myScope or myOptions.myDetached.
832  // For example, if we replace the contents of a private or
833  // detached attribute with those of a public one, it shouldn't
834  // (and can't) become public.
835  // myScope is more an indication of where the *detail* is keeping
836  // track of this attribute, (or not tracking, for detached.)
837  bool detached = myOptions.myDetached;
838  myOptions = that->myOptions;
839  myOptions.myDetached = detached;
840 
841  // NOTE: DO NOT set tail initialization here! This is just an
842  // indication of whether there may be data at non-default values
843  // past myIndexMap.myMaxTouchedOffset.
844  // This should be copied in the implementations of replace(),
845  // instead, since that's associated with referencing the data.
846  //setTailInitialization(that->isTailInitialize());
847  }
848 
849  /// This replaces the entirety of this attribute's content and non-
850  /// storage metadata (except the name) with that of the src attribute.
851  /// matchesStorage(src) should already return true.
852  /// This is primarily for use by GA_AttributeSet::replace().
853  /// NOTE: The internal content sizes may not match exactly if the
854  /// attribute type may overallocate, but the sizes should be such
855  /// that any real data will fit in the destination, so be careful
856  /// and deal with the myTailInitialize flag appropriately if
857  /// any extra elements aren't equal to the default.
858  virtual void replace(const GA_Attribute &src) = 0;
859 
860  /// Copy attribute values for a single element.
861  /// NOTE: The default implementation just tries to use GA_AIFCopyData,
862  /// incurring 2 more virtual calls!
863  /// @{
864  virtual bool copy(GA_Offset desti, GA_Offset srci)
865  { return copy(desti, *this, srci); }
866  virtual bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci);
867  /// @}
868 
869  /// Copy attribute values for a range of elements.
870  /// NOTE: The default implementation just tries to use GA_AIFCopyData,
871  /// incurring 2 more virtual calls!
872  /// WARNING: These do not support overlapping ranges within a single attribute!
873  /// @{
874  virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange)
875  { return copy(destrange, *this, srcrange); }
876  virtual bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange);
877  /// @}
878 
879  /// Assign all elements of a range from a single attribute value.
880  /// NOTE: The default implementation just tries to use GA_AIFCopyData,
881  /// incurring 2 more virtual calls, falling back on calling copy() for
882  /// each element in the destination range, which incurs the cost of the
883  /// virtual call for each!
884  /// @{
885  virtual bool fill(const GA_Range &destrange, GA_Offset srci)
886  { return fill(destrange, *this, srci); }
887  virtual bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci);
888  /// @}
889 private:
890  const GA_AttributeType &myType;
891  const GA_IndexMap &myIndexMap; // For mapping
892  UT_StringHolder myName; // Unprefixed name
893  GA_AttributeScope myScope; // Public or private
894  GA_AttributeOptions myOptions; // Attribute options
895  GA_AttributeProxy *myProxy; // representative referencer
896  int64 myDataId;
897  const GA_Attribute *myMergeSource; // Needed to optimize merging
898  int myAttribFlags;
899  mutable GA_CEAttributePtr myCEAttribute; // OpenCL Backing.
900  mutable bool myCEAttributeBuilt;
901 };
902 
903 #define GA_GET_AIF_SPECIALIZATION(AIF_NAME) \
904  template <> SYS_STATIC_INLINE const GA_##AIF_NAME * \
905  GAgetAIF(const GA_Attribute &attrib) { return attrib.get##AIF_NAME(); } \
906  /**/
907 GA_GET_AIF_SPECIALIZATION(AIFCopyData)
912 GA_GET_AIF_SPECIALIZATION(AIFInterp)
914 GA_GET_AIF_SPECIALIZATION(AIFBlobArray)
915 GA_GET_AIF_SPECIALIZATION(AIFStringTuple)
916 GA_GET_AIF_SPECIALIZATION(AIFSharedDictTuple)
917 GA_GET_AIF_SPECIALIZATION(AIFSharedDictArray)
918 GA_GET_AIF_SPECIALIZATION(AIFSharedStringTuple)
919 GA_GET_AIF_SPECIALIZATION(AIFSharedStringArray)
920 GA_GET_AIF_SPECIALIZATION(AIFIndexPair)
921 GA_GET_AIF_SPECIALIZATION(AIFBlindData)
923 GA_GET_AIF_SPECIALIZATION(AIFCompare)
924 GA_GET_AIF_SPECIALIZATION(AIFNumericArray)
925 #undef GA_GET_AIF_SPECIALIZATION
926 
927 /// @brief Automatically expand attribute data pages for threading
928 ///
929 /// Normally, threading is allowed only if each thread is guaranteed to write
930 /// to an individual page of data. Not all algorithms are amenable to this
931 /// constraint. Using the GA_AutoThreadExpand class will force the attribute
932 /// to harden all its data pages so that multiple threads can write across page
933 /// boundaries. Multiple threads are still prohibited from writing to the same
934 /// offset. In its destructor, the class will automatically call the compress
935 /// method to regain memory efficiency. For example: @code
936 /// void process(GA_RWAttributeRef &write, GA_ROAttributeRef &read)
937 /// {
938 /// GA_AutoHardenForThreading thread_write(*write.getAttribute());
939 /// // There's no need to harden the read-only attribute, but now that
940 /// // we've hardened the write attribute, our threaded algorithm is able
941 /// // to write data across page boundaries.
942 /// UTparallelFor(range, functor(write, read));
943 /// }
944 /// @endcode
946 {
947 public:
949  GA_Offset start_offset = GA_Offset(0),
950  GA_Offset end_offset = GA_INVALID_OFFSET)
951  : myAttribute(attribute)
952  , myStart(start_offset)
953  , myEnd(end_offset)
954  {
955  // Group-scoped attributes aren't thread safe even if hardened,
956  // so if someone is using this "For Threading" they are likely
957  // in trouble.
958  UT_ASSERT(!myAttribute.isGroup());
959  myAttribute.hardenAllPages(myStart, myEnd);
960  }
962  {
963  myAttribute.tryCompressAllPages(myStart, myEnd);
964  }
965 private:
966  GA_Attribute &myAttribute;
967  GA_Offset myStart;
968  GA_Offset myEnd;
969 };
970 
971 /// Utility for updating a data id by combining it with another.
972 /// If 'other' is negative then false is returned without any updates.
973 /// To use this for combining multiple data id's, initialize id with
974 /// -1. For example: @code
975 /// GA_DataId getDataId()
976 /// {
977 /// GA_DataId id = -1;
978 /// if (!mixDataId(id, myDataId0))
979 /// return -1;
980 /// if (!mixDataId(id, myDataId1))
981 /// return -1;
982 /// return id;
983 /// }
984 /// @endcode
985 static inline bool
986 GAcombineDataId(GA_DataId &id, GA_DataId other)
987 {
988  if (other < 0)
989  return false;
990  if (other > id)
991  id = other;
992  return true;
993 }
994 
996 
998 
999 #endif
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
type
Definition: core.h:556
UT_SharedPtr< GA_CEAttribute > GA_CEAttributePtr
Definition: GA_Attribute.h:56
UT_UniquePtr< const GA_Attribute > GA_ConstAttributeUPtr
Definition: GA_Attribute.h:997
GA_CEAttributeAccessorPtr getCEAttributeAccessorR(GA_StorageClass storage, int &tuplesize, bool isarray)
Definition: GA_Attribute.h:686
SYS_FORCE_INLINE void bumpDataId()
Definition: GA_Attribute.h:315
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
SYS_FORCE_INLINE const GA_Detail & getDetail() const
Definition: GA_Attribute.h:213
Definition of a geometry attribute.
Definition: GA_Attribute.h:203
Generic Attribute Interface class to access an attribute as a array.
Generic Attribute Interface class to get/set data as index pairs.
virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange)
Definition: GA_Attribute.h:874
SYS_FORCE_INLINE GA_Detail & getDetail()
Definition: GA_Attribute.h:214
void setTypeInfo(GA_TypeInfo t)
Definition: GA_Attribute.h:105
UT_IntrusivePtr< GA_AttributeProxy > GA_AttributeProxyHandle
UT_IntrusivePtr< const GA_AttributeProxy > GA_ConstAttributeProxyHandle
A specialization of GA_AIFDictTuple to access "shared strings".
bool exportOnSave(bool defval=false) const
Definition: GA_Attribute.h:133
GA_StorageClass
Definition: GA_Types.h:75
getFileOption("OpenEXR:storage") storage
Definition: HDK_Image.dox:276
Attribute Interface class to perform numeric operations on attributes.
Definition: GA_AIFMath.h:88
int64 GA_DataId
Definition: GA_Types.h:703
const GLdouble * v
Definition: glcorearb.h:837
GA_Precision
Definition: GA_Types.h:91
SYS_FORCE_INLINE const GA_IndexMap & getIndexMap() const
Definition: GA_Attribute.h:212
GA_CEAttributeAccessorPtr getCEAttributeAccessor(GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
Definition: GA_Attribute.h:682
GA_Attribute * create(const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, const UT_Options *creation_options, const GA_AttributeOptions *attribute_options) const
Attribute Interface for accessing generic blob data.
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
GA_CEAttributeAccessorPtr getCEAttributeAccessorW(GA_StorageClass storage, int &tuplesize, bool isarray)
Definition: GA_Attribute.h:690
void setExportOnMerge(bool v)
Set the export on merge flag.
Definition: GA_Attribute.h:122
void setExportOnSave(bool v)
Set the export on save flag.
Definition: GA_Attribute.h:136
SYS_FORCE_INLINE GA_AttributeScope getScope() const
Definition: GA_Attribute.h:217
bool hasFlag(AttribFlag flag) const
Definition: GA_Attribute.h:241
void setExportToInfoBlock(bool v)
Definition: GA_Attribute.h:109
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
#define GA_API
Definition: GA_API.h:14
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:39
void setExistedPriorToStream(bool preexisted)
Definition: GA_Attribute.h:762
#define GA_INVALID_DATAID
Definition: GA_Types.h:704
virtual bool matchesStorage(const GA_Attribute *that) const
Definition: GA_Attribute.h:815
SYS_FORCE_INLINE int getTypeId() const
float fpreal32
Definition: SYS_Types.h:200
FMT_NOINLINE FMT_CONSTEXPR auto fill(OutputIt it, size_t n, const fill_t< Char > &fill) -> OutputIt
Definition: format.h:1860
SYS_FORCE_INLINE const GA_AttributeType & getType() const
Definition: GA_Attribute.h:211
No concurrent writes supported.
Definition: GA_Attribute.h:374
#define GA_INVALID_OFFSET
Definition: GA_Types.h:694
GA_CEAttributePtr getCEAttribute(GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
Definition: GA_Attribute.h:668
A range of elements in an index-map.
Definition: GA_Range.h:42
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
SYS_FORCE_INLINE const UT_StringHolder & getName() const
Definition: GA_Attribute.h:292
SYS_FORCE_INLINE GA_ConstAttributeProxyHandle getProxy() const
Definition: GA_Attribute.h:227
double fpreal64
Definition: SYS_Types.h:201
GA_Size GA_Offset
Definition: GA_Types.h:653
SYS_FORCE_INLINE void cloneDataId(const GA_Attribute &src, bool allow_clear=false)
Definition: GA_Attribute.h:333
virtual bool fill(const GA_Range &destrange, GA_Offset srci)
Definition: GA_Attribute.h:885
void setFlag(AttribFlag flag, bool onoff)
Definition: GA_Attribute.h:244
GA_AttributeScope
Definition: GA_Types.h:148
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
GLintptr offset
Definition: glcorearb.h:665
Attribute Interface for accessing generic blob data.
Definition: GA_AIFBlob.h:39
Automatically expand attribute data pages for threading.
Definition: GA_Attribute.h:945
SYS_FORCE_INLINE bool isGroup() const
Definition: GA_Attribute.h:218
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
Attribute Interface for merging attribute data between details.
Definition: GA_AIFMerge.h:56
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
This class holds a reference to an attribute. Such an indirection level allows an easy way to invalid...
const UT_Options * options() const
Definition: GA_Attribute.h:155
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
bool needsTransform(bool include_P=true) const
Definition: GA_Attribute.h:446
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
UT_SharedPtr< const GA_CEAttribute > GA_CEAttributeConstPtr
Definition: GA_Attribute.h:57
Class to fill GA_Stat information about an attribute. This AIF is used to fill GA_Stat type informati...
Definition: GA_AIFStat.h:30
A specialization of GA_AIFStringArray to access "shared strings".
GA_AutoHardenForThreading(GA_Attribute &attribute, GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)
Definition: GA_Attribute.h:948
void mergeOptions(const GA_AttributeOptions &src)
Merge the options passed in with the options in the attribute.
Definition: GA_Attribute.h:473
long long int64
Definition: SYS_Types.h:116
Attribute Interface class to perform comparisons on attributes.
Definition: GA_AIFCompare.h:27
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
void setLeaveOnGPU(bool v)
Definition: GA_Attribute.h:111
GLuint const GLchar * name
Definition: glcorearb.h:786
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
SYS_FORCE_INLINE GA_DataId getDataId() const
Definition: GA_Attribute.h:308
GA_AttributeOptions & getOptions()
Definition: GA_Attribute.h:430
SYS_FORCE_INLINE GA_AttributeProxyHandle getProxy()
Definition: GA_Attribute.h:225
virtual void copyNonStorageMetadata(const GA_Attribute *that)
Definition: GA_Attribute.h:829
GA_TypeInfo
Definition: GA_Types.h:105
GLdouble t
Definition: glad.h:2397
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
Definition: GA_Attribute.h:995
#define GA_GET_AIF_SPECIALIZATION(AIF_NAME)
Definition: GA_Attribute.h:903
bool exportToInfoBlock() const
Definition: GA_Attribute.h:108
GT_API const UT_StringHolder version
UT_SharedPtr< GA_CEAttributeAccessor > GA_CEAttributeAccessorPtr
Definition: GA_Attribute.h:59
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
SYS_FORCE_INLINE const UT_StringHolder & getFullName() const
Definition: GA_Attribute.h:293
SYS_FORCE_INLINE void clearDataId()
Definition: GA_Attribute.h:321
GLsizeiptr size
Definition: glcorearb.h:664
GA_AttributeOwner
Definition: GA_Types.h:35
A map of string to various well defined value types.
Definition: UT_Options.h:87
bool exportOnMergeSet() const
Definition: GA_Attribute.h:116
void setDetached(bool detached)
Only called by GA_AttributeSet and GA_ElementGroup.
Definition: GA_Attribute.h:772
void setActivelyStreamed(bool isstreaming)
Definition: GA_Attribute.h:753
SYS_FORCE_INLINE GA_TypeInfo getTypeInfo() const
Definition: GA_Attribute.h:257
bool leaveOnGPU() const
Definition: GA_Attribute.h:110
virtual bool copy(GA_Offset desti, GA_Offset srci)
Definition: GA_Attribute.h:864
void reconstructElement(GA_Offset offset)
Definition: GA_Attribute.h:504
LeafData & operator=(const LeafData &)=delete
const T * getAIF() const
Generic method for getting an AIF by type.
Definition: GA_Attribute.h:425
GA_TypeInfo typeInfo() const
Definition: GA_Attribute.h:104
bool isStringSet(bool defval=false) const
Definition: GA_Attribute.h:144
const GA_AttributeOptions & getOptions() const
Definition: GA_Attribute.h:429
A specialization of GA_AIFDictArray to access "shared strings".
A specialization of GA_AIFStringTuple to access "shared strings".
Concurrent writes to separate pages supported.
Definition: GA_Attribute.h:376
GLuint GLfloat * val
Definition: glcorearb.h:1608
Attribute Interface for blind data per element.
bool isNonTransforming() const
Definition: GA_Attribute.h:106
#define SYS_UNIMPLEMENTED_TEMPLATE(T)
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
bool exportOnSaveSet() const
Definition: GA_Attribute.h:130
bool isDetached() const
Definition: GA_Attribute.h:454
SYS_FORCE_INLINE GA_AttributeOwner getOwner() const
Definition: GA_Attribute.h:215
Container class for all geometry.
Definition: GA_Detail.h:105
Attribute Interface class to copy attribute data.
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
void setNonTransforming(bool val)
Definition: GA_Attribute.h:438
bool isTailInitialization() const
Check whether the attribute is set to tail initialization.
Definition: GA_Attribute.h:497
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:165
GA_CEAttributeAccessorPtr getCEAttributeAccessorRW(GA_StorageClass storage, int &tuplesize, bool isarray)
Definition: GA_Attribute.h:694
bool existedPriorToStream() const
Definition: GA_Attribute.h:759
SYS_FORCE_INLINE void assignNewDataId()
Definition: GA_Attribute.h:310
Attribute Interface for file I/O.
Definition: GA_AIFJSON.h:39
void setIsNonTransforming(bool v)
Definition: GA_Attribute.h:107
SYS_FORCE_INLINE void setTypeInfo(GA_TypeInfo type)
Definition: GA_Attribute.h:265
bool exportOnMerge(bool defval=false) const
Definition: GA_Attribute.h:119
AIF to record changes to attribute values.
Definition: GA_AIFEdit.h:397
SYS_FORCE_INLINE void cloneOrBumpDataId(const GA_Attribute &src, bool allow_clear=false)
NOTE: Just call cloneDataId(src).
Definition: GA_Attribute.h:343
Generic Attribute Interface class to access an attribute as a tuple.
Definition: GA_AIFTuple.h:32
Definition: format.h:1821
bool isActivelyStreamed() const
Definition: GA_Attribute.h:750
Generic Attribute Interface class to work with string indices directly, rather than string values...
GLenum src
Definition: glcorearb.h:1793
void setIsStringSet(bool v)
Set the "string set" flag.
Definition: GA_Attribute.h:147