HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <UT/UT_Assert.h>
18 #include <UT/UT_ParallelUtil.h>
19 #include <UT/UT_IntrusivePtr.h>
20 #include <UT/UT_Vector3.h>
21 #include <UT/UT_Vector4.h>
22 #include <UT/UT_Matrix3.h>
23 #include <UT/UT_Matrix4.h>
24 #include <UT/UT_BoundingBox.h>
25 
26 class UT_StringArray;
27 class UT_JSONWriter;
29 
32 
33 /// @brief Abstract data class for an array of float, int or string data
34 ///
35 /// This is an abstract class. The data does not have to be owned by this
36 /// array. The data can be generated on the fly by the class. Or the data
37 /// might be flat numeric data.
39  : public UT_IntrusiveRefCounter<GT_DataArray>
40 {
41 public:
42  GT_DataArray();
44  virtual ~GT_DataArray();
45 
46  virtual const char *className() const = 0;
47 
48  /// Create a "hardened" version of the array
49  virtual GT_DataArrayHandle harden() const;
50 
51  /// Type of data stored in the array
52  virtual GT_Storage getStorage() const = 0;
53 
54  /// Number of entries in the array
55  virtual GT_Size entries() const = 0;
56 
57  /// Number of elements for each array element
58  virtual GT_Size getTupleSize() const = 0;
59 
60  /// Get an approximation of the memory usage. Since data is shared, this
61  /// may be an over-estimation of the memory used.
62  virtual int64 getMemoryUsage() const = 0;
63 
64  /// Return "type" information for the data. This defaults to GT_TYPE_NONE
65  virtual GT_Type getTypeInfo() const;
66 
67  /// Returns "true" if each entry is an array.
68  virtual bool hasArrayEntries() const { return false; }
69 
70  /// Return "true" if there's pointer aliasing
71  virtual bool getPointerAliasing(const void *data) const
72  { return false; }
73 
74  /// Data array is valid; can be sampled from.
75  virtual bool isValid() const { return true; }
76 
77  /// Return the "data id" associated with the data. The data ID will be
78  /// incremented if the data is modified. An ID less than 0 indicates that
79  /// the data ID should always be considered unique and will never be the
80  /// same across evaluations. This data ID can be used to detect whether
81  /// attribute data has changed in similar tesselations.
82  virtual int64 getDataId() const { return myDataId; }
83 
84  /// @{
85  /// Get data out of the data array
86  virtual uint8 getU8(GT_Offset offset, int idx=0) const = 0;
87  virtual int32 getI32(GT_Offset offset, int idx=0) const = 0;
88  virtual int64 getI64(GT_Offset offset, int idx=0) const
89  { return getI32(offset, idx); }
90 
91  virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
92  { return getF32(offset, idx); }
93  virtual fpreal32 getF32(GT_Offset offset, int idx=0) const = 0;
94  virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
95  { return getF32(offset, idx); }
96 
97  virtual GT_String getS(GT_Offset offset, int idx=0) const = 0;
98  virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
99  { return false; }
100 
102  { return false; }
103  virtual bool getIA32(UT_ValArray<int32> &a, GT_Offset offset) const
104  { return false; }
105  /// @}
106 
107  /// @{
108  /// Get raw access to the data buffer (or fill the data array passed in)
109  /// If the array is unable to provide a raw pointer to the underlying data,
110  /// the GT_DataArrayHandle will be allocated to store the data, and it's
111  /// raw data will be returned.
112  ///
113  /// This means that the data returned will be destructed when the buffer is
114  /// destructed. Beware.
115  virtual const uint8 *getU8Array(GT_DataArrayHandle &buffer) const;
116  virtual const int32 *getI32Array(GT_DataArrayHandle &buffer) const;
117  virtual const int64 *getI64Array(GT_DataArrayHandle &buffer) const;
118  virtual const fpreal16 *getF16Array(GT_DataArrayHandle &buffer) const;
119  virtual const fpreal32 *getF32Array(GT_DataArrayHandle &buffer) const;
120  virtual const fpreal64 *getF64Array(GT_DataArrayHandle &buffer) const;
121  const fpreal *getRealArray(GT_DataArrayHandle &buffer) const;
122  /// @}
123 
124  /// When an array of strings is based on an indexed list of strings, this
125  /// method can be used to query the maximum number of indices. If the
126  /// strings are not indexed, the method should return -1.
127  virtual GT_Size getStringIndexCount() const = 0;
128 
129  /// When an array of strings is based on an indexed list of strings, this
130  /// method can be used to query each element's index. If the strings are
131  /// not indexed, the method should return -1.
132  virtual GT_Offset getStringIndex(GT_Offset offset, int idx=0) const = 0;
133 
134  /// When an array of strings is based on an indexed list of strings, this
135  /// method can be used to extract all the strings and their corresponding
136  /// indicies. It's possible that the indices may not be contiguous or may
137  /// even be out of order.
138  virtual void getIndexedStrings(UT_StringArray &strings,
139  UT_IntArray &indices) const = 0;
140  /// When an array of strings is based on an indexed list of strings, this
141  /// method can be used to extract all the strings. If an index is not
142  /// used, the string array may contain a NULL pointer. When you call @c
143  /// getStringIndex(), you can look up directly into the @c strings array
144  /// returned here.
145  ///
146  /// Note, if the strings are not stored as an indexed list, this method
147  /// will return an empty array.
148  virtual void getStrings(UT_StringArray &strings) const;
149 
150  /// Fill an array of std::string with the strings corresponding to each
151  /// entry. There must be @c entries() strings in the array. Only a single
152  /// tuple index is extracted.
153  void fillStrings(std::string *strings,
154  int tuple_idx=0) const;
155 
156  /// @{
157  /// Extract data out of the array in a template friendly fashion.
158  /// Unlike the @c get() methods, these methods will @b always copy data
159  /// into the buffers. If the @c size is 0, the tuple size will be used.
160  /// The data buffer must be big enough.
161  ///
162  /// If the size given is larger than getTupleSize(), only the first
163  /// @c getTupleSize() elements will be filled out (leaving the others
164  /// untouched).
165  void import(GT_Offset idx, int32 *data, GT_Size size=0) const
166  { doImport(idx, data, size); }
167  void import(GT_Offset idx, int64 *data, GT_Size size=0) const
168  { doImport(idx, data, size); }
169  void import(GT_Offset idx, fpreal16 *data, GT_Size size=0) const
170  { doImport(idx, data, size); }
171  void import(GT_Offset idx, fpreal32 *data, GT_Size size=0) const
172  { doImport(idx, data, size); }
173  void import(GT_Offset idx, fpreal64 *data, GT_Size size=0) const
174  { doImport(idx, data, size); }
175  void import(GT_Offset idx, UT_ValArray<fpreal32> &data) const
176  { doImportArray(idx, data); }
177  void import(GT_Offset idx, UT_ValArray<int32> &data) const
178  { doImportArray(idx, data); }
179  void import(GT_Offset idx, uint8 *data, GT_Size size=0,
180  fpreal black=0, fpreal white=1) const
181  {
182  if (GTisFloat(getStorage()))
183  doImportQuantized(idx, data, size, black, white);
184  else
185  doImport(idx, data, size);
186  }
187  /// @}
188 
189  /// @{
190  /// Extract data for the entire array into a flat data array.
191  /// By default, this is implemented as: @code
192  /// if (tuple_size <= 0)
193  /// tuple_size = getTupleSize();
194  /// for (GT_Offset idx = 0; idx < length; ++idx, data += tuple_size)
195  /// import(idx+start, data, tuple_size);
196  /// @endcode
197  /// Obviously, the @c data array should be big enough to hold @c
198  /// length*tuple_size elements.
199  ///
200  /// The tuple size (@c tsize) specifies how many elements to extract from
201  /// each element of this array. The @c stride specifies how many items to
202  /// skip over for each element. With a stride of -1, the stride will be
203  /// set to the @c tsize. Otherwise the stride will be set to the maximum
204  /// of @c tsize and @c stride.
205  ///
206  /// The stride can be useful when trying to interleave data. For example:
207  /// @code
208  /// float uvbuf[ucoord->entries()*2];
209  /// ucoord->fillArray(&uvbuf[0], 0, ucoord->entries(), 1, 2);
210  /// vcoord->fillArray(&uvbuf[1], 0, vcoord->entries(), 1, 2);
211  /// @endcode
213  int tsize, int stride=-1) const
214  { doFillArray(data, start, length, tsize, stride); }
216  int tsize, int stride=-1) const
217  { doFillArray(data, start, length, tsize, stride); }
219  int tsize, int stride=-1) const
220  { doFillArray(data, start, length, tsize, stride); }
222  int tsize, int stride=-1) const
223  { doFillArray(data, start, length, tsize, stride); }
225  int tsize, int stride=-1) const
226  { doFillArray(data, start, length, tsize, stride); }
229  int tsize, int stride=-1,
230  fpreal black=0, fpreal white=1) const
231  {
232  if(GTisFloat(getStorage()))
233  doFillQuantizedArray(data, start, length, tsize,
234  stride, black, white);
235  else
236  doFillArray(data, start, length, tsize, stride);
237  }
238 
240  UT_BoundingBoxF &bbox, int tsize, int stride=-1)
241  {
242  UT_ASSERT_P(tsize==3);
243  doFillVec3BBox(dest, start, length, bbox,
244  tsize, stride);
245  }
247  UT_BoundingBoxD &bbox, int tsize, int stride=-1)
248  {
249  UT_ASSERT_P(tsize==3);
250  doFillVec3BBox(dest, start, length, bbox,
251  tsize, stride);
252  }
253  /// @}
254 
255  virtual void extendedFillArray(uint8 *data,
257  int tsize, int nrepeats,
258  int stride=-1,
259  fpreal black=0, fpreal white=1) const
260  {
261  doExtendedQuantizedFill(data, start, length, tsize,
262  nrepeats, stride, black, white);
263  }
264 
265  /// @{
266  /// Extract an element, but making @c nrepeats copies. The buffer
267  /// should be able to contain @c length*nrepeats*tsize elements
268  /// When filling an RGB color, with a repeat count of 4, the resulting
269  /// buffer will look like: @code
270  /// [ RGB0 RGB0 RGB0 RGB0 RGB1 RGB1 RGB1 RGB1 ... ]
271  /// @endcode
272  /// With a repeat count of 1, this is equivalent to @c fillArray()
274  int tsize, int nrepeats, int stride=-1) const
275  {
276  t_extendedFill(data, start, length, tsize,
277  nrepeats, stride);
278  }
280  int tsize, int nrepeats, int stride=-1) const
281  {
282  t_extendedFill(data, start, length, tsize,
283  nrepeats, stride);
284  }
286  int tsize, int nrepeats, int stride=-1) const
287  {
288  t_extendedFill(data, start, length, tsize,
289  nrepeats, stride);
290  }
292  int tsize, int nrepeats, int stride=-1) const
293  {
294  t_extendedFill(data, start, length, tsize,
295  nrepeats, stride);
296  }
298  int tsize, int nrepeats, int stride=-1) const
299  {
300  t_extendedFill(data, start, length, tsize,
301  nrepeats, stride);
302  }
304  int tsize, int nrepeats, int stride=-1) const
305  {
306  t_extendedFill(data, start, length, tsize,
307  nrepeats, stride);
308  }
309  /// @}
310 
311  /// @{
312  /// Copy the data out of the array as a tuple of @em size entries
313  /// The data may be copied, or the array may return a pointer to raw data.
314  /// That is, the sub-class may @b not copy the data into the storage.
315  virtual const uint8 *get(GT_Offset i, uint8 *store, int sz) const;
316  virtual const int32 *get(GT_Offset i, int32 *store, int sz) const;
317  virtual const int64 *get(GT_Offset i, int64 *store, int sz) const;
318  virtual const fpreal16 *get(GT_Offset i, fpreal16 *store, int z) const;
319  virtual const fpreal32 *get(GT_Offset i, fpreal32 *store, int z) const;
320  virtual const fpreal64 *get(GT_Offset i, fpreal64 *store, int z) const;
321  /// @}
322 
323  /// @{
324  /// Get the range of values in the array
325  virtual void getRange(exint &lo, exint &hi, int tuple_idx=0) const;
326  virtual void getRange(fpreal &lo, fpreal &hi, int tidx=0) const;
327  /// @}
328 
329  /// Compare whether two data arrays are equal.
330  bool isEqual(const GT_DataArray &src) const;
331 
332  /// Test to see whether the data array requires int32 or int64 indexing.
333  GT_Storage checkIndexing(GT_IndexingMode mode) const;
334 
335  /// Quick & dirty test to see if a size is bigger than a 32 bit int
336  static bool isBigInteger(GT_Size size)
337  { return size >= (((int64)1) << 31); }
338 
339  /// For debugging, print values to stdout
340  void dumpValues(const char *msg=NULL) const;
341 
342  /// Save array to a JSON stream. The 'flat' determines how to output
343  /// arrays with a tuple size greater than 1. If 'flat' is true, the
344  /// output will be an uninterrupted stream of values. If 'flat' is
345  /// false, then the output will look something like [[1,2,3],[4,5,6], ... ]
346  bool save(UT_JSONWriter &w, bool flat = true) const;
347 
348  /// @{
349  /// For memory tracking, we override the new/delete operators
350  static void *operator new(size_t size);
351  static void *operator new(size_t size, void *p);
352  static void operator delete(void *p, size_t size);
353  /// @}
354 
355  /// Forcibly set the data id for the array. You take responsibility for
356  /// all artifacts and crashes if you call this indiscriminately.
357  void copyDataId(const GT_DataArray &src)
358  { setDataId(src.getDataId()); }
359 
360  /// Set the data id - This is used by geometry arrays to copy over the data
361  /// id from GA. As above, you take responsibility for all artifacts and
362  /// crashes if you set this incorrectly. Do not set this if you don't
363  /// know how data IDs work.
364  void setDataId(int64 id) { myDataId = id; }
365 
366  /// Update cached data, in case the underlying attribute changed.
367  virtual void updateGeoDetail(const GU_ConstDetailHandle &dtl,
368  const char *attrib_name,
369  GT_Owner attrib_owner,
370  const int expected_size) {}
371 
372 protected:
373  /// Ensure the size is set properly when performing an import. If the size
374  /// isn't specified, we use the array's tuple size, otherwise we make sure
375  /// to clamp the tuple size.
378  {
379  return size == 0 ? tuple_size : SYSmin(size, tuple_size);
380  }
381 
382  /// @{
383  /// Virtual implementation for inline methods.
384  /// Note that @c doImport is for tuple data, while @c doImportArray
385  /// is for tuple array data.
386  virtual void doImport(GT_Offset idx, uint8 *data, GT_Size size) const;
387  virtual void doImport(GT_Offset idx, int32 *data, GT_Size size) const;
388  virtual void doImport(GT_Offset idx, int64 *data, GT_Size size) const;
389  virtual void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const;
390  virtual void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const;
391  virtual void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const;
392  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal32> &data) const;
393  virtual void doImportArray(GT_Offset idx, UT_ValArray<int32> &data) const;
394  virtual void doImportQuantized(GT_Offset idx, uint8 *data, GT_Size size,
395  fpreal black, fpreal white) const;
396 
398  int tuple_size, int stride) const
399  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
400 
402  int tuple_size, int stride) const
403  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
405  int tuple_size, int stride) const
406  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
408  int tuple_size, int stride) const
409  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
411  int tuple_size, int stride) const
412  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
414  int tuple_size, int stride) const
415  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
416 
419  int tuple_size, int stride,
420  fpreal black, fpreal white) const
421  {
422  doExtendedQuantizedFill(data, start, length, tuple_size,
423  1, stride, black, white);
424  }
425  virtual void doExtendedQuantizedFill(uint8 *data,
427  int tuple_size, int nrepeats, int stride,
428  fpreal black, fpreal white) const;
429 
430  /// Nested class to perform filling for a POD array
431  template <typename T_POD>
433  {
434  public:
435  fillV3BoxTask(const GT_DataArray &array, T_POD *data,
436  GT_Offset start, int stride)
437  : myArray(array)
438  , myData(data)
439  , myStart(start)
440  , myStride(stride)
441  {
442  myBox.initBounds();
443  }
445  : myArray(src.myArray)
446  , myBox(src.myBox)
447  , myData(src.myData)
448  , myStart(src.myStart)
449  , myStride(src.myStride)
450  {
451  }
453  {
454  exint i = range.begin();
455  T_POD *dest = myData + i*myStride;
456  for (; i != range.end(); ++i, dest += myStride)
457  {
458  myArray.import(i+myStart, dest, 3);
459  myBox.enlargeBounds(dest[0], dest[1], dest[2]);
460  }
461  }
462  void join(const fillV3BoxTask<T_POD> &src)
463  {
464  myBox.enlargeBounds(src.myBox);
465  }
466  const UT_BoundingBox &box() const { return myBox; }
467  private:
468  const GT_DataArray &myArray;
469  UT_BoundingBox myBox;
470  T_POD *myData;
471  GT_Offset myStart;
472  int myStride;
473  };
474 
476  UT_BoundingBoxF &bbox, int, int stride)
477  {
478  stride = SYSmax(stride, 3);
479  fillV3BoxTask<fpreal32> task(*this, dest, start, stride);
481  bbox = task.box();
482  }
484  UT_BoundingBoxD &bbox, int, int stride)
485  {
486  stride = SYSmax(stride, 3);
487  fillV3BoxTask<fpreal64> task(*this, dest, start, stride);
489  bbox = task.box();
490  }
491  /// @}
492 
493  /// Templated method to fill an array
494  template <typename T_POD> void
495  t_extendedFill(T_POD *dest, GT_Offset start, GT_Size length,
496  int tsize, int nrepeats, int stride) const;
497 
498 private:
499  /// @{
500  /// @private
501  /// Get more complicated POD data types out of the array
502  template <typename T, int tuplesize> class VectorPODAccessor
503  {
504  public:
505  static T getValue(const GT_DataArray &array, GT_Offset offset)
506  {
507  T result;
508  UT_ASSERT_P(array.getTupleSize() >= tuplesize);
509  array.get(offset, result.data(), tuplesize);
510  return result;
511  }
512  };
513  class I32Accessor {
514  public:
515  static int32 getValue(const GT_DataArray &a, GT_Offset i)
516  { return a.getI32(i); }
517  };
518  class I64Accessor {
519  public:
520  static int64 getValue(const GT_DataArray &a, GT_Offset i)
521  { return a.getI64(i); }
522  };
523  class F16Accessor {
524  public:
525  static fpreal16 getValue(const GT_DataArray &a, GT_Offset i)
526  { return a.getF16(i); }
527  };
528  class F32Accessor {
529  public:
530  static fpreal32 getValue(const GT_DataArray &a, GT_Offset i)
531  { return a.getF32(i); }
532  };
533  class F64Accessor {
534  public:
535  static fpreal64 getValue(const GT_DataArray &a, GT_Offset i)
536  { return a.getF64(i); }
537  };
538  /// @}
539 
540  /// @{
541  /// @private
542  /// Private template class to register POD accessors
543  template <typename T, int FAKE> class TypeInfo {};
544 
545  /// @{
546  /// @private
547  /// Simple scalar and vector accessors
548  template <int FAKE> class TypeInfo<int32, FAKE>
549  { public: typedef I32Accessor Accessors; };
550  template <int FAKE> class TypeInfo<int64, FAKE>
551  { public: typedef I64Accessor Accessors; };
552  template <int FAKE> class TypeInfo<fpreal16, FAKE>
553  { public: typedef F16Accessor Accessors; };
554  template <int FAKE> class TypeInfo<fpreal32, FAKE>
555  { public: typedef F32Accessor Accessors; };
556  template <int FAKE> class TypeInfo<fpreal64, FAKE>
557  { public: typedef F64Accessor Accessors; };
558 
559  template <int FAKE> class TypeInfo<UT_Vector3F, FAKE>
560  { public: typedef VectorPODAccessor<UT_Vector3F, 3> Accessors; };
561  template <int FAKE> class TypeInfo<UT_Vector3D, FAKE>
562  { public: typedef VectorPODAccessor<UT_Vector3D, 3> Accessors; };
563  template <int FAKE> class TypeInfo<UT_Vector4F, FAKE>
564  { public: typedef VectorPODAccessor<UT_Vector4F, 4> Accessors; };
565  template <int FAKE> class TypeInfo<UT_Vector4D, FAKE>
566  { public: typedef VectorPODAccessor<UT_Vector4D, 4> Accessors; };
567  template <int FAKE> class TypeInfo<UT_Matrix3F, FAKE>
568  { public: typedef VectorPODAccessor<UT_Matrix3F, 9> Accessors; };
569  template <int FAKE> class TypeInfo<UT_Matrix3D, FAKE>
570  { public: typedef VectorPODAccessor<UT_Matrix3D, 9> Accessors; };
571  template <int FAKE> class TypeInfo<UT_Matrix4F, FAKE>
572  { public: typedef VectorPODAccessor<UT_Matrix4F, 16> Accessors; };
573  template <int FAKE> class TypeInfo<UT_Matrix4D, FAKE>
574  { public: typedef VectorPODAccessor<UT_Matrix4D, 16> Accessors; };
575  /// @}
576 public:
577  /// Public accessor for POD types
578  template <typename T> T
580  { return TypeInfo<T, 0>::Accessors::getValue(*this, index); }
581 
582  template <typename T> T
584  {
585  return (1-t)*getValue<T>(i0) + t*getValue<T>(i1);
586  }
587 
588  template <typename T> T
590  GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
591  {
592  T l = (1-v)*getValue<T>(u0v0) + v*getValue<T>(u0v1);
593  T r = (1-v)*getValue<T>(u1v0) + v*getValue<T>(u1v1);
594  return (1-u)*l + u*r;
595  }
596 
597 private:
598  int64 myDataId;
599 };
600 
601 #endif
#define SYSmax(a, b)
Definition: SYS_Math.h:1365
GT_Storage
Definition: GT_Types.h:17
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:367
virtual bool getIA32(UT_ValArray< int32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:103
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:417
virtual bool isValid() const
Data array is valid; can be sampled from.
Definition: GT_DataArray.h:75
GLsizei GLenum const void * indices
Definition: glcorearb.h:405
GLenum GLint * range
Definition: glcorearb.h:1924
virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:91
tbb::split UT_Split
Definition: GA_PolyCounts.h:24
virtual void extendedFill(int32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:279
void fillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:224
Nested class to perform filling for a POD array.
Definition: GT_DataArray.h:432
virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:94
T lerpValue(GT_Offset i0, GT_Offset i1, fpreal t) const
Definition: GT_DataArray.h:583
const GLdouble * v
Definition: glcorearb.h:836
void join(const fillV3BoxTask< T_POD > &src)
Definition: GT_DataArray.h:462
GLuint start
Definition: glcorearb.h:474
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
const char * GT_String
Definition: GT_Types.h:108
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
GT_IndexingMode
Definition: GT_Types.h:88
virtual fpreal32 getF32(GT_Offset offset, int idx=0) const =0
#define GT_API
Definition: GT_API.h:11
const UT_BoundingBox & box() const
Definition: GT_DataArray.h:466
GT_Type
Definition: GT_Types.h:31
virtual int64 getI64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:88
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
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:336
virtual void extendedFill(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:291
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
virtual void extendedFill(int64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:285
A reference counter base class for use with UT_IntrusivePtr.
4D Vector class.
Definition: UT_Vector4.h:152
virtual void doFillArray(int64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:404
GLuint buffer
Definition: glcorearb.h:659
png_uint_32 i
Definition: png.h:2877
virtual void doFillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int, int stride)
Definition: GT_DataArray.h:483
virtual void extendedFill(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:297
virtual void doFillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int, int stride)
Definition: GT_DataArray.h:475
void fillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:221
GLsizeiptr size
Definition: glcorearb.h:663
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:101
GLuint id
Definition: glcorearb.h:654
long long int64
Definition: SYS_Types.h:106
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:38
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:273
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:30
int64 exint
Definition: SYS_Types.h:115
virtual void extendedFill(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:303
virtual int64 getDataId() const
Definition: GT_DataArray.h:82
fillV3BoxTask(const GT_DataArray &array, T_POD *data, GT_Offset start, int stride)
Definition: GT_DataArray.h:435
double fpreal64
Definition: SYS_Types.h:191
GLint GLenum GLboolean GLsizei stride
Definition: glcorearb.h:871
virtual bool getFA32(UT_ValArray< fpreal32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:101
GLintptr offset
Definition: glcorearb.h:664
virtual bool getPointerAliasing(const void *data) const
Return "true" if there's pointer aliasing.
Definition: GT_DataArray.h:71
virtual void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:397
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:255
virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
Definition: GT_DataArray.h:98
#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:579
GLboolean * data
Definition: glcorearb.h:130
int int32
Definition: SYS_Types.h:34
GLsizei const GLchar *const * strings
Definition: glcorearb.h:1932
void fillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:218
void setDataId(int64 id)
Definition: GT_DataArray.h:364
fillV3BoxTask(fillV3BoxTask &src, UT_Split)
Definition: GT_DataArray.h:444
void copyDataId(const GT_DataArray &src)
Definition: GT_DataArray.h:357
GLenum mode
Definition: glcorearb.h:98
GT_Owner
Definition: GT_Types.h:72
virtual void doFillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:407
double fpreal
Definition: SYS_Types.h:269
void fillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:246
png_infop png_sPLT_tpp entries
Definition: png.h:2481
virtual void doFillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:410
void operator()(const UT_BlockedRange< exint > &range)
Definition: GT_DataArray.h:452
void fillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:239
unsigned char uint8
Definition: SYS_Types.h:31
virtual bool hasArrayEntries() const
Returns "true" if each entry is an array.
Definition: GT_DataArray.h:68
GLuint index
Definition: glcorearb.h:785
virtual void doFillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:413
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:227
T bilerpValue(GT_Offset u0v0, GT_Offset u1v0, GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
Definition: GT_DataArray.h:589
void fillArray(int32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:212
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
GLboolean r
Definition: glcorearb.h:1221
int64 GT_Offset
Definition: GT_Types.h:110
int64 GT_Size
Definition: GT_Types.h:109
void fillArray(int64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:215
virtual void doFillArray(int32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:401
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:377
virtual GT_Size getTupleSize() const =0
Number of elements for each array element.
#define SYSmin(a, b)
Definition: SYS_Math.h:1366
Declare prior to use.
float fpreal32
Definition: SYS_Types.h:190
void UTparallelReduceLightItems(const Range &range, Body &body)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
GLenum src
Definition: glcorearb.h:1792