45using AttrType = AttributeType;
46using AttrOwner = AttributeOwner;
51 return {AttributeOwner::POINT,
52 AttributeOwner::VERTEX,
54 AttributeOwner::PRIMITIVE};
60 return {AttributeType::intT,
61 AttributeType::floatT,
63 AttributeType::vectorT,
65 AttributeType::matrixT};
73 case AttributeOwner::POINT:
75 case AttributeOwner::VERTEX:
77 case AttributeOwner::FACE:
79 case AttributeOwner::PRIMITIVE:
90 case AttributeType::intT:
92 case AttributeType::floatT:
94 case AttributeType::listT:
96 case AttributeType::vectorT:
98 case AttributeType::boolT:
100 case AttributeType::matrixT:
108inline std::optional<AttributeOwner>
getOwner(
const std::string& name)
117inline std::optional<AttributeType>
getType(
const std::string& name)
132enum class TransformClass : uint8_t
142inline TransformClass operator|(TransformClass a, TransformClass b)
144 return static_cast<TransformClass
>(
static_cast<uint8_t
>(a) |
static_cast<uint8_t
>(b));
146inline TransformClass operator&(TransformClass a, TransformClass b)
148 return static_cast<TransformClass
>(
static_cast<uint8_t
>(a) &
static_cast<uint8_t
>(b));
151inline bool hasFlag(TransformClass value, TransformClass flag)
153 return (value & flag) != TransformClass::NONE;
160using Vector2 = Eigen::Vector2f;
161using Vector3 = Eigen::Vector3f;
162using Vector4 = Eigen::Vector4f;
163using Matrix3 = Eigen::Matrix3f;
164using Matrix4 = Eigen::Matrix4f;
165using String = std::string;
187 if constexpr (std::is_same_v<T, intT>)
return AttributeType::intT;
188 else if constexpr (std::is_same_v<T, floatT>)
return AttributeType::floatT;
189 else if constexpr (std::is_same_v<T, boolT>)
return AttributeType::boolT;
190 else if constexpr (std::is_same_v<T, Vector3>)
return AttributeType::vectorT;
191 else if constexpr (std::is_same_v<T, Matrix4>)
return AttributeType::matrixT;
192 else static_assert(
sizeof(T) == 0,
"No attribute type stores this C++ type");
270inline std::optional<Type>
toType(
const std::string& name)
273 if (
toString(type) == name)
return type;
283 return ValueType::Float;
292 return ValueType::Int;
295 return ValueType::String;
297 return ValueType::Float;
299 return ValueType::Float;
311enum class SocketIOType
size_t Offset
enzo::Offset is the internal discontinuous index of an element in a given AttributeOwner.
Definition Types.h:181
std::string getOwnerName(AttributeOwner owner)
Returns the name of a part of the geometry, e.g. "point".
Definition Types.h:69
ValueType toValueType(Type type)
Returns the kind of value a parameter of this type stores.
Definition Types.h:278
AttributeType
Data types available to store attribute values in.
Definition Types.h:37
constexpr AttributeType getAttributeType()
Returns the attribute type that stores values of the given C++ type.
Definition Types.h:185
std::vector< AttributeType > getAllTypes()
Returns every type an attribute can store.
Definition Types.h:58
std::vector< AttributeOwner > getAllOwners()
Returns every part of the geometry that can own an attribute.
Definition Types.h:49
constexpr NodeId nullNode
The id that names no node, since real ids start at 1.
Definition Types.h:309
std::string toString(Type type)
The lowercase canonical name of a parameter type, e.g. "dropdown".
Definition Types.h:228
uint64_t NodeId
The unique ID assigned to each node in the network.
Definition Types.h:306
constexpr std::array kAllTypes
Every parameter type, in declaration order.
Definition Types.h:256
AttributeOwner
The segment of geometry that owns a particular attribute.
Definition Types.h:27
size_t Index
enzo::Index is the continuous index of an element in a given AttributeOwner.
Definition Types.h:172
std::optional< AttributeType > getType(const std::string &name)
Returns the type a name stands for, e.g. "vector".
Definition Types.h:117
ValueType
Which kind of value a parameter stores.
Definition Types.h:221
std::optional< Type > toType(const std::string &name)
Returns the parameter type a canonical name stands for, e.g. "dropdown".
Definition Types.h:270
std::string getTypeName(AttributeType type)
Returns the name of a type an attribute can store, e.g. "vector".
Definition Types.h:86
std::optional< AttributeOwner > getOwner(const std::string &name)
Returns the part of the geometry a name stands for, e.g. "point".
Definition Types.h:108