24 struct PrimitiveIndexMap;
32 enum VisualizerGeometryType { GEOMETRY_TYPE_RECTANGLE = 1, GEOMETRY_TYPE_TRIANGLE = 2, GEOMETRY_TYPE_POINT = 3, GEOMETRY_TYPE_LINE = 4 };
36 for (
const auto &geometry_type: all_geometry_types) {
37 face_index_data[geometry_type] = {};
38 vertex_data[geometry_type] = {};
39 normal_data[geometry_type] = {};
40 color_data[geometry_type] = {};
41 uv_data[geometry_type] = {};
42 texture_flag_data[geometry_type] = {};
43 texture_ID_data[geometry_type] = {};
44 coordinate_flag_data[geometry_type] = {};
45 visible_flag_data[geometry_type] = {};
46 context_geometry_flag_data[geometry_type] = {};
47 sky_geometry_flag_data[geometry_type] = {};
48 delete_flag_data[geometry_type] = {};
49 size_data[geometry_type] = {};
93 bool has_glyph_texture,
uint coordinate_system,
bool visible_flag,
bool iscontextgeometry,
bool isskygeometry =
false,
float size = 0);
99 [[nodiscard]]
const std::unordered_set<size_t> &
getDirtyUUIDs()
const;
104 [[nodiscard]]
bool doesGeometryExist(
size_t UUID)
const;
106 [[nodiscard]] std::vector<size_t> getAllGeometryIDs()
const;
108 [[nodiscard]]
size_t getPrimitiveCount(
bool include_deleted =
true)
const;
132 [[nodiscard]]
size_t getPointCount(
bool include_deleted =
true)
const;
140 [[nodiscard]]
size_t getLineCount(
bool include_deleted =
true)
const;
160 void setVertices(
size_t UUID,
const std::vector<helios::vec3> &vertices);
168 [[nodiscard]] std::vector<helios::vec3>
getVertices(
size_t UUID)
const;
235 void setUVs(
size_t UUID,
const std::vector<helios::vec2> &uvs);
243 [[nodiscard]] std::vector<helios::vec2>
getUVs(
size_t UUID)
const;
353 void setSize(
size_t UUID,
float size);
361 [[nodiscard]]
float getSize(
size_t UUID)
const;
371 [[nodiscard]]
bool getDeleteFlag(
size_t UUID)
const;
428 [[nodiscard]]
const PrimitiveIndexMap &
getIndexMap(
size_t UUID)
const;
430 constexpr static std::array<VisualizerGeometryType, 4> all_geometry_types = {GEOMETRY_TYPE_RECTANGLE, GEOMETRY_TYPE_TRIANGLE, GEOMETRY_TYPE_POINT, GEOMETRY_TYPE_LINE};
433 struct PrimitiveIndexMap {
435 size_t face_index_index;
440 size_t texture_flag_index;
441 size_t texture_ID_index;
442 size_t coordinate_flag_index;
443 size_t visible_index;
444 size_t context_geometry_flag_index;
445 size_t sky_geometry_flag_index;
446 size_t delete_flag_index;
450 std::mt19937_64 random_generator;
452 std::unordered_map<size_t, PrimitiveIndexMap> UUID_map;
454 std::unordered_map<VisualizerGeometryType, std::vector<int>> face_index_data;
455 std::unordered_map<VisualizerGeometryType, std::vector<float>> vertex_data;
456 std::unordered_map<VisualizerGeometryType, std::vector<float>> normal_data;
457 std::unordered_map<VisualizerGeometryType, std::vector<float>> uv_data;
458 std::unordered_map<VisualizerGeometryType, std::vector<float>> color_data;
459 std::unordered_map<VisualizerGeometryType, std::vector<int>> texture_flag_data;
460 std::unordered_map<VisualizerGeometryType, std::vector<int>> texture_ID_data;
461 std::unordered_map<VisualizerGeometryType, std::vector<int>> coordinate_flag_data;
462 std::unordered_map<VisualizerGeometryType, std::vector<char>> visible_flag_data;
463 std::unordered_map<VisualizerGeometryType, std::vector<bool>> context_geometry_flag_data;
464 std::unordered_map<VisualizerGeometryType, std::vector<char>> sky_geometry_flag_data;
465 std::unordered_map<VisualizerGeometryType, std::vector<bool>> delete_flag_data;
466 std::unordered_map<VisualizerGeometryType, std::vector<float>> size_data;
468 std::unordered_set<size_t> dirty_UUIDs;
470 size_t deleted_primitive_count = 0;
479 void defragmentBuffers();