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 attr {
22{
23 POINT,
24 VERTEX,
25 FACE,
26 PRIMITIVE
27};
31enum class AttributeType
32{
33 intT,
34 floatT,
35 listT,
36 vectorT,
37 boolT,
38 matrixT,
39};
40using AttrType = AttributeType;
41using AttrOwner = AttributeOwner;
42} // namespace attr
43namespace geo {
44enum class PrimType
45{
46 MESH,
47 CAMERA
48};
49}
50
51enum class TransformClass : uint8_t
52{
53 NONE = 0,
54 POINT = 1,
55 PRIMITIVE = 2,
56 POINT_PRIORITY = 3 // POINT | PRIMITIVE
57};
58
59// Enum class doesn't support bitwise ops natively. These allow bit-testing
60// e.g. (transformClass & TransformClass::POINT) != TransformClass::NONE
61inline TransformClass operator|(TransformClass a, TransformClass b)
62{
63 return static_cast<TransformClass>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
64}
65inline TransformClass operator&(TransformClass a, TransformClass b)
66{
67 return static_cast<TransformClass>(static_cast<uint8_t>(a) & static_cast<uint8_t>(b));
68}
69// e.g. hasFlag(prim.transformType(), TransformClass::POINT)
70inline bool hasFlag(TransformClass value, TransformClass flag)
71{
72 return (value & flag) != TransformClass::NONE;
73}
74
75// Basic types
76using floatT = float;
77using intT = int64_t;
78using boolT = bool;
79using Vector2 = Eigen::Vector2f;
80using Vector3 = Eigen::Vector3f;
81using Vector4 = Eigen::Vector4f;
82using Matrix3 = Eigen::Matrix3f;
83using Matrix4 = Eigen::Matrix4f;
84using String = std::string;
91using Index = size_t;
100using Offset = size_t;
101namespace prm {
102enum class Type
103{
104 STRING,
105 FLOAT,
106 BOOL,
107 XYZ,
108 INT,
109 TOGGLE,
110 GROUP,
111 DROPDOWN,
112 RAMP,
113 SPACER
114};
115enum class Direction
116{
117 HORIZONTAL,
118 VERTICAL
119};
126enum class ValueType
127{
128 Float,
129 Int,
130 String
131};
132} // namespace prm
133namespace nt {
137using OpId = uint64_t;
138
140constexpr OpId nullOp = 0;
141
142enum class SocketIOType
143{
144 Input,
145 Output
146};
147} // namespace nt
148} // namespace enzo
constexpr OpId nullOp
The id that names no operator, since real ids start at 1.
Definition Types.h:140
size_t Offset
enzo::Offset is the internal discontinuous index of an element in a given AttributeOwner.
Definition Types.h:100
AttributeType
Data types available to store attribute values in.
Definition Types.h:32
AttributeOwner
The segment of geometry that owns a particular attribute.
Definition Types.h:22
size_t Index
enzo::Index is the continuous index of an element in a given AttributeOwner.
Definition Types.h:91
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:137
ValueType
Which kind of value a parameter stores.
Definition Types.h:127