HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_ATINumeric.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_ATINumeric.h (GA Library, C++)
7  *
8  * COMMENTS: Numeric ATI (Attribute Type Implementation)
9  */
10 
11 #pragma once
12 
13 #ifndef __GA_ATINumeric
14 #define __GA_ATINumeric
15 
16 #include "GA_API.h"
17 #include "GA_Attribute.h"
18 #define USE_PAGEARRAY_NUMERIC 1
19 #if USE_PAGEARRAY_NUMERIC
20 #include "GA_PageArray.h"
21 #else
22 #include "GA_DataArray.h"
24 #include "GA_DataArrayTuple.h"
25 #endif
26 #include "GA_Defaults.h"
27 #include "GA_AttributeType.h" // for GA_AttributeType
28 #include "GA_Range.h" // for GA_Range
29 #include "GA_Types.h" // for GA_Offset, etc
30 
31 #include <UT/UT_Assert.h>
32 #include <UT/UT_StringHolder.h>
33 #include <SYS/SYS_Inline.h> // for SYS_FORCE_INLINE
34 #include <SYS/SYS_Types.h> // for fpreal32, fpreal64, fpreal, etc
35 
36 
37 class GA_AIFCompare;
38 class GA_AIFCopyData;
39 class GA_AIFDelta;
40 class GA_AIFEdit;
41 class GA_AIFInterp;
42 class GA_AIFJSON;
43 class GA_AIFMath;
44 class GA_AIFMerge;
45 class GA_AIFTuple;
46 class GA_Defragment;
47 class GA_IndexMap;
48 class GA_LoadMap;
49 class GA_MergeMap;
50 class GA_SaveMap;
51 class UT_JSONParser;
52 class UT_JSONWriter;
53 class UT_MemoryCounter;
54 
55 
57 {
58 public:
59  static void registerType();
61  static const UT_StringHolder &getTypeName()
62  { return theAttributeType->getTypeName(); }
64  static const GA_AttributeType &getType() { return *theAttributeType; }
65 
67  static bool isType(const GA_Attribute *attrib)
68  {
69  return attrib && &attrib->getType() == theAttributeType;
70  }
72  static GA_ATINumeric *cast(GA_Attribute *attrib)
73  {
74  if (attrib && &attrib->getType() == theAttributeType)
75  return static_cast<GA_ATINumeric *>(attrib);
76  return nullptr;
77  }
79  static const GA_ATINumeric *cast(const GA_Attribute *attrib)
80  {
81  if (attrib && &attrib->getType() == theAttributeType)
82  return static_cast<const GA_ATINumeric *>(attrib);
83  return nullptr;
84  }
85 
87  const GA_IndexMap &index_map,
88  GA_AttributeScope scope,
89  const UT_StringHolder &name,
90  GA_Storage store,
91  int tuple_size,
92  const GA_Defaults &defaults);
93  virtual ~GA_ATINumeric();
94 
95  virtual int64 getMemoryUsage(bool inclusive) const;
96 
97  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
98 
99  /// @{
100  /// Interface for defragmentation
101  virtual void defragment(const GA_Defragment &defrag);
102  /// @}
103 
104  virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements);
105 
106  /// Data is paged, so concurrent writes to separate pages supported.
108  { return WRITE_CONCURRENCE_PAGE; }
109 
110  virtual const GA_AIFCopyData *getAIFCopyData() const {return myAIFCopyData;}
111  virtual const GA_AIFDelta *getAIFDelta() const { return myAIFDelta; }
112  virtual const GA_AIFEdit *getAIFEdit() const { return myAIFEdit; }
113  virtual const GA_AIFTuple *getAIFTuple() const { return myAIFTuple; }
114  virtual const GA_AIFMath *getAIFMath() const
115  { return myDoMath ? myAIFMath:myAIFNoMath; }
116  virtual const GA_AIFMerge *getAIFMerge() const { return myAIFMerge; }
117  virtual const GA_AIFInterp *getAIFInterp() const { return myAIFInterp; }
118  virtual const GA_AIFCompare *getAIFCompare() const { return myAIFCompare; }
119 
120 #if !USE_PAGEARRAY_NUMERIC
121 private:
122  class AdapterBase
123  {
124  protected:
125  static const GA_DataArray *const* getData(const GA_Attribute *atr)
126  {
127  return static_cast<const GA_ATINumeric *>(atr)->myData.getDataPtr();
128  }
129  static GA_DataArray *const* getData(GA_Attribute *atr)
130  {
131  return static_cast<GA_ATINumeric *>(atr)->myData.getDataPtr();
132  }
133  };
134  typedef GA_DataArray::directAttributeAdapter<AdapterBase> DataArrayAdapter;
135 public:
136 
137 
138 #define EACHSTORAGE(FUNC) \
139  switch (atr->getStorage()) \
140  { \
141  case GA_STORE_UINT8: \
142  return DataArrayAdapter::direct##FUNC<T, uint8>; \
143  case GA_STORE_INT8: \
144  return DataArrayAdapter::direct##FUNC<T, int8>; \
145  case GA_STORE_INT16: \
146  return DataArrayAdapter::direct##FUNC<T, int16>; \
147  case GA_STORE_INT32: \
148  return DataArrayAdapter::direct##FUNC<T, int32>; \
149  case GA_STORE_INT64: \
150  return DataArrayAdapter::direct##FUNC<T, int64>; \
151  case GA_STORE_REAL16: \
152  return DataArrayAdapter::direct##FUNC<T, fpreal16>; \
153  case GA_STORE_REAL32: \
154  return DataArrayAdapter::direct##FUNC<T, fpreal32>; \
155  case GA_STORE_REAL64: \
156  return DataArrayAdapter::direct##FUNC<T, fpreal64>; \
157  default: \
158  return 0; \
159  } \
160  /**/
161 
162 #define EACHSTORAGEFP(FUNC) \
163  switch (atr->getStorage()) \
164  { \
165  case GA_STORE_REAL32: \
166  return DataArrayAdapter::direct##FUNC<T, fpreal32>; \
167  case GA_STORE_REAL64: \
168  return DataArrayAdapter::direct##FUNC<T, fpreal64>; \
169  default: \
170  return 0; \
171  } \
172  /**/
173 #define EACHPACKING(FUNC) \
174  if (atr->getPacking() == GA_DataArrayTuple::PACK_NONE) \
175  { \
176  EACHSTORAGE(FUNC); \
177  } \
178  else if (atr->getPacking() == GA_DataArrayTuple::PACK_VECTOR3) \
179  { \
180  EACHSTORAGEFP(Vector3##FUNC); \
181  } \
182  else return 0; \
183  /**/
184 
185  template <typename T>
186  class binderScalar
187  {
188  public:
189  typedef T (*GAprobeAttribGetter)(const GA_Attribute *atr, GA_Offset, int );
190  typedef void (*GAprobeAttribSetter)(GA_Attribute *atr, GA_Offset, int, T);
191 
192  static GAprobeAttribGetter bindGetter(const GA_ATINumeric *atr)
193  { EACHPACKING(GetterScalar) }
194 
195  static GAprobeAttribSetter bindSetter(GA_ATINumeric *atr)
196  { EACHPACKING(SetterScalar) }
197 
198  static GAprobeAttribSetter bindAdder(GA_ATINumeric *atr)
199  { EACHPACKING(AdderScalar) }
200  };
201 
202  template <typename T>
203  class binderVector
204  {
205  public:
206  typedef void (*GAprobeAttribGetter)(T &value, const GA_Attribute *atr, GA_Offset);
207  typedef void (*GAprobeAttribSetter)(GA_Attribute *atr, GA_Offset, const T &);
208 
209  static GAprobeAttribGetter bindGetter(const GA_ATINumeric *atr)
210  { EACHPACKING(GetterVector) }
211 
212  static GAprobeAttribSetter bindSetter(GA_ATINumeric *atr)
213  { EACHPACKING(SetterVector) }
214 
215  static GAprobeAttribSetter bindAdder(GA_ATINumeric *atr)
216  { EACHPACKING(AdderVector) }
217  };
218 
219 #undef EACHSTORAGE
220 #undef EACHSTORAGEFP
221 #undef EACHPACKING
222 
223 #define EACHSTORAGE(FUNC) \
224  switch (atr->getStorage()) \
225  { \
226  case GA_STORE_UINT8: \
227  return DataArrayAdapter::direct##FUNC<T, TB, uint8>; \
228  case GA_STORE_INT8: \
229  return DataArrayAdapter::direct##FUNC<T, TB, int8>; \
230  case GA_STORE_INT16: \
231  return DataArrayAdapter::direct##FUNC<T, TB, int16>; \
232  case GA_STORE_INT32: \
233  return DataArrayAdapter::direct##FUNC<T, TB, int32>; \
234  case GA_STORE_INT64: \
235  return DataArrayAdapter::direct##FUNC<T, TB, int64>; \
236  case GA_STORE_REAL16: \
237  return DataArrayAdapter::direct##FUNC<T, TB, fpreal16>; \
238  case GA_STORE_REAL32: \
239  return DataArrayAdapter::direct##FUNC<T, TB, fpreal32>; \
240  case GA_STORE_REAL64: \
241  return DataArrayAdapter::direct##FUNC<T, TB, fpreal64>; \
242  default: \
243  return 0; \
244  } \
245  /**/
246 
247 #define EACHSTORAGEFP(FUNC) \
248  switch (atr->getStorage()) \
249  { \
250  case GA_STORE_REAL32: \
251  return DataArrayAdapter::direct##FUNC<T, TB, fpreal32>; \
252  case GA_STORE_REAL64: \
253  return DataArrayAdapter::direct##FUNC<T, TB, fpreal64>; \
254  default: \
255  return 0; \
256  } \
257  /**/
258 
259 #define EACHPACKING(FUNC) \
260  if (atr->getPacking() == GA_DataArrayTuple::PACK_NONE) \
261  { \
262  EACHSTORAGE(FUNC); \
263  } \
264  else if (atr->getPacking() == GA_DataArrayTuple::PACK_VECTOR3) \
265  { \
266  EACHSTORAGEFP(Vector3##FUNC); \
267  } \
268  else return 0; \
269  /**/
270 
271  template <typename T, typename TB>
272  class binderPage
273  {
274  public:
275  typedef T *(*GAprobeAttribPageGet)(GA_Attribute *atr, T *marshall, GA_Offset, int comp, bool &isconstant);
276  typedef T *(*GAprobeAttribPageGetRO)(const GA_Attribute *atr, T *marshall, GA_Offset, int comp, bool &isconstant);
277  typedef void (*GAprobeAttribPageSet)(GA_Attribute *atr, const T *marshall, GA_Offset, int comp);
278 
279  static GAprobeAttribPageGet bindGetter(GA_ATINumeric *atr)
280  { EACHPACKING(PageGetter) }
281 
282  static GAprobeAttribPageGetRO bindGetterRO(const GA_ATINumeric *atr)
283  { EACHPACKING(PageGetterRO) }
284 
285  static GAprobeAttribPageSet bindSetter(GA_ATINumeric *atr)
286  { EACHPACKING(PageSetter) }
287  };
288 
289 #undef EACHSTORAGE
290 #undef EACHSTORAGEFP
291 #undef EACHPACKING
292 #endif
293 
294  /// @section JSON-GA_ATINumeric JSON Schema: GA_ATINumeric
295  /// @code
296  /// {
297  /// "name" : "GA_ATINumeric",
298  /// "description" : "An tuple array of numeric data",
299  /// "type" : "orderedmap",
300  /// "properties": {
301  /// "size": {
302  /// "type" : "integer",
303  /// "minimum" : 1,
304  /// "description" : "Tuple size",
305  /// },
306  /// "storage": {
307  /// "type" : "string",
308  /// "description" : "Tuple storage",
309  /// "enum" : [ "uint8","int8","int16","int32","int64",
310  /// "fpreal16", "fpreal32", "fpreal64" ],
311  /// },
312  /// "defaults": {
313  /// "type" : { "$ref" : "GA_Defaults" }
314  /// "description" : "Default values",
315  /// },
316  /// "values": {
317  /// "type" : {"$ref":"GA_DataArrayTuple"},
318  /// "description" : "Numeric values.",
319  /// },
320  /// },
321  /// }
322  /// @endcode
323  /// @see @ref JSON_FileFormat
324  virtual const GA_AIFJSON *getAIFJSON() const { return myAIFJSON; }
325 
326  /// Called during JSON load
327  bool jsonLoad(UT_JSONParser &p,
328  const GA_LoadMap &map,
329  const GA_Defaults &defs,
330  int tuple_size,
332 
333  const GA_Defaults &getDefaults() const { return myDefaults; }
334 
335  int getTupleSize() const { return myData.getTupleSize(); }
336  GA_Storage getStorage() const { return myData.getStorage(); }
337 #if !USE_PAGEARRAY_NUMERIC
338  GA_DataArrayTuple::ga_Packing getPacking() const { return myData.getPacking(); }
339 #endif
340 
341  bool setTupleSize(int size);
342  bool setStorage(GA_Storage storage);
343 
344  /// Checks if an attribute should be treated as a texture coordinate attribute.
345  /// Ideally, we could rely on the type info being GA_TYPE_TEXTURE_COORD,
346  /// but old files don't have this, and various importers don't set this.
347  /// If a float[3] (optionnally float[2]) attribute's name starts with "uv"
348  /// and is followed by zero or more digits (and nothing else), it's probably
349  /// safe to assume that it should be treated as a texture attribute.
350  bool shouldInterpretAsTexCoord(bool allow_float2=false) const
351  {
352  if (getTupleSize() != 3 && (!allow_float2 || getTupleSize() != 2))
353  return false;
354 
355  // If it's not a float type, it's probably not a texture coordinate,
356  // even if its typeinfo says otherwise.
357  GA_Storage storage = getStorage();
358  if (storage != GA_STORE_REAL16 && storage != GA_STORE_REAL32 && storage != GA_STORE_REAL64)
359  return false;
360 
361  // If it's marked as texture coord, go with that.
362  // If it's not that and not void, it's not texture coord.
363  GA_TypeInfo typeinfo = getTypeInfo();
364  if (typeinfo != GA_TYPE_VOID)
365  return (typeinfo == GA_TYPE_TEXTURE_COORD);
366 
367  // Void type info; check name next.
368  const char *name = getName().c_str();
369  if (name[0] != 'u' || name[1] != 'v')
370  return false;
371 
372  // Name starts with "uv". Check if everything else is digits.
373  for (name += 2; *name; ++name)
374  {
375  if (*name < '0' || *name > '9')
376  return false;
377  }
378  return true;
379  }
380 
381  /// Some types, especially integers, may not want to be lerped
382  bool isNonArithmetic() const { return !myDoMath; }
383 
384  /// Debug code
385  virtual bool debugValidateArrayCapacity(GA_Offset sz) const;
386 
387 #if !USE_PAGEARRAY_NUMERIC
388  /// @cond INTERNAL
390  *getPageTableImplV3()
391  { return myData.getPageTableImplV3(); }
392  /// @endcond
393 #endif
394 
395  /// Grow or shrink the array size
396  virtual bool setArraySize(GA_Offset new_size);
397 
398  /// Try to compress data pages
399  virtual void tryCompressAllPages(
400  GA_Offset start_offset = GA_Offset(0),
401  GA_Offset end_offset = GA_INVALID_OFFSET);
402  /// Harden data pages
403  virtual void hardenAllPages(
404  GA_Offset start_offset = GA_Offset(0),
405  GA_Offset end_offset = GA_INVALID_OFFSET);
406 
407  /// Returns true iff that is an attribute whose content can be copied
408  /// from this without any type conversions. This is important to
409  /// avoid reallocation of an attribute if its storage type,
410  /// including tuple size, matches the source attribute exactly.
411  virtual bool matchesStorage(const GA_Attribute *that) const
412  {
413  if (!GA_Attribute::matchesStorage(that))
414  return false;
415  const GA_ATINumeric *thatn = UTverify_cast<const GA_ATINumeric *>(that);
416  if (getStorage() != thatn->getStorage())
417  return false;
418  if (getTupleSize() != thatn->getTupleSize())
419  return false;
420  return true;
421  }
422  /// In the case that we're copying from an attribute whose storage
423  /// type matches this exactly, this function copies the metadata
424  /// not associated with the storage, e.g. myOptions,
425  /// *excluding* the name and the data ID.
426  virtual void copyNonStorageMetadata(const GA_Attribute *that)
427  {
429  const GA_ATINumeric *thatn = UTverify_cast<const GA_ATINumeric *>(that);
430  myDoMath = thatn->myDoMath;
431  myDefaults = thatn->myDefaults;
432  }
433 
434  /// This replaces the entirety of this attribute's content and non-
435  /// storage metadata (except the name) with that of the src attribute.
436  /// matchesStorage(src) should already return true.
437  /// This is primarily for use by GA_AttributeSet::replace().
438  /// NOTE: The internal content sizes may not match exactly if the
439  /// attribute type may overallocate, but the sizes should be such
440  /// that any real data will fit in the destination, so be careful
441  /// and deal with the myTailInitialize flag appropriately if
442  /// any extra elements aren't equal to the default.
443  virtual void replace(const GA_Attribute &src);
444 
445  /// Copy attribute values for a single element.
446  /// @{
447  virtual bool copy(GA_Offset desti, GA_Offset srci) final
448  {
449  return tupleSet(desti, *this, srci, -1);
450  }
451  virtual bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) final
452  {
453  if (!GA_ATINumeric::isType(&src))
454  return false;
455  return tupleSet(desti, *UTverify_cast<const GA_ATINumeric*>(&src), srci, -1);
456  }
457  bool copy(GA_Offset desti, const GA_ATINumeric &src, GA_Offset srci)
458  {
459  return tupleSet(desti, src, srci, -1);
460  }
461  /// @}
462 
463  /// Copy attribute values for a range of elements.
464  /// WARNING: These do not support overlapping ranges within a single attribute!
465  /// @{
466  virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange) final
467  {
468  return tupleSet(destrange, *this, srcrange, -1);
469  }
470  virtual bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) final
471  {
472  if (!GA_ATINumeric::isType(&src))
473  return false;
474  return tupleSet(destrange, *UTverify_cast<const GA_ATINumeric*>(&src), srcrange, -1);
475  }
476  bool copy(const GA_Range &destrange, const GA_ATINumeric &src, const GA_Range &srcrange)
477  {
478  return tupleSet(destrange, src, srcrange, -1);
479  }
480  /// @}
481 
482  /// Assign all elements of a range from a single attribute value.
483  /// @{
484  virtual bool fill(const GA_Range &destrange, GA_Offset srci) final;
485  virtual bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) final;
486  bool fill(const GA_Range &destrange, const GA_ATINumeric &src, GA_Offset srci);
487  /// @}
488 
489 #if USE_PAGEARRAY_NUMERIC
490  typedef GA_PageArray<void, -1, true, false> DataType;
491 
492  /// @{
493  /// Provide access to data
494  const DataType &getData() const { return myData; }
495  DataType &getData() { return myData; }
496  /// @}
497 
498  /// Returns true iff the specified page is constant-compressed,
499  /// where a single value is stored to represent GA_PAGE_SIZE
500  /// values in the page, (or possibly fewer if only one page).
502  {
503  return myData.isPageConstant(pagenum);
504  }
505  /// Sets all components of all elements of the specified page to
506  /// the given values.
507  /// NOTE: The length of values must be equal to the tuple size.
508  template<typename SRC_DATA_T>
509  SYS_FORCE_INLINE void setPageConstant(GA_PageNum pagenum, const SRC_DATA_T *values)
510  {
511  myData.setPageConstant(pagenum, values);
512  }
513 #endif
514 
515 protected:
516 #if USE_PAGEARRAY_NUMERIC
518 #else
519  GA_DataArrayTuple myData;
520 #endif
522  bool myDoMath; // Off for non-arithmetic integer
523 
529  static const GA_AIFMath *myAIFNoMath;
531  static GA_AIFInterp *myAIFInterp;
534 
536 
537 private:
538  void updateIntegerTypeInfo();
539 
540  virtual GA_Attribute *doClone(const GA_IndexMap &index_map,
541  const UT_StringHolder &name) const;
542 
543  /// @{ GA_AIFTuple
544  template <typename T> inline bool
545  tupleGet(GA_Offset di, T &v, int vi) const;
546  template <typename T> inline bool
547  tupleGet(GA_Offset di, T *v, int count, int start) const;
548 
549 #if !USE_PAGEARRAY_NUMERIC
550  /// Obtain a range of values from an attribute.
551  /// This is more efficient than individual calls of tupleGet.
552  /// The range [s, e) is assumed to lie within a block of contiguous offsets (no holes),
553  /// within a single page
554  template <typename T> inline bool
555  tupleGetArrayWithinBlock(GA_Offset s, GA_Offset e, T *v, int count, int start) const;
556  template <typename T, typename MYTYPE> inline bool
557  tupleGetPackV3(T *v, const GA_Range &range) const;
558 
559  /// Obtain a range of values from an attribute.
560  /// This is more efficient than individual calls of tupleGet.
561  /// The range [s, e) is assumed to lie within a block of contiguous offsets (no holes),
562  /// within a single page
563  template <typename T> inline bool
564  tupleSetArrayFromBlock(GA_Offset s, GA_Offset e, const T *src, int count, int start);
565  template <typename T, typename MYTYPE> inline bool
566  tupleSetPackV3(const GA_Range &range, const T *src);
567 #endif
568 
569  template <typename T> inline bool
570  tupleSet(GA_Offset di, T v, int vi);
571  template <typename T> inline bool
572  tupleSet(GA_Offset di, const T *v, int count, int start);
573  template <typename T> inline bool
574  tupleSet(const GA_Range &di, T v, int vi);
575  template <typename T> inline bool
576  tupleSet(const GA_Range &di, const T *v, int count, int start);
577  bool tupleSet(GA_Offset di, const GA_ATINumeric &s,
578  GA_Offset si, int component);
579  /// WARNING: These do not support overlapping ranges within a single attribute!
580  bool tupleSet(const GA_Range &di, const GA_ATINumeric &s,
581  const GA_Range &si, int component);
582 
583  template <typename T> inline bool
584  makeConstant(T v, int vi);
585  template <typename T> inline bool
586  makeConstant(const T *v, int count, int start);
587 
588  bool isNan(GA_Offset ai) const;
589  bool isNan(const GA_Range &ai) const;
590  /// @}
591 
592  /// @{ GA_AIFInterp
593  bool interpLerp(GA_Offset di,
594  const GA_ATINumeric &a, GA_Offset ai,
595  const GA_ATINumeric &b, GA_Offset bi,
596  fpreal t);
597  bool interpLerp(const GA_Range &di,
598  const GA_ATINumeric &a, const GA_Range &ai,
599  const GA_ATINumeric &b, const GA_Range &bi,
600  fpreal t);
601  bool interpSmooth(GA_Offset di, fpreal min, fpreal max,
602  const GA_ATINumeric &a, GA_Offset ai);
603  bool interpSmooth(const GA_Range &di, fpreal min, fpreal max,
604  const GA_ATINumeric &a, const GA_Range &ai);
605  bool interpFit(GA_Offset di, const GA_ATINumeric &a, GA_Offset ai,
606  fpreal omin, fpreal omax,
607  fpreal nmin, fpreal nmax);
608  bool interpFit(const GA_Range &di,
609  const GA_ATINumeric &a, const GA_Range &ai,
610  fpreal omin, fpreal omax,
611  fpreal nmin, fpreal nmax);
612  /// @}
613 
614  /// @{ GA_AIFMerge
615  void mergeDestroyDestination(const GA_MergeMap &map,
616  GA_Attribute *dattrib) const;
617  GA_Attribute *mergeAddDestination(const GA_MergeMap &map,
618  GA_Attribute *dattrib) const;
619  void mergeGrowArray(const GA_MergeMap &map,
620  const GA_ATINumeric &s);
621  bool mergeAppendData(const GA_MergeMap &map,
622  const GA_Attribute *sattrib);
623  /// @}
624 
625  /// @{ GA_AIFJSON
626  /// Save data to a JSON stream.
627  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s) const;
628  /// @}
629 
630  /// @cond INTERNAL_DOX
631  friend class ga_NumericCopyData;
632  friend class ga_NumericDelta;
633  friend class ga_NumericEdit;
634  template <typename T> friend class ga_NumericEditDelta;
635  template <typename T> friend class ga_NumericEditSnapshot;
636  friend class ga_NumericInterp;
637  friend class ga_NumericJSON;
638  friend class ga_NumericMarshal;
639  friend class ga_NumericMath;
640  friend class ga_NumericMerge;
641  friend class ga_NumericTuple;
642  friend class ga_NumericCompare;
643 
644  template <typename T> friend class binderScalar;
645  template <typename T> friend class binderVector;
646  template <typename T, typename TB> friend class binderPage;
647  /// @endcond
648 };
649 
650 #endif
651 
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
Data has no numeric representation.
Definition: GA_Types.h:83
bool isNonArithmetic() const
Some types, especially integers, may not want to be lerped.
GLenum GLint * range
Definition: glcorearb.h:1924
virtual bool matchesStorage(const GA_Attribute *that) const
GA_PageArray< void,-1, true, false > DataType
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
Definition: GA_ATINumeric.h:67
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:128
Class which stores the default values for a GA_Attribute.
Definition: GA_Defaults.h:35
Attribute Interface class to perform numeric operations on attributes.
Definition: GA_AIFMath.h:88
int getTupleSize() const
Size of the AIFTuple, if it exists. If it doesn't, 1.
const DataType & getData() const
const GLdouble * v
Definition: glcorearb.h:836
GLuint start
Definition: glcorearb.h:474
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
int getTupleSize() const
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
virtual const GA_AIFJSON * getAIFJSON() const
virtual const GA_AIFDelta * getAIFDelta() const
Return the attribute's delta interface or NULL.
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
Definition: GA_ATINumeric.h:61
GA_Defaults myDefaults
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
virtual bool setArraySize(GA_Offset size)=0
#define GA_API
Definition: GA_API.h:12
DataType myData
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
static GA_AIFCompare * myAIFCompare
static GA_AIFMath * myAIFMath
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual bool matchesStorage(const GA_Attribute *that) const
Definition: GA_Attribute.h:680
const UT_StringHolder & getName() const
Definition: GA_Attribute.h:250
virtual const GA_AIFTuple * getAIFTuple() const
Return the attribute's tuple interface or NULL.
virtual void tryCompressAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
GLsizeiptr size
Definition: glcorearb.h:663
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
A range of elements in an index-map.
Definition: GA_Range.h:42
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:132
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual bool fill(const GA_Range &destrange, GA_Offset srci)
Definition: GA_Attribute.h:746
long long int64
Definition: SYS_Types.h:106
GA_AttributeScope
Definition: GA_Types.h:121
static const GA_AttributeType * theAttributeType
virtual const GA_AIFInterp * getAIFInterp() const
Return the attribute's interpolation interface or NULL.
static GA_AIFTuple * myAIFTuple
virtual void replace(const GA_Attribute &src)=0
static GA_AIFInterp * myAIFInterp
Attribute Interface for merging attribute data between details.
Definition: GA_AIFMerge.h:56
static SYS_FORCE_INLINE GA_ATINumeric * cast(GA_Attribute *attrib)
Definition: GA_ATINumeric.h:72
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
virtual bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) final
GLintptr offset
Definition: glcorearb.h:664
virtual WriteConcurrence getSupportedWriteConcurrence() const
Data is paged, so concurrent writes to separate pages supported.
An array of numbers with various storage types.
Definition: GA_DataArray.h:49
Attribute Interface class to perform comparisons on attributes.
Definition: GA_AIFCompare.h:27
Options during loading.
Definition: GA_LoadMap.h:42
SYS_FORCE_INLINE const char * c_str() const
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1601
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
A tuple of scalar arrays.
static GA_AIFEdit * myAIFEdit
virtual const GA_AIFMath * getAIFMath() const
Return the attribute's math interface or NULL.
GLuint const GLchar * name
Definition: glcorearb.h:785
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:175
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
virtual void copyNonStorageMetadata(const GA_Attribute *that)
virtual void copyNonStorageMetadata(const GA_Attribute *that)
Definition: GA_Attribute.h:694
GLint GLsizei count
Definition: glcorearb.h:404
GA_TypeInfo
Definition: GA_Types.h:80
SYS_FORCE_INLINE bool isPageConstant(GA_PageNum pagenum) const
const GA_AttributeType & getType() const
Definition: GA_Attribute.h:197
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:269
static const GA_AIFMath * myAIFNoMath
virtual const GA_AIFEdit * getAIFEdit() const
Return the attribute's edit interface or NULL.
typedef int
Definition: png.h:1175
SYS_FORCE_INLINE GA_TypeInfo getTypeInfo() const
Definition: GA_Attribute.h:219
virtual bool copy(GA_Offset desti, GA_Offset srci) final
GA_Size GA_PageNum
Definition: GA_Types.h:620
Concurrent writes to separate pages supported.
Definition: GA_Attribute.h:338
static SYS_FORCE_INLINE const GA_AttributeType & getType()
Definition: GA_ATINumeric.h:64
static GA_AIFDelta * myAIFDelta
SYS_FORCE_INLINE void setPageConstant(GA_PageNum pagenum, const SRC_DATA_T *values)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual const GA_AIFMerge * getAIFMerge() const
Return the attribute's merge interface or NULL.
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
static GA_AIFJSON * myAIFJSON
Attribute Interface class to copy attribute data.
DataType & getData()
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) final
Attribute Interface for file I/O.
Definition: GA_AIFJSON.h:39
bool shouldInterpretAsTexCoord(bool allow_float2=false) const
static SYS_FORCE_INLINE const GA_ATINumeric * cast(const GA_Attribute *attrib)
Definition: GA_ATINumeric.h:79
virtual const GA_AIFCopyData * getAIFCopyData() const
Return the attribute's copy interface or NULL.
virtual const GA_AIFCompare * getAIFCompare() const
Return the attribute's comparison interface or NULL.
virtual bool debugValidateArrayCapacity(GA_Offset sz) const
Debug validation of allocated array size.
bool copy(GA_Offset desti, const GA_ATINumeric &src, GA_Offset srci)
AIF to record changes to attribute values.
Definition: GA_AIFEdit.h:393
virtual void hardenAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
virtual void defragment(const GA_Defragment &defrag)=0
Generic Attribute Interface class to access an attribute as a tuple.
Definition: GA_AIFTuple.h:32
virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange) final
GA_Storage
Definition: GA_Types.h:48
static GA_AIFCopyData * myAIFCopyData
const GA_Defaults & getDefaults() const
bool copy(const GA_Range &destrange, const GA_ATINumeric &src, const GA_Range &srcrange)
GLenum src
Definition: glcorearb.h:1792
GA_Storage getStorage() const
static GA_AIFMerge * myAIFMerge
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)