10#ifndef OPENVDB_POINTS_ATTRIBUTE_GROUP_HAS_BEEN_INCLUDED
11#define OPENVDB_POINTS_ATTRIBUTE_GROUP_HAS_BEEN_INCLUDED
36 static const char*
name() {
return "grp"; }
75 using Ptr = std::shared_ptr<GroupHandle>;
87 bool isUniform()
const {
return mArray.isUniform(); }
104 using Ptr = std::shared_ptr<GroupWriteHandle>;
138 : mIndex(attributeSet.groupIndex(name)) { }
140 explicit GroupFilter(
const AttributeSet::Descriptor::GroupIndex& index)
146 template <
typename LeafT>
149 template <
typename LeafT>
151 mHandle.reset(
new GroupHandle(leaf.groupHandle(mIndex)));
154 template <
typename IterT>
155 bool valid(
const IterT& iter)
const {
157 return mHandle->getUnsafe(*iter);
161 const AttributeSet::Descriptor::GroupIndex mIndex;
Attribute Array storage templated on type and compression codec.
Set of Attribute Arrays which tracks metadata about each array.
Base class for storing attribute data.
Definition AttributeArray.h:93
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition AttributeArray.h:224
Ordered collection of uniquely-named attribute arrays.
Definition AttributeSet.h:39
Index filtering on group membership.
Definition AttributeGroup.h:135
void reset(const LeafT &leaf)
Definition AttributeGroup.h:150
static index::State state()
Definition AttributeGroup.h:145
static index::State state(const LeafT &)
Definition AttributeGroup.h:147
GroupFilter(const Name &name, const AttributeSet &attributeSet)
Definition AttributeGroup.h:137
GroupFilter(const AttributeSet::Descriptor::GroupIndex &index)
Definition AttributeGroup.h:140
bool valid(const IterT &iter) const
Definition AttributeGroup.h:155
bool initialized() const
Definition AttributeGroup.h:143
Definition AttributeGroup.h:73
Index size() const
Definition AttributeGroup.h:86
std::unique_ptr< GroupHandle > UniquePtr
Definition AttributeGroup.h:76
const GroupAttributeArray & mArray
Definition AttributeGroup.h:93
GroupHandle(const GroupAttributeArray &array, const GroupType &bitMask, BitMask)
const GroupType mBitMask
Definition AttributeGroup.h:94
GroupHandle(const GroupAttributeArray &array, const GroupType &offset)
std::pair< Index, uint8_t > GroupIndex
Definition AttributeGroup.h:81
std::shared_ptr< GroupHandle > Ptr
Definition AttributeGroup.h:75
bool getUnsafe(Index n) const
bool isUniform() const
Definition AttributeGroup.h:87
Definition AttributeGroup.h:102
bool compact()
Compact the existing array to become uniform if all values are identical.
GroupWriteHandle(GroupAttributeArray &array, const GroupType &offset)
bool collapse(bool on)
Set membership for the whole array and attempt to collapse.
std::unique_ptr< GroupWriteHandle > UniquePtr
Definition AttributeGroup.h:105
void set(Index n, bool on)
Set on at the given index n.
void setUnsafe(Index n, bool on)
Set on at the given index n (assumes in-core and non-uniform)
std::shared_ptr< GroupWriteHandle > Ptr
Definition AttributeGroup.h:104
Typed class for storing attribute data.
Definition AttributeArray.h:545
State
Definition IndexIterator.h:40
uint8_t GroupType
Definition AttributeSet.h:31
bool isGroup(const AttributeArray &array)
Definition AttributeGroup.h:63
std::string Name
Definition Name.h:17
Index32 Index
Definition Types.h:54
Definition Exceptions.h:13
Definition AttributeGroup.h:32
StorageType Type
Definition AttributeGroup.h:32
Definition AttributeGroup.h:27
static const char * name()
Definition AttributeGroup.h:36
GroupType StorageType
Definition AttributeGroup.h:28
GroupType ValueType
Definition AttributeGroup.h:29
Definition AttributeGroup.h:79
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212