10 #ifndef OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED 11 #define OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED 16 #include <unordered_map> 31 using StringIndexType =
Index;
36 namespace attribute_traits
43 template <
bool Truncate>
51 template<
typename StorageType>
static void decode(
const StorageType&,
ValueType&);
52 template<
typename StorageType>
static void encode(
const ValueType&, StorageType&);
53 static const char*
name() {
return Truncate ?
"str_trnc" :
"str"; }
68 using ValueMap = std::unordered_map<Name, Index>;
74 bool empty()
const {
return mCache.empty(); }
76 size_t size()
const {
return mCache.size(); }
79 void reset(
const MetaMap& metadata);
82 void insert(
const Name& key,
Index index);
99 using UniquePtr = std::unique_ptr<StringMetaInserter>;
104 bool hasKey(
const Name& key)
const;
106 bool hasIndex(
Index index)
const;
120 using IndexPairArray = std::deque<std::pair<Index, Index>>;
123 IndexPairArray mIdBlocks;
131 template <
bool Truncate>
132 template<
typename StorageType>
140 template <
bool Truncate>
141 template<
typename StorageType>
164 using Ptr = std::shared_ptr<StringAttributeHandle>;
165 using UniquePtr = std::unique_ptr<StringAttributeHandle>;
171 const bool preserveCompression =
true);
197 using Ptr = std::shared_ptr<StringAttributeWriteHandle>;
198 using UniquePtr = std::unique_ptr<StringAttributeWriteHandle>;
204 const bool expand =
true);
208 void expand(
bool fill =
true);
214 void collapse(
const Name& name);
221 void fill(
const Name& name);
235 bool contains(
const Name& name)
const;
254 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
Definition: AttributeArrayString.h:49
Definition: AttributeArrayString.h:194
Attribute Array storage templated on type and compression codec.
bool hasConstantStride() const
Definition: AttributeArrayString.h:177
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition: AttributeArray.h:225
Typed class for storing attribute data.
Definition: AttributeArray.h:562
Index size() const
Definition: AttributeArrayString.h:174
std::shared_ptr< StringAttributeHandle > Ptr
Definition: AttributeArrayString.h:164
const MetaMap & mMetadata
Definition: AttributeArrayString.h:187
static const char * name()
Definition: AttributeArrayString.h:53
Base class for storing attribute data.
Definition: AttributeArray.h:92
Index Type
Definition: AttributeArrayString.h:38
Definition: AttributeArrayString.h:161
AttributeHandle< Index, StringCodec< false > > mHandle
Definition: AttributeArrayString.h:186
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:94
Definition: openvdb/Exceptions.h:13
uint16_t Type
Definition: AttributeArrayString.h:39
Definition: AttributeArray.h:848
bool isString(const AttributeArray &array)
Definition: AttributeArrayString.h:152
Definition: AttributeArrayString.h:38
Definition: AttributeArrayString.h:44
Index stride() const
Definition: AttributeArrayString.h:173
std::string Name
Definition: Name.h:17
Write-able version of AttributeHandle.
Definition: AttributeArray.h:919
Type Truncate(Type x, unsigned int digits)
Return x truncated to the given number of decimal digits.
Definition: Math.h:863
std::unique_ptr< StringAttributeHandle > UniquePtr
Definition: AttributeArrayString.h:165
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:146
Index32 Index
Definition: openvdb/Types.h:32
bool isUniform() const
Definition: AttributeArrayString.h:176
Index OPENVDB_DEPRECATED
Definition: AttributeArrayString.h:33
typename attribute_traits::StringTypeTrait< Truncate >::Type Type
Definition: AttributeArrayString.h:49
Index ValueType
Definition: AttributeArrayString.h:46