12template <
typename T>
using StoreContainer = std::vector<T>;
14template <
typename T>
class AttributeHandle;
48 attr::AttributeType type,
49 bool intrinsic =
false,
60 const std::string&
getName()
const;
62 Vector3 getVector3(Offset offset)
const;
63 Matrix4 getMatrix4(Offset offset)
const;
64 size_t getSize()
const;
94 void compact(
const std::vector<bool>& keep);
103 bool internal_ =
false;
104 bool intrinsic_ =
false;
107 unsigned int typeSize_ = 1;
111 using StoreVariant = std::variant<
112 std::shared_ptr<StoreContainer<intT>>,
113 std::shared_ptr<StoreContainer<floatT>>,
114 std::shared_ptr<StoreContainer<enzo::Vector3>>,
115 std::shared_ptr<StoreContainer<enzo::boolT>>,
116 std::shared_ptr<StoreContainer<enzo::Matrix4>>>;
120using attribVector = std::vector<std::shared_ptr<attr::Attribute>>;
Basic attribute, parameter, and node types for Enzo.
size_t Offset
enzo::Offset is the internal discontinuous index of an element in a given AttributeOwner.
Definition Types.h:182
AttributeType
Data types available to store attribute values in.
Definition Types.h:37
Read only accessor for enzo::attr::Attribute.
Definition AttributeHandle.h:188
Read write accessor for enzo::attr::Attribute.
AttributeType getType() const
Returns the attribute type this attribute stores.
Definition Attribute.cpp:126
bool isIntrinsic() const
Returns whether the attribute is intrinsic.
Definition Attribute.cpp:89
Attribute(std::string name, attr::AttributeType type, bool intrinsic=false, bool isInternal=false)
Construct a new attribute and initialize its typed storage.
Definition Attribute.cpp:10
void resize(size_t size)
Changes the number of elements stored.
Definition Attribute.cpp:50
const std::string & getName() const
Returns the name of this attribute.
Definition Attribute.cpp:128
unsigned int getTypeSize() const
Returns the number of components in the type (eg. StringT is 1, vectorT is 3).
void compact(const std::vector< bool > &keep)
Removes entries marked as deleted, defragmenting the storage so offsets are contiguous again.
Definition Attribute.cpp:55
bool isInternal() const
Returns whether the engine maintains this attribute.
Definition Attribute.cpp:91
void reverse(Offset start, Offset count)
Reverses the order of the entries from start to start + count.
Definition Attribute.cpp:78