11 #ifndef __GT_GEOElementArray__
12 #define __GT_GEOElementArray__
32 GT_GEOATTRIB_INVALID = -1,
66 {
return "GT_GEOElementArray"; }
74 return myOffsets.entries();
76 switch (myOffsetOwner)
79 return myGdp->getNumVertexOffsets();
81 return myGdp->getNumPointOffsets();
83 return myGdp->getNumPrimitiveOffsets();
101 ? myAttribute->getTypeInfo()
110 if(!myAttribute->needsTransform())
117 return mapTypeInfo(info, myTupleSize);
120 {
return sizeof(*this); }
121 bool isValid()
const override {
return myAttribute != NULL; }
124 return myFA.isValid() ||
133 const int expected_size)
override;
140 {
return getValue_t<fpreal32>(
offset, idx); }
142 {
return getValue_t<fpreal32>(
offset, idx); }
144 {
return getValue_t<fpreal64>(
offset, idx); }
146 {
return getValue_t<int32>(
offset, idx); }
148 {
return getValue_t<int32>(
offset, idx); }
150 {
return getValue_t<int64>(
offset, idx); }
156 return mySTuple->getString(myAttribute, si,idx);
166 mySSArray->getString(myAttribute, si, a);
176 return mySDictTuple->getDict(myAttribute, si, idx);
185 mySDictArray->getDict(myAttribute, si, a);
192 int idx=0)
const override;
209 {
return getArrayValue_t<fpreal16>(
a,
offset); }
212 {
return getArrayValue_t<fpreal32>(
a,
offset); }
215 {
return getArrayValue_t<fpreal64>(
a,
offset); }
218 {
return getArrayValue_t<uint8>(
a,
offset); }
221 {
return getArrayValue_t<int8>(
a,
offset); }
224 {
return getArrayValue_t<int16>(
a,
offset); }
227 {
return getArrayValue_t<int32>(
a,
offset); }
230 {
return getArrayValue_t<int64>(
a,
offset); }
240 {
return getTuple_t(i, store, sz); }
242 {
return getTuple_t(i, store, sz); }
246 {
return getTuple_t(i, store,
z); }
249 if (
z == 3 && myV3.isValid())
260 for (
int i = 0; i <
z; ++i)
261 store[i] = myF.get(o, i);
264 return getTuple_t(idx, store,
z);
292 int tuple_size,
int stride)
const override;
294 int tuple_size,
int stride)
const override;
296 int tuple_size,
int stride)
const override;
298 int tuple_size,
int stride)
const override;
300 int tuple_size,
int stride)
const override;
302 int tuple_size,
int stride)
const override;
304 int tuple_size,
int stride)
const override;
306 int tuple_size,
int stride)
const override;
315 int tuple_size,
int stride,
319 int tuple_size,
int nrepeats,
int stride,
348 myOffsetOwner != myAttributeOwner)
352 gaoff = myGdp->vertexPoint(gaoff);
358 gaoff = myGdp->vertexPrimitive(gaoff);
373 template <
typename T>
inline T
379 if (myTuple && myTuple->get(myAttribute, si, val, idx))
384 template <
typename T>
inline const T *
388 if (myTuple && myTuple->get(myAttribute, si, store, size))
393 template <
typename T>
inline bool
398 if (myNumericArray &&
399 myNumericArray->get(myAttribute, si, val))
448 {
return sizeof(*this); }
455 const int expected_size)
override;
457 void createAttribute();
460 int64 myTopologyDataId;
461 int64 myPrimitiveListDataId;
462 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