@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,11 +1,15 @@
1
1
  <script setup lang="ts">
2
- import type { AttributeSchemas } from "@ogw_front/utils/attribute_range";
2
+ import {
3
+ COLORING_STYLES,
4
+ type Schemas,
5
+ buildColoringStyles,
6
+ resolveAttributeSchemas,
7
+ } from "@ogw_front/utils/coloring_styles";
3
8
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
4
9
  import type { RangesPerData } from "@ogw_front/composables/batch_style";
5
10
  import ViewerOptionsAttributeSelector from "@ogw_front/components/Viewer/Options/AttributeSelector.vue";
6
11
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
7
12
  import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector.vue";
8
- import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
9
13
 
10
14
  interface Texture {
11
15
  id: string;
@@ -17,14 +21,6 @@ interface CapabilityConfig {
17
21
  hasColorMap?: boolean;
18
22
  }
19
23
 
20
- interface Schemas {
21
- vertex?: AttributeSchemas;
22
- edge?: AttributeSchemas;
23
- cell?: AttributeSchemas;
24
- polygon?: AttributeSchemas;
25
- polyhedron?: AttributeSchemas;
26
- }
27
-
28
24
  const coloring_style_key = defineModel<string>("coloring_style_key");
29
25
 
30
26
  interface Emits {
@@ -95,27 +91,13 @@ const {
95
91
  allowRandom = false,
96
92
  } = defineProps<Props>();
97
93
 
98
- const backSchemas = back_schemas.opengeodeweb_back;
99
- const vertexSchemas = schemas.vertex ?? {
100
- names: backSchemas.vertex_attribute_names,
101
- range: backSchemas.vertex_attribute_range,
102
- };
103
- const edgeSchemas = schemas.edge ?? {
104
- names: backSchemas.edge_attribute_names,
105
- range: backSchemas.edge_attribute_range,
106
- };
107
- const cellSchemas = schemas.cell ?? {
108
- names: backSchemas.cell_attribute_names,
109
- range: backSchemas.cell_attribute_range,
110
- };
111
- const polygonSchemas = schemas.polygon ?? {
112
- names: backSchemas.polygon_attribute_names,
113
- range: backSchemas.polygon_attribute_range,
114
- };
115
- const polyhedronSchemas = schemas.polyhedron ?? {
116
- names: backSchemas.polyhedron_attribute_names,
117
- range: backSchemas.polyhedron_attribute_range,
118
- };
94
+ const {
95
+ vertex: vertexSchemas,
96
+ edge: edgeSchemas,
97
+ cell: cellSchemas,
98
+ polygon: polygonSchemas,
99
+ polyhedron: polyhedronSchemas,
100
+ } = resolveAttributeSchemas(schemas);
119
101
 
120
102
  function isAvailable(key: string): boolean {
121
103
  if (capabilities[key] && capabilities[key].available === false) {
@@ -156,49 +138,29 @@ const has_polyhedra = computed<boolean>(
156
138
  hasColorMap("polyhedron"),
157
139
  );
158
140
 
159
- const color_dict = { name: "Constant", value: "constant" };
160
- const random_dict = { name: "Random", value: "random" };
161
- const textures_dict = { name: "Textures", value: "textures" };
162
- const vertex_dict = { name: "Vertex attribute", value: "vertex" };
163
- const edge_dict = { name: "Edge attribute", value: "edge" };
164
- const cell_dict = { name: "Cell attribute", value: "cell" };
165
- const polygon_dict = { name: "Polygon attribute", value: "polygon" };
166
- const polyhedron_dict = {
167
- name: "Polyhedron attribute",
168
- value: "polyhedron",
169
- };
170
- const coloring_styles = computed<{ labels: string[]; values: string[] }>(() => {
171
- const array = [];
172
- if (has_color.value) {
173
- array.push(color_dict);
174
- if (allowRandom) {
175
- array.push(random_dict);
176
- }
177
- }
178
- if (has_textures.value) {
179
- array.push(textures_dict);
180
- }
181
- if (has_vertex.value) {
182
- array.push(vertex_dict);
183
- }
184
- if (has_edge.value) {
185
- array.push(edge_dict);
186
- }
187
- if (has_cells.value) {
188
- array.push(cell_dict);
189
- }
190
- if (has_polygons.value) {
191
- array.push(polygon_dict);
192
- }
193
- if (has_polyhedra.value) {
194
- array.push(polyhedron_dict);
195
- }
196
-
197
- const labels = array.map((coloring) => coloring.name);
198
- const values = array.map((coloring) => coloring.value);
199
-
200
- return { labels, values };
201
- });
141
+ const {
142
+ color: color_dict,
143
+ textures: textures_dict,
144
+ vertex: vertex_dict,
145
+ edge: edge_dict,
146
+ cell: cell_dict,
147
+ polygon: polygon_dict,
148
+ polyhedron: polyhedron_dict,
149
+ } = COLORING_STYLES;
150
+ const coloring_styles = computed<{ labels: string[]; values: string[] }>(() =>
151
+ buildColoringStyles(
152
+ {
153
+ color: has_color.value,
154
+ textures: has_textures.value,
155
+ vertex: has_vertex.value,
156
+ edge: has_edge.value,
157
+ cell: has_cells.value,
158
+ polygon: has_polygons.value,
159
+ polyhedron: has_polyhedra.value,
160
+ },
161
+ allowRandom,
162
+ ),
163
+ );
202
164
 
203
165
  const coloring_style_label = ref<string>("");
204
166
 
@@ -19,6 +19,18 @@ const { dataId = undefined, blockIds = undefined, x, y } = defineProps<Props>();
19
19
  const show = defineModel<boolean>("show", { default: false });
20
20
 
21
21
  const dataIdRef = computed<string>(() => dataId);
22
+ function useAttributeStyle():
23
+ | ReturnType<typeof useGlobalAttributeStyle>
24
+ | ReturnType<typeof useModelAttributeStyle> {
25
+ if (blockIds === undefined) {
26
+ return useGlobalAttributeStyle(dataIdRef);
27
+ }
28
+ return useModelAttributeStyle(
29
+ dataIdRef,
30
+ computed<number[]>(() => blockIds),
31
+ );
32
+ }
33
+
22
34
  // The parent keys this picker on the picked data: a mesh or a model, so the style is chosen once here
23
35
  const {
24
36
  currentColormap,
@@ -28,13 +40,7 @@ const {
28
40
  currentTimeSteps,
29
41
  currentTimeStep,
30
42
  loadTimeSteps,
31
- } =
32
- blockIds === undefined
33
- ? useGlobalAttributeStyle(dataIdRef)
34
- : useModelAttributeStyle(
35
- dataIdRef,
36
- computed<number[]>(() => blockIds),
37
- );
43
+ } = useAttributeStyle();
38
44
 
39
45
  watch(show, async (isShown) => {
40
46
  if (isShown) {
@@ -0,0 +1,56 @@
1
+ <script setup lang="ts">
2
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
3
+ import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
4
+
5
+ const attributeNoDataColor = defineModel<typeof DEFAULT_NO_DATA_COLOR>();
6
+
7
+ const cssNoDataColor = computed<string>(() => {
8
+ const { red, green, blue, alpha } = attributeNoDataColor.value ?? DEFAULT_NO_DATA_COLOR;
9
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
10
+ });
11
+ </script>
12
+
13
+ <template>
14
+ <div
15
+ class="text-caption text-high-emphasis mt-1 d-flex align-center ga-1"
16
+ data-testid="noDataInfo"
17
+ >
18
+ <v-icon icon="mdi-information-outline" size="14" color="info" />
19
+ <span>Contains unmapped elements</span>
20
+ <v-menu :close-on-content-click="false">
21
+ <template #activator="{ props }">
22
+ <button
23
+ v-bind="props"
24
+ type="button"
25
+ class="color-picker-rect-btn ml-1"
26
+ :style="{ backgroundColor: cssNoDataColor }"
27
+ v-tooltip="'Change unmapped elements color'"
28
+ data-testid="noDataColorBtn"
29
+ />
30
+ </template>
31
+ <v-card class="pa-2">
32
+ <ViewerOptionsColorPicker v-model="attributeNoDataColor" disabled-alpha />
33
+ </v-card>
34
+ </v-menu>
35
+ </div>
36
+ </template>
37
+
38
+ <style scoped>
39
+ .color-picker-rect-btn {
40
+ width: 26px;
41
+ height: 15px;
42
+ border-radius: 3px;
43
+ border: 2px solid rgba(255, 255, 255, 0.912);
44
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
45
+ cursor: pointer;
46
+ outline: none;
47
+ transition:
48
+ border-color 0.15s ease,
49
+ transform 0.15s ease;
50
+ }
51
+
52
+ .color-picker-rect-btn:hover {
53
+ border-color: rgba(255, 255, 255, 0.9);
54
+ transform: scale(1.1);
55
+ }
56
+ </style>
@@ -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>