Enzo
Loading...
Searching...
No Matches
Types.h
Go to the documentation of this file.
1
6#pragma once
7#include <Eigen/Dense>
8#include <cstdint>
9
10namespace enzo {
11
12namespace ga {
21enum class AttributeOwner { POINT, VERTEX, FACE, PRIMITIVE };
25enum class AttributeType {
26 intT,
27 floatT,
28 listT,
29 vectorT,
30 boolT,
31 matrixT,
32};
33using AttrType = AttributeType;
34using AttrOwner = AttributeOwner;
43using Offset = size_t;
44} // namespace ga
45namespace geo {
46enum class PrimType { MESH, CAMERA };
47}
48
49enum class TransformClass : uint8_t {
50 NONE = 0,
51 POINT = 1,
52 PRIMITIVE = 2,
53 POINT_PRIORITY = 3 // POINT | PRIMITIVE
54};
55
56// Enum class doesn't support bitwise ops natively. These allow bit-testing
57// e.g. (transformClass & TransformClass::POINT) != TransformClass::NONE
58inline TransformClass operator|(TransformClass a, TransformClass b) {
59 return static_cast<TransformClass>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
60}
61inline TransformClass operator&(TransformClass a, TransformClass b) {
62 return static_cast<TransformClass>(static_cast<uint8_t>(a) & static_cast<uint8_t>(b));
63}
64// e.g. hasFlag(prim.transformType(), TransformClass::POINT)
65inline bool hasFlag(TransformClass value, TransformClass flag) {
66 return (value & flag) != TransformClass::NONE;
67}
68
69// Basic types
70namespace bt {
71using floatT = double;
72using intT = int64_t;
73using boolT = bool;
74using Vector2f = Eigen::Vector2f;
75using Vector3 = Eigen::Vector3d;
76using Vector4 = Eigen::Vector4d;
77using Matrix4 = Eigen::Matrix4d;
78using String = std::string;
79} // namespace bt
80namespace prm {
81enum class Type { LIST_TERMINATOR, STRING, FLOAT, BOOL, XYZ, INT, TOGGLE };
82}
83namespace nt {
87using OpId = uint64_t;
88
89enum class SocketIOType { Input, Output };
90} // namespace nt
91} // namespace enzo
size_t Offset
ga::Offset is the index of an element in a given AttributeOwner.
Definition Types.h:43
AttributeOwner
The segment of geometry that owns a particular attribute.
Definition Types.h:21
AttributeType
Data types available to store attribute values in.
Definition Types.h:25
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:87