HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_DataArray.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: GT_DataArray.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_DataArray__
12 #define __GT_DataArray__
13 
14 #include "GT_API.h"
15 #include "GT_Types.h"
16 #include "GT_Handles.h"
17 #include <SYS/SYS_Hash.h>
18 #include <UT/UT_Assert.h>
19 #include <UT/UT_ParallelUtil.h>
20 #include <UT/UT_IntrusivePtr.h>
21 #include <UT/UT_Vector3.h>
22 #include <UT/UT_Vector4.h>
23 #include <UT/UT_Matrix3.h>
24 #include <UT/UT_Matrix4.h>
25 #include <UT/UT_BoundingBox.h>
26 #include <UT/UT_StackBuffer.h>
27 
28 class UT_StringArray;
29 class UT_JSONWriter;
31 
34 
35 /// @brief Abstract data class for an array of float, int or string data
36 ///
37 /// This is an abstract class. The data does not have to be owned by this
38 /// array. The data can be generated on the fly by the class. Or the data
39 /// might be flat numeric data.
41  : public UT_IntrusiveRefCounter<GT_DataArray>
42 {
43 public:
44  GT_DataArray();
46  virtual ~GT_DataArray();
47 
48  virtual const char *className() const = 0;
49 
50  /// Create a "hardened" version of the array
51  virtual GT_DataArrayHandle harden() const;
52 
53  /// Type of data stored in the array
54  virtual GT_Storage getStorage() const = 0;
55 
56  /// Number of entries in the array
57  virtual GT_Size entries() const = 0;
58 
59  /// Total number of array elements if this is an array attribute.
60  /// Sum of each entry's array length, as each entry's array length can vary.
61  virtual GT_Size getTotalArrayEntries() const { return 0; }
62 
63  /// Number of elements for each array element
64  virtual GT_Size getTupleSize() const = 0;
65 
66  /// Get an approximation of the memory usage. Since data is shared, this
67  /// may be an over-estimation of the memory used.
68  virtual int64 getMemoryUsage() const = 0;
69 
70  /// Return "type" information for the data. This defaults to GT_TYPE_NONE
71  virtual GT_Type getTypeInfo() const;
72 
73  /// Returns "true" if each entry is an array.
74  virtual bool hasArrayEntries() const { return false; }
75 
76  /// Return "true" if there's pointer aliasing
77  virtual bool getPointerAliasing(const void *data) const
78  { return false; }
79 
80  /// Data array is valid; can be sampled from.
81  virtual bool isValid() const { return true; }
82 
83  /// If the array has backing storage, this method can be used to access the
84  /// storage. The backing storage must be a flat array of interleaved
85  /// values of the given pod type. For example, if the array has 35 entries
86  /// of fpreal32 color (RGB) data, the pointer returned should be mapped to
87  /// an array that's (35*3) fpreal32 values with the first three values
88  /// representing the RGB values for the first item in the array.
89  virtual const void *getBackingData() const { return nullptr; }
90 
91  /// Return the "data id" associated with the data. The data ID will be
92  /// incremented if the data is modified. An ID less than 0 indicates that
93  /// the data ID should always be considered unique and will never be the
94  /// same across evaluations. This data ID can be used to detect whether
95  /// attribute data has changed in similar tesselations.
96  virtual int64 getDataId() const { return myDataId; }
97 
98  /// @{
99  /// Get data out of the data array
100  virtual uint8 getU8(GT_Offset offset, int idx=0) const = 0;
101  virtual int8 getI8(GT_Offset offset, int idx=0) const
102  { return getI32(offset, idx); }
103  virtual int16 getI16(GT_Offset offset, int idx=0) const
104  { return getI32(offset, idx); }
105  virtual int32 getI32(GT_Offset offset, int idx=0) const = 0;
106  virtual int64 getI64(GT_Offset offset, int idx=0) const
107  { return getI32(offset, idx); }
108 
109  virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
110  { return getF32(offset, idx); }
111  virtual fpreal32 getF32(GT_Offset offset, int idx=0) const = 0;
112  virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
113  { return getF32(offset, idx); }
114 
115  virtual GT_String getS(GT_Offset offset, int idx=0) const = 0;
116 
117  virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
118  { return false; }
120  { return false; }
122  { return false; }
124  { return false; }
126  { return false; }
127  virtual bool getIA8(UT_ValArray<int8> &a, GT_Offset offset) const
128  { return false; }
130  { return false; }
132  { return false; }
134  { return false; }
135  /// @}
136 
137  /// @{
138  /// Get raw access to the data buffer (or fill the data array passed in)
139  /// If the array is unable to provide a raw pointer to the underlying data,
140  /// the GT_DataArrayHandle will be allocated to store the data, and it's
141  /// raw data will be returned.
142  ///
143  /// This means that the data returned will be destructed when the buffer is
144  /// destructed. Beware.
145  virtual const uint8 *getU8Array(GT_DataArrayHandle &buffer) const;
146  virtual const int8 *getI8Array(GT_DataArrayHandle &buffer) const;
147  virtual const int16 *getI16Array(GT_DataArrayHandle &buffer) const;
148  virtual const int32 *getI32Array(GT_DataArrayHandle &buffer) const;
149  virtual const int64 *getI64Array(GT_DataArrayHandle &buffer) const;
150  virtual const fpreal16 *getF16Array(GT_DataArrayHandle &buffer) const;
151  virtual const fpreal32 *getF32Array(GT_DataArrayHandle &buffer) const;
152  virtual const fpreal64 *getF64Array(GT_DataArrayHandle &buffer) const;
153  const fpreal *getRealArray(GT_DataArrayHandle &buffer) const;
154  /// @}
155 
156  /// Template-friendly version of getU8Array() and related methods.
157  template <typename T>
158  const T *getArray(GT_DataArrayHandle &buffer) const;
159 
160  /// When an array of strings is based on an indexed list of strings, this
161  /// method can be used to query the maximum number of indices. If the
162  /// strings are not indexed, the method should return -1.
163  virtual GT_Size getStringIndexCount() const = 0;
164 
165  /// When an array of strings is based on an indexed list of strings, this
166  /// method can be used to query each element's index. If the strings are
167  /// not indexed, the method should return -1.
168  virtual GT_Offset getStringIndex(GT_Offset offset, int idx=0) const = 0;
169 
170  /// When an array of strings is based on an indexed list of strings, this
171  /// method can be used to extract all the strings and their corresponding
172  /// indicies. It's possible that the indices may not be contiguous or may
173  /// even be out of order.
174  virtual void getIndexedStrings(UT_StringArray &strings,
175  UT_IntArray &indices) const = 0;
176  /// When an array of strings is based on an indexed list of strings, this
177  /// method can be used to extract all the strings. If an index is not
178  /// used, the string array may contain a NULL pointer. When you call @c
179  /// getStringIndex(), you can look up directly into the @c strings array
180  /// returned here.
181  ///
182  /// Note, if the strings are not stored as an indexed list, this method
183  /// will return an empty array.
184  virtual void getStrings(UT_StringArray &strings) const;
185 
186  /// Fill an array of std::string with the strings corresponding to each
187  /// entry. There must be @c entries() strings in the array. Only a single
188  /// tuple index is extracted.
189  void fillStrings(std::string *strings,
190  int tuple_idx=0) const;
191 
192  /// Fill array of strings from start to length number of entries.
193  /// This should only be called for an array attribute of strings.
194  /// The @c data will contain a flattened array of strings, with
195  /// the @c sizes array containing the array length per entry.
198  GT_Offset start, GT_Size length) const {}
199 
200  /// @{
201  /// Extract data out of the array in a template friendly fashion.
202  /// Unlike the @c get() methods, these methods will @b always copy data
203  /// into the buffers. If the @c size is 0, the tuple size will be used.
204  /// The data buffer must be big enough.
205  ///
206  /// If the size given is larger than getTupleSize(), only the first
207  /// @c getTupleSize() elements will be filled out (leaving the others
208  /// untouched).
209  void import(GT_Offset idx, int8 *data, GT_Size size=0) const
210  { doImport(idx, data, size); }
211  void import(GT_Offset idx, int16 *data, GT_Size size=0) const
212  { doImport(idx, data, size); }
213  void import(GT_Offset idx, int32 *data, GT_Size size=0) const
214  { doImport(idx, data, size); }
215  void import(GT_Offset idx, int64 *data, GT_Size size=0) const
216  { doImport(idx, data, size); }
217  void import(GT_Offset idx, fpreal16 *data, GT_Size size=0) const
218  { doImport(idx, data, size); }
219  void import(GT_Offset idx, fpreal32 *data, GT_Size size=0) const
220  { doImport(idx, data, size); }
221  void import(GT_Offset idx, fpreal64 *data, GT_Size size=0) const
222  { doImport(idx, data, size); }
223  void import(GT_Offset idx, UT_ValArray<fpreal16> &data) const
224  { doImportArray(idx, data); }
225  void import(GT_Offset idx, UT_ValArray<fpreal32> &data) const
226  { doImportArray(idx, data); }
227  void import(GT_Offset idx, UT_ValArray<fpreal64> &data) const
228  { doImportArray(idx, data); }
229  void import(GT_Offset idx, UT_ValArray<uint8> &data) const
230  { doImportArray(idx, data); }
231  void import(GT_Offset idx, UT_ValArray<int8> &data) const
232  { doImportArray(idx, data); }
233  void import(GT_Offset idx, UT_ValArray<int16> &data) const
234  { doImportArray(idx, data); }
235  void import(GT_Offset idx, UT_ValArray<int32> &data) const
236  { doImportArray(idx, data); }
237  void import(GT_Offset idx, UT_ValArray<int64> &data) const
238  { doImportArray(idx, data); }
239  void import(GT_Offset idx, UT_StringArray &data) const
240  { getSA(data, idx); }
241  void import(GT_Offset idx, uint8 *data, GT_Size size=0,
242  fpreal black=0, fpreal white=1) const
243  {
244  if (GTisFloat(getStorage()))
245  doImportQuantized(idx, data, size, black, white);
246  else
247  doImport(idx, data, size);
248  }
249  /// @}
250 
251  /// @{
252  /// Extract data for the entire array into a flat data array.
253  /// By default, this is implemented as: @code
254  /// if (tuple_size <= 0)
255  /// tuple_size = getTupleSize();
256  /// for (GT_Offset idx = 0; idx < length; ++idx, data += tuple_size)
257  /// import(idx+start, data, tuple_size);
258  /// @endcode
259  /// Obviously, the @c data array should be big enough to hold @c
260  /// length*tuple_size elements.
261  ///
262  /// The tuple size (@c tsize) specifies how many elements to extract from
263  /// each element of this array. The @c stride specifies how many items to
264  /// skip over for each element. With a stride of -1, the stride will be
265  /// set to the @c tsize. Otherwise the stride will be set to the maximum
266  /// of @c tsize and @c stride.
267  ///
268  /// The stride can be useful when trying to interleave data. For example:
269  /// @code
270  /// float uvbuf[ucoord->entries()*2];
271  /// ucoord->fillArray(&uvbuf[0], 0, ucoord->entries(), 1, 2);
272  /// vcoord->fillArray(&uvbuf[1], 0, vcoord->entries(), 1, 2);
273  /// @endcode
275  int tsize, int stride=-1) const
276  { doFillArray(data, start, length, tsize, stride); }
278  int tsize, int stride=-1) const
279  { doFillArray(data, start, length, tsize, stride); }
281  int tsize, int stride=-1) const
282  { doFillArray(data, start, length, tsize, stride); }
284  int tsize, int stride=-1) const
285  { doFillArray(data, start, length, tsize, stride); }
287  int tsize, int stride=-1) const
288  { doFillArray(data, start, length, tsize, stride); }
290  int tsize, int stride=-1) const
291  { doFillArray(data, start, length, tsize, stride); }
293  int tsize, int stride=-1) const
294  { doFillArray(data, start, length, tsize, stride); }
297  int tsize, int stride=-1,
298  fpreal black=0, fpreal white=1) const
299  {
300  if(GTisFloat(getStorage()))
301  doFillQuantizedArray(data, start, length, tsize,
302  stride, black, white);
303  else
304  doFillArray(data, start, length, tsize, stride);
305  }
306 
308  UT_BoundingBoxF &bbox, int tsize, int stride=-1)
309  {
310  UT_ASSERT_P(tsize==3);
311  doFillVec3BBox(dest, start, length, bbox,
312  tsize, stride);
313  }
315  UT_BoundingBoxD &bbox, int tsize, int stride=-1)
316  {
317  UT_ASSERT_P(tsize==3);
318  doFillVec3BBox(dest, start, length, bbox,
319  tsize, stride);
320  }
321  /// @}
322 
323  /// @{
324  /// Extract data for an array attribute into a flat data array.
325  /// Since each entry in an array attribute varies in terms of array size,
326  /// the sizes of each entry will be stored in the @c sizes array.
329  { doFillArrayAttr(data, sizes, start, length); }
332  { doFillArrayAttr(data, sizes, start, length); }
335  { doFillArrayAttr(data, sizes, start, length); }
338  { doFillArrayAttr(data, sizes, start, length); }
341  { doFillArrayAttr(data, sizes, start, length); }
344  { doFillArrayAttr(data, sizes, start, length); }
347  { doFillArrayAttr(data, sizes, start, length); }
350  { doFillArrayAttr(data, sizes, start, length); }
351  /// @}
352 
353  virtual void extendedFillArray(uint8 *data,
355  int tsize, int nrepeats,
356  int stride=-1,
357  fpreal black=0, fpreal white=1) const
358  {
359  doExtendedQuantizedFill(data, start, length, tsize,
360  nrepeats, stride, black, white);
361  }
362 
363  /// @{
364  /// Extract an element, but making @c nrepeats copies. The buffer
365  /// should be able to contain @c length*nrepeats*tsize elements
366  /// When filling an RGB color, with a repeat count of 4, the resulting
367  /// buffer will look like: @code
368  /// [ RGB0 RGB0 RGB0 RGB0 RGB1 RGB1 RGB1 RGB1 ... ]
369  /// @endcode
370  /// With a repeat count of 1, this is equivalent to @c fillArray()
372  int tsize, int nrepeats, int stride=-1) const
373  {
374  t_extendedFill(data, start, length, tsize,
375  nrepeats, stride);
376  }
378  int tsize, int nrepeats, int stride=-1) const
379  {
380  t_extendedFill(data, start, length, tsize,
381  nrepeats, stride);
382  }
384  int tsize, int nrepeats, int stride=-1) const
385  {
386  t_extendedFill(data, start, length, tsize,
387  nrepeats, stride);
388  }
390  int tsize, int nrepeats, int stride=-1) const
391  {
392  t_extendedFill(data, start, length, tsize,
393  nrepeats, stride);
394  }
396  int tsize, int nrepeats, int stride=-1) const
397  {
398  t_extendedFill(data, start, length, tsize,
399  nrepeats, stride);
400  }
402  int tsize, int nrepeats, int stride=-1) const
403  {
404  t_extendedFill(data, start, length, tsize,
405  nrepeats, stride);
406  }
408  int tsize, int nrepeats, int stride=-1) const
409  {
410  t_extendedFill(data, start, length, tsize,
411  nrepeats, stride);
412  }
414  int tsize, int nrepeats, int stride=-1) const
415  {
416  t_extendedFill(data, start, length, tsize,
417  nrepeats, stride);
418  }
419  /// @}
420 
421  /// @{
422  /// Copy the data out of the array as a tuple of @em size entries
423  /// The data may be copied, or the array may return a pointer to raw data.
424  /// That is, the sub-class may @b not copy the data into the storage.
425  virtual const uint8 *get(GT_Offset i, uint8 *store, int sz) const;
426  virtual const int8 *get(GT_Offset i, int8 *store, int sz) const;
427  virtual const int16 *get(GT_Offset i, int16 *store, int sz) const;
428  virtual const int32 *get(GT_Offset i, int32 *store, int sz) const;
429  virtual const int64 *get(GT_Offset i, int64 *store, int sz) const;
430  virtual const fpreal16 *get(GT_Offset i, fpreal16 *store, int z) const;
431  virtual const fpreal32 *get(GT_Offset i, fpreal32 *store, int z) const;
432  virtual const fpreal64 *get(GT_Offset i, fpreal64 *store, int z) const;
433  /// @}
434 
435  /// @{
436  /// Get the range of values in the array
437  virtual void getRange(exint &lo, exint &hi, int tuple_idx=0) const;
438  virtual void getRange(fpreal &lo, fpreal &hi, int tidx=0) const;
439  /// @}
440 
441  /// Compare whether two data arrays are equal.
442  virtual bool isEqual(const GT_DataArray &src) const;
443 
444  /// @{
445  /// Compute a hash of the data in the array. The base class hash is computed
446  /// @code
447  /// SYS_HashType hash = 0;
448  /// for (i = begin; i < end; ++i) {
449  /// import(i, tmp, getTupleSize());
450  /// for (t = 0; t < getTupleSize(); t++)
451  /// SYShashCombine(hash, hashNumeric(tmp[t]));
452  /// }
453  /// @endcode
454  /// Where @c hashNumeric returns the value for integer types. Real data is
455  /// cast to the corresponding unsigned integer values. For example, fpreal16 @code
456  /// void hashNumeric(SYS_HashType &hash, fpreal16 v) {
457  /// SYShashCombine(hash, *(const uint16 *)(&v));
458  /// }
459  /// void hashNumeric(SYS_HashType &hash, fpreal32 v) {
460  /// SYShashCombine(hash, *(const uint32 *)(&v));
461  /// }
462  /// @endcode
463  SYS_HashType hash() const { return hashRange(0, entries()); }
464  virtual SYS_HashType hashRange(exint begin, exint end) const;
465  /// @}
466 
467  /// Enlarge a bounding box with values of this 3-tuple array
469  {
470  // Initialize min/max
471  for (int i = 0, n = getTupleSize(); i < n; ++i)
472  {
473  min[i] = SYS_FP64_MAX;
474  max[i] = -SYS_FP64_MAX;
475  }
476  if (getStorage() == GT_STORE_STRING)
477  return false;
478  if (!entries())
479  return true;
480  return computeMinMax(min, max);
481  }
483  {
484  int tsize = getTupleSize();
485  UT_StackBuffer<fpreal64> min(tsize), max(tsize);
486  getMinMax(min, max);
487  if (min[0] <= max[0] && min[1] <= max[1] && min[2] <= max[2])
488  {
489  b.enlargeBounds(min[0], min[1], min[2]);
490  b.enlargeBounds(max[0], max[1], max[2]);
491  }
492  return true;
493  }
494 
495  /// Test to see whether the data array requires int32 or int64 indexing.
496  GT_Storage checkIndexing(GT_IndexingMode mode) const;
497 
498  /// Quick & dirty test to see if a size is bigger than a 32 bit int
499  static bool isBigInteger(GT_Size size)
500  { return size >= (((int64)1) << 31); }
501 
502  /// For debugging, print values to stdout
503  void dumpValues(const char *msg=NULL) const;
504 
505  /// Save array to a JSON stream. The 'flat' determines how to output
506  /// arrays with a tuple size greater than 1. If 'flat' is true, the
507  /// output will be an uninterrupted stream of values. If 'flat' is
508  /// false, then the output will look something like [[1,2,3],[4,5,6], ... ]
509  bool save(UT_JSONWriter &w, bool flat = true) const;
510 
511  /// @{
512  /// For memory tracking, we override the new/delete operators
513  static void *operator new(size_t size);
514  static void *operator new(size_t size, void *p);
515  static void operator delete(void *p, size_t size);
516  /// @}
517 
518  /// Forcibly set the data id for the array. You take responsibility for
519  /// all artifacts and crashes if you call this indiscriminately.
520  void copyDataId(const GT_DataArray &src)
521  { setDataId(src.getDataId()); }
522 
523  /// Set the data id - This is used by geometry arrays to copy over the data
524  /// id from GA. As above, you take responsibility for all artifacts and
525  /// crashes if you set this incorrectly. Do not set this if you don't
526  /// know how data IDs work.
527  void setDataId(int64 id) { myDataId = id; }
528 
529  /// Update cached data, in case the underlying attribute changed.
530  virtual void updateGeoDetail(const GU_ConstDetailHandle &dtl,
531  const char *attrib_name,
532  GT_Owner attrib_owner,
533  const int expected_size) {}
534 
535 protected:
536  /// Compute the min & max values for an array. This fails for strings
538  {
539  public:
541  : myArray(array)
542  , myTupleSize(array.getTupleSize())
543  {
544  initBuffers();
545  for (int j = 0; j < myTupleSize; ++j)
546  {
547  myMin[j] = SYS_FP64_MAX;
548  myMax[j] = -SYS_FP64_MAX;
549  }
550  }
552  : myArray(src.myArray)
553  , myTupleSize(src.myTupleSize)
554  {
555  initBuffers();
556  std::copy(src.myMin, src.myMin+myTupleSize, myMin);
557  std::copy(src.myMax, src.myMax+myTupleSize, myMax);
558  }
560  {
561  if (myMin != myMinBuffer)
562  {
563  delete [] myMin;
564  delete [] myMax;
565  delete [] myPos;
566  }
567  }
569  {
570  for (GT_Size i = range.begin(), n = range.end(); i < n; ++i)
571  {
572  myArray.import(i, myPos, myTupleSize);
573  for (int j = 0; j < myTupleSize; ++j)
574  {
575  myMin[j] = SYSmin(myMin[j], myPos[j]);
576  myMax[j] = SYSmax(myMax[j], myPos[j]);
577  }
578  }
579  }
581  {
582  for (int j = 0; j < myTupleSize; ++j)
583  {
584  min[j] = SYSmin(min[j], myMin[j]);
585  max[j] = SYSmax(max[j], myMax[j]);
586  }
587  }
588  void join(const minMaxTask &src)
589  {
590  for (int j = 0; j < myTupleSize; ++j)
591  {
592  myMin[j] = SYSmin(myMin[j], src.myMin[j]);
593  myMax[j] = SYSmax(myMax[j], src.myMax[j]);
594  }
595  }
596  private:
597  void initBuffers()
598  {
599  if (myTupleSize > 16)
600  {
601  myMin = new fpreal64[myTupleSize];
602  myMax = new fpreal64[myTupleSize];
603  myPos = new fpreal64[myTupleSize];
604  }
605  else
606  {
607  myMin = myMinBuffer;
608  myMax = myMaxBuffer;
609  myPos = myPosBuffer;
610  }
611  }
612  const GT_DataArray &myArray;
613  fpreal64 *myMin;
614  fpreal64 *myMax;
615  fpreal64 *myPos;
616  fpreal64 myMinBuffer[16];
617  fpreal64 myMaxBuffer[16];
618  fpreal64 myPosBuffer[16];
619  int myTupleSize;
620  };
621  virtual bool computeMinMax(fpreal64 *min, fpreal64 *max) const
622  {
623  minMaxTask task(*this);
625  task.getResult(min, max);
626  return true;
627  }
628  /// Ensure the size is set properly when performing an import. If the size
629  /// isn't specified, we use the array's tuple size, otherwise we make sure
630  /// to clamp the tuple size.
633  {
634  return size == 0 ? tuple_size : SYSmin(size, tuple_size);
635  }
636 
637  /// @{
638  /// Virtual implementation for inline methods.
639  /// Note that @c doImport is for tuple data, while @c doImportArray
640  /// is for tuple array data.
641  virtual void doImport(GT_Offset idx, uint8 *data, GT_Size size) const;
642  virtual void doImport(GT_Offset idx, int8 *data, GT_Size size) const;
643  virtual void doImport(GT_Offset idx, int16 *data, GT_Size size) const;
644  virtual void doImport(GT_Offset idx, int32 *data, GT_Size size) const;
645  virtual void doImport(GT_Offset idx, int64 *data, GT_Size size) const;
646  virtual void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const;
647  virtual void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const;
648  virtual void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const;
649  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal16> &data) const;
650  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal32> &data) const;
651  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal64> &data) const;
652  virtual void doImportArray(GT_Offset idx, UT_ValArray<uint8> &data) const;
653  virtual void doImportArray(GT_Offset idx, UT_ValArray<int8> &data) const;
654  virtual void doImportArray(GT_Offset idx, UT_ValArray<int16> &data) const;
655  virtual void doImportArray(GT_Offset idx, UT_ValArray<int32> &data) const;
656  virtual void doImportArray(GT_Offset idx, UT_ValArray<int64> &data) const;
657  virtual void doImportQuantized(GT_Offset idx, uint8 *data, GT_Size size,
658  fpreal black, fpreal white) const;
659 
661  int tuple_size, int stride) const
662  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
663 
665  int tuple_size, int stride) const
666  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
668  int tuple_size, int stride) const
669  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
671  int tuple_size, int stride) const
672  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
674  int tuple_size, int stride) const
675  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
677  int tuple_size, int stride) const
678  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
680  int tuple_size, int stride) const
681  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
683  int tuple_size, int stride) const
684  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
686  GT_Offset start, GT_Size length) const
687  { t_extendedFillArray(data, sizes, start, length); }
689  GT_Offset start, GT_Size length) const
690  { t_extendedFillArray(data, sizes, start, length); }
692  GT_Offset start, GT_Size length) const
693  { t_extendedFillArray(data, sizes, start, length); }
695  GT_Offset start, GT_Size length) const
696  { t_extendedFillArray(data, sizes, start, length); }
698  GT_Offset start, GT_Size length) const
699  { t_extendedFillArray(data, sizes, start, length); }
701  GT_Offset start, GT_Size length) const
702  { t_extendedFillArray(data, sizes, start, length); }
704  GT_Offset start, GT_Size length) const
705  { t_extendedFillArray(data, sizes, start, length); }
707  GT_Offset start, GT_Size length) const
708  { t_extendedFillArray(data, sizes, start, length); }
709 
712  int tuple_size, int stride,
713  fpreal black, fpreal white) const
714  {
715  doExtendedQuantizedFill(data, start, length, tuple_size,
716  1, stride, black, white);
717  }
718  virtual void doExtendedQuantizedFill(uint8 *data,
720  int tuple_size, int nrepeats, int stride,
721  fpreal black, fpreal white) const;
722 
723  /// Nested class to perform filling for a POD array
724  template <typename T_POD>
726  {
727  public:
729  GT_Offset start, int stride)
730  : myArray(array)
731  , myData(data)
732  , myStart(start)
733  , myStride(stride)
734  {
735  myBox.initBounds();
736  }
738  : myArray(src.myArray)
739  , myBox(src.myBox)
740  , myData(src.myData)
741  , myStart(src.myStart)
742  , myStride(src.myStride)
743  {
744  }
746  {
747  exint i = range.begin();
748  T_POD *dest = myData + i*myStride;
749  for (; i != range.end(); ++i, dest += myStride)
750  {
751  myArray.import(i+myStart, dest, 3);
752  myBox.enlargeBounds(dest[0], dest[1], dest[2]);
753  }
754  }
755  void join(const fillV3BoxTask<T_POD> &src)
756  {
757  myBox.enlargeBounds(src.myBox);
758  }
759  const UT_BoundingBox &box() const { return myBox; }
760  private:
761  const GT_DataArray &myArray;
762  UT_BoundingBox myBox;
763  T_POD *myData;
764  GT_Offset myStart;
765  int myStride;
766  };
767 
769  UT_BoundingBoxF &bbox, int, int stride)
770  {
771  stride = SYSmax(stride, 3);
772  fillV3BoxTask<fpreal32> task(*this, dest, start, stride);
774  bbox = task.box();
775  }
777  UT_BoundingBoxD &bbox, int, int stride)
778  {
779  stride = SYSmax(stride, 3);
780  fillV3BoxTask<fpreal64> task(*this, dest, start, stride);
782  bbox = task.box();
783  }
784  /// @}
785 
786  /// Templated method to fill an array
787  template <typename T_POD> void
788  t_extendedFill(T_POD *dest, GT_Offset start, GT_Size length,
789  int tsize, int nrepeats, int stride) const;
790 
791  /// Templated method to fill an array attribute
792  template <typename T_POD> void
793  t_extendedFillArray(UT_Array<T_POD> &dest, UT_Array<int> &sizes,
794  GT_Offset start, GT_Size length) const;
795 
796 private:
797  /// @{
798  /// @private
799  /// Get more complicated POD data types out of the array
800  template <typename T, int tuplesize> class VectorPODAccessor
801  {
802  public:
803  static T getValue(const GT_DataArray &array, GT_Offset offset)
804  {
805  T result;
806  UT_ASSERT_P(array.getTupleSize() >= tuplesize);
807  array.get(offset, result.data(), tuplesize);
808  return result;
809  }
810  };
811  class I32Accessor {
812  public:
813  static int32 getValue(const GT_DataArray &a, GT_Offset i)
814  { return a.getI32(i); }
815  };
816  class I64Accessor {
817  public:
818  static int64 getValue(const GT_DataArray &a, GT_Offset i)
819  { return a.getI64(i); }
820  };
821  class F16Accessor {
822  public:
823  static fpreal16 getValue(const GT_DataArray &a, GT_Offset i)
824  { return a.getF16(i); }
825  };
826  class F32Accessor {
827  public:
828  static fpreal32 getValue(const GT_DataArray &a, GT_Offset i)
829  { return a.getF32(i); }
830  };
831  class F64Accessor {
832  public:
833  static fpreal64 getValue(const GT_DataArray &a, GT_Offset i)
834  { return a.getF64(i); }
835  };
836  /// @}
837 
838  /// @{
839  /// @private
840  /// Private template class to register POD accessors
841  template <typename T, int FAKE> class TypeInfo {};
842  /// @}
843 
844  /// @{
845  /// @private
846  /// Simple scalar and vector accessors
847  template <int FAKE> class TypeInfo<int32, FAKE>
848  { public: typedef I32Accessor Accessors; };
849  template <int FAKE> class TypeInfo<int64, FAKE>
850  { public: typedef I64Accessor Accessors; };
851  template <int FAKE> class TypeInfo<fpreal16, FAKE>
852  { public: typedef F16Accessor Accessors; };
853  template <int FAKE> class TypeInfo<fpreal32, FAKE>
854  { public: typedef F32Accessor Accessors; };
855  template <int FAKE> class TypeInfo<fpreal64, FAKE>
856  { public: typedef F64Accessor Accessors; };
857 
858  template <int FAKE> class TypeInfo<UT_Vector3F, FAKE>
859  { public: typedef VectorPODAccessor<UT_Vector3F, 3> Accessors; };
860  template <int FAKE> class TypeInfo<UT_Vector3D, FAKE>
861  { public: typedef VectorPODAccessor<UT_Vector3D, 3> Accessors; };
862  template <int FAKE> class TypeInfo<UT_Vector4F, FAKE>
863  { public: typedef VectorPODAccessor<UT_Vector4F, 4> Accessors; };
864  template <int FAKE> class TypeInfo<UT_Vector4D, FAKE>
865  { public: typedef VectorPODAccessor<UT_Vector4D, 4> Accessors; };
866  template <int FAKE> class TypeInfo<UT_Matrix3F, FAKE>
867  { public: typedef VectorPODAccessor<UT_Matrix3F, 9> Accessors; };
868  template <int FAKE> class TypeInfo<UT_Matrix3D, FAKE>
869  { public: typedef VectorPODAccessor<UT_Matrix3D, 9> Accessors; };
870  template <int FAKE> class TypeInfo<UT_Matrix4F, FAKE>
871  { public: typedef VectorPODAccessor<UT_Matrix4F, 16> Accessors; };
872  template <int FAKE> class TypeInfo<UT_Matrix4D, FAKE>
873  { public: typedef VectorPODAccessor<UT_Matrix4D, 16> Accessors; };
874  /// @}
875 public:
876  /// Public accessor for POD types
877  template <typename T> T
879  { return TypeInfo<T, 0>::Accessors::getValue(*this, index); }
880 
881  template <typename T> T
883  {
884  return (1-t)*getValue<T>(i0) + t*getValue<T>(i1);
885  }
886 
887  template <typename T> T
889  GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
890  {
891  T l = (1-v)*getValue<T>(u0v0) + v*getValue<T>(u0v1);
892  T r = (1-v)*getValue<T>(u1v0) + v*getValue<T>(u1v1);
893  return (1-u)*l + u*r;
894  }
895 
896 private:
897  int64 myDataId;
898 };
899 
900 #endif
SYS_HashType hash() const
Definition: GT_DataArray.h:463
#define SYSmax(a, b)
Definition: SYS_Math.h:1526
void fillArray(UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:336
vint4 max(const vint4 &a, const vint4 &b)
Definition: simd.h:4703
GT_Storage
Definition: GT_Types.h:18
void fillArray(UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:342
virtual void updateGeoDetail(const GU_ConstDetailHandle &dtl, const char *attrib_name, GT_Owner attrib_owner, const int expected_size)
Update cached data, in case the underlying attribute changed.
Definition: GT_DataArray.h:530
GLenum GLint * range
Definition: glew.h:3500
virtual void extendedFill(int16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:383
virtual bool getIA32(UT_ValArray< int32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:131
virtual void doFillQuantizedArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride, fpreal black, fpreal white) const
Definition: GT_DataArray.h:710
virtual bool isValid() const
Data array is valid; can be sampled from.
Definition: GT_DataArray.h:81
GLuint id
Definition: glew.h:1679
GLsizeiptr size
Definition: glew.h:1681
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:109
tbb::split UT_Split
Definition: GA_PolyCounts.h:24
void fillArray(UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:345
virtual void extendedFill(int32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:389
void fillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:292
Nested class to perform filling for a POD array.
Definition: GT_DataArray.h:725
virtual bool getFA64(UT_ValArray< fpreal64 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:123
virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:112
T lerpValue(GT_Offset i0, GT_Offset i1, fpreal t) const
Definition: GT_DataArray.h:882
GLenum mode
Definition: glew.h:2163
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
Definition: format.h:251
virtual void fillStringArray(UT_StringArray &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:196
GLuint index
Definition: glew.h:1814
void join(const fillV3BoxTask< T_POD > &src)
Definition: GT_DataArray.h:755
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
virtual void doFillArray(int16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:667
bool enlargeBounds(UT_BoundingBox &b) const
Definition: GT_DataArray.h:482
GT_IndexingMode
Definition: GT_Types.h:92
virtual fpreal32 getF32(GT_Offset offset, int idx=0) const =0
virtual const void * getBackingData() const
Definition: GT_DataArray.h:89
#define GT_API
Definition: GT_API.h:11
int64 exint
Definition: SYS_Types.h:125
const UT_BoundingBox & box() const
Definition: GT_DataArray.h:759
GT_Type
Definition: GT_Types.h:34
virtual int64 getI64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:106
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
static bool isBigInteger(GT_Size size)
Quick & dirty test to see if a size is bigger than a 32 bit int.
Definition: GT_DataArray.h:499
virtual bool getUA8(UT_ValArray< uint8 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:125
void fillArray(int16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:277
virtual void extendedFill(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:401
GLdouble l
Definition: glew.h:9122
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
const GLdouble * v
Definition: glew.h:1391
minMaxTask(const GT_DataArray &array)
Definition: GT_DataArray.h:540
virtual void extendedFill(int64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:395
void fillArray(UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:348
A reference counter base class for use with UT_IntrusivePtr.
virtual void doFillArray(int64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:673
float fpreal32
Definition: SYS_Types.h:200
#define SYS_FP64_MAX
Definition: SYS_Types.h:221
virtual void doFillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int, int stride)
Definition: GT_DataArray.h:776
virtual void extendedFill(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:407
virtual void doFillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int, int stride)
Definition: GT_DataArray.h:768
void fillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:289
virtual bool getIA64(UT_ValArray< int64 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:133
virtual bool computeMinMax(fpreal64 *min, fpreal64 *max) const
Definition: GT_DataArray.h:621
virtual bool getIA16(UT_ValArray< int16 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:129
GLdouble GLdouble z
Definition: glew.h:1559
double fpreal64
Definition: SYS_Types.h:201
unsigned char uint8
Definition: SYS_Types.h:36
virtual void extendedFill(int8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:377
virtual void doFillArrayAttr(UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:700
void getResult(fpreal64 *min, fpreal64 *max) const
Definition: GT_DataArray.h:580
virtual void doFillArrayAttr(UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:694
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:40
virtual const uint8 * get(GT_Offset i, uint8 *store, int sz) const
virtual void extendedFill(uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:371
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
Definition: glew.h:5268
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:32
GLuint buffer
Definition: glew.h:1680
virtual void extendedFill(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:413
virtual int64 getDataId() const
Definition: GT_DataArray.h:96
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
fillV3BoxTask(const GT_DataArray &array, T_POD *data, GT_Offset start, int stride)
Definition: GT_DataArray.h:728
GLuint GLuint GLsizei GLenum const void * indices
Definition: glew.h:1253
virtual void doFillArray(int8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:664
virtual bool getFA32(UT_ValArray< fpreal32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:121
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
virtual bool getIA8(UT_ValArray< int8 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:127
GLuint GLuint end
Definition: glew.h:1253
virtual bool getPointerAliasing(const void *data) const
Return "true" if there's pointer aliasing.
Definition: GT_DataArray.h:77
GLsizei n
Definition: glew.h:4040
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
virtual void doFillArrayAttr(UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:688
virtual void doFillArrayAttr(UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:691
int64 GT_Offset
Definition: GT_Types.h:114
long long int64
Definition: SYS_Types.h:116
GLsizei const GLchar *const * strings
Definition: glew.h:5883
virtual void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:660
virtual void extendedFillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1, fpreal black=0, fpreal white=1) const
Definition: GT_DataArray.h:353
virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
Definition: GT_DataArray.h:117
#define SYS_STATIC_FORCE_INLINE
Definition: SYS_Inline.h:48
T getValue(GT_Offset index) const
Public accessor for POD types.
Definition: GT_DataArray.h:878
signed char int8
Definition: SYS_Types.h:35
void enlargeBounds(const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
void fillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:286
void setDataId(int64 id)
Definition: GT_DataArray.h:527
fillV3BoxTask(fillV3BoxTask &src, UT_Split)
Definition: GT_DataArray.h:737
virtual void doFillArrayAttr(UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:706
void copyDataId(const GT_DataArray &src)
Definition: GT_DataArray.h:520
GLuint start
Definition: glew.h:1253
GLsizei stride
Definition: glew.h:1523
GT_Owner
Definition: GT_Types.h:76
void operator()(const UT_BlockedRange< GT_Size > &range)
Definition: GT_DataArray.h:568
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
minMaxTask(minMaxTask &src, UT_Split)
Definition: GT_DataArray.h:551
GLfloat GLfloat p
Definition: glew.h:16321
int64 GT_Size
Definition: GT_Types.h:113
void fillArray(int8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:274
GLsizei const GLchar *const * string
Definition: glew.h:1844
virtual bool getFA16(UT_ValArray< fpreal16 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:119
void fillArray(UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:330
virtual void doFillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:676
void fillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:314
virtual void doFillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:679
virtual void doFillArrayAttr(UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:703
void fillArray(UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:333
bool getMinMax(fpreal64 *min, fpreal64 *max) const
Enlarge a bounding box with values of this 3-tuple array.
Definition: GT_DataArray.h:468
virtual int16 getI16(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:103
void operator()(const UT_BlockedRange< exint > &range)
Definition: GT_DataArray.h:745
void fillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:307
short int16
Definition: SYS_Types.h:37
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual bool hasArrayEntries() const
Returns "true" if each entry is an array.
Definition: GT_DataArray.h:74
virtual void doFillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:682
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
OIIO_API bool copy(string_view from, string_view to, std::string &err)
void fillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1, fpreal black=0, fpreal white=1) const
Definition: GT_DataArray.h:295
virtual void doFillArrayAttr(UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:697
T bilerpValue(GT_Offset u0v0, GT_Offset u1v0, GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
Definition: GT_DataArray.h:888
GLuint64EXT * result
Definition: glew.h:14007
void fillArray(int32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:280
GLenum array
Definition: glew.h:9066
void fillArray(UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:339
vint4 min(const vint4 &a, const vint4 &b)
Definition: simd.h:4694
void fillArray(int64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:283
virtual void doFillArray(int32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:670
void join(const minMaxTask &src)
Definition: GT_DataArray.h:588
virtual int32 getI32(GT_Offset offset, int idx=0) const =0
SYS_STATIC_FORCE_INLINE GT_Size fixImportTupleSize(GT_Size size, GT_Size tuple_size)
Definition: GT_DataArray.h:632
virtual int8 getI8(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:101
virtual GT_Size getTupleSize() const =0
Number of elements for each array element.
#define SYSmin(a, b)
Definition: SYS_Math.h:1527
Declare prior to use.
void fillArray(UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length)
Definition: GT_DataArray.h:327
virtual void doFillArrayAttr(UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:685
GLdouble GLdouble t
Definition: glew.h:1398
Compute the min & max values for an array. This fails for strings.
Definition: GT_DataArray.h:537
virtual GT_Size getTotalArrayEntries() const
Definition: GT_DataArray.h:61
void UTparallelReduceLightItems(const Range &range, Body &body)
GLintptr offset
Definition: glew.h:1682