10 #ifndef OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
11 #define OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
16 #include <unordered_map>
28 namespace attribute_traits
35 template <
bool Truncate>
43 template<
typename StorageType>
static void decode(
const StorageType&,
ValueType&);
44 template<
typename StorageType>
static void encode(
const ValueType&, StorageType&);
45 static const char*
name() {
return Truncate ?
"str_trnc" :
"str"; }
60 using ValueMap = std::unordered_map<Name, Index>;
66 bool empty()
const {
return mCache.empty(); }
68 size_t size()
const {
return mCache.size(); }
91 using UniquePtr = std::unique_ptr<StringMetaInserter>;
96 bool hasKey(
const Name& key)
const;
112 using IndexPairArray = std::deque<std::pair<Index, Index>>;
115 IndexPairArray mIdBlocks;
123 template <
bool Truncate>
124 template<
typename StorageType>
132 template <
bool Truncate>
133 template<
typename StorageType>
156 using Ptr = std::shared_ptr<StringAttributeHandle>;
157 using UniquePtr = std::unique_ptr<StringAttributeHandle>;
163 const bool preserveCompression =
true);
189 using Ptr = std::shared_ptr<StringAttributeWriteHandle>;
190 using UniquePtr = std::unique_ptr<StringAttributeWriteHandle>;
196 const bool expand =
true);
200 void expand(
bool fill =
true);
246 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
bool isString(const AttributeArray &array)
AttributeHandle< Index, StringCodec< false > > mHandle
GLdouble GLdouble GLint GLint const GLdouble * points
Write-able version of AttributeHandle.
#define OPENVDB_USE_VERSION_NAMESPACE
typename attribute_traits::StringTypeTrait< Truncate >::Type Type
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
std::shared_ptr< StringAttributeHandle > Ptr
const MetaMap & mMetadata
static void decode(const StorageType &, ValueType &)
Base class for storing attribute data.
GLuint const GLchar * name
bool hasConstantStride() const
Typed class for storing attribute data.
static const char * name()
static void encode(const ValueType &, StorageType &)
Attribute Array storage templated on type and compression codec.
bool isType() const
Return true if this attribute is of the same type as the template parameter.
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
std::unique_ptr< StringAttributeHandle > UniquePtr
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.