Skip to content

Commit 0398bfe

Browse files
committed
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into feat/save_and_load
2 parents 328eb14 + 126f24b commit 0398bfe

File tree

13 files changed

+143
-51
lines changed

13 files changed

+143
-51
lines changed

components/Viewer/Generic/Mesh/EdgesOptions.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,34 @@
2626
const id = toRef(() => props.itemProps.id)
2727
2828
const dataStyleStore = useDataStyleStore()
29+
const hybridViewerStore = useHybridViewerStore()
2930
3031
const visibility = computed({
3132
get: () => dataStyleStore.meshEdgesVisibility(id.value),
32-
set: (newValue) =>
33-
dataStyleStore.setMeshEdgesVisibility(id.value, newValue),
33+
set: (newValue) => {
34+
dataStyleStore.setMeshEdgesVisibility(id.value, newValue)
35+
hybridViewerStore.remoteRender()
36+
},
3437
})
3538
const size = computed({
3639
get: () => dataStyleStore.edgesSize(id.value),
37-
set: (newValue) => dataStyleStore.setEdgesSize(id.value, newValue),
40+
set: (newValue) => {
41+
dataStyleStore.setEdgesSize(id.value, newValue)
42+
hybridViewerStore.remoteRender()
43+
},
3844
})
3945
const coloring_style_key = computed({
4046
get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
4147
set: (newValue) => {
4248
dataStyleStore.setMeshEdgesActiveColoring(id.value, newValue)
49+
hybridViewerStore.remoteRender()
4350
},
4451
})
4552
const color = computed({
4653
get: () => dataStyleStore.meshEdgesColor(id.value),
47-
set: (newValue) => dataStyleStore.setMeshEdgesColor(id.value, newValue),
54+
set: (newValue) => {
55+
dataStyleStore.setMeshEdgesColor(id.value, newValue)
56+
hybridViewerStore.remoteRender()
57+
},
4858
})
4959
</script>

components/Viewer/Generic/Mesh/PointsOptions.vue

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
<script setup>
4242
const dataStyleStore = useDataStyleStore()
43+
const hybridViewerStore = useHybridViewerStore()
4344
4445
const props = defineProps({
4546
itemProps: { type: Object, required: true },
@@ -50,25 +51,37 @@
5051
5152
const visibility = computed({
5253
get: () => dataStyleStore.meshPointsVisibility(id.value),
53-
set: (newValue) =>
54-
dataStyleStore.setMeshPointsVisibility(id.value, newValue),
54+
set: (newValue) => {
55+
dataStyleStore.setMeshPointsVisibility(id.value, newValue)
56+
hybridViewerStore.remoteRender()
57+
},
5558
})
5659
const size = computed({
5760
get: () => dataStyleStore.meshPointsSize(id.value),
58-
set: (newValue) => dataStyleStore.setMeshPointsSize(id.value, newValue),
61+
set: (newValue) => {
62+
dataStyleStore.setMeshPointsSize(id.value, newValue)
63+
hybridViewerStore.remoteRender()
64+
},
5965
})
6066
const coloring_style_key = computed({
6167
get: () => dataStyleStore.meshPointsActiveColoring(id.value),
62-
set: (newValue) =>
63-
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
68+
set: (newValue) => {
69+
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue)
70+
hybridViewerStore.remoteRender()
71+
},
6472
})
6573
const color = computed({
6674
get: () => dataStyleStore.meshPointsColor(id.value),
67-
set: (newValue) => dataStyleStore.setMeshPointsColor(id.value, newValue),
75+
set: (newValue) => {
76+
dataStyleStore.setMeshPointsColor(id.value, newValue)
77+
hybridViewerStore.remoteRender()
78+
},
6879
})
6980
const vertex_attribute = computed({
7081
get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
71-
set: (newValue) =>
72-
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue),
82+
set: (newValue) => {
83+
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue)
84+
hybridViewerStore.remoteRender()
85+
},
7386
})
7487
</script>

components/Viewer/Generic/Mesh/PolygonsOptions.vue

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<script setup>
2424
const dataStyleStore = useDataStyleStore()
25+
const hybridViewerStore = useHybridViewerStore()
2526
2627
const props = defineProps({
2728
itemProps: { type: Object, required: true },
@@ -33,33 +34,44 @@
3334
3435
const visibility = computed({
3536
get: () => dataStyleStore.meshPolygonsVisibility(id.value),
36-
set: (newValue) =>
37-
dataStyleStore.setMeshPolygonsVisibility(id.value, newValue),
37+
set: (newValue) => {
38+
dataStyleStore.setMeshPolygonsVisibility(id.value, newValue)
39+
hybridViewerStore.remoteRender()
40+
},
3841
})
3942
const coloring_style_key = computed({
4043
get: () => dataStyleStore.meshPolygonsActiveColoring(id.value),
41-
set: (newValue) =>
42-
dataStyleStore.setMeshPolygonsActiveColoring(id.value, newValue),
44+
set: (newValue) => {
45+
dataStyleStore.setMeshPolygonsActiveColoring(id.value, newValue)
46+
hybridViewerStore.remoteRender()
47+
},
4348
})
4449
const color = computed({
4550
get: () => dataStyleStore.meshPolygonsColor(id.value),
46-
set: (newValue) => dataStyleStore.setMeshPolygonsColor(id.value, newValue),
51+
set: (newValue) => {
52+
dataStyleStore.setMeshPolygonsColor(id.value, newValue)
53+
hybridViewerStore.remoteRender()
54+
},
4755
})
4856
const textures = computed({
4957
get: () => dataStyleStore.meshPolygonsTextures(id.value),
50-
set: (newValue) =>
51-
dataStyleStore.setMeshPolygonsTextures(id.value, newValue),
58+
set: (newValue) => {
59+
dataStyleStore.setMeshPolygonsTextures(id.value, newValue)
60+
hybridViewerStore.remoteRender()
61+
},
5262
})
5363
const vertex_attribute = computed({
5464
get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
5565
set: (newValue) => {
5666
dataStyleStore.setMeshPolygonsVertexAttribute(id.value, newValue)
67+
hybridViewerStore.remoteRender()
5768
},
5869
})
5970
const polygon_attribute = computed({
6071
get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
6172
set: (newValue) => {
6273
dataStyleStore.setMeshPolygonsPolygonAttribute(id.value, newValue)
74+
hybridViewerStore.remoteRender()
6375
},
6476
})
6577
</script>

components/Viewer/Generic/Mesh/PolyhedraOptions.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<script setup>
2424
const dataStyleStore = useDataStyleStore()
25+
const hybridViewerStore = useHybridViewerStore()
2526
2627
const props = defineProps({
2728
itemProps: { type: Object, required: true },
@@ -33,26 +34,37 @@
3334
3435
const visibility = computed({
3536
get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
36-
set: (newValue) =>
37-
dataStyleStore.setMeshPolyhedraVisibility(id.value, newValue),
37+
set: (newValue) => {
38+
dataStyleStore.setMeshPolyhedraVisibility(id.value, newValue)
39+
hybridViewerStore.remoteRender()
40+
},
3841
})
3942
const coloring_style_key = computed({
4043
get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
41-
set: (newValue) =>
42-
dataStyleStore.setMeshPolyhedraActiveColoring(id.value, newValue),
44+
set: (newValue) => {
45+
dataStyleStore.setMeshPolyhedraActiveColoring(id.value, newValue)
46+
hybridViewerStore.remoteRender()
47+
},
4348
})
4449
const color = computed({
4550
get: () => dataStyleStore.meshPolyhedraColor(id.value),
46-
set: (newValue) => dataStyleStore.setMeshPolyhedraColor(id.value, newValue),
51+
set: (newValue) => {
52+
dataStyleStore.setMeshPolyhedraColor(id.value, newValue)
53+
hybridViewerStore.remoteRender()
54+
},
4755
})
4856
const vertex_attribute = computed({
4957
get: () => dataStyleStore.polyhedraVertexAttribute(id.value),
50-
set: (newValue) =>
51-
dataStyleStore.setPolyhedraVertexAttribute(id.value, newValue),
58+
set: (newValue) => {
59+
dataStyleStore.setPolyhedraVertexAttribute(id.value, newValue)
60+
hybridViewerStore.remoteRender()
61+
},
5262
})
5363
const polyhedron_attribute = computed({
5464
get: () => dataStyleStore.polyhedraPolyhedronAttribute(id.value),
55-
set: (newValue) =>
56-
dataStyleStore.setPolyhedraPolyhedronAttribute(id.value, newValue),
65+
set: (newValue) => {
66+
dataStyleStore.setPolyhedraPolyhedronAttribute(id.value, newValue)
67+
hybridViewerStore.remoteRender()
68+
},
5769
})
5870
</script>

components/Viewer/Generic/Model/EdgesOptions.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
2121
const id = toRef(() => props.itemProps.id)
2222
const dataStyleStore = useDataStyleStore()
23+
const hybridViewerStore = useHybridViewerStore()
2324
2425
const visibility = computed({
2526
get: () => dataStyleStore.modelEdgesVisibility(id.value),
26-
set: (newValue) =>
27-
dataStyleStore.setModelEdgesVisibility(id.value, newValue),
27+
set: (newValue) => {
28+
dataStyleStore.setModelEdgesVisibility(id.value, newValue)
29+
hybridViewerStore.remoteRender()
30+
},
2831
})
2932
</script>

components/Viewer/Generic/Model/PointsOptions.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import SurfacePoints from "@ogw_f/assets/viewer_svgs/surface_points.svg"
3434
3535
const dataStyleStore = useDataStyleStore()
36+
const hybridViewerStore = useHybridViewerStore()
3637
3738
const props = defineProps({
3839
itemProps: { type: Object, required: true },
@@ -43,11 +44,16 @@
4344
4445
const visibility = computed({
4546
get: () => dataStyleStore.modelPointsVisibility(id.value),
46-
set: (newValue) =>
47-
dataStyleStore.setModelPointsVisibility(id.value, newValue),
47+
set: (newValue) => {
48+
dataStyleStore.setModelPointsVisibility(id.value, newValue)
49+
hybridViewerStore.remoteRender()
50+
},
4851
})
4952
const size = computed({
5053
get: () => dataStyleStore.modelPointsSize(id.value),
51-
set: (newValue) => dataStyleStore.setModelPointsSize(id.value, newValue),
54+
set: (newValue) => {
55+
dataStyleStore.setModelPointsSize(id.value, newValue)
56+
hybridViewerStore.remoteRender()
57+
},
5258
})
5359
</script>

components/Viewer/PointSet/SpecificPointsOptions.vue

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
<script setup>
4343
const dataStyleStore = useDataStyleStore()
44+
const hybridViewerStore = useHybridViewerStore()
4445
4546
const props = defineProps({
4647
itemProps: { type: Object, required: true },
@@ -51,25 +52,37 @@
5152
5253
const visibility = computed({
5354
get: () => dataStyleStore.meshPointsVisibility(id.value),
54-
set: (newValue) =>
55-
dataStyleStore.setMeshPointsVisibility(id.value, newValue),
55+
set: (newValue) => {
56+
dataStyleStore.setMeshPointsVisibility(id.value, newValue)
57+
hybridViewerStore.remoteRender()
58+
},
5659
})
5760
const size = computed({
5861
get: () => dataStyleStore.meshPointsSize(id.value),
59-
set: (newValue) => dataStyleStore.setMeshPointsSize(id.value, newValue),
62+
set: (newValue) => {
63+
dataStyleStore.setMeshPointsSize(id.value, newValue)
64+
hybridViewerStore.remoteRender()
65+
},
6066
})
6167
const coloring_style_key = computed({
6268
get: () => dataStyleStore.meshPointsActiveColoring(id.value),
63-
set: (newValue) =>
64-
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
69+
set: (newValue) => {
70+
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue)
71+
hybridViewerStore.remoteRender()
72+
},
6573
})
6674
const color = computed({
6775
get: () => dataStyleStore.meshPointsColor(id.value),
68-
set: (newValue) => dataStyleStore.setMeshPointsColor(id.value, newValue),
76+
set: (newValue) => {
77+
dataStyleStore.setMeshPointsColor(id.value, newValue)
78+
hybridViewerStore.remoteRender()
79+
},
6980
})
7081
const vertex_attribute = computed({
7182
get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
72-
set: (newValue) =>
73-
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue),
83+
set: (newValue) => {
84+
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue)
85+
hybridViewerStore.remoteRender()
86+
},
7487
})
7588
</script>

components/Viewer/TreeComponent.vue

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<script setup>
1717
const dataStyleStore = useDataStyleStore()
1818
const dataBaseStore = useDataBaseStore()
19+
const hybridViewerStore = useHybridViewerStore()
1920
2021
const props = defineProps({ id: { type: String, required: true } })
2122
@@ -39,43 +40,51 @@
3940
removed_surfaces,
4041
removed_blocks,
4142
] = sortMeshComponents(removed)
42-
if (added_corners.length > 0)
43+
if (added_corners.length > 0) {
4344
dataStyleStore.setModelCornersVisibility(
4445
props.id,
4546
added_corners,
4647
true,
4748
)
48-
if (added_lines.length > 0)
49+
}
50+
if (added_lines.length > 0) {
4951
dataStyleStore.setModelLinesVisibility(props.id, added_lines, true)
50-
if (added_surfaces.length > 0)
52+
}
53+
if (added_surfaces.length > 0) {
5154
dataStyleStore.setModelSurfacesVisibility(
5255
props.id,
5356
added_surfaces,
5457
true,
5558
)
56-
if (added_blocks.length > 0)
59+
}
60+
if (added_blocks.length > 0) {
5761
dataStyleStore.setModelBlocksVisibility(props.id, added_blocks, true)
58-
59-
if (removed_corners.length > 0)
62+
}
63+
if (removed_corners.length > 0) {
6064
dataStyleStore.setModelCornersVisibility(
6165
props.id,
6266
removed_corners,
6367
false,
6468
)
65-
if (removed_lines.length > 0)
69+
}
70+
if (removed_lines.length > 0) {
6671
dataStyleStore.setModelLinesVisibility(props.id, removed_lines, false)
67-
if (removed_surfaces.length > 0)
72+
}
73+
if (removed_surfaces.length > 0) {
6874
dataStyleStore.setModelSurfacesVisibility(
6975
props.id,
7076
removed_surfaces,
7177
false,
7278
)
73-
if (removed_blocks.length > 0)
79+
}
80+
if (removed_blocks.length > 0) {
7481
dataStyleStore.setModelBlocksVisibility(
7582
props.id,
7683
removed_blocks,
7784
false,
7885
)
86+
}
87+
hybridViewerStore.remoteRender()
7988
}
8089
},
8190
{ immediate: true, deep: true },

components/Viewer/TreeObject.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
const treeviewStore = useTreeviewStore()
4040
const dataStyleStore = useDataStyleStore()
4141
const dataBaseStore = useDataBaseStore()
42+
const hybridViewerStore = useHybridViewerStore()
4243
const emit = defineEmits(["show-menu"])
4344
4445
function isLeafNode(item) {
@@ -68,6 +69,7 @@
6869
}
6970
}
7071
})
72+
hybridViewerStore.remoteRender()
7173
},
7274
{ immediate: true },
7375
)

0 commit comments

Comments
 (0)