Enzo
Loading...
Searching...
No Matches
Types.h File Reference

Basic attribute, parameter, and node types for Enzo. More...

#include <Eigen/Dense>
#include <array>
#include <cstdint>
#include <optional>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Typedefs

using enzo::attr::AttrType = AttributeType
 
using enzo::attr::AttrOwner = AttributeOwner
 
using enzo::floatT = float
 
using enzo::intT = int64_t
 
using enzo::boolT = bool
 
using enzo::Vector2 = Eigen::Vector2f
 
using enzo::Vector3 = Eigen::Vector3f
 
using enzo::Vector4 = Eigen::Vector4f
 
using enzo::Matrix3 = Eigen::Matrix3f
 
using enzo::Matrix4 = Eigen::Matrix4f
 
using enzo::String = std::string
 
using enzo::Index = size_t
 enzo::Index is the continuous index of an element in a given AttributeOwner.
 
using enzo::Offset = size_t
 enzo::Offset is the internal discontinuous index of an element in a given AttributeOwner.
 
using enzo::nt::NodeId = uint64_t
 The unique ID assigned to each node in the network.
 

Enumerations

enum class  enzo::attr::AttributeOwner { POINT , VERTEX , FACE , PRIMITIVE }
 The segment of geometry that owns a particular attribute. More...
 
enum class  enzo::attr::AttributeType {
  intT , floatT , listT , vectorT ,
  boolT , matrixT
}
 Data types available to store attribute values in.
 
enum class  PrimType { MESH , CAMERA }
 
enum class  TransformClass : uint8_t { NONE = 0 , POINT = 1 , PRIMITIVE = 2 , POINT_PRIORITY = 3 }
 
enum class  Type {
  STRING , FLOAT , BOOL , INT ,
  TOGGLE , GROUP , DROPDOWN , RAMP ,
  DIVIDER
}
 
enum class  Direction { HORIZONTAL , VERTICAL }
 
enum class  enzo::prm::ValueType { Float , Int , String }
 Which kind of value a parameter stores. More...
 
enum class  SocketIOType { Input , Output }
 

Functions

std::vector< AttributeOwnerenzo::attr::getAllOwners ()
 Returns every part of the geometry that can own an attribute.
 
std::vector< AttributeTypeenzo::attr::getAllTypes ()
 Returns every type an attribute can store.
 
std::string enzo::attr::getOwnerName (AttributeOwner owner)
 Returns the name of a part of the geometry, e.g. "point".
 
std::string enzo::attr::getTypeName (AttributeType type)
 Returns the name of a type an attribute can store, e.g. "vector".
 
std::optional< AttributeOwnerenzo::attr::getOwner (const std::string &name)
 Returns the part of the geometry a name stands for, e.g. "point".
 
std::optional< AttributeTypeenzo::attr::getType (const std::string &name)
 Returns the type a name stands for, e.g. "vector".
 
TransformClass enzo::operator| (TransformClass a, TransformClass b)
 
TransformClass enzo::operator& (TransformClass a, TransformClass b)
 
bool enzo::hasFlag (TransformClass value, TransformClass flag)
 
template<typename T >
constexpr AttributeType enzo::attr::getAttributeType ()
 Returns the attribute type that stores values of the given C++ type.
 
std::string enzo::prm::toString (Type type)
 The lowercase canonical name of a parameter type, e.g. "dropdown".
 
std::optional< Type > enzo::prm::toType (const std::string &name)
 Returns the parameter type a canonical name stands for, e.g. "dropdown".
 
ValueType enzo::prm::toValueType (Type type)
 Returns the kind of value a parameter of this type stores.
 

Variables

constexpr std::array enzo::prm::kAllTypes
 Every parameter type, in declaration order.
 
constexpr NodeId enzo::nt::nullNode = 0
 The id that names no node, since real ids start at 1.
 

Detailed Description

Basic attribute, parameter, and node types for Enzo.

Typedef Documentation

◆ Index

using enzo::Index = size_t

enzo::Index is the continuous index of an element in a given AttributeOwner.

Eg. point index, vertex index, primitive index, or global index. This is usually provided by the user where enzo::Offset is used internally.

◆ Offset

using enzo::Offset = size_t

enzo::Offset is the internal discontinuous index of an element in a given AttributeOwner.

Eg. point offset, vertex offset, primitive offset, or global offset. This different but similar in concept to the index. This value will stay consistant through geometry modification such as adding and deleting points unless defragmented.

Enumeration Type Documentation

◆ AttributeOwner

enum class enzo::attr::AttributeOwner
strong

The segment of geometry that owns a particular attribute.

  • POINT attributes are stored per point, these attributes have an value for each point.
  • VERTEX attributes are stored per vertex, these attributes have an value for each vertex.
  • FACE attributes are stored per face, these attributes have an value for each face.
  • PRIMITIVE attributes are stored per primitive object, these attributes only have one value.

◆ ValueType

enum class enzo::prm::ValueType
strong

Which kind of value a parameter stores.

Every prm::Type maps to one of these through toValueType, and the rest of the value handling switches on this tag.

Function Documentation

◆ getOwner()

std::optional< AttributeOwner > enzo::attr::getOwner ( const std::string & name)
inline

Returns the part of the geometry a name stands for, e.g. "point".

Returns
The owner, or empty when nothing owns attributes under that name.

◆ getType()

std::optional< AttributeType > enzo::attr::getType ( const std::string & name)
inline

Returns the type a name stands for, e.g. "vector".

Returns
The type, or empty when no type goes by that name.

◆ toType()

std::optional< Type > enzo::prm::toType ( const std::string & name)
inline

Returns the parameter type a canonical name stands for, e.g. "dropdown".

Returns
The type, or nullopt when no type carries that name.

Variable Documentation

◆ kAllTypes

std::array enzo::prm::kAllTypes
inlineconstexpr
Initial value:
= {
Type::STRING,
Type::FLOAT,
Type::BOOL,
Type::INT,
Type::TOGGLE,
Type::GROUP,
Type::DROPDOWN,
Type::RAMP,
Type::DIVIDER
}

Every parameter type, in declaration order.