11 #ifndef __GT_AttributeList__
12 #define __GT_AttributeList__
52 template <
typename... Pairs>
55 int n = gt_CountAttribs(std::forward<Pairs>(pairs)...);
58 gt_CreateAttributeList(*list, *list->getMap(),
59 std::forward<Pairs>(pairs)...);
73 bool replace_existing)
const;
76 bool replace_existing)
const
78 return addAttribute(name, &h, 1, replace_existing);
99 {
return myMap->entries(); }
103 int64 getMemoryUsage()
const;
107 {
return myMotionSegments; }
111 {
return myMap->getNames(); }
117 return get(myMap->get(
name), segment);
124 {
return myMap->getName(index); }
128 {
return myMap->getExportName(index); }
132 {
return myMap->getOriginalOwner(idx); }
136 {
return myMap->get(name); }
140 {
return myMap->hasName(name); }
144 int motion_segment=0);
147 void setAllSegments(
int idx,
161 bool copySegment(
int dest_segment,
163 int source_segment=0);
180 bool flatten_nested =
true)
const;
230 bool getDataIdHash(
int64 &hash,
int segment=0)
const;
237 void dumpList(
const char *
label=
"",
bool data_too =
true);
246 : myList(NULL), myCurr(0), mySize(0), mySegment(0) {}
253 return myList->get(myCurr,
258 return myList->getName(myCurr);
263 bool atEnd()
const {
return myCurr >= mySize; }
280 mySize(list->entries()) {}
283 int myCurr, mySize, mySegment;
290 class gt_CreateIndirectTask;
291 friend class gt_CreateIndirectTask;
297 int motion_segments);
304 template <
typename DataT,
typename... Pairs>
309 return (
data ? 1 : 0) + gt_CountAttribs(std::forward<Pairs>(pairs)...);
316 template <
typename DataT,
typename... Pairs>
318 gt_CreateAttributeList(
327 int i = map.
add(name,
false);
331 gt_CreateAttributeList(list, map, std::forward<Pairs>(pairs)...);
350 bool flatten_nested)
const;
352 inline int getSegmentIndex(
int index,
int segment)
const
353 {
return index + segment*entries(); }
357 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.