22 face_index_data[geometry_type].reserve(face_index_data[geometry_type].size() + primitive_count);
23 vertex_data[geometry_type].reserve(vertex_data[geometry_type].size() + primitive_count * vertex_count * 3);
24 normal_data[geometry_type].reserve(normal_data[geometry_type].size() + primitive_count * vertex_count * 3);
25 color_data[geometry_type].reserve(color_data[geometry_type].size() + primitive_count * 4);
26 uv_data[geometry_type].reserve(uv_data[geometry_type].size() + primitive_count * vertex_count * 2);
27 texture_flag_data[geometry_type].reserve(texture_flag_data[geometry_type].size() + primitive_count);
28 texture_ID_data[geometry_type].reserve(texture_ID_data[geometry_type].size() + primitive_count);
29 coordinate_flag_data[geometry_type].reserve(coordinate_flag_data[geometry_type].size() + primitive_count);
30 delete_flag_data[geometry_type].reserve(delete_flag_data[geometry_type].size() + primitive_count);
31 context_geometry_flag_data[geometry_type].reserve(context_geometry_flag_data[geometry_type].size() + primitive_count);
32 size_data[geometry_type].reserve(size_data[geometry_type].size() + primitive_count);
36 bool has_glyph_texture,
uint coordinate_system,
bool visible_flag,
bool iscontextgeometry,
int size) {
41 assert(vertices.size() == vertex_count);
42 assert(uvs.empty() || uvs.size() == vertex_count);
45 std::vector<helios::vec3> vertices_copy = vertices;
47 bool geometry_is_new =
false;
48 if (!doesGeometryExist(UUID)) {
49 registerUUID(UUID, geometry_type);
50 geometry_is_new =
true;
53 if (coordinate_system == 0) {
56 for (
auto &vertex: vertices_copy) {
57 vertex.x = 2.f * vertex.x - 1.f;
58 vertex.y = 2.f * vertex.y - 1.f;
62 size_t vertex_index = UUID_map.at(UUID).vertex_index;
63 size_t normal_index = UUID_map.at(UUID).normal_index;
64 size_t uv_index = UUID_map.at(UUID).uv_index;
65 size_t color_index = UUID_map.at(UUID).color_index;
66 size_t texture_flag_index = UUID_map.at(UUID).texture_flag_index;
67 size_t texture_ID_index = UUID_map.at(UUID).texture_ID_index;
69 for (
char i = 0; i < vertex_count; i++) {
71 if (geometry_is_new) {
72 face_index_data[geometry_type].push_back(
static_cast<int>(visible_flag_data[geometry_type].size()));
74 vertex_data[geometry_type].push_back(vertices_copy.at(i).x);
75 vertex_data[geometry_type].push_back(vertices_copy.at(i).y);
76 vertex_data[geometry_type].push_back(vertices_copy.at(i).z);
80 vertex_data[geometry_type].at(vertex_index) = vertices_copy.at(i).x;
81 vertex_data[geometry_type].at(vertex_index + 1) = vertices_copy.at(i).y;
82 vertex_data[geometry_type].at(vertex_index + 2) = vertices_copy.at(i).z;
86 if ((geometry_type == GEOMETRY_TYPE_TRIANGLE || geometry_type == GEOMETRY_TYPE_RECTANGLE) && !uvs.empty()) {
88 if (geometry_is_new) {
89 uv_data[geometry_type].push_back(uvs.at(i).x);
90 uv_data[geometry_type].push_back(1.f - uvs.at(i).y);
93 if (has_glyph_texture) {
94 texture_flag_data[geometry_type].push_back(3);
95 }
else if (override_texture_color) {
96 texture_flag_data[geometry_type].push_back(2);
98 texture_flag_data[geometry_type].push_back(1);
100 texture_ID_data[geometry_type].push_back(textureID);
103 uv_data[geometry_type].at(uv_index) = uvs.at(i).x;
104 uv_data[geometry_type].at(uv_index + 1) = 1.f - uvs.at(i).y;
108 if (has_glyph_texture) {
109 texture_flag_data[geometry_type].at(texture_flag_index) = 3;
110 }
else if (override_texture_color) {
111 texture_flag_data[geometry_type].at(texture_flag_index) = 2;
113 texture_flag_data[geometry_type].at(texture_flag_index) = 1;
115 texture_flag_index++;
116 texture_ID_data[geometry_type].at(texture_ID_index) = textureID;
122 if (geometry_is_new) {
123 uv_data[geometry_type].push_back(0.f);
124 uv_data[geometry_type].push_back(0.f);
127 if (has_glyph_texture) {
128 texture_flag_data[geometry_type].push_back(3);
129 texture_ID_data[geometry_type].push_back(textureID);
131 texture_flag_data[geometry_type].push_back(0);
132 texture_ID_data[geometry_type].push_back(0);
136 uv_data[geometry_type].at(uv_index) = 0.f;
137 uv_data[geometry_type].at(uv_index + 1) = 0.f;
141 if (has_glyph_texture) {
142 texture_flag_data[geometry_type].at(texture_flag_index) = 3;
143 texture_ID_data[geometry_type].at(texture_ID_index) = textureID;
145 texture_flag_data[geometry_type].at(texture_flag_index) = 0;
146 texture_ID_data[geometry_type].at(texture_ID_index) = 0;
148 texture_flag_index++;
156 if (geometry_type == GEOMETRY_TYPE_TRIANGLE || geometry_type == GEOMETRY_TYPE_RECTANGLE) {
157 normal = normalize(
cross(vertices_copy.at(1) - vertices_copy.at(0), vertices_copy.at(2) - vertices_copy.at(0)));
159 if (geometry_is_new) {
160 normal_data[geometry_type].push_back(normal.
x);
161 normal_data[geometry_type].push_back(normal.
y);
162 normal_data[geometry_type].push_back(normal.
z);
164 color_data[geometry_type].push_back(color.
r);
165 color_data[geometry_type].push_back(color.
g);
166 color_data[geometry_type].push_back(color.
b);
167 color_data[geometry_type].push_back(color.
a);
169 coordinate_flag_data[geometry_type].push_back(coordinate_system);
171 visible_flag_data[geometry_type].push_back(visible_flag);
173 delete_flag_data[geometry_type].push_back(
false);
175 context_geometry_flag_data[geometry_type].push_back(iscontextgeometry);
177 size_data[geometry_type].push_back(
static_cast<float>(size));
179 normal_data[geometry_type].at(normal_index) = normal.
x;
180 normal_data[geometry_type].at(normal_index + 1) = normal.
y;
181 normal_data[geometry_type].at(normal_index + 2) = normal.
z;
183 color_data[geometry_type].at(color_index) = color.
r;
184 color_data[geometry_type].at(color_index + 1) = color.
g;
185 color_data[geometry_type].at(color_index + 2) = color.
b;
186 color_data[geometry_type].at(color_index + 3) = color.
a;
192bool GeometryHandler::doesGeometryExist(
size_t UUID)
const {
193 return (UUID_map.find(UUID) != UUID_map.end());
196std::vector<size_t> GeometryHandler::getAllGeometryIDs()
const {
197 std::vector<size_t> result;
198 result.reserve(UUID_map.size());
199 for (
const auto &[UUID, primitivemap]: UUID_map) {
200 if (getDeleteFlag(UUID)) {
204 result.push_back(UUID);
209size_t GeometryHandler::getPrimitiveCount(
bool include_deleted)
const {
211 if (include_deleted) {
212 for (
auto &type: all_geometry_types) {
213 count += delete_flag_data.at(type).size();
218 for (
auto &type: all_geometry_types) {
219 count += std::count(delete_flag_data.at(type).begin(), delete_flag_data.at(type).end(),
false);
226 if (include_deleted) {
227 return delete_flag_data.at(type).size();
230 size_t count = std::count(delete_flag_data.at(type).begin(), delete_flag_data.at(type).end(),
false);
236 if (include_deleted) {
237 return delete_flag_data.at(type).size();
240 size_t count = std::count(delete_flag_data.at(type).begin(), delete_flag_data.at(type).end(),
false);
246 if (include_deleted) {
247 return delete_flag_data.at(type).size();
250 size_t count = std::count(delete_flag_data.at(type).begin(), delete_flag_data.at(type).end(),
false);
256 if (include_deleted) {
257 return delete_flag_data.at(type).size();
260 size_t count = std::count(delete_flag_data.at(type).begin(), delete_flag_data.at(type).end(),
false);
266 assert(face_index_data.find(geometry_type) != face_index_data.end());
268 return &face_index_data.at(geometry_type);
274 assert(UUID_map.find(UUID) != UUID_map.end());
277 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
279 const char vertex_count =
getVertexCount(index_map.geometry_type);
282 assert(vertices.size() == vertex_count);
285 const size_t vertex_ind = index_map.vertex_index;
288 for (
int i = 0; i < vertex_count; i++) {
289 vertex_data[index_map.geometry_type].at(vertex_ind + ii + 0) = vertices.at(i).x;
290 vertex_data[index_map.geometry_type].at(vertex_ind + ii + 1) = vertices.at(i).y;
291 vertex_data[index_map.geometry_type].at(vertex_ind + ii + 2) = vertices.at(i).z;
295 const size_t normal_ind = index_map.normal_index;
297 const helios::vec3 normal = normalize(
cross(vertices.at(1) - vertices.at(0), vertices.at(2) - vertices.at(0)));
298 normal_data[index_map.geometry_type].at(normal_ind + ii + 0) = normal.
x;
299 normal_data[index_map.geometry_type].at(normal_ind + ii + 1) = normal.
y;
300 normal_data[index_map.geometry_type].at(normal_ind + ii + 2) = normal.
z;
308 assert(UUID_map.find(UUID) != UUID_map.end());
311 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
313 const size_t vertex_ind = index_map.vertex_index;
315 const char vertex_count =
getVertexCount(index_map.geometry_type);
317 std::vector<helios::vec3> vertices(vertex_count);
319 for (
int i = 0; i < vertex_count; i++) {
320 vertices.at(i).x = vertex_data.at(index_map.geometry_type).at(vertex_ind + i * 3 + 0);
321 vertices.at(i).y = vertex_data.at(index_map.geometry_type).at(vertex_ind + i * 3 + 1);
322 vertices.at(i).z = vertex_data.at(index_map.geometry_type).at(vertex_ind + i * 3 + 2);
330 assert(vertex_data.find(geometry_type) != vertex_data.end());
332 return &vertex_data.at(geometry_type);
338 assert(UUID_map.find(UUID) != UUID_map.end());
341 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
343 const size_t normal_ind = index_map.normal_index;
347 normal.
x = normal_data.at(index_map.geometry_type).at(normal_ind + 0);
348 normal.
y = normal_data.at(index_map.geometry_type).at(normal_ind + 1);
349 normal.
z = normal_data.at(index_map.geometry_type).at(normal_ind + 2);
356 assert(normal_data.find(geometry_type) != normal_data.end());
358 return &normal_data.at(geometry_type);
364 assert(UUID_map.find(UUID) != UUID_map.end());
367 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
369 const size_t color_ind = index_map.color_index;
371 color_data[index_map.geometry_type].at(color_ind + 0) = color.
r;
372 color_data[index_map.geometry_type].at(color_ind + 1) = color.
g;
373 color_data[index_map.geometry_type].at(color_ind + 2) = color.
b;
374 color_data[index_map.geometry_type].at(color_ind + 3) = color.
a;
382 assert(UUID_map.find(UUID) != UUID_map.end());
385 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
387 const size_t color_ind = index_map.color_index;
389 const helios::RGBAcolor color{color_data.at(index_map.geometry_type).at(color_ind), color_data.at(index_map.geometry_type).at(color_ind + 1), color_data.at(index_map.geometry_type).at(color_ind + 2),
390 color_data.at(index_map.geometry_type).at(color_ind + 3)};
397 assert(color_data.find(geometry_type) != color_data.end());
399 return &color_data.at(geometry_type);
405 assert(UUID_map.find(UUID) != UUID_map.end());
408 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
410 if (index_map.geometry_type == GEOMETRY_TYPE_LINE || index_map.geometry_type == GEOMETRY_TYPE_POINT) {
415 const char vertex_count =
getVertexCount(index_map.geometry_type);
418 assert(uvs.size() == vertex_count);
421 const size_t uv_ind = index_map.uv_index;
424 for (
int i = 0; i < vertex_count; i++) {
425 uv_data.at(index_map.geometry_type).at(uv_ind + ii) = uvs.at(i).x;
426 uv_data.at(index_map.geometry_type).at(uv_ind + ii + 1) = uvs.at(i).y;
436 assert(UUID_map.find(UUID) != UUID_map.end());
439 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
441 const size_t uv_ind = index_map.uv_index;
443 const char vertex_count =
getVertexCount(index_map.geometry_type);
445 std::vector<helios::vec2> uvs(vertex_count);
447 for (
int i = 0; i < vertex_count; i++) {
448 uvs.at(i).x = uv_data.at(index_map.geometry_type).at(uv_ind + i * 2);
449 uvs.at(i).x = uv_data.at(index_map.geometry_type).at(uv_ind + i * 2 + 1);
457 assert(uv_data.find(geometry_type) != uv_data.end());
459 return &uv_data.at(geometry_type);
465 assert(UUID_map.find(UUID) != UUID_map.end());
468 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
470 if (index_map.geometry_type == GEOMETRY_TYPE_LINE || index_map.geometry_type == GEOMETRY_TYPE_POINT) {
475 const size_t texture_ind = index_map.texture_ID_index;
477 texture_ID_data.at(index_map.geometry_type).at(texture_ind) = textureID;
485 assert(UUID_map.find(UUID) != UUID_map.end());
488 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
490 const size_t texture_ID_ind = index_map.texture_ID_index;
492 return texture_ID_data.at(index_map.geometry_type).at(texture_ID_ind);
497 assert(texture_ID_data.find(geometry_type) != texture_ID_data.end());
499 return &texture_ID_data.at(geometry_type);
505 assert(UUID_map.find(UUID) != UUID_map.end());
508 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
510 if (index_map.geometry_type == GEOMETRY_TYPE_LINE || index_map.geometry_type == GEOMETRY_TYPE_POINT) {
515 const size_t texture_flag_ind = index_map.texture_flag_index;
517 const int current_flag = texture_flag_data.at(index_map.geometry_type).at(texture_flag_ind);
518 if (current_flag == 1) {
520 texture_flag_data.at(index_map.geometry_type).at(texture_flag_ind) = 2;
529 assert(UUID_map.find(UUID) != UUID_map.end());
532 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
534 if (index_map.geometry_type == GEOMETRY_TYPE_LINE || index_map.geometry_type == GEOMETRY_TYPE_POINT) {
539 const size_t texture_flag_ind = index_map.texture_flag_index;
542 texture_flag_data.at(index_map.geometry_type).at(texture_flag_ind) = 1;
549 assert(texture_flag_data.find(geometry_type) != texture_flag_data.end());
551 return &texture_flag_data.at(geometry_type);
557 assert(UUID_map.find(UUID) != UUID_map.end());
560 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
562 const size_t visibile_ind = index_map.visible_index;
564 visible_flag_data.at(index_map.geometry_type).at(visibile_ind) =
static_cast<char>(isvisible);
572 assert(UUID_map.find(UUID) != UUID_map.end());
575 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
577 const size_t visible_ind = index_map.visible_index;
579 return static_cast<bool>(visible_flag_data.at(index_map.geometry_type).at(visible_ind));
584 assert(visible_flag_data.find(geometry_type) != visible_flag_data.end());
586 return &visible_flag_data.at(geometry_type);
591 assert(coordinate_flag_data.find(geometry_type) != coordinate_flag_data.end());
593 return &coordinate_flag_data.at(geometry_type);
599 assert(UUID_map.find(UUID) != UUID_map.end());
602 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
604 const size_t size_ind = index_map.size_index;
606 size_data[index_map.geometry_type].at(size_ind) = size;
614 assert(UUID_map.find(UUID) != UUID_map.end());
617 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
619 const size_t size_ind = index_map.size_index;
621 return size_data.at(index_map.geometry_type).at(size_ind);
626 assert(size_data.find(geometry_type) != size_data.end());
628 return &size_data.at(geometry_type);
631bool GeometryHandler::getDeleteFlag(
size_t UUID)
const {
633 assert(UUID_map.find(UUID) != UUID_map.end());
636 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
638 const size_t delete_flag_ind = index_map.delete_flag_index;
640 return delete_flag_data.at(index_map.geometry_type).at(delete_flag_ind);
646 assert(UUID_map.find(UUID) != UUID_map.end());
649 const PrimitiveIndexMap &index_map = UUID_map.at(UUID);
651 delete_flag_data.at(index_map.geometry_type).at(index_map.delete_flag_index) =
true;
652 visible_flag_data.at(index_map.geometry_type).at(index_map.visible_index) =
false;
656 deleted_primitive_count++;
658 if (deleted_primitive_count > 250000) {
664 for (
const auto &UUID: UUIDs) {
671 for (
const auto &geometry_type: all_geometry_types) {
672 if (vertex_data.find(geometry_type) == vertex_data.end()) {
676 face_index_data.at(geometry_type).clear();
677 vertex_data.at(geometry_type).clear();
678 normal_data.at(geometry_type).clear();
679 uv_data.at(geometry_type).clear();
680 color_data.at(geometry_type).clear();
681 texture_flag_data.at(geometry_type).clear();
682 texture_ID_data.at(geometry_type).clear();
683 coordinate_flag_data.at(geometry_type).clear();
684 visible_flag_data.at(geometry_type).clear();
685 context_geometry_flag_data.at(geometry_type).clear();
686 delete_flag_data.at(geometry_type).clear();
687 size_data.at(geometry_type).clear();
692 deleted_primitive_count = 0;
697 for (
const auto &geometry_type: all_geometry_types) {
698 if (vertex_data.find(geometry_type) == vertex_data.end()) {
702 for (
size_t i = 0; i < context_geometry_flag_data.at(geometry_type).size(); i++) {
703 assert(context_geometry_flag_data.at(geometry_type).size() == delete_flag_data.at(geometry_type).size());
704 if (context_geometry_flag_data.at(geometry_type).at(i)) {
705 delete_flag_data.at(geometry_type).at(i) =
true;
707 deleted_primitive_count++;
724 for (
const auto &[UUID, index_map]: UUID_map) {
726 if (coordinate_flag_data.at(index_map.geometry_type).at(index_map.coordinate_flag_index) == 0) {
732 for (
const auto &vertex: vertices) {
733 if (vertex.x < xbounds.
x) {
734 xbounds.
x = vertex.x;
736 if (vertex.x > xbounds.
y) {
737 xbounds.
y = vertex.x;
739 if (vertex.y < ybounds.
x) {
740 ybounds.
x = vertex.y;
742 if (vertex.y > ybounds.
y) {
743 ybounds.
y = vertex.y;
745 if (vertex.z < zbounds.
x) {
746 zbounds.
x = vertex.z;
748 if (vertex.z > zbounds.
y) {
749 zbounds.
y = vertex.z;
760 radius = {0.5f * (xbounds.
y - xbounds.
x), 0.5f * (ybounds.
y - ybounds.
x), 0.5f * (zbounds.
y - zbounds.
x)};
762 center = {xbounds.
x + radius.
x, ybounds.
x + radius.
y, zbounds.
x + radius.
z};
766 std::uniform_int_distribution<size_t> dist(1, (std::numeric_limits<size_t>::max)());
768 while (UUID == 0 || UUID_map.find(UUID) != UUID_map.end()) {
769 UUID = dist(random_generator);
776 assert(UUID_map.find(UUID) != UUID_map.end());
778 return UUID_map.at(UUID);
781void GeometryHandler::defragmentBuffers() {
784 if (deleted_primitive_count == 0) {
790 for (
const auto &geometry_type: all_geometry_types) {
791 if (vertex_data.find(geometry_type) == vertex_data.end()) {
795 auto &oldFace = face_index_data.at(geometry_type);
796 auto &oldVertex = vertex_data.at(geometry_type);
797 auto &oldNormal = normal_data.at(geometry_type);
798 auto &oldUV = uv_data.at(geometry_type);
799 auto &oldColor = color_data.at(geometry_type);
800 auto &oldTexFlag = texture_flag_data.at(geometry_type);
801 auto &oldTexID = texture_ID_data.at(geometry_type);
802 auto &oldCoordFlag = coordinate_flag_data.at(geometry_type);
803 auto &oldVisible = visible_flag_data.at(geometry_type);
804 auto &oldContextFlag = context_geometry_flag_data.at(geometry_type);
805 auto &oldDeleteFlag = delete_flag_data.at(geometry_type);
806 auto &oldSize = size_data.at(geometry_type);
809 std::vector<VisualizerGeometryType> newType;
810 std::vector<float> newVertex, newNormal, newUV, newColor, newSize;
811 std::vector<int> newFace, newTexFlag, newTexID, newCoordFlag;
812 std::vector<bool> newDeleteFlag, newContextFlag;
813 std::vector<char> newVisible;
816 std::vector<size_t> toErase;
819 for (
auto &[UUID, prim]: UUID_map) {
820 if (prim.geometry_type != geometry_type) {
825 if (oldDeleteFlag[prim.delete_flag_index]) {
826 toErase.push_back(UUID);
832 const size_t v3 =
static_cast<size_t>(vcount) * 3;
833 const size_t v2 =
static_cast<size_t>(vcount) * 2;
836 const size_t fi = newFace.size();
837 const size_t vi = newVertex.size();
838 const size_t ni = newNormal.size();
839 const size_t ui = newUV.size();
840 const size_t ci = newColor.size();
841 const size_t tfi = newTexFlag.size();
842 const size_t tidi = newTexID.size();
843 const size_t cfi = newCoordFlag.size();
844 const size_t vi2 = newVisible.size();
845 const size_t cfi2 = newContextFlag.size();
846 const size_t dfi = newDeleteFlag.size();
847 const size_t si = newSize.size();
850 newFace.insert(newFace.end(), vcount, scast<int>(newVisible.size()));
852 newVertex.insert(newVertex.end(), oldVertex.begin() + prim.vertex_index, oldVertex.begin() + prim.vertex_index + v3);
854 newNormal.insert(newNormal.end(), oldNormal.begin() + prim.normal_index, oldNormal.begin() + prim.normal_index + 3);
856 newUV.insert(newUV.end(), oldUV.begin() + prim.uv_index, oldUV.begin() + prim.uv_index + v2);
858 newColor.insert(newColor.end(), oldColor.begin() + prim.color_index, oldColor.begin() + prim.color_index + 4);
860 newTexFlag.push_back(oldTexFlag[prim.texture_flag_index]);
861 newTexID.push_back(oldTexID[prim.texture_ID_index]);
862 newCoordFlag.push_back(oldCoordFlag[prim.coordinate_flag_index]);
863 newVisible.push_back(oldVisible[prim.visible_index]);
864 newContextFlag.push_back(oldContextFlag[prim.context_geometry_flag_index]);
865 newDeleteFlag.push_back(oldDeleteFlag[prim.delete_flag_index]);
866 newSize.push_back(oldSize[prim.size_index]);
869 prim.face_index_index = fi;
870 prim.vertex_index = vi;
871 prim.normal_index = ni;
873 prim.color_index = ci;
874 prim.texture_flag_index = tfi;
875 prim.texture_ID_index = tidi;
876 prim.coordinate_flag_index = cfi;
877 prim.visible_index = vi2;
878 prim.context_geometry_flag_index = cfi2;
879 prim.delete_flag_index = dfi;
880 prim.size_index = si;
884 for (
auto UUID: toErase) {
885 UUID_map.erase(UUID);
889 oldFace.swap(newFace);
890 oldVertex.swap(newVertex);
891 oldNormal.swap(newNormal);
893 oldColor.swap(newColor);
894 oldTexFlag.swap(newTexFlag);
895 oldTexID.swap(newTexID);
896 oldCoordFlag.swap(newCoordFlag);
897 oldVisible.swap(newVisible);
898 oldContextFlag.swap(newContextFlag);
899 oldDeleteFlag.swap(newDeleteFlag);
900 oldSize.swap(newSize);
904 deleted_primitive_count = 0;
907void GeometryHandler::registerUUID(
size_t UUID,
const VisualizerGeometryType &geometry_type) {
909 UUID_map[UUID] = {geometry_type,
910 face_index_data.at(geometry_type).size(),
911 vertex_data.at(geometry_type).size(),
912 normal_data.at(geometry_type).size(),
913 uv_data.at(geometry_type).size(),
914 color_data.at(geometry_type).size(),
915 texture_flag_data.at(geometry_type).size(),
916 texture_ID_data.at(geometry_type).size(),
917 coordinate_flag_data.at(geometry_type).size(),
918 visible_flag_data.at(geometry_type).size(),
919 context_geometry_flag_data.at(geometry_type).size(),
920 delete_flag_data.at(geometry_type).size(),
921 size_data.at(geometry_type).size()};
926 switch (geometry_type) {
927 case GEOMETRY_TYPE_RECTANGLE:
929 case GEOMETRY_TYPE_TRIANGLE:
931 case GEOMETRY_TYPE_POINT:
933 case GEOMETRY_TYPE_LINE:
942 dirty_UUIDs.insert(UUID);