OpenVDB: AttributeSet.h Source File

OpenVDB 7.0.0

AttributeSet.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
9
10 #ifndef OPENVDB_POINTS_ATTRIBUTE_SET_HAS_BEEN_INCLUDED
11 #define OPENVDB_POINTS_ATTRIBUTE_SET_HAS_BEEN_INCLUDED
12
13 #include "AttributeArray.h"
14 #include <openvdb/version.h>
15 #include <openvdb/MetaMap.h>
16
17 #include <limits>
18 #include <memory>
19 #include <vector>
20
21
22 class TestAttributeSet;
23
24
25 namespace openvdb {
26 OPENVDB_USE_VERSION_NAMESPACE
27 namespace OPENVDB_VERSION_NAME {
28 namespace points {
29
30
32
33
35 class OPENVDB_API AttributeSet
36 {
37 public:
38 enum { INVALID_POS = std::numeric_limits<size_t>::max() };
39
40 using Ptr = std::shared_ptr<AttributeSet>;
41 using ConstPtr = std::shared_ptr<const AttributeSet>;
42
43 class Descriptor;
44
45 using DescriptorPtr = std::shared_ptr<Descriptor>;
46 using DescriptorConstPtr = std::shared_ptr<const Descriptor>;
47
49
50 struct Util
51 {
53 struct NameAndType {
54 NameAndType(const std::string& n, const NamePair& t, const Index s = 1)
55 : name(n), type(t), stride(s) {}
56 Name name;
57 NamePair type;
58 Index stride;
59 };
60
61 using NameAndTypeVec = std::vector<NameAndType>;
62 using NameToPosMap = std::map<std::string, size_t>;
63 using GroupIndex = std::pair<size_t, uint8_t>;
64 };
65
67
68 AttributeSet();
69
76 AttributeSet(const AttributeSet& attributeSet, Index arrayLength,
77 const AttributeArray::ScopedRegistryLock* lock = nullptr);
78
86 AttributeSet(const DescriptorPtr& descriptor, Index arrayLength = 1,
87 const AttributeArray::ScopedRegistryLock* lock = nullptr);
88
90 AttributeSet(const AttributeSet&);
91
93 AttributeSet& operator=(const AttributeSet&) = delete;
94
96 Descriptor& descriptor() { return *mDescr; }
99 const Descriptor& descriptor() const { return *mDescr; }
101
104 DescriptorPtr descriptorPtr() const { return mDescr; }
105
107 size_t size() const { return mAttrs.size(); }
108
110 size_t memUsage() const;
111
114 size_t find(const std::string& name) const;
115
120 size_t replace(const std::string& name, const AttributeArray::Ptr&);
121
126 size_t replace(size_t pos, const AttributeArray::Ptr&);
127
129 const AttributeArray* getConst(const std::string& name) const;
132 const AttributeArray* get(const std::string& name) const;
133 AttributeArray* get(const std::string& name);
135
137 const AttributeArray* getConst(size_t pos) const;
140 const AttributeArray* get(size_t pos) const;
141 AttributeArray* get(size_t pos);
143
145 size_t groupOffset(const Name& groupName) const;
152 size_t groupOffset(const Util::GroupIndex& index) const;
154
156 Util::GroupIndex groupIndex(const Name& groupName) const;
159 Util::GroupIndex groupIndex(const size_t offset) const;
160
162 bool isShared(size_t pos) const;
166 void makeUnique(size_t pos);
167
169 AttributeArray::Ptr appendAttribute(const Name& name,
170 const NamePair& type,
171 const Index strideOrTotalSize = 1,
172 const bool constantStride = true,
173 Metadata::Ptr defaultValue = Metadata::Ptr());
174
179 AttributeArray::Ptr appendAttribute(const Descriptor& expected, DescriptorPtr& replacement,
180 const size_t pos, const Index strideOrTotalSize = 1,
181 const bool constantStride = true,
182 const AttributeArray::ScopedRegistryLock* lock = nullptr);
183
186 void dropAttributes(const std::vector<size_t>& pos);
187
191 void dropAttributes(const std::vector<size_t>& pos,
192 const Descriptor& expected, DescriptorPtr& replacement);
193
196 void renameAttributes(const Descriptor& expected, const DescriptorPtr& replacement);
197
200 void reorderAttributes(const DescriptorPtr& replacement);
201
205 void resetDescriptor(const DescriptorPtr& replacement, const bool allowMismatchingDescriptors = false);
206
208 void read(std::istream&);
211 void write(std::ostream&, bool outputTransient = false) const;
212
214 void readDescriptor(std::istream&);
217 void writeDescriptor(std::ostream&, bool outputTransient = false) const;
218
220 void readMetadata(std::istream&);
224 void writeMetadata(std::ostream&, bool outputTransient = false, bool paged = false) const;
225
227 void readAttributes(std::istream&);
230 void writeAttributes(std::ostream&, bool outputTransient = false) const;
231
234 bool operator==(const AttributeSet& other) const;
235 bool operator!=(const AttributeSet& other) const { return !this->operator==(other); }
236
237 private:
238 using AttrArrayVec = std::vector<AttributeArray::Ptr>;
239
240 DescriptorPtr mDescr;
241 AttrArrayVec mAttrs;
242 }; // class AttributeSet
243
245
246
248 #if OPENVDB_ABI_VERSION_NUMBER >= 5
249 namespace future {
250 class Container
251 {
252 class Element { };
253 std::vector<std::shared_ptr<Element>> mElements;
254 };
255 }
256 #endif
257
258
260
261
266 class OPENVDB_API AttributeSet::Descriptor
267 {
268 public:
269 using Ptr = std::shared_ptr<Descriptor>;
270
271 using NameAndType = Util::NameAndType;
272 using NameAndTypeVec = Util::NameAndTypeVec;
273 using GroupIndex = Util::GroupIndex;
274 using NameToPosMap = Util::NameToPosMap;
275 using ConstIterator = NameToPosMap::const_iterator;
276
278 struct Inserter {
279 NameAndTypeVec vec;
280 Inserter& add(const NameAndType& nameAndType) {
281 vec.push_back(nameAndType); return *this;
282 }
283 Inserter& add(const Name& name, const NamePair& type) {
284 vec.emplace_back(name, type); return *this;
285 }
286 Inserter& add(const NameAndTypeVec& other) {
287 for (NameAndTypeVec::const_iterator it = other.begin(), itEnd = other.end(); it != itEnd; ++it) {
288 vec.emplace_back(it->name, it->type);
289 }
290 return *this;
291 }
292 };
293
295
296 Descriptor();
297
299 Descriptor(const Descriptor&);
300
302 static Ptr create(const NamePair&);
303
305 Ptr duplicateAppend(const Name& name, const NamePair& type) const;
306
308 Ptr duplicateDrop(const std::vector<size_t>& pos) const;
309
311 size_t size() const { return mTypes.size(); }
312
314 size_t count(const NamePair& type) const;
315
317 size_t memUsage() const;
318
321 size_t find(const std::string& name) const;
322
324 size_t rename(const std::string& fromName, const std::string& toName);
325
327 const Name& valueType(size_t pos) const;
329 const NamePair& type(size_t pos) const;
330
332 MetaMap& getMetadata();
333 const MetaMap& getMetadata() const;
334
336 bool hasDefaultValue(const Name& name) const;
338 template<typename ValueType>
339 ValueType getDefaultValue(const Name& name) const
340 {
341 const size_t pos = find(name);
342 if (pos == INVALID_POS) {
343 OPENVDB_THROW(LookupError, "Cannot find attribute name to set default value.")
344 }
345
346 std::stringstream ss;
347 ss << "default:" << name;
348
349 auto metadata = mMetadata.getMetadata<TypedMetadata<ValueType>>(ss.str());
350
351 if (metadata) return metadata->value();
352
353 return zeroVal<ValueType>();
354 }
356 void setDefaultValue(const Name& name, const Metadata& defaultValue);
357 // Remove the default value if it exists
358 void removeDefaultValue(const Name& name);
359 // Prune any default values for which the key is no longer present
360 void pruneUnusedDefaultValues();
361
363 bool operator==(const Descriptor&) const;
365 bool operator!=(const Descriptor& rhs) const { return !this->operator==(rhs); }
368 bool hasSameAttributes(const Descriptor& rhs) const;
369
371 const NameToPosMap& map() const { return mNameMap; }
373 const NameToPosMap& groupMap() const { return mGroupMap; }
374
376 bool hasGroup(const Name& group) const;
378 void setGroup(const Name& group, const size_t offset);
380 void dropGroup(const Name& group);
382 void clearGroups();
384 size_t renameGroup(const std::string& fromName, const std::string& toName);
386 const Name uniqueGroupName(const Name& name) const;
387
389 size_t groupOffset(const Name& groupName) const;
396 size_t groupOffset(const GroupIndex& index) const;
398
400 GroupIndex groupIndex(const Name& groupName) const;
403 GroupIndex groupIndex(const size_t offset) const;
404
406 const Name uniqueName(const Name& name) const;
407
409 static bool validName(const Name& name);
410
417 static void parseNames( std::vector<std::string>& includeNames,
418 std::vector<std::string>& excludeNames,
419 bool& includeAll,
420 const std::string& nameStr);
421
424 static void parseNames( std::vector<std::string>& includeNames,
425 std::vector<std::string>& excludeNames,
426 const std::string& nameStr);
427
429 void write(std::ostream&) const;
431 void read(std::istream&);
432
433 protected:
435 void appendTo(NameAndTypeVec& attrs) const;
436
439 static Ptr create(const NameAndTypeVec&, const NameToPosMap&, const MetaMap&);
440
441 size_t insert(const std::string& name, const NamePair& typeName);
442
443 private:
444 friend class ::TestAttributeSet;
445
446 NameToPosMap mNameMap;
447 std::vector<NamePair> mTypes;
448 NameToPosMap mGroupMap;
449 MetaMap mMetadata;
450 #if OPENVDB_ABI_VERSION_NUMBER >= 5
451 // as this change is part of an ABI change, there's no good reason to reduce the reserved
452 // space aside from keeping the memory size of an AttributeSet the same for convenience
453 // (note that this assumes a typical three-pointer implementation for std::vector)
454 future::Container mFutureContainer; // occupies 3 reserved slots
455 int64_t mReserved[5]; // for future use
456 #else
457 int64_t mReserved[8]; // for future use
458 #endif
459 }; // class Descriptor
460
461 } // namespace points
462 } // namespace OPENVDB_VERSION_NAME
463 } // namespace openvdb
464
465 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_HAS_BEEN_INCLUDED
openvdb::v7_0::points::AttributeSet::GroupIndex
Util::GroupIndex GroupIndex
Definition: AttributeSet.h:273
openvdb::v7_0::points::AttributeSet::readAttributes
void readAttributes(std::istream &)
This will read the attribute data from a stream.
openvdb::v7_0::points::AttributeSet::replace
size_t replace(size_t pos, const AttributeArray::Ptr &)
Replace the attribute array stored at position pos in this container.
openvdb::v7_0::points::AttributeSet::Descriptor
Descriptor()
openvdb::v7_0::points::AttributeSet::isShared
bool isShared(size_t pos) const
Return true if the attribute array stored at position pos is shared.
openvdb::v7_0::Metadata
Base class for storing metadata information in a grid.
Definition: Metadata.h:24
openvdb::v7_0::points::AttributeSet::get
AttributeArray * get(const std::string &name)
openvdb::v7_0::points::AttributeSet::setDefaultValue
void setDefaultValue(const Name &name, const Metadata &defaultValue)
Set a default value for an existing attribute.
openvdb::v7_0::TypedMetadata::value
T & value()
Return this metadata's value.
Definition: Metadata.h:272
openvdb::v7_0::points::AttributeArray
Base class for storing attribute data.
Definition: AttributeArray.h:93
openvdb::v7_0::points::AttributeSet::Descriptor
Descriptor(const Descriptor &)
Copy constructor.
openvdb::v7_0::points::AttributeSet::operator=
AttributeSet & operator=(const AttributeSet &)=delete
Disallow copy assignment, since it wouldn't be obvious whether the copy is deep or shallow.
openvdb::v7_0::points::AttributeSet::NameToPosMap
Util::NameToPosMap NameToPosMap
Definition: AttributeSet.h:274
openvdb::v7_0::LookupError
Definition: Exceptions.h:60
openvdb::v7_0::points::AttributeSet::ConstPtr
std::shared_ptr< const AttributeSet > ConstPtr
Definition: AttributeSet.h:41
openvdb::v7_0::points::AttributeSet::groupOffset
size_t groupOffset(const Util::GroupIndex &index) const
openvdb::v7_0::points::AttributeSet::setGroup
void setGroup(const Name &group, const size_t offset)
Define a group name to offset mapping.
openvdb::v7_0::points::AttributeSet::hasGroup
bool hasGroup(const Name &group) const
Return true if group exists.
openvdb::v7_0::points::AttributeSet::map
const NameToPosMap & map() const
Return a reference to the name-to-position map.
Definition: AttributeSet.h:371
openvdb::v7_0::points::AttributeSet::AttributeSet
AttributeSet()
openvdb::v7_0::points::AttributeSet::count
size_t count(const NamePair &type) const
Return the number of attributes with this attribute type.
openvdb::v7_0::points::AttributeSet::appendAttribute
AttributeArray::Ptr appendAttribute(const Descriptor &expected, DescriptorPtr &replacement, const size_t pos, const Index strideOrTotalSize=1, const bool constantStride=true, const AttributeArray::ScopedRegistryLock *lock=nullptr)
openvdb::v7_0::points::AttributeSet::create
static Ptr create(const NamePair &)
Create a new descriptor from a position attribute type and assumes "P" (for convenience).
openvdb::v7_0::points::AttributeSet::Util::NameAndType::stride
Index stride
Definition: AttributeSet.h:58
openvdb::v7_0::points::AttributeSet::operator!=
bool operator!=(const Descriptor &rhs) const
Return true if this descriptor is not equal to the given one.
Definition: AttributeSet.h:365
openvdb::v7_0::points::AttributeSet::Inserter::vec
NameAndTypeVec vec
Definition: AttributeSet.h:279
openvdb::v7_0::Metadata::Ptr
SharedPtr< Metadata > Ptr
Definition: Metadata.h:26
openvdb::v7_0::points::AttributeArray::Ptr
std::shared_ptr< AttributeArray > Ptr
Definition: AttributeArray.h:126
openvdb::v7_0::points::AttributeSet::hasSameAttributes
bool hasSameAttributes(const Descriptor &rhs) const
version.h
Library and file format version numbers.
AttributeArray.h
Attribute Array storage templated on type and compression codec.
openvdb::v7_0::points::AttributeSet::validName
static bool validName(const Name &name)
Return true if the name is valid.
openvdb::v7_0::points::AttributeSet::uniqueGroupName
const Name uniqueGroupName(const Name &name) const
Return a unique name for a group based on given name.
openvdb::v7_0::points::AttributeSet::Ptr
std::shared_ptr< AttributeSet > Ptr
Definition: AttributeSet.h:40
openvdb::v7_0::points::AttributeSet::makeUnique
void makeUnique(size_t pos)
If the attribute array stored at position pos is shared, replace the array with a deep copy of itself...
openvdb::v7_0::points::AttributeSet::dropAttributes
void dropAttributes(const std::vector< size_t > &pos)
openvdb::v7_0::points::AttributeSet::type
const NamePair & type(size_t pos) const
Return the name of the attribute array's type.
openvdb::v7_0::points::AttributeSet::DescriptorPtr
std::shared_ptr< Descriptor > DescriptorPtr
Definition: AttributeSet.h:45
openvdb::v7_0::points::AttributeSet::descriptorPtr
DescriptorPtr descriptorPtr() const
Return a pointer to this attribute set's descriptor, which might be shared with other sets.
Definition: AttributeSet.h:104
openvdb::v7_0::points::AttributeSet::get
AttributeArray * get(size_t pos)
openvdb::v7_0::points::AttributeSet::uniqueName
const Name uniqueName(const Name &name) const
Return a unique name for an attribute array based on given name.
MetaMap.h
openvdb::v7_0::points::AttributeSet::appendTo
void appendTo(NameAndTypeVec &attrs) const
Append to a vector of names and types from this Descriptor in position order.
OPENVDB_API
#define OPENVDB_API
Helper macros for defining library symbol visibility.
Definition: Platform.h:230
openvdb::v7_0::points::AttributeSet::operator==
bool operator==(const Descriptor &) const
Return true if this descriptor is equal to the given one.
openvdb::v7_0::points::AttributeSet::Util
Definition: AttributeSet.h:51
openvdb::v7_0::points::AttributeSet::dropGroup
void dropGroup(const Name &group)
Drop any mapping keyed by group name.
openvdb::v7_0::points::AttributeSet::AttributeSet
AttributeSet(const DescriptorPtr &descriptor, Index arrayLength=1, const AttributeArray::ScopedRegistryLock *lock=nullptr)
openvdb::v7_0::points::AttributeSet::groupIndex
GroupIndex groupIndex(const Name &groupName) const
Return the group index from the name of the group.
openvdb::v7_0::points::AttributeSet::removeDefaultValue
void removeDefaultValue(const Name &name)
openvdb::v7_0::NamePair
std::pair< Name, Name > NamePair
Definition: AttributeArray.h:39
openvdb::v7_0::MetaMap
Container that maps names (strings) to values of arbitrary types.
Definition: MetaMap.h:20
openvdb::v7_0::points::AttributeSet::NameAndTypeVec
Util::NameAndTypeVec NameAndTypeVec
Definition: AttributeSet.h:272
openvdb::v7_0::points::AttributeSet::replace
size_t replace(const std::string &name, const AttributeArray::Ptr &)
Replace the attribute array whose name is name.
openvdb::v7_0::points::AttributeSet::groupMap
const NameToPosMap & groupMap() const
Return a reference to the name-to-position group map.
Definition: AttributeSet.h:373
openvdb::v7_0::points::AttributeSet::hasDefaultValue
bool hasDefaultValue(const Name &name) const
Return true if the attribute has a default value.
openvdb::v7_0::points::AttributeSet::parseNames
static void parseNames(std::vector< std::string > &includeNames, std::vector< std::string > &excludeNames, bool &includeAll, const std::string &nameStr)
Extract each name from nameStr into includeNames, or into excludeNames if the name is prefixed with a...
openvdb::v7_0::points::AttributeSet::find
size_t find(const std::string &name) const
Return the position of the attribute array whose name is name, or INVALID_POS if no match is found.
openvdb::v7_0::points::AttributeSet::groupIndex
Util::GroupIndex groupIndex(const size_t offset) const
openvdb::v7_0::points::AttributeSet::write
void write(std::ostream &, bool outputTransient=false) const
openvdb::v7_0::points::AttributeSet::AttributeSet
AttributeSet(const AttributeSet &)
Shallow copy constructor, the descriptor and attribute arrays will be shared.
openvdb::v7_0::points::AttributeSet::AttributeSet
AttributeSet(const AttributeSet &attributeSet, Index arrayLength, const AttributeArray::ScopedRegistryLock *lock=nullptr)
openvdb::v7_0::TypedMetadata
Templated metadata class to hold specific types.
Definition: Metadata.h:145
openvdb::v7_0::points::AttributeSet::operator!=
bool operator!=(const AttributeSet &other) const
Definition: AttributeSet.h:235
openvdb::v7_0::tools::composite::max
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:106
openvdb::v7_0::points::AttributeSet::valueType
const Name & valueType(size_t pos) const
Return the name of the attribute array's type.
openvdb::v7_0::math::operator==
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:471
openvdb::v7_0::points::AttributeSet::dropAttributes
void dropAttributes(const std::vector< size_t > &pos, const Descriptor &expected, DescriptorPtr &replacement)
openvdb::v7_0::points::AttributeSet::descriptor
const Descriptor & descriptor() const
Definition: AttributeSet.h:99
openvdb::v7_0::points::AttributeSet::getDefaultValue
ValueType getDefaultValue(const Name &name) const
Get a default value for an existing attribute.
Definition: AttributeSet.h:339
openvdb::v7_0::points::AttributeSet::ConstIterator
NameToPosMap::const_iterator ConstIterator
Definition: AttributeSet.h:275
openvdb::v7_0::points::AttributeSet::readMetadata
void readMetadata(std::istream &)
This will read the attribute metadata from a stream.
openvdb::v7_0::points::AttributeSet::Inserter::add
Inserter & add(const NameAndType &nameAndType)
Definition: AttributeSet.h:280
openvdb::v7_0::points::AttributeSet::renameAttributes
void renameAttributes(const Descriptor &expected, const DescriptorPtr &replacement)
openvdb::v7_0::points::AttributeSet::Util::NameAndType
Attribute and type name pair.
Definition: AttributeSet.h:53
openvdb::v7_0::points::AttributeSet::Util::NameAndTypeVec
std::vector< NameAndType > NameAndTypeVec
Definition: AttributeSet.h:61
openvdb::v7_0::points::AttributeSet::Util::NameAndType::type
NamePair type
Definition: AttributeSet.h:57
openvdb::v7_0::points::AttributeSet::duplicateAppend
Ptr duplicateAppend(const Name &name, const NamePair &type) const
Create a new descriptor as a duplicate with a new attribute appended.
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
openvdb::v7_0::points::AttributeSet::clearGroups
void clearGroups()
Clear all groups.
openvdb::v7_0::points::AttributeSet::operator==
bool operator==(const AttributeSet &other) const
openvdb::v7_0::points::AttributeArray::ScopedRegistryLock
Definition: AttributeArray.h:120
openvdb::v7_0::points::AttributeSet::Util::NameAndType::name
Name name
Definition: AttributeSet.h:56
openvdb::v7_0::points::AttributeSet::rename
size_t rename(const std::string &fromName, const std::string &toName)
Rename an attribute array.
openvdb::v7_0::points::AttributeSet::size
size_t size() const
Return the number of attributes in this set.
Definition: AttributeSet.h:107
openvdb::v7_0::points::AttributeSet
Ordered collection of uniquely-named attribute arrays.
Definition: AttributeSet.h:36
openvdb::v7_0::points::AttributeSet::get
const AttributeArray * get(size_t pos) const
openvdb::v7_0::points::AttributeSet::renameGroup
size_t renameGroup(const std::string &fromName, const std::string &toName)
Rename a group.
openvdb::v7_0::points::AttributeSet::Inserter::add
Inserter & add(const NameAndTypeVec &other)
Definition: AttributeSet.h:286
openvdb::v7_0::points::AttributeSet::getMetadata
const MetaMap & getMetadata() const
openvdb::v7_0::points::AttributeSet::writeDescriptor
void writeDescriptor(std::ostream &, bool outputTransient=false) const
openvdb::v7_0::Index
Index32 Index
Definition: Types.h:31
openvdb::v7_0::points::AttributeSet::insert
size_t insert(const std::string &name, const NamePair &typeName)
openvdb::v7_0::points::AttributeSet::duplicateDrop
Ptr duplicateDrop(const std::vector< size_t > &pos) const
Create a new descriptor as a duplicate with existing attributes dropped.
openvdb::v7_0::Name
std::string Name
Definition: Name.h:17
openvdb::v7_0::points::AttributeSet::DescriptorConstPtr
std::shared_ptr< const Descriptor > DescriptorConstPtr
Definition: AttributeSet.h:46
openvdb::v7_0::points::AttributeSet::writeMetadata
void writeMetadata(std::ostream &, bool outputTransient=false, bool paged=false) const
openvdb::v7_0::points::AttributeSet::groupIndex
GroupIndex groupIndex(const size_t offset) const
openvdb::v7_0::points::AttributeSet::Util::NameToPosMap
std::map< std::string, size_t > NameToPosMap
Definition: AttributeSet.h:62
openvdb::v7_0::points::AttributeSet::Inserter
Utility method to construct a NameAndType sequence.
Definition: AttributeSet.h:278
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
openvdb::v7_0::points::AttributeSet::Util::GroupIndex
std::pair< size_t, uint8_t > GroupIndex
Definition: AttributeSet.h:63
openvdb::v7_0::points::AttributeSet::create
static Ptr create(const NameAndTypeVec &, const NameToPosMap &, const MetaMap &)
openvdb::v7_0::points::AttributeSet::parseNames
static void parseNames(std::vector< std::string > &includeNames, std::vector< std::string > &excludeNames, const std::string &nameStr)
Extract each name from nameStr into includeNames, or into excludeNames if the name is prefixed with a...
openvdb::v7_0::points::future::Container
Definition: AttributeSet.h:251
openvdb::v7_0::points::AttributeSet::readDescriptor
void readDescriptor(std::istream &)
This will read the attribute descriptor from a stream.
openvdb::v7_0::points::AttributeSet::writeAttributes
void writeAttributes(std::ostream &, bool outputTransient=false) const
openvdb
Definition: Exceptions.h:13
openvdb::v7_0::points::AttributeSet::appendAttribute
AttributeArray::Ptr appendAttribute(const Name &name, const NamePair &type, const Index strideOrTotalSize=1, const bool constantStride=true, Metadata::Ptr defaultValue=Metadata::Ptr())
Append attribute attribute (simple method)
openvdb::v7_0::points::AttributeSet::groupIndex
Util::GroupIndex groupIndex(const Name &groupName) const
Return the group index from the name of the group.
openvdb::v7_0::points::AttributeSet::memUsage
size_t memUsage() const
Return the number of bytes of memory used by this attribute set.
openvdb::v7_0::points::AttributeSet::Util::NameAndType::NameAndType
NameAndType(const std::string &n, const NamePair &t, const Index s=1)
Definition: AttributeSet.h:54
openvdb::v7_0::points::AttributeSet::groupOffset
size_t groupOffset(const GroupIndex &index) const
openvdb::v7_0::points::AttributeSet::reorderAttributes
void reorderAttributes(const DescriptorPtr &replacement)
openvdb::v7_0::points::AttributeSet::resetDescriptor
void resetDescriptor(const DescriptorPtr &replacement, const bool allowMismatchingDescriptors=false)
openvdb::v7_0::points::AttributeSet::getMetadata
MetaMap & getMetadata()
Retrieve metadata map.
openvdb::v7_0::points::AttributeSet::write
void write(std::ostream &) const
Serialize this descriptor to the given stream.
openvdb::v7_0::points::AttributeSet::read
void read(std::istream &)
Read the entire set from a stream.
OPENVDB_THROW
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:82
openvdb::v7_0::points::AttributeSet::get
const AttributeArray * get(const std::string &name) const
openvdb::v7_0::points::AttributeSet::pruneUnusedDefaultValues
void pruneUnusedDefaultValues()
openvdb::v7_0::points::AttributeSet::Inserter::add
Inserter & add(const Name &name, const NamePair &type)
Definition: AttributeSet.h:283