19 #ifndef __GA_GBElement__
20 #define __GA_GBElement__
60 : myIndexMap(&index_map)
71 : myIndexMap(src.myIndexMap)
72 , myOffset(src.myOffset)
83 myIndexMap = src.myIndexMap;
84 myOffset = src.myOffset;
89 return myIndexMap == src.myIndexMap &&
90 myOffset == src.myOffset;
106 {
return myIndexMap->indexFromOffset(myOffset); }
115 const GA_GBElement &
src,
133 bool isPrimary()
const;
148 bool copy_point_P=false)
150 gaCopyAttribData(src, src_dict, dest_dict,
151 copy_point_P ? NULL : getDetail().getP());
156 bool copy_point_P=false)
158 copyAttribData(src, dict, dict, copy_point_P);
161 void copyAttributeValues(const GA_GBElement &
src,
163 bool copy_point_P=false)
165 copyAttribData(src, dict, copy_point_P);
171 bool scale_point_P=false);
173 void addAttributeValues(const GA_GBElement &
src,
177 bool add_point_P=false);
179 void addAttributeValues(const GA_GBElement &src,
182 bool add_point_P=false)
184 addAttributeValues(src, dict, dict, scale, add_point_P);
187 void lerpAttributeValues(const GA_GBElement &
v0,
188 const GA_GBElement &
v1,
192 bool lerp_point_P=false);
194 void lerpAttributeValues(const GA_GBElement &v0,
195 const GA_GBElement &v1,
198 bool lerp_point_P=false)
200 lerpAttributeValues(v0, v1, bias, dict, dict, lerp_point_P);
208 template <
typename T>
class BasicAccessors
221 if (!
h.getAIFTuple() ||
222 !
h.getAIFTuple()->get(
h.getAttribute(), off,
242 memset(val, 0,
sizeof(
T)*
count);
256 template <
typename T,
typename BASIC_T>
class PODCompoundAccessors
269 const size_t n_basic =
270 sizeof(
T)/
sizeof(BASIC_T);
279 const T &val,
int index)
281 const size_t n_basic =
282 sizeof(
T)/
sizeof(BASIC_T);
285 (
const BASIC_T *)&val,
295 count*
sizeof(
T)/
sizeof(BASIC_T)))
298 for (
int i = 0; i <
count; i++)
303 const T *val,
int count)
307 (
const BASIC_T *)val,
308 count*
sizeof(
T)/
sizeof(BASIC_T));
323 template <
typename T,
int FAKE>
class TypeInfo
329 template <
int FAKE>
class TypeInfo<
fpreal32, FAKE>
330 {
public:
typedef BasicAccessors<fpreal32> Accessors; };
331 template <
int FAKE>
class TypeInfo<
int32, FAKE>
332 {
public:
typedef BasicAccessors<int32> Accessors; };
334 template <
int FAKE>
class TypeInfo<
fpreal64, FAKE>
335 {
public:
typedef BasicAccessors<fpreal64> Accessors; };
336 template <
int FAKE>
class TypeInfo<
int64, FAKE>
337 {
public:
typedef BasicAccessors<int64> Accessors; };
339 template <
int FAKE>
class TypeInfo<
UT_Vector2, FAKE>
340 {
public:
typedef PODCompoundAccessors<UT_Vector2, fpreal32> Accessors; };
341 template <
int FAKE>
class TypeInfo<
UT_Vector3, FAKE>
342 {
public:
typedef PODCompoundAccessors<UT_Vector3, fpreal32> Accessors; };
343 template <
int FAKE>
class TypeInfo<
UT_Vector4, FAKE>
344 {
public:
typedef PODCompoundAccessors<UT_Vector4, fpreal32> Accessors; };
346 {
public:
typedef PODCompoundAccessors<UT_Quaternion, fpreal32> Accessors; };
347 template <
int FAKE>
class TypeInfo<
UT_Matrix3, FAKE>
348 {
public:
typedef PODCompoundAccessors<UT_Matrix3, fpreal32> Accessors; };
349 template <
int FAKE>
class TypeInfo<
UT_Matrix4, FAKE>
350 {
public:
typedef PODCompoundAccessors<UT_Matrix4, fpreal32> Accessors; };
378 &h.getAttribute()->getDetail() == &getDetail());
379 return aif->
getString(h.getAttribute(), getMapOffset(),
391 &h.getAttribute()->getDetail() == &getDetail());
392 aif->
setString(h.getAttribute(), getMapOffset(),
396 template <
typename T>
401 &h.getAttribute()->getDetail() == &getDetail());
403 h, getMapOffset(), index);
405 template <
typename T>
411 &h.getAttribute()->getDetail() == &getDetail());
412 TypeInfo<T,0>::Accessors::set(
413 h, getMapOffset(), val, index);
415 template <
typename T>
420 &h.getAttribute()->getDetail() == &getDetail());
422 h, getMapOffset(), val, index);
424 template <
typename T>
429 &h.getAttribute()->getDetail() == &getDetail());
431 h, getMapOffset(), val, count);
433 template <
typename T>
438 &h.getAttribute()->getDetail() == &getDetail());
439 TypeInfo<T,0>::Accessors::set(
440 h, getMapOffset(), val, count);
446 void gaCopyAttribData(
const GA_GBElement *
src,
448 void gaCopyAttribData(
const GA_GBElement &
src,
452 void gaCopyAttribData(
const GA_GBElement &
src,
A class to manage an ordered array which has fixed offset handles.
Definition of a geometry attribute.
GA_Index getMapIndex() const
Provide the ordered GA_Index of this element in its GA_IndexMap.
GA_Attribute * getAttribute() const
GA_Offset getMapOffset() const
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
This class provides a way to manage a reference to an attribute permitting Write-Only access...
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
GA_GBElement & operator=(const GA_GBElement &src)
__hostdev__ void setValue(uint32_t offset, bool v)
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
virtual const char * getString(const GA_Attribute *attrib, GA_Offset ai, int tuple_index=0) const =0
Get a single string from the array for a single tuple of an element.
virtual bool get(const GA_Attribute *attrib, GA_Offset ai, int32 &data, int index=0) const =0
__hostdev__ float getValue(uint32_t i) const
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
const GA_AIFTuple * getAIFTuple() const
GA_API const UT_StringHolder scale
This class provides a way to manage a reference to an attribute permitting Read-Write access...
This class provides a way to manage a reference to an attribute permitting Read-Only access...
GA_GBElement(const GA_IndexMap &index_map, GA_Offset offset)
auto get(const UT_ARTIterator< T > &it) -> decltype(it.key())
A handle to simplify manipulation of multiple attributes.
GA_Detail & getDetail() const
Provide access to the GA_Detail containing this element.
Defragmentation of IndexMaps.
#define SYS_DEPRECATED_HDK(__V__)
GA_GBElement(const GA_GBElement &src)
Copy c-tor.
virtual bool set(GA_Attribute *attrib, GA_Offset ai, int32 data, int comp=-1) const =0
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
GLfloat GLfloat GLfloat GLfloat h
GA_GBElement()
Default c-tor.
bool operator==(const GA_GBElement &src) const
Container class for all geometry.
virtual bool setString(GA_Attribute *attrib, GA_Offset ai, const char *string, int tuple_index) const =0
Set a single component for a single element.
Generic Attribute Interface class to work with string indices directly, rather than string values...
const GA_IndexMap & getIndexMap() const
Provide access to the GA_IndexMap containing this element.