37 #ifndef OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED 38 #define OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED 56 namespace attribute_traits
63 template <
bool Truncate>
71 template<
typename StorageType>
static void decode(
const StorageType&,
ValueType&);
72 template<
typename StorageType>
static void encode(
const ValueType&, StorageType&);
73 static const char*
name() {
return Truncate ?
"str_trnc" :
"str"; }
89 void insert(
const Name& name);
96 std::vector<Index> mIndices;
97 std::vector<Name> mValues;
104 template <
bool Truncate>
105 template<
typename StorageType>
113 template <
bool Truncate>
114 template<
typename StorageType>
137 using Ptr = std::shared_ptr<StringAttributeHandle>;
143 const bool preserveCompression =
true);
163 using Ptr = std::shared_ptr<StringAttributeWriteHandle>;
169 const bool expand =
true);
173 void expand(
bool fill =
true);
179 void collapse(
const Name& name);
186 void fill(
const Name& name);
200 using ValueMap = std::map<std::string, Index>;
214 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_STRING_HAS_BEEN_INCLUDED
std::shared_ptr< StringAttributeHandle > Ptr
Definition: AttributeArrayString.h:137
Write-able version of AttributeHandle.
Definition: AttributeArray.h:715
typename attribute_traits::StringTypeTrait< Truncate >::Type Type
Definition: AttributeArrayString.h:69
uint16_t Type
Definition: AttributeArrayString.h:59
Attribute Array storage templated on type and compression codec.
Definition: AttributeArrayString.h:69
std::string Name
Definition: Name.h:44
Definition: AttributeArrayString.h:160
static const char * name()
Definition: AttributeArrayString.h:73
AttributeHandle< StringIndexType, StringCodec< false > > mHandle
Definition: AttributeArrayString.h:152
Definition: AttributeArrayString.h:134
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
bool isString(const AttributeArray &array)
Definition: AttributeArrayString.h:125
Definition: Exceptions.h:40
Index32 Index
Definition: Types.h:61
Definition: AttributeArray.h:644
Base class for storing attribute data.
Definition: AttributeArray.h:118
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition: AttributeArray.h:186
StringIndexType ValueType
Definition: AttributeArrayString.h:66
uint32_t StringIndexType
Definition: AttributeArrayString.h:53
Definition: AttributeArrayString.h:58
Index size() const
Definition: AttributeArrayString.h:145
Type Truncate(Type x, unsigned int digits)
Return x truncated to the given number of decimal digits.
Definition: Math.h:824
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
Definition: AttributeArrayString.h:64
bool isUniform() const
Definition: AttributeArrayString.h:146
const MetaMap & mMetadata
Definition: AttributeArrayString.h:153
StringIndexType Type
Definition: AttributeArrayString.h:58
Typed class for storing attribute data.
Definition: AttributeArray.h:441