11 #ifndef __GT_GEOElementArray__
12 #define __GT_GEOElementArray__
32 GT_GEOATTRIB_INVALID = -1,
69 {
return "GT_GEOElementArray"; }
77 return myOffsets.entries();
79 switch (myOffsetOwner)
82 return myGdp->getNumVertexOffsets();
84 return myGdp->getNumPointOffsets();
86 return myGdp->getNumPrimitiveOffsets();
104 ? myAttribute->getTypeInfo()
113 if(!myAttribute->needsTransform())
120 return mapTypeInfo(info, myTupleSize);
123 {
return sizeof(*this); }
124 bool isValid()
const override {
return myAttribute != NULL; }
127 return myFA.isValid() ||
136 const int expected_size)
override;
143 {
return getValue_t<fpreal32>(
offset, idx); }
145 {
return getValue_t<fpreal32>(
offset, idx); }
147 {
return getValue_t<fpreal64>(
offset, idx); }
149 {
return getValue_t<int32>(
offset, idx); }
151 {
return getValue_t<int32>(
offset, idx); }
153 {
return getValue_t<int64>(
offset, idx); }
159 return mySTuple->getString(myAttribute, si,idx);
169 mySSArray->getString(myAttribute, si, a);
179 return mySDictTuple->getDict(myAttribute, si, idx);
188 mySDictArray->getDict(myAttribute, si, a);
195 int idx=0)
const override;
212 {
return getArrayValue_t<fpreal16>(
a,
offset); }
215 {
return getArrayValue_t<fpreal32>(
a,
offset); }
218 {
return getArrayValue_t<fpreal64>(
a,
offset); }
221 {
return getArrayValue_t<uint8>(
a,
offset); }
224 {
return getArrayValue_t<int8>(
a,
offset); }
227 {
return getArrayValue_t<int16>(
a,
offset); }
230 {
return getArrayValue_t<int32>(
a,
offset); }
233 {
return getArrayValue_t<int64>(
a,
offset); }
243 {
return getTuple_t(i, store, sz); }
245 {
return getTuple_t(i, store, sz); }
249 {
return getTuple_t(i, store,
z); }
252 if (
z == 3 && myV3.isValid())
263 for (
int i = 0; i <
z; ++i)
264 store[i] = myF.get(o, i);
267 return getTuple_t(idx, store,
z);
295 int tuple_size,
int stride)
const override;
297 int tuple_size,
int stride)
const override;
299 int tuple_size,
int stride)
const override;
301 int tuple_size,
int stride)
const override;
303 int tuple_size,
int stride)
const override;
305 int tuple_size,
int stride)
const override;
307 int tuple_size,
int stride)
const override;
309 int tuple_size,
int stride)
const override;
318 int tuple_size,
int stride,
322 int tuple_size,
int nrepeats,
int stride,
351 myOffsetOwner != myAttributeOwner)
355 gaoff = myGdp->vertexPoint(gaoff);
361 gaoff = myGdp->vertexPrimitive(gaoff);
376 template <
typename T>
inline T
382 if (myTuple && myTuple->get(myAttribute, si, val, idx))
387 template <
typename T>
inline const T *
391 if (myTuple && myTuple->get(myAttribute, si, store, size))
396 template <
typename T>
inline bool
401 if (myNumericArray &&
402 myNumericArray->get(myAttribute, si, val))
451 {
return sizeof(*this); }
458 const int expected_size)
override;
460 void createAttribute();
463 int64 myTopologyDataId;
464 int64 myPrimitiveListDataId;
465 const float myCuspAngle;
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
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 of a geometry attribute.
Data has no numeric representation.
virtual void doFillQuantizedArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride, fpreal black, fpreal white) const
Generic Attribute Interface class to access an attribute as a array.
GT_Dict getDict(GT_Offset offset, int idx=0) const override
A specialization of GA_AIFDictTuple to access "shared strings".
const GA_Attribute * myAttribute
T getValue_t(GT_Offset offset, int idx) const
fpreal32 getF32(GT_Offset offset, int idx) const override
const T * getTuple_t(GT_Offset offset, T *store, int size) const
bool getIA64(UT_ValArray< int64 > &a, GT_Offset offset) const override
virtual void fillStringArray(UT_StringArray &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
const GA_AIFTuple * myTuple
GT_Storage getStorage() const override
int64 getMemoryUsage() const override
bool getDictA(UT_Array< UT_OptionsHolder > &a, GT_Offset offset) const override
GA_AttributeOwner myAttributeOwner
int64 getI64(GT_Offset offset, int idx) const override
virtual void doImport(GT_Offset idx, uint8 *data, GT_Size size) const
GLdouble GLdouble GLdouble z
constexpr SYS_FORCE_INLINE T & z() noexcept
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
int64 getMemoryUsage() const override
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool isValid() const override
virtual GT_Size itemSize(GT_Offset) const
Return the number of elements in the array for the given item.
const GA_AIFSharedStringArray * mySSArray
virtual void doFillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int, int stride)
virtual bool computeMinMax(fpreal64 *min, fpreal64 *max) const
GLuint GLsizei const GLuint const GLintptr * offsets
bool getFA32(UT_ValArray< fpreal32 > &a, GT_Offset offset) const override
GU_ConstDetailHandle myGdh
virtual GT_Offset getDictIndex(GT_Offset offset, int idx=0) const =0
bool hasArrayEntries() const override
Abstract data class for an array of float, int or string data.
virtual GT_Size getStringIndexCount() const =0
const GA_AIFNumericArray * myNumericArray
virtual const uint8 * get(GT_Offset i, uint8 *store, int sz) const
fpreal64 getF64(GT_Offset offset, int idx) const override
void updateGeoDetail(const GU_ConstDetailHandle &dtl, const char *name, GT_Owner attrib_scope, const int expected_size) override
bool getUA8(UT_ValArray< uint8 > &a, GT_Offset offset) const override
static const UT_StringHolder theEmptyString
bool getIA8(UT_ValArray< int8 > &a, GT_Offset offset) const override
A GT Data Array to extract values from a point/primitive attribute.
static const UT_OptionsHolder theEmptyOptions
A specialization of GA_AIFStringArray to access "shared strings".
GLint GLenum GLboolean GLsizei stride
bool getIA32(UT_ValArray< int32 > &a, GT_Offset offset) const override
const GA_AIFStringTuple * mySTuple
virtual void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
virtual void getIndexedDicts(UT_Array< UT_OptionsHolder > &dicts, UT_IntArray &indices) const =0
GLuint const GLchar * name
virtual GT_Offset getStringIndex(GT_Offset offset, int idx=0) const =0
GT_Size entries() const override
const char * className() const override
uint8 getU8(GT_Offset offset, int idx) const override
bool getArrayValue_t(UT_ValArray< T > &val, GT_Offset offset) const
GT_GEOOffsetList myOffsets
GT_Size getTupleSize() const override
virtual void doImportArray(GT_Offset idx, UT_ValArray< fpreal16 > &data) const
GT_Type getTypeInfo() const override
Data represents a normal vector. Token "normal".
GA_AttributeOwner myOffsetOwner
A specialization of GA_AIFDictArray to access "shared strings".
bool getIA16(UT_ValArray< int16 > &a, GT_Offset offset) const override
A specialization of GA_AIFStringTuple to access "shared strings".
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Data represents a direction vector. Token "vector".
const GA_AIFSharedStringTuple * mySSTuple
Data represents a position in space. Token "point".
virtual void doExtendedQuantizedFill(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int nrepeats, int stride, fpreal black, fpreal white) const
virtual void getIndexedStrings(UT_StringArray &strings, UT_IntArray &indices) const =0
virtual void fillDictionaryArray(UT_Array< UT_OptionsHolder > &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
const GA_AIFSharedDictArray * mySDictArray
GT_String getS(GT_Offset offset, int idx) const override
bool getSA(UT_StringArray &a, GT_Offset offset) const override
fpreal16 getF16(GT_Offset offset, int idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Generic Attribute Interface class to access an attribute as a tuple.
virtual void doFillArrayAttr(UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
bool getFA16(UT_ValArray< fpreal16 > &a, GT_Offset offset) const override
virtual GT_Size getTotalArrayEntries() const
UT_UniquePtr< GA_ATINumeric > GA_ATINumericUPtr
virtual GT_Size getDictIndexCount() const =0
const GA_AIFSharedDictTuple * mySDictTuple
Generic Attribute Interface class to work with string indices directly, rather than string values...
int32 getI32(GT_Offset offset, int idx) const override
bool getFA64(UT_ValArray< fpreal64 > &a, GT_Offset offset) const override
constexpr SYS_FORCE_INLINE T & x() noexcept