@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
@@ -0,0 +1,221 @@
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>>({
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>>({
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
+ :capabilities="{
217
+ vertex: { available: true, hasColorMap: true },
218
+ polyhedron: { available: true, hasColorMap: true },
219
+ }"
220
+ />
221
+ </template>
@@ -1,15 +1,10 @@
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 ViewerGenericMeshPolyhedraColoring from "@ogw_front/components/Viewer/Generic/Mesh/PolyhedraColoring.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
 
@@ -36,179 +31,6 @@ 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>>({
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>>({
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>
213
35
 
214
36
  <template>
@@ -226,29 +48,7 @@ async function setPolyhedronAttributeRangesPerData(ranges: RangesPerData): Promi
226
48
  />
227
49
  <template v-if="visibility">
228
50
  <v-divider />
229
- <ViewerOptionsColoringTypeSelector
230
- :id="id"
231
- v-model:coloring_style_key="coloring_style_key"
232
- v-model:color="color"
233
- v-model:vertex_attribute_name="vertex_attribute_name"
234
- v-model:vertex_attribute_item="vertex_attribute_item"
235
- v-model:vertex_attribute_range="vertex_attribute_range"
236
- @vertex_attribute_ranges_per_data="setVertexAttributeRangesPerData"
237
- v-model:vertex_attribute_color_map="vertex_attribute_color_map"
238
- v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
239
- v-model:vertex_attribute_time_step="vertex_attribute_time_step"
240
- v-model:polyhedron_attribute_name="polyhedron_attribute_name"
241
- v-model:polyhedron_attribute_item="polyhedron_attribute_item"
242
- v-model:polyhedron_attribute_range="polyhedron_attribute_range"
243
- @polyhedron_attribute_ranges_per_data="setPolyhedronAttributeRangesPerData"
244
- v-model:polyhedron_attribute_color_map="polyhedron_attribute_color_map"
245
- v-model:polyhedron_attribute_no_data_color="polyhedron_attribute_no_data_color"
246
- v-model:polyhedron_attribute_time_step="polyhedron_attribute_time_step"
247
- :capabilities="{
248
- vertex: { available: true, hasColorMap: true },
249
- polyhedron: { available: true, hasColorMap: true },
250
- }"
251
- />
51
+ <ViewerGenericMeshPolyhedraColoring :id="id" />
252
52
  </template>
253
53
  </template>
254
54
  </ViewerContextMenuItem>
@@ -31,14 +31,16 @@ const referenceBlockId = computed<string | undefined>(() =>
31
31
  collections ? targetBlockIds[0] : undefined,
32
32
  );
33
33
 
34
- const blockComponentIds = computed<string[]>(() => (blockId === undefined ? [] : [blockId]));
34
+ const blockComponentIds = computed<string[]>(() => (blockId !== undefined && [blockId]) || []);
35
35
 
36
36
  // Visibility
37
37
  const blocksVisibility = computed<boolean>({
38
- get: () =>
39
- collections
40
- ? targetBlockIds.every((id) => dataStyleStore.modelBlockVisibility(modelId, id))
41
- : dataStyleStore.modelComponentTypeVisibility(modelId, "Block"),
38
+ get: () => {
39
+ if (collections) {
40
+ return targetBlockIds.every((id) => dataStyleStore.modelBlockVisibility(modelId, id));
41
+ }
42
+ return dataStyleStore.modelComponentTypeVisibility(modelId, "Block");
43
+ },
42
44
  set: async (newValue) => {
43
45
  await dataStyleStore.setModelBlocksVisibility(modelId, targetBlockIds, newValue);
44
46
  hybridViewerStore.remoteRender();
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
+ import { MODEL_VERTEX_COLORING } from "@ogw_front/utils/model_component_coloring";
2
3
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
3
4
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
4
5
  import ViewerOptionsSizeSlider from "@ogw_front/components/Viewer/Options/Sliders/Size.vue";
5
6
  import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
6
- import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
7
7
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
8
8
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
9
9
 
@@ -203,23 +203,7 @@ const vertexAttributeNoDataColor = computed<RGBAColor | undefined>({
203
203
  },
204
204
  });
205
205
 
206
- const capabilities = {
207
- color: { available: true },
208
- textures: { available: false },
209
- vertex: { available: true },
210
- edge: { available: false },
211
- cell: { available: false },
212
- polygon: { available: false },
213
- polyhedron: { available: false },
214
- };
215
-
216
- const backSchemas = back_schemas.opengeodeweb_back;
217
- const attributeSchemas = {
218
- vertex: {
219
- names: backSchemas.model_component_vertex_attribute_names,
220
- range: backSchemas.model_component_vertex_attribute_range,
221
- },
222
- };
206
+ const { capabilities, schemas: attributeSchemas } = MODEL_VERTEX_COLORING;
223
207
  </script>
224
208
 
225
209
  <template>
@@ -0,0 +1,145 @@
1
+ <script setup lang="ts">
2
+ import { MODEL_VERTEX_COLORING } from "@ogw_front/utils/model_component_coloring";
3
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
4
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
5
+ import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
6
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
7
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
8
+
9
+ interface Props {
10
+ modelId: string;
11
+ cornerId?: string;
12
+ activeTab?: string;
13
+ }
14
+
15
+ const { modelId, cornerId = undefined, activeTab = undefined } = defineProps<Props>();
16
+
17
+ const dataStyleStore = useDataStyleStore();
18
+ const hybridViewerStore = useHybridViewerStore();
19
+
20
+ const cornerComponentIds = computed<string[]>(() => (cornerId !== undefined && [cornerId]) || []);
21
+
22
+ const cornerVisibility = computed<boolean | undefined>({
23
+ get: () => dataStyleStore.modelCornerVisibility(modelId, cornerId) as boolean | undefined,
24
+ set: async (newValue) => {
25
+ if (newValue === undefined || cornerId === undefined) {
26
+ return;
27
+ }
28
+ await dataStyleStore.setModelCornersVisibility(modelId, [cornerId], newValue);
29
+ hybridViewerStore.remoteRender();
30
+ },
31
+ });
32
+
33
+ const cornerColor = computed<RGBAColor | undefined>({
34
+ get: () => dataStyleStore.modelCornerColor(modelId, cornerId) as RGBAColor | undefined,
35
+ set: async (color) => {
36
+ if (cornerId === undefined) {
37
+ return;
38
+ }
39
+ await dataStyleStore.setModelCornersColor(modelId, [cornerId], color);
40
+ hybridViewerStore.remoteRender();
41
+ },
42
+ });
43
+
44
+ const cornerActiveColoring = computed<string | undefined>({
45
+ get: () => dataStyleStore.modelCornerActiveColoring(modelId, cornerId) as string | undefined,
46
+ set: async (coloringType) => {
47
+ if (cornerId === undefined || typeof coloringType !== "string") {
48
+ return;
49
+ }
50
+ await dataStyleStore.setModelCornersActiveColoring(modelId, [cornerId], coloringType);
51
+ hybridViewerStore.remoteRender();
52
+ },
53
+ });
54
+
55
+ // Individual Attributes
56
+ const vertexAttributeName = computed<string | undefined>({
57
+ get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, cornerId),
58
+ set: async (newValue) => {
59
+ if (cornerId === undefined || newValue === undefined) {
60
+ return;
61
+ }
62
+ await dataStyleStore.setModelCornersVertexAttributeName(modelId, [cornerId], newValue);
63
+ hybridViewerStore.remoteRender();
64
+ },
65
+ });
66
+
67
+ const vertexAttributeTimeStep = computed<number | undefined>({
68
+ get: () => dataStyleStore.modelCornersVertexAttributeTimeStep(modelId, cornerId),
69
+ set: async (newValue) => {
70
+ if (cornerId === undefined || newValue === undefined) {
71
+ return;
72
+ }
73
+ await dataStyleStore.setModelCornersVertexAttributeTimeStep(modelId, [cornerId], newValue);
74
+ hybridViewerStore.remoteRender();
75
+ },
76
+ });
77
+
78
+ const vertexAttributeItem = computed<string | undefined>({
79
+ get: () => dataStyleStore.modelCornersVertexAttributeItem(modelId, cornerId),
80
+ set: async (newValue) => {
81
+ if (cornerId === undefined) {
82
+ return;
83
+ }
84
+ await dataStyleStore.setModelCornersVertexAttributeItem(modelId, [cornerId], newValue);
85
+ hybridViewerStore.remoteRender();
86
+ },
87
+ });
88
+
89
+ const vertexAttributeRange = computed<[number, number] | undefined>({
90
+ get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, cornerId),
91
+ set: async (newValue) => {
92
+ const [minimum, maximum] = newValue;
93
+ if (cornerId === undefined || minimum === undefined || maximum === undefined) {
94
+ return;
95
+ }
96
+ await dataStyleStore.setModelCornersVertexAttributeRange(modelId, [cornerId], minimum, maximum);
97
+ hybridViewerStore.remoteRender();
98
+ },
99
+ });
100
+
101
+ const vertexAttributeColorMap = computed<ColorMap | undefined>({
102
+ get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, cornerId),
103
+ set: async (newValue) => {
104
+ if (cornerId === undefined) {
105
+ return;
106
+ }
107
+ await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, [cornerId], newValue);
108
+ hybridViewerStore.remoteRender();
109
+ },
110
+ });
111
+
112
+ const vertexAttributeNoDataColor = computed<RGBAColor>({
113
+ get: () => dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, cornerId),
114
+ set: async (newValue) => {
115
+ if (cornerId === undefined) {
116
+ return;
117
+ }
118
+ await dataStyleStore.setModelCornersVertexAttributeNoDataColor(modelId, [cornerId], newValue);
119
+ hybridViewerStore.remoteRender();
120
+ },
121
+ });
122
+
123
+ const { capabilities, schemas: attributeSchemas } = MODEL_VERTEX_COLORING;
124
+ </script>
125
+
126
+ <template>
127
+ <div v-show="!activeTab || activeTab === 'component'" data-testid="modelComponentOptions">
128
+ <VisibilitySwitch v-model="cornerVisibility" />
129
+ <ViewerOptionsColoringTypeSelector
130
+ :id="modelId"
131
+ :componentIds="cornerComponentIds"
132
+ v-model:coloring_style_key="cornerActiveColoring"
133
+ v-model:color="cornerColor"
134
+ v-model:vertex_attribute_name="vertexAttributeName"
135
+ v-model:vertex_attribute_item="vertexAttributeItem"
136
+ v-model:vertex_attribute_range="vertexAttributeRange"
137
+ v-model:vertex_attribute_color_map="vertexAttributeColorMap"
138
+ v-model:vertex_attribute_no_data_color="vertexAttributeNoDataColor"
139
+ v-model:vertex_attribute_time_step="vertexAttributeTimeStep"
140
+ :capabilities="capabilities"
141
+ :schemas="attributeSchemas"
142
+ :allowRandom="true"
143
+ />
144
+ </div>
145
+ </template>