File indexing completed on 2026-05-27 07:23:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #include "detray/definitions/detail/qualifiers.hpp"
0013
0014
0015 #include <cstdint>
0016 #include <ostream>
0017
0018 namespace detray::navigation {
0019
0020
0021
0022 enum class direction : std::int_least8_t { e_backward = -1, e_forward = 1 };
0023
0024
0025 enum class status : std::int_least8_t {
0026 e_abort = -3,
0027 e_exit = -2,
0028 e_unknown = -1,
0029 e_towards_object = 0,
0030 e_on_object = 1,
0031 e_on_portal = 2,
0032 };
0033
0034
0035 enum class trust_level : std::uint_least8_t {
0036 e_no_trust = 0u,
0037 e_fair = 1u,
0038 e_high = 3u,
0039 e_full = 4u
0040 };
0041
0042
0043 #define ENUM_PRINT(x) \
0044 case x: \
0045 os << #x; \
0046 break
0047
0048 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, direction d) {
0049 switch (d) {
0050 using enum direction;
0051 ENUM_PRINT(e_backward);
0052 ENUM_PRINT(e_forward);
0053 }
0054 return os;
0055 }
0056
0057 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, status st) {
0058 switch (st) {
0059 using enum status;
0060 ENUM_PRINT(e_abort);
0061 ENUM_PRINT(e_exit);
0062 ENUM_PRINT(e_unknown);
0063 ENUM_PRINT(e_towards_object);
0064 ENUM_PRINT(e_on_object);
0065 ENUM_PRINT(e_on_portal);
0066 }
0067 return os;
0068 }
0069
0070 DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, trust_level d) {
0071 switch (d) {
0072 using enum trust_level;
0073 ENUM_PRINT(e_no_trust);
0074 ENUM_PRINT(e_fair);
0075 ENUM_PRINT(e_high);
0076 ENUM_PRINT(e_full);
0077 }
0078 return os;
0079 }
0080
0081 #undef ENUM_PRINT
0082 }