11 #ifndef __GT_AttributeList__
12 #define __GT_AttributeList__
53 template <
typename... Pairs>
56 int n = gt_CountAttribs(std::forward<Pairs>(pairs)...);
59 gt_CreateAttributeList(*list, *list->getMap(),
60 std::forward<Pairs>(pairs)...);
74 bool replace_existing)
const;
77 bool replace_existing)
const
79 return addAttribute(name, &h, 1, replace_existing);
100 {
return myMap->entries(); }
104 int64 getMemoryUsage()
const;
108 {
return myMotionSegments; }
112 {
return myMap->getNames(); }
118 return get(myMap->get(
name), segment);
125 {
return myMap->getName(index); }
129 {
return myMap->getExportName(index); }
133 {
return myMap->getOriginalOwner(idx); }
137 {
return myMap->get(name); }
141 {
return myMap->hasName(name); }
145 int motion_segment=0);
148 void setAllSegments(
int idx,
162 bool copySegment(
int dest_segment,
164 int source_segment=0);
181 bool flatten_nested =
true)
const;
192 bool replace_existing =
false)
const;
238 bool getDataIdHash(
int64 &hash,
int segment=0)
const;
245 void dumpList(
const char *
label=
"",
bool data_too =
true);
254 : myList(NULL), myCurr(0), mySize(0), mySegment(0) {}
261 return myList->get(myCurr,
266 return myList->getName(myCurr);
271 bool atEnd()
const {
return myCurr >= mySize; }
288 mySize(list->entries()) {}
291 int myCurr, mySize, mySegment;
298 class gt_CreateIndirectTask;
299 friend class gt_CreateIndirectTask;
305 int motion_segments);
312 template <
typename DataT,
typename... Pairs>
317 return (
data ? 1 : 0) + gt_CountAttribs(std::forward<Pairs>(pairs)...);
324 template <
typename DataT,
typename... Pairs>
326 gt_CreateAttributeList(
335 int i = map.
add(name,
false);
339 gt_CreateAttributeList(list, map, std::forward<Pairs>(pairs)...);
358 bool flatten_nested)
const;
360 inline int getSegmentIndex(
int index,
int segment)
const
361 {
return index + segment*entries(); }
365 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
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.
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
GT_AttributeListHandle addAttribute(const UT_StringHolder &name, const GT_DataArrayHandle &h, bool replace_existing) 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.