11 #ifndef __GT_AttributeList__
12 #define __GT_AttributeList__
54 template <
typename... Pairs>
57 int n = gt_CountAttribs(std::forward<Pairs>(pairs)...);
60 gt_CreateAttributeList(*list, *list->getMap(),
61 std::forward<Pairs>(pairs)...);
78 bool replace_existing)
const;
82 bool replace_existing)
const
84 return addAttribute(name, &h, 1, replace_existing);
103 void harden(
int idx);
110 {
return myMap->entries(); }
114 int64 getMemoryUsage()
const;
118 {
return myMotionSegments; }
122 {
return myMap->getNames(); }
128 return get(myMap->get(
name), segment);
135 {
return myMap->getName(index); }
139 {
return myMap->getExportName(index); }
143 {
return myMap->getOriginalOwner(idx); }
147 {
return myMap->get(name); }
151 {
return myMap->hasName(name); }
155 int motion_segment=0);
158 void setAllSegments(
int idx,
172 bool copySegment(
int dest_segment,
174 int source_segment=0);
191 bool flatten_nested =
true)
const;
202 bool replace_existing =
false)
const;
248 bool getDataIdHash(
int64 &hash,
int segment=0)
const;
255 void dumpList(
const char *
label=
"",
bool data_too =
true);
264 : myList(NULL), myCurr(0), mySize(0), mySegment(0) {}
271 return myList->get(myCurr,
276 return myList->getName(myCurr);
281 bool atEnd()
const {
return myCurr >= mySize; }
298 mySize(list->entries()) {}
301 int myCurr, mySize, mySegment;
308 class gt_CreateIndirectTask;
309 friend class gt_CreateIndirectTask;
315 int motion_segments);
322 template <
typename DataT,
typename... Pairs>
327 return (
data ? 1 : 0) + gt_CountAttribs(std::forward<Pairs>(pairs)...);
334 template <
typename DataT,
typename... Pairs>
336 gt_CreateAttributeList(
345 int i = map.
add(name,
false);
349 gt_CreateAttributeList(list, map, std::forward<Pairs>(pairs)...);
368 bool flatten_nested)
const;
370 inline int getSegmentIndex(
int index,
int segment)
const
371 {
return index + segment*entries(); }
375 int myMotionSegments;
Keep track of merging of attribute maps.
GLuint GLsizei const GLchar * label
GLenum const void * lists
void set(int idx, const GT_DataArrayHandle &h, int motion_segment=0)
Assign an array to a given index in the list.
A symbol table for attribute data.
const GT_DataArrayHandle & getData() const
SYS_NO_DISCARD_RESULT GT_AttributeListHandle addAttribute(const UT_StringHolder &name, const GT_DataArrayHandle &h, bool replace_existing) const
int getIndex(const UT_StringRef &name) const
Return the index for a given name (returns -1 if miss)
GLboolean GLboolean GLboolean GLboolean a
const GT_AttributeMapHandle & getMap() const
Get a handle to the name map for this list.
Class which writes ASCII or binary JSON streams.
A reference counter base class for use with UT_IntrusivePtr.
const UT_StringHolder & getName(int index) const
Return the name for a given index.
int add(const UT_StringHolder &name, bool replace_existing)
iterator(const iterator &src)
#define UT_ASSERT_MSG(ZZ,...)
const UT_StringArray & getNames() const
Return the list of names.
const UT_StringHolder & getExportName(int index) const
Return the export name for a given index.
Abstract data class for an array of float, int or string data.
constexpr auto set(type rhs) -> int
#define SYS_NO_DISCARD_RESULT
static GT_AttributeListHandle createAttributeList(Pairs &&...pairs)
GLuint const GLchar * name
int entries() const
Return the number of attributes in the list.
GLboolean GLboolean GLboolean b
GA_API const UT_StringHolder transform
const UT_StringHolder & getName() const
GLfloat GLfloat GLfloat GLfloat h
int getSegments() const
Return the number of motion segements.
iterator begin(int segment=0) const
Traverse over all attributes for a given motion segment.
GT_Owner getOriginalOwner(int idx) const
Get original attribute owner for the given attribute.
GLubyte GLubyte GLubyte GLubyte w
const iterator & operator=(const iterator &src)
bool hasName(const UT_StringRef &name) const
Test of an attribute name exists.