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>
109 val = static_cast<ValueType>(data);
113 template <
bool Truncate>
114 template<
typename StorageType>
118 data = static_cast<ValueType>(val);
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 StringIndexType Type
Definition: AttributeArrayString.h:58
AttributeHandle< StringIndexType, StringCodec< false > > mHandle
Definition: AttributeArrayString.h:152
uint16_t Type
Definition: AttributeArrayString.h:59
Index32 Index
Definition: Types.h:61
Typed class for storing attribute data.
Definition: AttributeArray.h:574
Write-able version of AttributeHandle.
Definition: AttributeArray.h:903
Attribute Array storage templated on type and compression codec.
const MetaMap & mMetadata
Definition: AttributeArrayString.h:153
uint32_t StringIndexType
Definition: AttributeArrayString.h:53
StringIndexType ValueType
Definition: AttributeArrayString.h:66
Definition: AttributeArrayString.h:134
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
Definition: AttributeArrayString.h:64
Definition: AttributeArrayString.h:69
Definition: AttributeArrayString.h:58
Definition: Exceptions.h:40
Type Truncate(Type x, unsigned int digits)
Return x truncated to the given number of decimal digits.
Definition: Math.h:824
std::shared_ptr< StringAttributeHandle > Ptr
Definition: AttributeArrayString.h:137
Index size() const
Definition: AttributeArrayString.h:145
static const char * name()
Definition: AttributeArrayString.h:73
typename attribute_traits::StringTypeTrait< Truncate >::Type Type
Definition: AttributeArrayString.h:69
Base class for storing attribute data.
Definition: AttributeArray.h:118
Definition: AttributeArray.h:832
bool isUniform() const
Definition: AttributeArrayString.h:146
bool isString(const AttributeArray &array)
Definition: AttributeArrayString.h:125
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition: AttributeArray.h:253
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
Definition: AttributeArrayString.h:160
std::string Name
Definition: Name.h:44