Developer Documentation
Loading...
Searching...
No Matches
Entities.hh
1#pragma once
2
3#include <OpenVolumeMesh/Config/Export.hh>
4#include <type_traits>
5#include <cstddef>
6#include <cstdint>
7
8namespace OpenVolumeMesh {
9
10enum class EntityType : uint8_t {
11 Vertex, Edge, HalfEdge, Face, HalfFace, Cell, Mesh
12};
13inline static const size_t n_entity_types = 7;
14
16namespace Entity {
17struct OVM_EXPORT Vertex { static EntityType type() {return EntityType::Vertex;}};
18struct OVM_EXPORT Edge { static EntityType type() {return EntityType::Edge;}};
19struct OVM_EXPORT HalfEdge { static EntityType type() {return EntityType::HalfEdge;}};
20struct OVM_EXPORT Face { static EntityType type() {return EntityType::Face;}};
21struct OVM_EXPORT HalfFace { static EntityType type() {return EntityType::HalfFace;}};
22struct OVM_EXPORT Cell { static EntityType type() {return EntityType::Cell;}};
23struct OVM_EXPORT Mesh { static EntityType type() {return EntityType::Mesh;}};
24} // namespace Entity
25
26
27template<typename T>
28struct is_entity : std::false_type {};
29
30template<typename T>
31inline constexpr bool is_entity_v = is_entity<T>::value;
32
33
34template<> struct OVM_EXPORT is_entity<Entity::Vertex> : std::true_type {};
35template<> struct OVM_EXPORT is_entity<Entity::Edge> : std::true_type {};
36template<> struct OVM_EXPORT is_entity<Entity::HalfEdge> : std::true_type {};
37template<> struct OVM_EXPORT is_entity<Entity::Face> : std::true_type {};
38template<> struct OVM_EXPORT is_entity<Entity::HalfFace> : std::true_type {};
39template<> struct OVM_EXPORT is_entity<Entity::Cell> : std::true_type {};
40template<> struct OVM_EXPORT is_entity<Entity::Mesh> : std::true_type {};
41
42} // namespace OpenVolumeMesh
unsigned char uint8_t
Definition SR_types.hh:80