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