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 delete_flag_data[geometry_type] = {};
48 size_data[geometry_type] = {};
91 bool has_glyph_texture,
uint coordinate_system,
bool visible_flag,
bool iscontextgeometry,
int size = 0);
97 [[nodiscard]]
const std::unordered_set<size_t> &
getDirtyUUIDs()
const;
102 [[nodiscard]]
bool doesGeometryExist(
size_t UUID)
const;
104 [[nodiscard]] std::vector<size_t> getAllGeometryIDs()
const;
106 [[nodiscard]]
size_t getPrimitiveCount(
bool include_deleted =
true)
const;
130 [[nodiscard]]
size_t getPointCount(
bool include_deleted =
true)
const;
138 [[nodiscard]]
size_t getLineCount(
bool include_deleted =
true)
const;
158 void setVertices(
size_t UUID,
const std::vector<helios::vec3> &vertices);
166 [[nodiscard]] std::vector<helios::vec3>
getVertices(
size_t UUID)
const;
233 void setUVs(
size_t UUID,
const std::vector<helios::vec2> &uvs);
241 [[nodiscard]] std::vector<helios::vec2>
getUVs(
size_t UUID)
const;
335 void setSize(
size_t UUID,
float size);
343 [[nodiscard]]
float getSize(
size_t UUID)
const;
353 [[nodiscard]]
bool getDeleteFlag(
size_t UUID)
const;
410 [[nodiscard]]
const PrimitiveIndexMap &
getIndexMap(
size_t UUID)
const;
412 constexpr static std::array<VisualizerGeometryType, 4> all_geometry_types = {GEOMETRY_TYPE_RECTANGLE, GEOMETRY_TYPE_TRIANGLE, GEOMETRY_TYPE_POINT, GEOMETRY_TYPE_LINE};
415 struct PrimitiveIndexMap {
417 size_t face_index_index;
422 size_t texture_flag_index;
423 size_t texture_ID_index;
424 size_t coordinate_flag_index;
425 size_t visible_index;
426 size_t context_geometry_flag_index;
427 size_t delete_flag_index;
431 std::mt19937_64 random_generator;
433 std::unordered_map<size_t, PrimitiveIndexMap> UUID_map;
435 std::unordered_map<VisualizerGeometryType, std::vector<int>> face_index_data;
436 std::unordered_map<VisualizerGeometryType, std::vector<float>> vertex_data;
437 std::unordered_map<VisualizerGeometryType, std::vector<float>> normal_data;
438 std::unordered_map<VisualizerGeometryType, std::vector<float>> uv_data;
439 std::unordered_map<VisualizerGeometryType, std::vector<float>> color_data;
440 std::unordered_map<VisualizerGeometryType, std::vector<int>> texture_flag_data;
441 std::unordered_map<VisualizerGeometryType, std::vector<int>> texture_ID_data;
442 std::unordered_map<VisualizerGeometryType, std::vector<int>> coordinate_flag_data;
443 std::unordered_map<VisualizerGeometryType, std::vector<char>> visible_flag_data;
444 std::unordered_map<VisualizerGeometryType, std::vector<bool>> context_geometry_flag_data;
445 std::unordered_map<VisualizerGeometryType, std::vector<bool>> delete_flag_data;
446 std::unordered_map<VisualizerGeometryType, std::vector<float>> size_data;
448 std::unordered_set<size_t> dirty_UUIDs;
450 size_t deleted_primitive_count = 0;
459 void defragmentBuffers();