Go to the documentation of this file.
37 #ifndef OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
38 #define OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
42 #include <unordered_set>
43 #include <unordered_map>
58 namespace attribute_traits
65 template <
bool Truncate>
73 template<
typename StorageType>
static void decode(
const StorageType&,
ValueType&);
74 template<
typename StorageType>
static void encode(
const ValueType&, StorageType&);
75 static const char*
name() {
return Truncate ?
"str_trnc" :
"str"; }
91 void insert(
const Name& name);
98 std::vector<std::pair<Index, Index>> mIdBlocks;
99 std::unordered_set<Name> mValues;
106 template <
bool Truncate>
107 template<
typename StorageType>
111 val = static_cast<ValueType>(data);
115 template <
bool Truncate>
116 template<
typename StorageType>
120 data = static_cast<ValueType>(val);
139 using Ptr = std::shared_ptr<StringAttributeHandle>;
145 const bool preserveCompression =
true);
171 using Ptr = std::shared_ptr<StringAttributeWriteHandle>;
177 const bool expand =
true);
181 void expand(
bool fill =
true);
187 void collapse(
const Name& name);
194 void fill(
const Name& name);
208 bool contains(
const Name& name)
const;
215 using ValueMap = std::unordered_map<std::string, Index>;
229 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition: AttributeArray.h:270
std::string Name
Definition: Name.h:44
StringIndexType ValueType
Definition: AttributeArrayString.h:68
typename attribute_traits::StringTypeTrait< Truncate >::Type Type
Definition: AttributeArrayString.h:71
Write-able version of AttributeHandle.
Definition: AttributeArray.h:944
Definition: AttributeArrayString.h:136
Definition: AttributeArrayString.h:71
Type Truncate(Type x, unsigned int digits)
Return x truncated to the given number of decimal digits.
Definition: Math.h:844
Index32 Index
Definition: Types.h:61
Attribute Array storage templated on type and compression codec.
Index size() const
Definition: AttributeArrayString.h:148
Index stride() const
Definition: AttributeArrayString.h:147
static const char * name()
Definition: AttributeArrayString.h:75
bool isUniform() const
Definition: AttributeArrayString.h:150
Definition: AttributeArray.h:873
Definition: AttributeArrayString.h:60
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:180
uint16_t Type
Definition: AttributeArrayString.h:61
Definition: AttributeArrayString.h:66
uint32_t StringIndexType
Definition: AttributeArrayString.h:55
Base class for storing attribute data.
Definition: AttributeArray.h:118
Definition: AttributeArrayString.h:168
AttributeHandle< StringIndexType, StringCodec< false > > mHandle
Definition: AttributeArrayString.h:160
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:128
Typed class for storing attribute data.
Definition: AttributeArray.h:608
bool hasConstantStride() const
Definition: AttributeArrayString.h:151
StringIndexType Type
Definition: AttributeArrayString.h:60
Definition: Exceptions.h:40
std::shared_ptr< StringAttributeHandle > Ptr
Definition: AttributeArrayString.h:139
bool isString(const AttributeArray &array)
Definition: AttributeArrayString.h:127
const MetaMap & mMetadata
Definition: AttributeArrayString.h:161