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 {
75 static const std::uint16_t kBadId = 0;
78 inline size_t Hash()
const {
79 return static_cast<std::uint16_t
>(
type) << 16 |
id;
83 return id == other.
id && type == other.
type;
91 return Hash() < other.
Hash();
94 explicit operator bool()
const {
return id != kBadId; }
98 std::uint16_t
GetId()
const {
return id; }
102 : type(aType), id(aId) {}
107 std::uint16_t
id = kBadId;
114 template <EntityType entityType>
119 const auto index =
static_cast<std::uint16_t
>(entityType);
120 auto id = ++uid_table[index];
130 if (
abstract.
type != entityType) {
149 template <EntityType entityType>
185 template <
typename FormatContext>
187 FormatContext& ctx) {
188 return format_to(ctx.out(),
"[{}, {}, hash: {}]",
194 template <
typename ParseContext>
195 constexpr
auto parse(ParseContext& ctx) {
REHandle< EntityType::Geometry > GeometryHandle
Definition: RendererHandle.h:154
std::ostream & operator<<(std::ostream &os, const REHandle_abstract &uid)
Definition: RendererHandle.cpp:38
REHandle< EntityType::Camera > CameraHandle
Definition: RendererHandle.h:158
REHandle_abstract(const EntityType aType, const std::uint16_t aId)
Definition: RendererHandle.h:101
REHandle_abstract()
Definition: RendererHandle.h:96
static REHandle Concretize(const REHandle_abstract &abstract)
Definition: RendererHandle.h:129
REHandle()
Definition: RendererHandle.h:138
REHandle & operator=(const REHandle &other)
Definition: RendererHandle.h:143
REHandle(std::uint16_t id)
Definition: RendererHandle.h:141
Definition: RendererHandle.h:115
Definition: Optional.h:922
bool operator==(const PointXYZ A, const PointXYZ B)
Definition: Cloud.h:151
REHandle< EntityType::Material > MaterialHandle
Definition: RendererHandle.h:159
std::uint16_t GetId() const
Definition: RendererHandle.h:98
REHandle< EntityType::MaterialInstance > MaterialInstanceHandle
Definition: RendererHandle.h:160
const EntityType type
Definition: RendererHandle.h:76
bool operator<(const REHandle_abstract &other) const
Definition: RendererHandle.h:90
REHandle< EntityType::Scene > SceneHandle
Definition: RendererHandle.h:153
EntityType
Definition: RendererHandle.h:49
REHandle< EntityType::Texture > TextureHandle
Definition: RendererHandle.h:161
static REHandle Next()
Definition: RendererHandle.h:118
static const char * TypeToString(EntityType type)
Definition: RendererHandle.cpp:44
char type
Definition: FilePCD.cpp:60
REHandle< EntityType::IndirectLight > IndirectLightHandle
Definition: RendererHandle.h:156
bool operator==(const REHandle_abstract &other) const
Definition: RendererHandle.h:82
REHandle< EntityType::Light > LightHandle
Definition: RendererHandle.h:155
Definition: PinholeCameraIntrinsic.cpp:35
REHandle(const REHandle &other)
Definition: RendererHandle.h:139
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:191
REHandle< EntityType::View > ViewHandle
Definition: RendererHandle.h:152
static const std::uint16_t kBadId
Definition: RendererHandle.h:75
REHandle< EntityType::Skybox > SkyboxHandle
Definition: RendererHandle.h:157
std::uint16_t id
Definition: RendererHandle.h:107
REHandle< EntityType::VertexBuffer > VertexBufferHandle
Definition: RendererHandle.h:162
Definition: RendererHandle.h:72
REHandle< EntityType::IndexBuffer > IndexBufferHandle
Definition: RendererHandle.h:163
size_t Hash() const
Definition: RendererHandle.h:78
bool operator!=(const REHandle_abstract &other) const
Definition: RendererHandle.h:86
static const REHandle kBad
Definition: RendererHandle.h:116