@geode/opengeodeweb-front 10.44.0-rc.2 → 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 (160) hide show
  1. package/.build/server/utils/cleanup.js +7 -2
  2. package/.build/server/utils/microservices.js +9 -81
  3. package/.build/server/utils/microservices_process.js +85 -0
  4. package/.build/server/utils/typed_handler.js +5 -1
  5. package/.build/server/utils/ws_client.js +7 -2
  6. package/.build/shared/utils/fetch_raw.js +2 -2
  7. package/.build/shared/utils/parse_boolean.js +2 -1
  8. package/app/components/ClippingPlanes.vue +22 -78
  9. package/app/components/DragAndDrop.vue +16 -79
  10. package/app/components/FileSelector.vue +9 -6
  11. package/app/components/HybridViewerTooltip.vue +8 -2
  12. package/app/components/MissingFilesSelector.vue +10 -6
  13. package/app/components/ObjectSelector.vue +6 -3
  14. package/app/components/Screenshot.vue +9 -2
  15. package/app/components/ThresholdCard.vue +205 -0
  16. package/app/components/ThresholdFilter.vue +81 -216
  17. package/app/components/ViewToolbar.vue +15 -231
  18. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  19. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  20. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +228 -0
  21. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  22. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  23. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  24. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +234 -0
  25. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  26. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  27. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  28. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +7 -5
  29. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  30. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  31. package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -292
  32. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  33. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  34. package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -425
  35. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  36. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +12 -10
  37. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +12 -10
  38. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +9 -5
  39. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  40. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +6 -1
  41. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  42. package/app/components/Viewer/Options/AttributeSelector.vue +40 -136
  43. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  44. package/app/components/Viewer/Options/ColoringTypeSelector.vue +36 -74
  45. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  46. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  47. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  48. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  49. package/app/components/Viewer/Surface/PolygonsColoring.vue +231 -0
  50. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  51. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  52. package/app/composables/attribute_coloring_style.ts +8 -2
  53. package/app/composables/attribute_selector.ts +126 -0
  54. package/app/composables/clipping_slices.ts +166 -0
  55. package/app/composables/global_attribute_style.ts +4 -3
  56. package/app/composables/hover_highlight.ts +6 -5
  57. package/app/composables/project_manager.ts +5 -5
  58. package/app/composables/stepper_tree.ts +10 -2
  59. package/app/composables/tree_filter.ts +11 -2
  60. package/app/composables/tree_keyboard_nav.ts +4 -2
  61. package/app/composables/use_overlapping_picker.ts +5 -5
  62. package/app/composables/view_toolbar_options.ts +126 -0
  63. package/app/composables/view_toolbar_tool_options.ts +115 -0
  64. package/app/composables/view_toolbar_tools.ts +108 -0
  65. package/app/composables/virtual_tree.ts +20 -131
  66. package/app/composables/virtual_tree_flatten.ts +86 -0
  67. package/app/composables/virtual_tree_types.ts +81 -0
  68. package/app/stores/app.ts +8 -55
  69. package/app/stores/app_helpers/extension.ts +1 -1
  70. package/app/stores/app_helpers/registry.ts +69 -0
  71. package/app/stores/feedback.ts +2 -2
  72. package/app/stores/hybrid_viewer.ts +1 -1
  73. package/app/stores/menu.ts +1 -124
  74. package/app/stores/menu_helpers/menus_data.ts +127 -0
  75. package/app/stores/treeview.ts +17 -10
  76. package/app/stores/viewer.ts +17 -78
  77. package/app/stores/viewer_helpers/actions.ts +68 -0
  78. package/app/stores/viewer_helpers/request.ts +61 -0
  79. package/app/utils/clipping_planes.ts +4 -131
  80. package/app/utils/clipping_planes_scene.ts +131 -0
  81. package/app/utils/coloring_styles.ts +101 -0
  82. package/app/utils/default_styles/mesh_components.ts +168 -0
  83. package/app/utils/default_styles/meshes.ts +13 -153
  84. package/app/utils/default_styles/model_components.ts +170 -0
  85. package/app/utils/default_styles/models.ts +16 -153
  86. package/app/utils/drag_and_drop.ts +80 -0
  87. package/app/utils/extension.ts +1 -1
  88. package/app/utils/import_workflow.ts +6 -4
  89. package/app/utils/model_component_coloring.ts +46 -0
  90. package/app/utils/threshold.ts +33 -0
  91. package/app/utils/threshold_sources.ts +51 -0
  92. package/app/utils/upload_path.ts +15 -9
  93. package/internal/database/database.ts +4 -1
  94. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  95. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  96. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  97. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  98. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  99. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  100. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  101. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  102. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  103. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  104. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  105. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  106. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  107. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  108. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  109. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  110. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  111. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  112. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  113. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  114. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  115. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  116. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  117. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  118. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  119. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  120. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  121. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  122. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  123. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  124. package/internal/stores/data_style/model/blocks/polyhedron.ts +14 -10
  125. package/internal/stores/data_style/model/blocks/vertex.ts +14 -10
  126. package/internal/stores/data_style/model/common.ts +10 -119
  127. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  128. package/internal/stores/data_style/model/corners/vertex.ts +14 -10
  129. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  130. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  131. package/internal/stores/data_style/model/lines/edge.ts +14 -10
  132. package/internal/stores/data_style/model/lines/index.ts +10 -134
  133. package/internal/stores/data_style/model/lines/vertex.ts +14 -10
  134. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  135. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  136. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  137. package/internal/stores/data_style/model/surfaces/polygon.ts +14 -10
  138. package/internal/stores/data_style/model/surfaces/vertex.ts +14 -10
  139. package/internal/stores/data_style/model/visibility.ts +3 -156
  140. package/internal/stores/data_style/model/visibility_dispatch.ts +160 -0
  141. package/internal/stores/data_style/state.ts +1 -181
  142. package/internal/stores/data_style/state_shared.ts +191 -0
  143. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  144. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  145. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  146. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  147. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  148. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  149. package/internal/stores/hybrid_viewer/highlight.ts +10 -9
  150. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  151. package/internal/utils/ws_client.ts +8 -1
  152. package/package.json +2 -2
  153. package/server/api/local/extensions/run.post.ts +6 -4
  154. package/server/utils/cleanup.ts +12 -2
  155. package/server/utils/microservices.ts +10 -102
  156. package/server/utils/microservices_process.ts +127 -0
  157. package/server/utils/typed_handler.ts +8 -1
  158. package/server/utils/ws_client.ts +15 -2
  159. package/shared/utils/fetch_raw.ts +2 -2
  160. package/shared/utils/parse_boolean.ts +4 -1
@@ -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
- import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
5
+ import ViewerGenericMeshEdgesColoring from "@ogw_front/components/Viewer/Generic/Mesh/EdgesColoring.vue";
12
6
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
13
7
  import ViewerOptionsWidthSlider from "@ogw_front/components/Viewer/Options/Sliders/Width.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
 
@@ -52,171 +47,6 @@ const size = computed<number>({
52
47
  hybridViewerStore.remoteRender();
53
48
  },
54
49
  });
55
- const coloring_style_key = computed<string>({
56
- get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
57
- set: async (newValue) => {
58
- await applyBatchStyle(id.value, (targetId: string) =>
59
- dataStyleStore.setMeshEdgesActiveColoring(targetId, newValue),
60
- );
61
- hybridViewerStore.remoteRender();
62
- },
63
- });
64
- const color = computed<RGBAColor | undefined>({
65
- get: () => dataStyleStore.meshEdgesColor(id.value) as RGBAColor | undefined,
66
- set: async (newValue) => {
67
- if (newValue === undefined) {
68
- return;
69
- }
70
- await applyBatchStyle(id.value, (targetId: string) =>
71
- dataStyleStore.setMeshEdgesColor(targetId, newValue),
72
- );
73
- hybridViewerStore.remoteRender();
74
- },
75
- });
76
- const vertex_attribute_name = computed<string | undefined>({
77
- get: () => dataStyleStore.meshEdgesVertexAttributeName(id.value),
78
- set: async (newValue) => {
79
- if (newValue === undefined) {
80
- return;
81
- }
82
- await applyBatchStyle(id.value, (targetId: string) =>
83
- Promise.resolve(dataStyleStore.setMeshEdgesVertexAttributeName(targetId, newValue)),
84
- );
85
- hybridViewerStore.remoteRender();
86
- },
87
- });
88
-
89
- const vertex_attribute_time_step = computed<number | undefined>({
90
- get: () => dataStyleStore.meshEdgesVertexAttributeTimeStep(id.value),
91
- set: async (newValue) => {
92
- if (newValue === undefined) {
93
- return;
94
- }
95
- await applyBatchStyle(id.value, (targetId: string) =>
96
- Promise.resolve(dataStyleStore.setMeshEdgesVertexAttributeTimeStep(targetId, newValue)),
97
- );
98
- hybridViewerStore.remoteRender();
99
- },
100
- });
101
- const vertex_attribute_item = computed<string | undefined>({
102
- get: () => dataStyleStore.meshEdgesVertexAttributeItem(id.value),
103
- set: async (newValue) => {
104
- await applyBatchStyle(id.value, (targetId: string) =>
105
- Promise.resolve(dataStyleStore.setMeshEdgesVertexAttributeItem(targetId, newValue)),
106
- );
107
- hybridViewerStore.remoteRender();
108
- },
109
- });
110
- const vertex_attribute_range = computed<[number, number] | undefined>({
111
- get: () => dataStyleStore.meshEdgesVertexAttributeRange(id.value),
112
- set: async (newValue) => {
113
- const [minimum, maximum] = newValue;
114
- if (minimum === undefined || maximum === undefined) {
115
- return;
116
- }
117
- await applyBatchStyle(id.value, (targetId: string) =>
118
- Promise.resolve(dataStyleStore.setMeshEdgesVertexAttributeRange(targetId, minimum, maximum)),
119
- );
120
- hybridViewerStore.remoteRender();
121
- },
122
- });
123
- const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
124
- get: () => dataStyleStore.meshEdgesVertexAttributeColorMap(id.value),
125
- set: async (newValue) => {
126
- await applyBatchStyle(id.value, (targetId: string) =>
127
- Promise.resolve(dataStyleStore.setMeshEdgesVertexAttributeColorMap(targetId, newValue)),
128
- );
129
- hybridViewerStore.remoteRender();
130
- },
131
- });
132
- const vertex_attribute_no_data_color = computed<RGBAColor>({
133
- get: () => dataStyleStore.meshEdgesVertexAttributeNoDataColor(id.value),
134
- set: async (newValue) => {
135
- await applyBatchStyle(id.value, (targetId: string) =>
136
- dataStyleStore.setMeshEdgesVertexAttributeNoDataColor(targetId, newValue),
137
- );
138
- hybridViewerStore.remoteRender();
139
- },
140
- });
141
- const edge_attribute_name = computed<string | undefined>({
142
- get: () => dataStyleStore.meshEdgesEdgeAttributeName(id.value),
143
- set: async (newValue) => {
144
- if (newValue === undefined) {
145
- return;
146
- }
147
- await applyBatchStyle(id.value, (targetId: string) =>
148
- Promise.resolve(dataStyleStore.setMeshEdgesEdgeAttributeName(targetId, newValue)),
149
- );
150
- hybridViewerStore.remoteRender();
151
- },
152
- });
153
-
154
- const edge_attribute_time_step = computed<number | undefined>({
155
- get: () => dataStyleStore.meshEdgesEdgeAttributeTimeStep(id.value),
156
- set: async (newValue) => {
157
- if (newValue === undefined) {
158
- return;
159
- }
160
- await applyBatchStyle(id.value, (targetId: string) =>
161
- Promise.resolve(dataStyleStore.setMeshEdgesEdgeAttributeTimeStep(targetId, newValue)),
162
- );
163
- hybridViewerStore.remoteRender();
164
- },
165
- });
166
- const edge_attribute_item = computed<string | undefined>({
167
- get: () => dataStyleStore.meshEdgesEdgeAttributeItem(id.value),
168
- set: async (newValue) => {
169
- await applyBatchStyle(id.value, (targetId: string) =>
170
- Promise.resolve(dataStyleStore.setMeshEdgesEdgeAttributeItem(targetId, newValue)),
171
- );
172
- hybridViewerStore.remoteRender();
173
- },
174
- });
175
- const edge_attribute_range = computed<[number, number] | undefined>({
176
- get: () => dataStyleStore.meshEdgesEdgeAttributeRange(id.value),
177
- set: async (newValue) => {
178
- const [minimum, maximum] = newValue;
179
- if (minimum === undefined || maximum === undefined) {
180
- return;
181
- }
182
- await applyBatchStyle(id.value, (targetId: string) =>
183
- Promise.resolve(dataStyleStore.setMeshEdgesEdgeAttributeRange(targetId, minimum, maximum)),
184
- );
185
- hybridViewerStore.remoteRender();
186
- },
187
- });
188
- const edge_attribute_color_map = computed<Map<string, RGBAColor>>({
189
- get: () => dataStyleStore.meshEdgesEdgeAttributeColorMap(id.value),
190
- set: async (newValue) => {
191
- await applyBatchStyle(id.value, (targetId: string) =>
192
- Promise.resolve(dataStyleStore.setMeshEdgesEdgeAttributeColorMap(targetId, newValue)),
193
- );
194
- hybridViewerStore.remoteRender();
195
- },
196
- });
197
- const edge_attribute_no_data_color = computed<RGBAColor>({
198
- get: () => dataStyleStore.meshEdgesEdgeAttributeNoDataColor(id.value),
199
- set: async (newValue) => {
200
- await applyBatchStyle(id.value, (targetId: string) =>
201
- dataStyleStore.setMeshEdgesEdgeAttributeNoDataColor(targetId, newValue),
202
- );
203
- hybridViewerStore.remoteRender();
204
- },
205
- });
206
-
207
- async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
208
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
209
- dataStyleStore.setMeshEdgesVertexAttributeRange(targetId, minimum, maximum),
210
- );
211
- hybridViewerStore.remoteRender();
212
- }
213
-
214
- async function setEdgeAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
215
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
216
- dataStyleStore.setMeshEdgesEdgeAttributeRange(targetId, minimum, maximum),
217
- );
218
- hybridViewerStore.remoteRender();
219
- }
220
50
  </script>
221
51
 
222
52
  <template>
@@ -239,26 +69,7 @@ async function setEdgeAttributeRangesPerData(ranges: RangesPerData): Promise<voi
239
69
  <template v-if="visibility">
240
70
  <v-divider class="my-2" />
241
71
  <ViewerOptionsWidthSlider data-testid="meshEdgesWidthSlider" v-model="size" />
242
- <ViewerOptionsColoringTypeSelector
243
- :id="id"
244
- v-model:coloring_style_key="coloring_style_key"
245
- v-model:color="color"
246
- v-model:vertex_attribute_name="vertex_attribute_name"
247
- v-model:vertex_attribute_item="vertex_attribute_item"
248
- v-model:vertex_attribute_range="vertex_attribute_range"
249
- @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
250
- v-model:vertex_attribute_color_map="vertex_attribute_color_map"
251
- v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
252
- v-model:vertex_attribute_time_step="vertex_attribute_time_step"
253
- v-model:edge_attribute_name="edge_attribute_name"
254
- v-model:edge_attribute_item="edge_attribute_item"
255
- v-model:edge_attribute_range="edge_attribute_range"
256
- @edge_attribute_ranges_per_data="setEdgeAttributeRangesPerData"
257
- v-model:edge_attribute_color_map="edge_attribute_color_map"
258
- v-model:edge_attribute_no_data_color="edge_attribute_no_data_color"
259
- v-model:edge_attribute_time_step="edge_attribute_time_step"
260
- :capabilities="capabilities"
261
- />
72
+ <ViewerGenericMeshEdgesColoring :id="id" :capabilities="capabilities" />
262
73
  </template>
263
74
  </template>
264
75
  </ViewerContextMenuItem>
@@ -0,0 +1,234 @@
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
+ capabilities: Record<string, { available?: boolean; hasColorMap?: boolean }>;
24
+ }
25
+
26
+ const { id, capabilities } = defineProps<Props>();
27
+
28
+ const coloring_style_key = computed<string>({
29
+ get: () => dataStyleStore.meshPolygonsActiveColoring(id),
30
+ set: async (newValue) => {
31
+ await applyBatchStyle(id, (targetId: string) =>
32
+ dataStyleStore.setMeshPolygonsActiveColoring(targetId, newValue),
33
+ );
34
+ hybridViewerStore.remoteRender();
35
+ },
36
+ });
37
+ const color = computed<RGBAColor | undefined>({
38
+ get: () => dataStyleStore.meshPolygonsColor(id) as RGBAColor | undefined,
39
+ set: async (newValue) => {
40
+ if (newValue === undefined) {
41
+ return;
42
+ }
43
+ await applyBatchStyle(id, (targetId: string) =>
44
+ dataStyleStore.setMeshPolygonsColor(targetId, newValue),
45
+ );
46
+ hybridViewerStore.remoteRender();
47
+ },
48
+ });
49
+ const textures = computed<Texture[] | undefined>({
50
+ get: () => dataStyleStore.meshPolygonsTextures(id) as Texture[] | undefined,
51
+ set: async (newValue) => {
52
+ if (newValue === undefined) {
53
+ return;
54
+ }
55
+ await applyBatchStyle(id, (targetId: string) =>
56
+ dataStyleStore.setMeshPolygonsTextures(targetId, newValue),
57
+ );
58
+ hybridViewerStore.remoteRender();
59
+ },
60
+ });
61
+
62
+ const vertex_attribute_name = computed<string | undefined>({
63
+ get: () => dataStyleStore.meshPolygonsVertexAttributeName(id),
64
+ set: async (newValue) => {
65
+ if (newValue === undefined) {
66
+ return;
67
+ }
68
+ await applyBatchStyle(id, (targetId: string) =>
69
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeName(targetId, newValue)),
70
+ );
71
+ hybridViewerStore.remoteRender();
72
+ },
73
+ });
74
+
75
+ const vertex_attribute_time_step = computed<number | undefined>({
76
+ get: () => dataStyleStore.meshPolygonsVertexAttributeTimeStep(id),
77
+ set: async (newValue) => {
78
+ if (newValue === undefined) {
79
+ return;
80
+ }
81
+ await applyBatchStyle(id, (targetId: string) =>
82
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeTimeStep(targetId, newValue)),
83
+ );
84
+ hybridViewerStore.remoteRender();
85
+ },
86
+ });
87
+ const vertex_attribute_item = computed<string | undefined>({
88
+ get: () => dataStyleStore.meshPolygonsVertexAttributeItem(id),
89
+ set: async (newValue) => {
90
+ await applyBatchStyle(id, (targetId: string) =>
91
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeItem(targetId, newValue)),
92
+ );
93
+ hybridViewerStore.remoteRender();
94
+ },
95
+ });
96
+ const vertex_attribute_range = computed<[number, number] | undefined>({
97
+ get: () => dataStyleStore.meshPolygonsVertexAttributeRange(id),
98
+ set: async (newValue) => {
99
+ const [minimum, maximum] = newValue;
100
+ if (minimum === undefined || maximum === undefined) {
101
+ return;
102
+ }
103
+ await applyBatchStyle(id, (targetId: string) =>
104
+ Promise.resolve(
105
+ dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
106
+ ),
107
+ );
108
+ hybridViewerStore.remoteRender();
109
+ },
110
+ });
111
+ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
112
+ get: () => dataStyleStore.meshPolygonsVertexAttributeColorMap(id),
113
+ set: async (newValue) => {
114
+ await applyBatchStyle(id, (targetId: string) =>
115
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeColorMap(targetId, newValue)),
116
+ );
117
+ hybridViewerStore.remoteRender();
118
+ },
119
+ });
120
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
121
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id),
122
+ set: async (newValue) => {
123
+ await applyBatchStyle(id, (targetId: string) =>
124
+ dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
125
+ );
126
+ hybridViewerStore.remoteRender();
127
+ },
128
+ });
129
+ const polygon_attribute_name = computed<string | undefined>({
130
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeName(id),
131
+ set: async (newValue) => {
132
+ if (newValue === undefined) {
133
+ return;
134
+ }
135
+ await applyBatchStyle(id, (targetId: string) =>
136
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeName(targetId, newValue)),
137
+ );
138
+ hybridViewerStore.remoteRender();
139
+ },
140
+ });
141
+
142
+ const polygon_attribute_time_step = computed<number | undefined>({
143
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeTimeStep(id),
144
+ set: async (newValue) => {
145
+ if (newValue === undefined) {
146
+ return;
147
+ }
148
+ await applyBatchStyle(id, (targetId: string) =>
149
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeTimeStep(targetId, newValue)),
150
+ );
151
+ hybridViewerStore.remoteRender();
152
+ },
153
+ });
154
+ const polygon_attribute_item = computed<string | undefined>({
155
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeItem(id),
156
+ set: async (newValue) => {
157
+ await applyBatchStyle(id, (targetId: string) =>
158
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeItem(targetId, newValue)),
159
+ );
160
+ hybridViewerStore.remoteRender();
161
+ },
162
+ });
163
+ const polygon_attribute_range = computed<[number, number] | undefined>({
164
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeRange(id),
165
+ set: async (newValue) => {
166
+ const [minimum, maximum] = newValue;
167
+ if (minimum === undefined || maximum === undefined) {
168
+ return;
169
+ }
170
+ await applyBatchStyle(id, (targetId: string) =>
171
+ Promise.resolve(
172
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
173
+ ),
174
+ );
175
+ hybridViewerStore.remoteRender();
176
+ },
177
+ });
178
+ const polygon_attribute_color_map = computed<Map<string, RGBAColor>>({
179
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeColorMap(id),
180
+ set: async (newValue) => {
181
+ await applyBatchStyle(id, (targetId: string) =>
182
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeColorMap(targetId, newValue)),
183
+ );
184
+ hybridViewerStore.remoteRender();
185
+ },
186
+ });
187
+ const polygon_attribute_no_data_color = computed<RGBAColor>({
188
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id),
189
+ set: async (newValue) => {
190
+ await applyBatchStyle(id, (targetId: string) =>
191
+ dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
192
+ );
193
+ hybridViewerStore.remoteRender();
194
+ },
195
+ });
196
+
197
+ async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
198
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
199
+ dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
200
+ );
201
+ hybridViewerStore.remoteRender();
202
+ }
203
+
204
+ async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
205
+ await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
206
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
207
+ );
208
+ hybridViewerStore.remoteRender();
209
+ }
210
+ </script>
211
+
212
+ <template>
213
+ <ViewerOptionsColoringTypeSelector
214
+ :id="id"
215
+ v-model:coloring_style_key="coloring_style_key"
216
+ v-model:color="color"
217
+ v-model:textures="textures"
218
+ v-model:vertex_attribute_name="vertex_attribute_name"
219
+ v-model:vertex_attribute_item="vertex_attribute_item"
220
+ v-model:vertex_attribute_range="vertex_attribute_range"
221
+ @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
222
+ v-model:vertex_attribute_color_map="vertex_attribute_color_map"
223
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
224
+ v-model:vertex_attribute_time_step="vertex_attribute_time_step"
225
+ v-model:polygon_attribute_name="polygon_attribute_name"
226
+ v-model:polygon_attribute_item="polygon_attribute_item"
227
+ v-model:polygon_attribute_range="polygon_attribute_range"
228
+ @polygon_attribute_ranges_per_data="setPolygonAttributeRangesPerData"
229
+ v-model:polygon_attribute_color_map="polygon_attribute_color_map"
230
+ v-model:polygon_attribute_no_data_color="polygon_attribute_no_data_color"
231
+ v-model:polygon_attribute_time_step="polygon_attribute_time_step"
232
+ :capabilities="capabilities"
233
+ />
234
+ </template>
@@ -1,23 +1,13 @@
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
- import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
5
+ import ViewerGenericMeshPolygonsColoring from "@ogw_front/components/Viewer/Generic/Mesh/PolygonsColoring.vue";
12
6
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
7
+ import { useBatchStyle } from "@ogw_front/composables/batch_style";
13
8
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
14
9
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
15
10
 
16
- interface Texture {
17
- id: string;
18
- texture_name: string;
19
- }
20
-
21
11
  interface CapabilityConfig {
22
12
  available?: boolean;
23
13
  hasColorMap?: boolean;
@@ -52,188 +42,6 @@ const visibility = computed<boolean>({
52
42
  hybridViewerStore.remoteRender();
53
43
  },
54
44
  });
55
- const coloring_style_key = computed<string>({
56
- get: () => dataStyleStore.meshPolygonsActiveColoring(id.value),
57
- set: async (newValue) => {
58
- await applyBatchStyle(id.value, (targetId: string) =>
59
- dataStyleStore.setMeshPolygonsActiveColoring(targetId, newValue),
60
- );
61
- hybridViewerStore.remoteRender();
62
- },
63
- });
64
- const color = computed<RGBAColor | undefined>({
65
- get: () => dataStyleStore.meshPolygonsColor(id.value) as RGBAColor | undefined,
66
- set: async (newValue) => {
67
- if (newValue === undefined) {
68
- return;
69
- }
70
- await applyBatchStyle(id.value, (targetId: string) =>
71
- dataStyleStore.setMeshPolygonsColor(targetId, newValue),
72
- );
73
- hybridViewerStore.remoteRender();
74
- },
75
- });
76
- const textures = computed<Texture[] | undefined>({
77
- get: () => dataStyleStore.meshPolygonsTextures(id.value) as Texture[] | undefined,
78
- set: async (newValue) => {
79
- if (newValue === undefined) {
80
- return;
81
- }
82
- await applyBatchStyle(id.value, (targetId: string) =>
83
- dataStyleStore.setMeshPolygonsTextures(targetId, newValue),
84
- );
85
- hybridViewerStore.remoteRender();
86
- },
87
- });
88
-
89
- const vertex_attribute_name = computed<string | undefined>({
90
- get: () => dataStyleStore.meshPolygonsVertexAttributeName(id.value),
91
- set: async (newValue) => {
92
- if (newValue === undefined) {
93
- return;
94
- }
95
- await applyBatchStyle(id.value, (targetId: string) =>
96
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeName(targetId, newValue)),
97
- );
98
- hybridViewerStore.remoteRender();
99
- },
100
- });
101
-
102
- const vertex_attribute_time_step = computed<number | undefined>({
103
- get: () => dataStyleStore.meshPolygonsVertexAttributeTimeStep(id.value),
104
- set: async (newValue) => {
105
- if (newValue === undefined) {
106
- return;
107
- }
108
- await applyBatchStyle(id.value, (targetId: string) =>
109
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeTimeStep(targetId, newValue)),
110
- );
111
- hybridViewerStore.remoteRender();
112
- },
113
- });
114
- const vertex_attribute_item = computed<string | undefined>({
115
- get: () => dataStyleStore.meshPolygonsVertexAttributeItem(id.value),
116
- set: async (newValue) => {
117
- await applyBatchStyle(id.value, (targetId: string) =>
118
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeItem(targetId, newValue)),
119
- );
120
- hybridViewerStore.remoteRender();
121
- },
122
- });
123
- const vertex_attribute_range = computed<[number, number] | undefined>({
124
- get: () => dataStyleStore.meshPolygonsVertexAttributeRange(id.value),
125
- set: async (newValue) => {
126
- const [minimum, maximum] = newValue;
127
- if (minimum === undefined || maximum === undefined) {
128
- return;
129
- }
130
- await applyBatchStyle(id.value, (targetId: string) =>
131
- Promise.resolve(
132
- dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
133
- ),
134
- );
135
- hybridViewerStore.remoteRender();
136
- },
137
- });
138
- const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
139
- get: () => dataStyleStore.meshPolygonsVertexAttributeColorMap(id.value),
140
- set: async (newValue) => {
141
- await applyBatchStyle(id.value, (targetId: string) =>
142
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeColorMap(targetId, newValue)),
143
- );
144
- hybridViewerStore.remoteRender();
145
- },
146
- });
147
- const vertex_attribute_no_data_color = computed<RGBAColor>({
148
- get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value),
149
- set: async (newValue) => {
150
- await applyBatchStyle(id.value, (targetId: string) =>
151
- dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
152
- );
153
- hybridViewerStore.remoteRender();
154
- },
155
- });
156
- const polygon_attribute_name = computed<string | undefined>({
157
- get: () => dataStyleStore.meshPolygonsPolygonAttributeName(id.value),
158
- set: async (newValue) => {
159
- if (newValue === undefined) {
160
- return;
161
- }
162
- await applyBatchStyle(id.value, (targetId: string) =>
163
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeName(targetId, newValue)),
164
- );
165
- hybridViewerStore.remoteRender();
166
- },
167
- });
168
-
169
- const polygon_attribute_time_step = computed<number | undefined>({
170
- get: () => dataStyleStore.meshPolygonsPolygonAttributeTimeStep(id.value),
171
- set: async (newValue) => {
172
- if (newValue === undefined) {
173
- return;
174
- }
175
- await applyBatchStyle(id.value, (targetId: string) =>
176
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeTimeStep(targetId, newValue)),
177
- );
178
- hybridViewerStore.remoteRender();
179
- },
180
- });
181
- const polygon_attribute_item = computed<string | undefined>({
182
- get: () => dataStyleStore.meshPolygonsPolygonAttributeItem(id.value),
183
- set: async (newValue) => {
184
- await applyBatchStyle(id.value, (targetId: string) =>
185
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeItem(targetId, newValue)),
186
- );
187
- hybridViewerStore.remoteRender();
188
- },
189
- });
190
- const polygon_attribute_range = computed<[number, number] | undefined>({
191
- get: () => dataStyleStore.meshPolygonsPolygonAttributeRange(id.value),
192
- set: async (newValue) => {
193
- const [minimum, maximum] = newValue;
194
- if (minimum === undefined || maximum === undefined) {
195
- return;
196
- }
197
- await applyBatchStyle(id.value, (targetId: string) =>
198
- Promise.resolve(
199
- dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
200
- ),
201
- );
202
- hybridViewerStore.remoteRender();
203
- },
204
- });
205
- const polygon_attribute_color_map = computed<Map<string, RGBAColor>>({
206
- get: () => dataStyleStore.meshPolygonsPolygonAttributeColorMap(id.value),
207
- set: async (newValue) => {
208
- await applyBatchStyle(id.value, (targetId: string) =>
209
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeColorMap(targetId, newValue)),
210
- );
211
- hybridViewerStore.remoteRender();
212
- },
213
- });
214
- const polygon_attribute_no_data_color = computed<RGBAColor>({
215
- get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value),
216
- set: async (newValue) => {
217
- await applyBatchStyle(id.value, (targetId: string) =>
218
- dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
219
- );
220
- hybridViewerStore.remoteRender();
221
- },
222
- });
223
-
224
- async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
225
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
226
- dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
227
- );
228
- hybridViewerStore.remoteRender();
229
- }
230
-
231
- async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
232
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
233
- dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
234
- );
235
- hybridViewerStore.remoteRender();
236
- }
237
45
  </script>
238
46
 
239
47
  <template>
@@ -251,27 +59,7 @@ async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<
251
59
  />
252
60
  <template v-if="visibility">
253
61
  <v-divider />
254
- <ViewerOptionsColoringTypeSelector
255
- :id="id"
256
- v-model:coloring_style_key="coloring_style_key"
257
- v-model:color="color"
258
- v-model:textures="textures"
259
- v-model:vertex_attribute_name="vertex_attribute_name"
260
- v-model:vertex_attribute_item="vertex_attribute_item"
261
- v-model:vertex_attribute_range="vertex_attribute_range"
262
- @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
263
- v-model:vertex_attribute_color_map="vertex_attribute_color_map"
264
- v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
265
- v-model:vertex_attribute_time_step="vertex_attribute_time_step"
266
- v-model:polygon_attribute_name="polygon_attribute_name"
267
- v-model:polygon_attribute_item="polygon_attribute_item"
268
- v-model:polygon_attribute_range="polygon_attribute_range"
269
- @polygon_attribute_ranges_per_data="setPolygonAttributeRangesPerData"
270
- v-model:polygon_attribute_color_map="polygon_attribute_color_map"
271
- v-model:polygon_attribute_no_data_color="polygon_attribute_no_data_color"
272
- v-model:polygon_attribute_time_step="polygon_attribute_time_step"
273
- :capabilities="capabilities"
274
- />
62
+ <ViewerGenericMeshPolygonsColoring :id="id" :capabilities="capabilities" />
275
63
  </template>
276
64
  </template>
277
65
  </ViewerContextMenuItem>