33 #define FMT_HEADER_ONLY 1 34 #define FMT_STRING_ALIAS 1 38 #ifndef FMT_USE_WINDOWS_H 39 #define FMT_USE_WINDOWS_H 0 41 #include <fmt/format.h> 45 namespace visualization {
74 static const std::uint16_t kBadId = 0;
77 inline size_t Hash()
const {
78 return static_cast<std::uint16_t
>(
type) << 16 |
id;
82 return id == other.
id && type == other.
type;
86 return Hash() < other.
Hash();
89 explicit operator bool()
const {
return id != kBadId; }
93 std::uint16_t
GetId()
const {
return id; }
97 : type(aType), id(aId) {}
102 std::uint16_t
id = kBadId;
109 template <EntityType entityType>
114 const auto index =
static_cast<std::uint16_t
>(entityType);
115 auto id = ++uid_table[index];
125 if (
abstract.
type != entityType) {
142 explicit REHandle(
const std::uint16_t aId)
146 template <EntityType entityType>
167 class hash<
open3d::visualization::REHandle_abstract> {
179 struct formatter<
open3d::visualization::REHandle_abstract> {
180 template <
typename FormatContext>
182 FormatContext& ctx) {
183 return format_to(ctx.out(),
"[{}, {}, hash: {}]",
189 template <
typename ParseContext>
190 constexpr
auto parse(ParseContext& ctx) {
REHandle< EntityType::Texture > TextureHandle
Definition: RendererHandle.h:158
Definition: ImguiFilamentBridge.h:61
EntityType
Definition: RendererHandle.h:48
const EntityType type
Definition: RendererHandle.h:75
Definition: RendererHandle.h:165
std::uint16_t id
Definition: RendererHandle.h:102
REHandle< EntityType::MaterialInstance > MaterialInstanceHandle
Definition: RendererHandle.h:157
REHandle< EntityType::Camera > CameraHandle
Definition: RendererHandle.h:155
static const std::uint16_t kBadId
Definition: RendererHandle.h:74
REHandle< EntityType::VertexBuffer > VertexBufferHandle
Definition: RendererHandle.h:159
std::uint16_t GetId() const
Definition: RendererHandle.h:93
REHandle(const REHandle &other)
Definition: RendererHandle.h:134
size_t Hash() const
Definition: RendererHandle.h:77
REHandle()
Definition: RendererHandle.h:133
REHandle< EntityType::Skybox > SkyboxHandle
Definition: RendererHandle.h:154
REHandle_abstract()
Definition: RendererHandle.h:91
std::ostream & operator<<(std::ostream &os, const REHandle_abstract &uid)
Definition: RendererHandle.cpp:37
static const REHandle kBad
Definition: RendererHandle.h:111
char type
Definition: FilePCD.cpp:58
REHandle< EntityType::Material > MaterialHandle
Definition: RendererHandle.h:156
bool operator<(const REHandle_abstract &other) const
Definition: RendererHandle.h:85
Definition: Open3DViewer.h:29
Definition: RendererHandle.h:110
REHandle< EntityType::View > ViewHandle
Definition: RendererHandle.h:149
REHandle< EntityType::IndirectLight > IndirectLightHandle
Definition: RendererHandle.h:153
static const char * TypeToString(EntityType type)
Definition: RendererHandle.cpp:43
static REHandle Concretize(const REHandle_abstract &abstract)
Definition: RendererHandle.h:124
static REHandle Next()
Definition: RendererHandle.h:113
REHandle< EntityType::Scene > SceneHandle
Definition: RendererHandle.h:150
Definition: RendererHandle.h:176
REHandle< EntityType::IndexBuffer > IndexBufferHandle
Definition: RendererHandle.h:160
bool operator==(const REHandle_abstract &other) const
Definition: RendererHandle.h:81
REHandle_abstract(const EntityType aType, const std::uint16_t aId)
Definition: RendererHandle.h:96
REHandle & operator=(const REHandle &other)
Definition: RendererHandle.h:136
Definition: RendererHandle.h:71
REHandle< EntityType::Light > LightHandle
Definition: RendererHandle.h:152
REHandle< EntityType::Geometry > GeometryHandle
Definition: RendererHandle.h:151
size_t operator()(const open3d::visualization::REHandle_abstract &uid) const
Definition: RendererHandle.h:169