@geode/opengeodeweb-front 10.44.0-rc.3 → 10.44.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/.build/server/utils/microservices.js +9 -85
  2. package/.build/server/utils/microservices_process.js +85 -0
  3. package/app/components/ClippingPlanes.vue +16 -82
  4. package/app/components/DragAndDrop.vue +1 -74
  5. package/app/components/ThresholdCard.vue +205 -0
  6. package/app/components/ThresholdFilter.vue +77 -216
  7. package/app/components/ViewToolbar.vue +15 -231
  8. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  9. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  10. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +228 -0
  11. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  12. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  13. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  14. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +234 -0
  15. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  16. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  17. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  18. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  19. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  20. package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -294
  21. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  22. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  23. package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -425
  24. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  25. package/app/components/Viewer/Options/AttributeSelector.vue +26 -133
  26. package/app/components/Viewer/Options/ColoringTypeSelector.vue +36 -74
  27. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  28. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  29. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  30. package/app/components/Viewer/Surface/PolygonsColoring.vue +231 -0
  31. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  32. package/app/composables/attribute_selector.ts +126 -0
  33. package/app/composables/clipping_slices.ts +166 -0
  34. package/app/composables/view_toolbar_options.ts +126 -0
  35. package/app/composables/view_toolbar_tool_options.ts +115 -0
  36. package/app/composables/view_toolbar_tools.ts +108 -0
  37. package/app/composables/virtual_tree.ts +20 -138
  38. package/app/composables/virtual_tree_flatten.ts +86 -0
  39. package/app/composables/virtual_tree_types.ts +81 -0
  40. package/app/stores/app.ts +8 -55
  41. package/app/stores/app_helpers/registry.ts +69 -0
  42. package/app/stores/menu.ts +1 -124
  43. package/app/stores/menu_helpers/menus_data.ts +127 -0
  44. package/app/stores/viewer.ts +17 -78
  45. package/app/stores/viewer_helpers/actions.ts +68 -0
  46. package/app/stores/viewer_helpers/request.ts +61 -0
  47. package/app/utils/clipping_planes.ts +4 -132
  48. package/app/utils/clipping_planes_scene.ts +131 -0
  49. package/app/utils/coloring_styles.ts +101 -0
  50. package/app/utils/default_styles/mesh_components.ts +168 -0
  51. package/app/utils/default_styles/meshes.ts +13 -153
  52. package/app/utils/default_styles/model_components.ts +170 -0
  53. package/app/utils/default_styles/models.ts +16 -153
  54. package/app/utils/drag_and_drop.ts +80 -0
  55. package/app/utils/model_component_coloring.ts +46 -0
  56. package/app/utils/threshold.ts +33 -0
  57. package/app/utils/threshold_sources.ts +51 -0
  58. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  59. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  60. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  61. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  62. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  63. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  64. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  65. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  66. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  67. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  68. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  69. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  70. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  71. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  72. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  73. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  74. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  75. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  76. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  77. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  78. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  79. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  80. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  81. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  82. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  83. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  84. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  85. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  86. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  87. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  88. package/internal/stores/data_style/model/common.ts +10 -119
  89. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  90. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  91. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  92. package/internal/stores/data_style/model/lines/index.ts +10 -134
  93. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  94. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  95. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  96. package/internal/stores/data_style/model/visibility.ts +3 -156
  97. package/internal/stores/data_style/model/visibility_dispatch.ts +160 -0
  98. package/internal/stores/data_style/state.ts +1 -181
  99. package/internal/stores/data_style/state_shared.ts +191 -0
  100. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  101. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  102. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  103. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  104. package/package.json +1 -1
  105. package/server/utils/microservices.ts +10 -109
  106. package/server/utils/microservices_process.ts +127 -0
@@ -0,0 +1,217 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ type RangesPerData,
4
+ applyRangesPerData,
5
+ useBatchStyle,
6
+ } from "@ogw_front/composables/batch_style";
7
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
8
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
9
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
10
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
11
+
12
+ const dataStyleStore = useDataStyleStore();
13
+ const hybridViewerStore = useHybridViewerStore();
14
+ const { applyBatchStyle } = useBatchStyle();
15
+
16
+ interface Props {
17
+ id: string;
18
+ }
19
+
20
+ const { id } = defineProps<Props>();
21
+
22
+ const coloring_style_key = computed<string>({
23
+ get: () => dataStyleStore.meshPolyhedraActiveColoring(id),
24
+ set: async (newValue) => {
25
+ await applyBatchStyle(id, (targetId: string) =>
26
+ dataStyleStore.setMeshPolyhedraActiveColoring(targetId, newValue),
27
+ );
28
+ hybridViewerStore.remoteRender();
29
+ },
30
+ });
31
+ const color = computed<RGBAColor | undefined>({
32
+ get: () => dataStyleStore.meshPolyhedraColor(id) as RGBAColor | undefined,
33
+ set: async (newValue) => {
34
+ if (newValue === undefined) {
35
+ return;
36
+ }
37
+ await applyBatchStyle(id, (targetId: string) =>
38
+ dataStyleStore.setMeshPolyhedraColor(targetId, newValue),
39
+ );
40
+ hybridViewerStore.remoteRender();
41
+ },
42
+ });
43
+ const vertex_attribute_name = computed<string | undefined>({
44
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeName(id),
45
+ set: async (newValue) => {
46
+ if (newValue === undefined) {
47
+ return;
48
+ }
49
+ await applyBatchStyle(id, (targetId: string) =>
50
+ Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeName(targetId, newValue)),
51
+ );
52
+ hybridViewerStore.remoteRender();
53
+ },
54
+ });
55
+
56
+ const vertex_attribute_time_step = computed<number | undefined>({
57
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeTimeStep(id),
58
+ set: async (newValue) => {
59
+ if (newValue === undefined) {
60
+ return;
61
+ }
62
+ await applyBatchStyle(id, (targetId: string) =>
63
+ Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeTimeStep(targetId, newValue)),
64
+ );
65
+ hybridViewerStore.remoteRender();
66
+ },
67
+ });
68
+ const vertex_attribute_item = computed<string | undefined>({
69
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeItem(id),
70
+ set: async (newValue) => {
71
+ await applyBatchStyle(id, (targetId: string) =>
72
+ Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeItem(targetId, newValue)),
73
+ );
74
+ hybridViewerStore.remoteRender();
75
+ },
76
+ });
77
+ const vertex_attribute_range = computed<[number, number] | undefined>({
78
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeRange(id),
79
+ set: async (newValue) => {
80
+ const [minimum, maximum] = newValue;
81
+ if (minimum === undefined || maximum === undefined) {
82
+ return;
83
+ }
84
+ await applyBatchStyle(id, (targetId: string) =>
85
+ Promise.resolve(
86
+ dataStyleStore.setMeshPolyhedraVertexAttributeRange(targetId, minimum, maximum),
87
+ ),
88
+ );
89
+ hybridViewerStore.remoteRender();
90
+ },
91
+ });
92
+ const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
93
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeColorMap(id),
94
+ set: async (newValue) => {
95
+ await applyBatchStyle(id, (targetId: string) =>
96
+ Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeColorMap(targetId, newValue)),
97
+ );
98
+ hybridViewerStore.remoteRender();
99
+ },
100
+ });
101
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
102
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id),
103
+ set: async (newValue) => {
104
+ await applyBatchStyle(id, (targetId: string) =>
105
+ dataStyleStore.setMeshPolyhedraVertexAttributeNoDataColor(targetId, newValue),
106
+ );
107
+ hybridViewerStore.remoteRender();
108
+ },
109
+ });
110
+ const polyhedron_attribute_name = computed<string | undefined>({
111
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeName(id),
112
+ set: async (newValue) => {
113
+ if (newValue === undefined) {
114
+ return;
115
+ }
116
+ await applyBatchStyle(id, (targetId: string) =>
117
+ Promise.resolve(dataStyleStore.setMeshPolyhedraPolyhedronAttributeName(targetId, newValue)),
118
+ );
119
+ hybridViewerStore.remoteRender();
120
+ },
121
+ });
122
+
123
+ const polyhedron_attribute_time_step = computed<number | undefined>({
124
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeTimeStep(id),
125
+ set: async (newValue) => {
126
+ if (newValue === undefined) {
127
+ return;
128
+ }
129
+ await applyBatchStyle(id, (targetId: string) =>
130
+ Promise.resolve(
131
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeTimeStep(targetId, newValue),
132
+ ),
133
+ );
134
+ hybridViewerStore.remoteRender();
135
+ },
136
+ });
137
+ const polyhedron_attribute_item = computed<string | undefined>({
138
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeItem(id),
139
+ set: async (newValue) => {
140
+ await applyBatchStyle(id, (targetId: string) =>
141
+ Promise.resolve(dataStyleStore.setMeshPolyhedraPolyhedronAttributeItem(targetId, newValue)),
142
+ );
143
+ hybridViewerStore.remoteRender();
144
+ },
145
+ });
146
+ const polyhedron_attribute_range = computed<[number, number] | undefined>({
147
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeRange(id),
148
+ set: async (newValue) => {
149
+ const [minimum, maximum] = newValue;
150
+ if (minimum === undefined || maximum === undefined) {
151
+ return;
152
+ }
153
+ await applyBatchStyle(id, (targetId: string) =>
154
+ Promise.resolve(
155
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeRange(targetId, minimum, maximum),
156
+ ),
157
+ );
158
+ hybridViewerStore.remoteRender();
159
+ },
160
+ });
161
+ const polyhedron_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
162
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeColorMap(id),
163
+ set: async (newValue) => {
164
+ await applyBatchStyle(id, (targetId: string) =>
165
+ Promise.resolve(
166
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeColorMap(targetId, newValue),
167
+ ),
168
+ );
169
+ hybridViewerStore.remoteRender();
170
+ },
171
+ });
172
+ const polyhedron_attribute_no_data_color = computed<RGBAColor>({
173
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id),
174
+ set: async (newValue) => {
175
+ await applyBatchStyle(id, (targetId: string) =>
176
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeNoDataColor(targetId, newValue),
177
+ );
178
+ hybridViewerStore.remoteRender();
179
+ },
180
+ });
181
+
182
+ async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
183
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
184
+ dataStyleStore.setMeshPolyhedraVertexAttributeRange(targetId, minimum, maximum),
185
+ );
186
+ hybridViewerStore.remoteRender();
187
+ }
188
+
189
+ async function setPolyhedronAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
190
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
191
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeRange(targetId, minimum, maximum),
192
+ );
193
+ hybridViewerStore.remoteRender();
194
+ }
195
+ </script>
196
+
197
+ <template>
198
+ <ViewerOptionsColoringTypeSelector
199
+ :id="id"
200
+ v-model:coloring_style_key="coloring_style_key"
201
+ v-model:color="color"
202
+ v-model:vertex_attribute_name="vertex_attribute_name"
203
+ v-model:vertex_attribute_item="vertex_attribute_item"
204
+ v-model:vertex_attribute_range="vertex_attribute_range"
205
+ @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
206
+ v-model:vertex_attribute_color_map="vertex_attribute_color_map"
207
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
208
+ v-model:vertex_attribute_time_step="vertex_attribute_time_step"
209
+ v-model:polyhedron_attribute_name="polyhedron_attribute_name"
210
+ v-model:polyhedron_attribute_item="polyhedron_attribute_item"
211
+ v-model:polyhedron_attribute_range="polyhedron_attribute_range"
212
+ @polyhedron_attribute_ranges_per_data="setPolyhedronAttributeRangesPerData"
213
+ v-model:polyhedron_attribute_color_map="polyhedron_attribute_color_map"
214
+ v-model:polyhedron_attribute_no_data_color="polyhedron_attribute_no_data_color"
215
+ v-model:polyhedron_attribute_time_step="polyhedron_attribute_time_step"
216
+ />
217
+ </template>
@@ -1,16 +1,11 @@
1
1
  <script setup lang="ts">
2
- import {
3
- type RangesPerData,
4
- applyRangesPerData,
5
- useBatchStyle,
6
- } from "@ogw_front/composables/batch_style";
7
2
  import ViewerContextMenuItem, {
8
3
  type ItemProps,
9
4
  } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
10
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
11
5
  import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
12
- import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
13
6
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
7
+ import ViewerSolidSpecificPolyhedraColoring from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraColoring.vue";
8
+ import { useBatchStyle } from "@ogw_front/composables/batch_style";
14
9
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
15
10
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
16
11
 
@@ -36,180 +31,8 @@ const visibility = computed<boolean>({
36
31
  hybridViewerStore.remoteRender();
37
32
  },
38
33
  });
39
- const coloring_style_key = computed<string>({
40
- get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
41
- set: async (newValue) => {
42
- await applyBatchStyle(id.value, (targetId: string) =>
43
- dataStyleStore.setMeshPolyhedraActiveColoring(targetId, newValue),
44
- );
45
- hybridViewerStore.remoteRender();
46
- },
47
- });
48
- const color = computed<RGBAColor | undefined>({
49
- get: () => dataStyleStore.meshPolyhedraColor(id.value) as RGBAColor | undefined,
50
- set: async (newValue) => {
51
- if (newValue === undefined) {
52
- return;
53
- }
54
- await applyBatchStyle(id.value, (targetId: string) =>
55
- dataStyleStore.setMeshPolyhedraColor(targetId, newValue),
56
- );
57
- hybridViewerStore.remoteRender();
58
- },
59
- });
60
- const vertex_attribute_name = computed<string | undefined>({
61
- get: () => dataStyleStore.meshPolyhedraVertexAttributeName(id.value),
62
- set: async (newValue) => {
63
- if (newValue === undefined) {
64
- return;
65
- }
66
- await applyBatchStyle(id.value, (targetId: string) =>
67
- Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeName(targetId, newValue)),
68
- );
69
- hybridViewerStore.remoteRender();
70
- },
71
- });
72
-
73
- const vertex_attribute_time_step = computed<number | undefined>({
74
- get: () => dataStyleStore.meshPolyhedraVertexAttributeTimeStep(id.value),
75
- set: async (newValue) => {
76
- if (newValue === undefined) {
77
- return;
78
- }
79
- await applyBatchStyle(id.value, (targetId: string) =>
80
- Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeTimeStep(targetId, newValue)),
81
- );
82
- hybridViewerStore.remoteRender();
83
- },
84
- });
85
- const vertex_attribute_item = computed<string | undefined>({
86
- get: () => dataStyleStore.meshPolyhedraVertexAttributeItem(id.value),
87
- set: async (newValue) => {
88
- await applyBatchStyle(id.value, (targetId: string) =>
89
- Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeItem(targetId, newValue)),
90
- );
91
- hybridViewerStore.remoteRender();
92
- },
93
- });
94
- const vertex_attribute_range = computed<[number, number] | undefined>({
95
- get: () => dataStyleStore.meshPolyhedraVertexAttributeRange(id.value),
96
- set: async (newValue) => {
97
- const [minimum, maximum] = newValue;
98
- if (minimum === undefined || maximum === undefined) {
99
- return;
100
- }
101
- await applyBatchStyle(id.value, (targetId: string) =>
102
- Promise.resolve(
103
- dataStyleStore.setMeshPolyhedraVertexAttributeRange(targetId, minimum, maximum),
104
- ),
105
- );
106
- hybridViewerStore.remoteRender();
107
- },
108
- });
109
- const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
110
- get: () => dataStyleStore.meshPolyhedraVertexAttributeColorMap(id.value),
111
- set: async (newValue) => {
112
- await applyBatchStyle(id.value, (targetId: string) =>
113
- Promise.resolve(dataStyleStore.setMeshPolyhedraVertexAttributeColorMap(targetId, newValue)),
114
- );
115
- hybridViewerStore.remoteRender();
116
- },
117
- });
118
- const vertex_attribute_no_data_color = computed<RGBAColor>({
119
- get: () => dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value),
120
- set: async (newValue) => {
121
- await applyBatchStyle(id.value, (targetId: string) =>
122
- dataStyleStore.setMeshPolyhedraVertexAttributeNoDataColor(targetId, newValue),
123
- );
124
- hybridViewerStore.remoteRender();
125
- },
126
- });
127
- const polyhedron_attribute_name = computed<string | undefined>({
128
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeName(id.value),
129
- set: async (newValue) => {
130
- if (newValue === undefined) {
131
- return;
132
- }
133
- await applyBatchStyle(id.value, (targetId: string) =>
134
- Promise.resolve(dataStyleStore.setMeshPolyhedraPolyhedronAttributeName(targetId, newValue)),
135
- );
136
- hybridViewerStore.remoteRender();
137
- },
138
- });
139
-
140
- const polyhedron_attribute_time_step = computed<number | undefined>({
141
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeTimeStep(id.value),
142
- set: async (newValue) => {
143
- if (newValue === undefined) {
144
- return;
145
- }
146
- await applyBatchStyle(id.value, (targetId: string) =>
147
- Promise.resolve(
148
- dataStyleStore.setMeshPolyhedraPolyhedronAttributeTimeStep(targetId, newValue),
149
- ),
150
- );
151
- hybridViewerStore.remoteRender();
152
- },
153
- });
154
- const polyhedron_attribute_item = computed<string | undefined>({
155
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeItem(id.value),
156
- set: async (newValue) => {
157
- await applyBatchStyle(id.value, (targetId: string) =>
158
- Promise.resolve(dataStyleStore.setMeshPolyhedraPolyhedronAttributeItem(targetId, newValue)),
159
- );
160
- hybridViewerStore.remoteRender();
161
- },
162
- });
163
- const polyhedron_attribute_range = computed<[number, number] | undefined>({
164
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeRange(id.value),
165
- set: async (newValue) => {
166
- const [minimum, maximum] = newValue;
167
- if (minimum === undefined || maximum === undefined) {
168
- return;
169
- }
170
- await applyBatchStyle(id.value, (targetId: string) =>
171
- Promise.resolve(
172
- dataStyleStore.setMeshPolyhedraPolyhedronAttributeRange(targetId, minimum, maximum),
173
- ),
174
- );
175
- hybridViewerStore.remoteRender();
176
- },
177
- });
178
- const polyhedron_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
179
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeColorMap(id.value),
180
- set: async (newValue) => {
181
- await applyBatchStyle(id.value, (targetId: string) =>
182
- Promise.resolve(
183
- dataStyleStore.setMeshPolyhedraPolyhedronAttributeColorMap(targetId, newValue),
184
- ),
185
- );
186
- hybridViewerStore.remoteRender();
187
- },
188
- });
189
- const polyhedron_attribute_no_data_color = computed<RGBAColor>({
190
- get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value),
191
- set: async (newValue) => {
192
- await applyBatchStyle(id.value, (targetId: string) =>
193
- dataStyleStore.setMeshPolyhedraPolyhedronAttributeNoDataColor(targetId, newValue),
194
- );
195
- hybridViewerStore.remoteRender();
196
- },
197
- });
198
-
199
- async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
200
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
201
- dataStyleStore.setMeshPolyhedraVertexAttributeRange(targetId, minimum, maximum),
202
- );
203
- hybridViewerStore.remoteRender();
204
- }
205
-
206
- async function setPolyhedronAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
207
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
208
- dataStyleStore.setMeshPolyhedraPolyhedronAttributeRange(targetId, minimum, maximum),
209
- );
210
- hybridViewerStore.remoteRender();
211
- }
212
34
  </script>
35
+
213
36
  <template>
214
37
  <ViewerContextMenuItem
215
38
  data-testid="meshPolyhedraMenu"
@@ -224,25 +47,7 @@ async function setPolyhedronAttributeRangesPerData(ranges: RangesPerData): Promi
224
47
  v-model="visibility"
225
48
  />
226
49
  <template v-if="visibility">
227
- <ViewerOptionsColoringTypeSelector
228
- :id="id"
229
- v-model:coloring_style_key="coloring_style_key"
230
- v-model:color="color"
231
- v-model:vertex_attribute_name="vertex_attribute_name"
232
- v-model:vertex_attribute_item="vertex_attribute_item"
233
- v-model:vertex_attribute_range="vertex_attribute_range"
234
- @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
235
- v-model:vertex_attribute_color_map="vertex_attribute_color_map"
236
- v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
237
- v-model:vertex_attribute_time_step="vertex_attribute_time_step"
238
- v-model:polyhedron_attribute_name="polyhedron_attribute_name"
239
- v-model:polyhedron_attribute_item="polyhedron_attribute_item"
240
- v-model:polyhedron_attribute_range="polyhedron_attribute_range"
241
- @polyhedron_attribute_ranges_per_data="setPolyhedronAttributeRangesPerData"
242
- v-model:polyhedron_attribute_color_map="polyhedron_attribute_color_map"
243
- v-model:polyhedron_attribute_no_data_color="polyhedron_attribute_no_data_color"
244
- v-model:polyhedron_attribute_time_step="polyhedron_attribute_time_step"
245
- />
50
+ <ViewerSolidSpecificPolyhedraColoring :id="id" />
246
51
  </template>
247
52
  </template>
248
53
  </ViewerContextMenuItem>
@@ -0,0 +1,231 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ type RangesPerData,
4
+ applyRangesPerData,
5
+ useBatchStyle,
6
+ } from "@ogw_front/composables/batch_style";
7
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
8
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
9
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
10
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
11
+
12
+ interface Texture {
13
+ id: string;
14
+ texture_name: string;
15
+ }
16
+
17
+ const dataStyleStore = useDataStyleStore();
18
+ const hybridViewerStore = useHybridViewerStore();
19
+ const { applyBatchStyle } = useBatchStyle();
20
+
21
+ interface Props {
22
+ id: string;
23
+ }
24
+
25
+ const { id } = defineProps<Props>();
26
+
27
+ const coloring_style_key = computed<string>({
28
+ get: () => dataStyleStore.meshPolygonsActiveColoring(id),
29
+ set: async (newValue) => {
30
+ await applyBatchStyle(id, (targetId: string) =>
31
+ dataStyleStore.setMeshPolygonsActiveColoring(targetId, newValue),
32
+ );
33
+ hybridViewerStore.remoteRender();
34
+ },
35
+ });
36
+ const color = computed<RGBAColor | undefined>({
37
+ get: () => dataStyleStore.meshPolygonsColor(id) as RGBAColor | undefined,
38
+ set: async (newValue) => {
39
+ if (newValue === undefined) {
40
+ return;
41
+ }
42
+ await applyBatchStyle(id, (targetId: string) =>
43
+ dataStyleStore.setMeshPolygonsColor(targetId, newValue),
44
+ );
45
+ hybridViewerStore.remoteRender();
46
+ },
47
+ });
48
+ const textures = computed<Texture[] | undefined>({
49
+ get: () => dataStyleStore.meshPolygonsTextures(id) as Texture[] | undefined,
50
+ set: async (newValue) => {
51
+ if (newValue === undefined) {
52
+ return;
53
+ }
54
+ await applyBatchStyle(id, (targetId: string) =>
55
+ dataStyleStore.setMeshPolygonsTextures(targetId, newValue),
56
+ );
57
+ hybridViewerStore.remoteRender();
58
+ },
59
+ });
60
+ const vertex_attribute_name = computed<string | undefined>({
61
+ get: () => dataStyleStore.meshPolygonsVertexAttributeName(id),
62
+ set: async (newValue) => {
63
+ if (newValue === undefined) {
64
+ return;
65
+ }
66
+ await applyBatchStyle(id, (targetId: string) =>
67
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeName(targetId, newValue)),
68
+ );
69
+ hybridViewerStore.remoteRender();
70
+ },
71
+ });
72
+
73
+ const vertex_attribute_time_step = computed<number | undefined>({
74
+ get: () => dataStyleStore.meshPolygonsVertexAttributeTimeStep(id),
75
+ set: async (newValue) => {
76
+ if (newValue === undefined) {
77
+ return;
78
+ }
79
+ await applyBatchStyle(id, (targetId: string) =>
80
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeTimeStep(targetId, newValue)),
81
+ );
82
+ hybridViewerStore.remoteRender();
83
+ },
84
+ });
85
+ const vertex_attribute_item = computed<string | undefined>({
86
+ get: () => dataStyleStore.meshPolygonsVertexAttributeItem(id),
87
+ set: async (newValue) => {
88
+ await applyBatchStyle(id, (targetId: string) =>
89
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeItem(targetId, newValue)),
90
+ );
91
+ hybridViewerStore.remoteRender();
92
+ },
93
+ });
94
+ const vertex_attribute_range = computed<[number, number] | undefined>({
95
+ get: () => dataStyleStore.meshPolygonsVertexAttributeRange(id),
96
+ set: async (newValue) => {
97
+ const [minimum, maximum] = newValue;
98
+ if (minimum === undefined || maximum === undefined) {
99
+ return;
100
+ }
101
+ await applyBatchStyle(id, (targetId: string) =>
102
+ Promise.resolve(
103
+ dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
104
+ ),
105
+ );
106
+ hybridViewerStore.remoteRender();
107
+ },
108
+ });
109
+ const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
110
+ get: () => dataStyleStore.meshPolygonsVertexAttributeColorMap(id),
111
+ set: async (newValue) => {
112
+ await applyBatchStyle(id, (targetId: string) =>
113
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeColorMap(targetId, newValue)),
114
+ );
115
+ hybridViewerStore.remoteRender();
116
+ },
117
+ });
118
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
119
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id),
120
+ set: async (newValue) => {
121
+ await applyBatchStyle(id, (targetId: string) =>
122
+ dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
123
+ );
124
+ hybridViewerStore.remoteRender();
125
+ },
126
+ });
127
+ const polygon_attribute_name = computed<string | undefined>({
128
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeName(id),
129
+ set: async (newValue) => {
130
+ if (newValue === undefined) {
131
+ return;
132
+ }
133
+ await applyBatchStyle(id, (targetId: string) =>
134
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeName(targetId, newValue)),
135
+ );
136
+ hybridViewerStore.remoteRender();
137
+ },
138
+ });
139
+
140
+ const polygon_attribute_time_step = computed<number | undefined>({
141
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeTimeStep(id),
142
+ set: async (newValue) => {
143
+ if (newValue === undefined) {
144
+ return;
145
+ }
146
+ await applyBatchStyle(id, (targetId: string) =>
147
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeTimeStep(targetId, newValue)),
148
+ );
149
+ hybridViewerStore.remoteRender();
150
+ },
151
+ });
152
+ const polygon_attribute_item = computed<string | undefined>({
153
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeItem(id),
154
+ set: async (newValue) => {
155
+ await applyBatchStyle(id, (targetId: string) =>
156
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeItem(targetId, newValue)),
157
+ );
158
+ hybridViewerStore.remoteRender();
159
+ },
160
+ });
161
+ const polygon_attribute_range = computed<[number, number] | undefined>({
162
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeRange(id),
163
+ set: async (newValue) => {
164
+ const [minimum, maximum] = newValue;
165
+ if (minimum === undefined || maximum === undefined) {
166
+ return;
167
+ }
168
+ await applyBatchStyle(id, (targetId: string) =>
169
+ Promise.resolve(
170
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
171
+ ),
172
+ );
173
+ hybridViewerStore.remoteRender();
174
+ },
175
+ });
176
+ const polygon_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
177
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeColorMap(id),
178
+ set: async (newValue) => {
179
+ await applyBatchStyle(id, (targetId: string) =>
180
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeColorMap(targetId, newValue)),
181
+ );
182
+ hybridViewerStore.remoteRender();
183
+ },
184
+ });
185
+ const polygon_attribute_no_data_color = computed<RGBAColor>({
186
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id),
187
+ set: async (newValue) => {
188
+ await applyBatchStyle(id, (targetId: string) =>
189
+ dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
190
+ );
191
+ hybridViewerStore.remoteRender();
192
+ },
193
+ });
194
+
195
+ async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
196
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
197
+ dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
198
+ );
199
+ hybridViewerStore.remoteRender();
200
+ }
201
+
202
+ async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
203
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
204
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
205
+ );
206
+ hybridViewerStore.remoteRender();
207
+ }
208
+ </script>
209
+
210
+ <template>
211
+ <ViewerOptionsColoringTypeSelector
212
+ :id="id"
213
+ v-model:coloring_style_key="coloring_style_key"
214
+ v-model:color="color"
215
+ v-model:textures="textures"
216
+ v-model:vertex_attribute_name="vertex_attribute_name"
217
+ v-model:vertex_attribute_item="vertex_attribute_item"
218
+ v-model:vertex_attribute_range="vertex_attribute_range"
219
+ @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
220
+ v-model:vertex_attribute_color_map="vertex_attribute_color_map"
221
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
222
+ v-model:vertex_attribute_time_step="vertex_attribute_time_step"
223
+ v-model:polygon_attribute_name="polygon_attribute_name"
224
+ v-model:polygon_attribute_item="polygon_attribute_item"
225
+ v-model:polygon_attribute_range="polygon_attribute_range"
226
+ @polygon_attribute_ranges_per_data="setPolygonAttributeRangesPerData"
227
+ v-model:polygon_attribute_color_map="polygon_attribute_color_map"
228
+ v-model:polygon_attribute_no_data_color="polygon_attribute_no_data_color"
229
+ v-model:polygon_attribute_time_step="polygon_attribute_time_step"
230
+ />
231
+ </template>