ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RendererHandle.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
10 #include <iostream>
11 
12 namespace cloudViewer {
13 namespace visualization {
14 namespace rendering {
15 
16 std::array<std::uint16_t, static_cast<size_t>(EntityType::Count)>
18 
19 std::ostream& operator<<(std::ostream& os, const REHandle_abstract& uid) {
20  os << "[" << REHandle_abstract::TypeToString(uid.type) << ", "
21  << uid.GetId() << ", hash: " << uid.Hash() << "]";
22  return os;
23 }
24 
26  static const size_t kTypesCount = static_cast<size_t>(EntityType::Count);
27  static const size_t kTypesMapped = 14;
28 
29  static_assert(kTypesCount == kTypesMapped,
30  "You forgot to add string value for new handle type.");
31 
32  static const char* kTypesMapping[kTypesMapped] = {
33  "None", "View",
34  "Scene", "Geometry",
35  "Light", "IndirectLight",
36  "Skybox", "Camera",
37  "Material", "MaterialInstance",
38  "Texture", "RenderTarget",
39  "VertexBuffer", "IndexBuffer"};
40 
41  return kTypesMapping[static_cast<size_t>(type)];
42 }
43 
44 } // namespace rendering
45 } // namespace visualization
46 } // namespace cloudViewer
char type
std::ostream & operator<<(std::ostream &os, const REHandle_abstract &uid)
Generic file read and write utility for python interface.
static const char * TypeToString(EntityType type)
static std::array< std::uint16_t, static_cast< size_t >EntityType::Count)> uid_table