9 #ifndef __PDG_ATTRIBUTE_ARRAY_H__
10 #define __PDG_ATTRIBUTE_ARRAY_H__
52 return (myData.size() > 0);
60 inline bool valid(
int component)
const
62 return (component >= 0) && (component < myData.size());
67 int real_index = component;
72 if (!valid(real_index))
75 data = myData[real_index];
81 return myData[component];
86 return myData[component];
101 expand(value, component);
106 myData.setSizeIfNeeded(data.size());
107 for (
exint i = 0; i < data.size(); i++)
113 myData.append(value);
114 return myData.last();
134 myData.truncate(length);
139 myData.concat(other->
myData);
145 myData.setSize(myData.size() +
offset);
151 myData.setSize(size);
158 hash_value = SYShashRange(myData.begin(), myData.end());
164 myData.swap(other->
myData);
175 return ((
const Self*)(other))->myData == myData;
189 myData.append(value);
193 myData.setSizeIfNeeded(component+1);
194 myData[component] =
value;
204 myData.append(default_value);
206 else if (component >= myData.size())
208 myData.setSizeIfNeeded(component+1);
209 myData[component] = default_value;
DataType & value(int component)
GLsizei const GLfloat * value
void setValues(const ArrayType &data)
std::size_t SYS_HashType
Define the type for hash values.
GLuint GLsizei GLsizei * length
void setValue(const DataType &value, int component)
void truncate(int length)
const DataType & value(int component) const
void copy(const Self *other)
const ArrayType & values() const
bool concat(const Self *other)
const DataType & appendValue(const DataType &value)
void setValue(const ArrayType &&data)
void setValue(const ArrayType &data)
virtual PDG_AttributeMergeError merge(PDG_AttributeMergeOp merge_op, int stride)=0
Applies a merge op to the data in this attribute.
PDG_AttributeArray(const ArrayType &data)
bool hash(SYS_HashType &hash_value, UT_WorkBuffer &errors) const override
Return a hash value derived from the attribute data.
GLint GLenum GLboolean GLsizei stride
bool valid(int component) const
void expand(const DataType &value, int component)
PDG_AttributeType
Enumeration of possible attribute types.
~PDG_AttributeArray() override
PDG_AttributeMergeOp
Enumeration of different ways that attributes can be combined.
bool adjustSize(int offset)
void expandIfNeeded(const DataType &default_value, int component)
bool value(DataType &data, int component) const
PDG_AttributeMergeError
Enumerations of errors that can occur when merging attributes.
PDG_AttributeMergeError merge(PDG_AttributeMergeOp merge_op, int stride) override
Applies a merge op to the data in this attribute.
size_t hash_value(const CH_ChannelRef &ref)
bool compare(const PDG_AttributeData *other) const override
Compares this data object with another data object.