@geode/opengeodeweb-front 10.36.0 → 10.37.0

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 (93) hide show
  1. package/app/components/Screenshot.vue +6 -4
  2. package/app/components/ViewToolbar.vue +4 -2
  3. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +7 -4
  4. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +10 -4
  5. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +7 -4
  6. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -2
  7. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +10 -6
  8. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +7 -6
  9. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +9 -18
  10. package/app/components/Viewer/Generic/Model/CornersOptions.vue +5 -10
  11. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -0
  12. package/app/components/Viewer/Generic/Model/LinesOptions.vue +9 -17
  13. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +8 -18
  14. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +1 -5
  15. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +11 -2
  16. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +7 -6
  17. package/app/components/Viewer/Surface/PolygonsOptions.vue +10 -6
  18. package/app/composables/hover_highlight.ts +5 -4
  19. package/app/composables/project_manager.ts +1 -1
  20. package/app/composables/use_overlapping_picker.ts +4 -73
  21. package/app/composables/use_quick_colormap.ts +4 -14
  22. package/app/stores/back.ts +4 -10
  23. package/app/stores/camera_manager.ts +1 -1
  24. package/app/stores/data.ts +1 -1
  25. package/app/stores/viewer.ts +33 -19
  26. package/internal/stores/data_style/mesh/cells/cell.ts +26 -23
  27. package/internal/stores/data_style/mesh/cells/color.ts +8 -6
  28. package/internal/stores/data_style/mesh/cells/index.ts +13 -6
  29. package/internal/stores/data_style/mesh/cells/textures.ts +17 -6
  30. package/internal/stores/data_style/mesh/cells/vertex.ts +29 -23
  31. package/internal/stores/data_style/mesh/cells/visibility.ts +3 -6
  32. package/internal/stores/data_style/mesh/edges/color.ts +8 -6
  33. package/internal/stores/data_style/mesh/edges/edge.ts +26 -23
  34. package/internal/stores/data_style/mesh/edges/index.ts +13 -3
  35. package/internal/stores/data_style/mesh/edges/vertex.ts +29 -23
  36. package/internal/stores/data_style/mesh/edges/visibility.ts +3 -6
  37. package/internal/stores/data_style/mesh/edges/width.ts +3 -3
  38. package/internal/stores/data_style/mesh/index.ts +24 -11
  39. package/internal/stores/data_style/mesh/points/color.ts +8 -6
  40. package/internal/stores/data_style/mesh/points/index.ts +13 -6
  41. package/internal/stores/data_style/mesh/points/size.ts +3 -3
  42. package/internal/stores/data_style/mesh/points/vertex.ts +29 -23
  43. package/internal/stores/data_style/mesh/points/visibility.ts +5 -11
  44. package/internal/stores/data_style/mesh/polygons/color.ts +8 -6
  45. package/internal/stores/data_style/mesh/polygons/index.ts +13 -9
  46. package/internal/stores/data_style/mesh/polygons/polygon.ts +26 -23
  47. package/internal/stores/data_style/mesh/polygons/textures.ts +17 -6
  48. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -23
  49. package/internal/stores/data_style/mesh/polygons/visibility.ts +3 -6
  50. package/internal/stores/data_style/mesh/polyhedra/color.ts +8 -6
  51. package/internal/stores/data_style/mesh/polyhedra/index.ts +9 -5
  52. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +28 -23
  53. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -23
  54. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +3 -6
  55. package/internal/stores/data_style/model/blocks/color.ts +8 -6
  56. package/internal/stores/data_style/model/blocks/index.ts +9 -22
  57. package/internal/stores/data_style/model/blocks/polyhedron.ts +28 -23
  58. package/internal/stores/data_style/model/blocks/vertex.ts +26 -23
  59. package/internal/stores/data_style/model/blocks/visibility.ts +3 -3
  60. package/internal/stores/data_style/model/color.ts +10 -7
  61. package/internal/stores/data_style/model/common.ts +36 -20
  62. package/internal/stores/data_style/model/corners/color.ts +8 -6
  63. package/internal/stores/data_style/model/corners/index.ts +8 -14
  64. package/internal/stores/data_style/model/corners/vertex.ts +26 -23
  65. package/internal/stores/data_style/model/corners/visibility.ts +3 -3
  66. package/internal/stores/data_style/model/edges/visibility.ts +8 -8
  67. package/internal/stores/data_style/model/lines/color.ts +8 -6
  68. package/internal/stores/data_style/model/lines/edge.ts +26 -23
  69. package/internal/stores/data_style/model/lines/index.ts +9 -22
  70. package/internal/stores/data_style/model/lines/vertex.ts +26 -23
  71. package/internal/stores/data_style/model/lines/visibility.ts +3 -3
  72. package/internal/stores/data_style/model/points/index.ts +14 -4
  73. package/internal/stores/data_style/model/points/size.ts +3 -3
  74. package/internal/stores/data_style/model/points/visibility.ts +3 -6
  75. package/internal/stores/data_style/model/surfaces/color.ts +8 -6
  76. package/internal/stores/data_style/model/surfaces/index.ts +9 -22
  77. package/internal/stores/data_style/model/surfaces/polygon.ts +29 -23
  78. package/internal/stores/data_style/model/surfaces/vertex.ts +26 -23
  79. package/internal/stores/data_style/model/surfaces/visibility.ts +3 -3
  80. package/internal/stores/data_style/model/visibility.ts +1 -1
  81. package/internal/stores/data_style/when_defined.ts +13 -0
  82. package/internal/stores/hybrid_viewer/camera.ts +14 -15
  83. package/internal/stores/hybrid_viewer/core.ts +1 -1
  84. package/internal/stores/hybrid_viewer/filters.ts +12 -6
  85. package/internal/stores/hybrid_viewer/highlight.ts +9 -18
  86. package/internal/stores/hybrid_viewer/ruler.ts +10 -13
  87. package/internal/stores/hybrid_viewer/scene.ts +1 -1
  88. package/internal/utils/viewer_call.ts +1 -1
  89. package/package.json +1 -1
  90. package/server/utils/ws_client.ts +4 -4
  91. package/shared/utils/call_raw.ts +3 -3
  92. package/shared/utils/call_schema.ts +10 -8
  93. package/shared/utils/types.ts +6 -0
@@ -1,10 +1,12 @@
1
1
  <script setup lang="ts">
2
+ import viewer_schemas, {
3
+ type ViewerTakeScreenshotParams,
4
+ } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
2
5
  import ToolPanel from "@ogw_front/components/ToolPanel.vue";
3
6
  import fileDownload from "js-file-download";
4
7
  import { useClipboardItems } from "@vueuse/core";
5
8
  import { useFeedbackStore } from "@ogw_front/stores/feedback";
6
9
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
8
10
 
9
11
  const DEFAULT_PANEL_WIDTH = 260;
10
12
 
@@ -20,7 +22,7 @@ const { width = DEFAULT_PANEL_WIDTH, escapeFunction = undefined } = defineProps<
20
22
  const output_extensions =
21
23
  viewer_schemas.opengeodeweb_viewer.viewer.take_screenshot.properties.output_extension.enum;
22
24
  const filename = ref<string>("");
23
- const output_extension = ref<string>("png");
25
+ const output_extension = ref<ViewerTakeScreenshotParams["output_extension"]>("png");
24
26
  const include_background = ref<boolean>(true);
25
27
  const screenshot_type = ref<string>("file");
26
28
 
@@ -42,8 +44,8 @@ async function takeScreenshot(): Promise<void> {
42
44
  params,
43
45
  },
44
46
  {
45
- response_function: async (response: unknown) => {
46
- const { blob } = response as { blob: BlobPart };
47
+ // `blob` is a wslink attachment: the viewer sends its key, the client receives the binary in its place
48
+ response_function: async ({ blob }) => {
47
49
  if (screenshot_type.value === "file") {
48
50
  fileDownload(blob, `${current_filename}.${output_extension.value}`);
49
51
  feedbackStore.add_success("Screenshot downloaded");
@@ -1,4 +1,7 @@
1
1
  <script setup lang="ts">
2
+ import schemas, {
3
+ type PickedFieldType,
4
+ } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
2
5
  import ActionButton from "@ogw_front/components/ActionButton.vue";
3
6
  import CameraBookmarkIcon from "@ogw_front/assets/viewer_svgs/camera-bookmark.svg";
4
7
  import CameraManager from "@ogw_front/components/CameraManager.vue";
@@ -10,7 +13,6 @@ import ShrinkFilter from "@ogw_front/components/ShrinkFilter.vue";
10
13
  import ThresholdFilter from "@ogw_front/components/ThresholdFilter.vue";
11
14
  import ZScaling from "@ogw_front/components/ZScaling.vue";
12
15
  import { onKeyStroke } from "@vueuse/core";
13
- import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
14
16
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
15
17
  import { useViewerStore } from "@ogw_front/stores/viewer";
16
18
 
@@ -96,7 +98,7 @@ function toggleTool(toolRef: Ref<boolean>): void {
96
98
  toolRef.value = !toolRef.value;
97
99
  }
98
100
 
99
- function toggleHoverHighlight(fieldType: string): void {
101
+ function toggleHoverHighlight(fieldType: PickedFieldType): void {
100
102
  const activate =
101
103
  !hybridViewerStore.is_hover_highlight ||
102
104
  hybridViewerStore.hover_highlight_field_type !== fieldType;
@@ -53,6 +53,9 @@ const coloring_style_key = computed<string>({
53
53
  const color = computed<RGBAColor | undefined>({
54
54
  get: () => dataStyleStore.meshEdgesColor(id.value) as RGBAColor | undefined,
55
55
  set: async (newValue) => {
56
+ if (newValue === undefined) {
57
+ return;
58
+ }
56
59
  await applyBatchStyle(id.value, (targetId: string) =>
57
60
  dataStyleStore.setMeshEdgesColor(targetId, newValue),
58
61
  );
@@ -102,8 +105,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
102
105
  hybridViewerStore.remoteRender();
103
106
  },
104
107
  });
105
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
106
- get: () => dataStyleStore.meshEdgesVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
108
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
109
+ get: () => dataStyleStore.meshEdgesVertexAttributeNoDataColor(id.value),
107
110
  set: async (newValue) => {
108
111
  await applyBatchStyle(id.value, (targetId: string) =>
109
112
  dataStyleStore.setMeshEdgesVertexAttributeNoDataColor(targetId, newValue),
@@ -154,8 +157,8 @@ const edge_attribute_color_map = computed<Map<string, RGBAColor>>({
154
157
  hybridViewerStore.remoteRender();
155
158
  },
156
159
  });
157
- const edge_attribute_no_data_color = computed<RGBAColor | undefined>({
158
- get: () => dataStyleStore.meshEdgesEdgeAttributeNoDataColor(id.value) as RGBAColor | undefined,
160
+ const edge_attribute_no_data_color = computed<RGBAColor>({
161
+ get: () => dataStyleStore.meshEdgesEdgeAttributeNoDataColor(id.value),
159
162
  set: async (newValue) => {
160
163
  await applyBatchStyle(id.value, (targetId: string) =>
161
164
  dataStyleStore.setMeshEdgesEdgeAttributeNoDataColor(targetId, newValue),
@@ -49,6 +49,9 @@ const coloring_style_key = computed<string>({
49
49
  const color = computed<RGBAColor | undefined>({
50
50
  get: () => dataStyleStore.meshCellsColor(id.value) as RGBAColor | undefined,
51
51
  set: async (newValue) => {
52
+ if (newValue === undefined) {
53
+ return;
54
+ }
52
55
  await applyBatchStyle(id.value, (targetId: string) =>
53
56
  dataStyleStore.setMeshCellsColor(targetId, newValue),
54
57
  );
@@ -58,6 +61,9 @@ const color = computed<RGBAColor | undefined>({
58
61
  const textures = computed<Texture[] | undefined>({
59
62
  get: () => dataStyleStore.meshCellsTextures(id.value) as Texture[] | undefined,
60
63
  set: async (newValue) => {
64
+ if (newValue === undefined) {
65
+ return;
66
+ }
61
67
  await applyBatchStyle(id.value, (targetId: string) =>
62
68
  dataStyleStore.setMeshCellsTextures(targetId, newValue),
63
69
  );
@@ -108,8 +114,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
108
114
  hybridViewerStore.remoteRender();
109
115
  },
110
116
  });
111
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
112
- get: () => dataStyleStore.meshCellsVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
117
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
118
+ get: () => dataStyleStore.meshCellsVertexAttributeNoDataColor(id.value),
113
119
  set: async (newValue) => {
114
120
  await applyBatchStyle(id.value, (targetId: string) =>
115
121
  dataStyleStore.setMeshCellsVertexAttributeNoDataColor(targetId, newValue),
@@ -160,8 +166,8 @@ const cell_attribute_color_map = computed<Map<string, RGBAColor>>({
160
166
  hybridViewerStore.remoteRender();
161
167
  },
162
168
  });
163
- const cell_attribute_no_data_color = computed<RGBAColor | undefined>({
164
- get: () => dataStyleStore.meshCellsCellAttributeNoDataColor(id.value) as RGBAColor | undefined,
169
+ const cell_attribute_no_data_color = computed<RGBAColor>({
170
+ get: () => dataStyleStore.meshCellsCellAttributeNoDataColor(id.value),
165
171
  set: async (newValue) => {
166
172
  await applyBatchStyle(id.value, (targetId: string) =>
167
173
  dataStyleStore.setMeshCellsCellAttributeNoDataColor(targetId, newValue),
@@ -54,6 +54,9 @@ const coloring_style_key = computed<string>({
54
54
  const color = computed<RGBAColor | undefined>({
55
55
  get: () => dataStyleStore.meshEdgesColor(id.value) as RGBAColor | undefined,
56
56
  set: async (newValue) => {
57
+ if (newValue === undefined) {
58
+ return;
59
+ }
57
60
  await applyBatchStyle(id.value, (targetId: string) =>
58
61
  dataStyleStore.setMeshEdgesColor(targetId, newValue),
59
62
  );
@@ -103,8 +106,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
103
106
  hybridViewerStore.remoteRender();
104
107
  },
105
108
  });
106
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
107
- get: () => dataStyleStore.meshEdgesVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
109
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
110
+ get: () => dataStyleStore.meshEdgesVertexAttributeNoDataColor(id.value),
108
111
  set: async (newValue) => {
109
112
  await applyBatchStyle(id.value, (targetId: string) =>
110
113
  dataStyleStore.setMeshEdgesVertexAttributeNoDataColor(targetId, newValue),
@@ -155,8 +158,8 @@ const edge_attribute_color_map = computed<Map<string, RGBAColor>>({
155
158
  hybridViewerStore.remoteRender();
156
159
  },
157
160
  });
158
- const edge_attribute_no_data_color = computed<RGBAColor | undefined>({
159
- get: () => dataStyleStore.meshEdgesEdgeAttributeNoDataColor(id.value) as RGBAColor | undefined,
161
+ const edge_attribute_no_data_color = computed<RGBAColor>({
162
+ get: () => dataStyleStore.meshEdgesEdgeAttributeNoDataColor(id.value),
160
163
  set: async (newValue) => {
161
164
  await applyBatchStyle(id.value, (targetId: string) =>
162
165
  dataStyleStore.setMeshEdgesEdgeAttributeNoDataColor(targetId, newValue),
@@ -54,6 +54,9 @@ const coloring_style_key = computed<string>({
54
54
  const color = computed<RGBAColor | undefined>({
55
55
  get: () => dataStyleStore.meshPointsColor(id.value) as RGBAColor | undefined,
56
56
  set: async (newValue) => {
57
+ if (newValue === undefined) {
58
+ return;
59
+ }
57
60
  await applyBatchStyle(id.value, (targetId: string) =>
58
61
  dataStyleStore.setMeshPointsColor(targetId, newValue),
59
62
  );
@@ -103,8 +106,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
103
106
  hybridViewerStore.remoteRender();
104
107
  },
105
108
  });
106
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
107
- get: () => dataStyleStore.meshPointsVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
109
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
110
+ get: () => dataStyleStore.meshPointsVertexAttributeNoDataColor(id.value),
108
111
  set: async (newValue) => {
109
112
  await applyBatchStyle(id.value, (targetId: string) =>
110
113
  dataStyleStore.setMeshPointsVertexAttributeNoDataColor(targetId, newValue),
@@ -60,6 +60,9 @@ const coloring_style_key = computed<string>({
60
60
  const color = computed<RGBAColor | undefined>({
61
61
  get: () => dataStyleStore.meshPolygonsColor(id.value) as RGBAColor | undefined,
62
62
  set: async (newValue) => {
63
+ if (newValue === undefined) {
64
+ return;
65
+ }
63
66
  await applyBatchStyle(id.value, (targetId: string) =>
64
67
  dataStyleStore.setMeshPolygonsColor(targetId, newValue),
65
68
  );
@@ -69,6 +72,9 @@ const color = computed<RGBAColor | undefined>({
69
72
  const textures = computed<Texture[] | undefined>({
70
73
  get: () => dataStyleStore.meshPolygonsTextures(id.value) as Texture[] | undefined,
71
74
  set: async (newValue) => {
75
+ if (newValue === undefined) {
76
+ return;
77
+ }
72
78
  await applyBatchStyle(id.value, (targetId: string) =>
73
79
  dataStyleStore.setMeshPolygonsTextures(targetId, newValue),
74
80
  );
@@ -121,9 +127,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
121
127
  hybridViewerStore.remoteRender();
122
128
  },
123
129
  });
124
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
125
- get: () =>
126
- dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
130
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
131
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value),
127
132
  set: async (newValue) => {
128
133
  await applyBatchStyle(id.value, (targetId: string) =>
129
134
  dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
@@ -176,9 +181,8 @@ const polygon_attribute_color_map = computed<Map<string, RGBAColor>>({
176
181
  hybridViewerStore.remoteRender();
177
182
  },
178
183
  });
179
- const polygon_attribute_no_data_color = computed<RGBAColor | undefined>({
180
- get: () =>
181
- dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value) as RGBAColor | undefined,
184
+ const polygon_attribute_no_data_color = computed<RGBAColor>({
185
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value),
182
186
  set: async (newValue) => {
183
187
  await applyBatchStyle(id.value, (targetId: string) =>
184
188
  dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
@@ -44,6 +44,9 @@ const coloring_style_key = computed<string>({
44
44
  const color = computed<RGBAColor | undefined>({
45
45
  get: () => dataStyleStore.meshPolyhedraColor(id.value) as RGBAColor | undefined,
46
46
  set: async (newValue) => {
47
+ if (newValue === undefined) {
48
+ return;
49
+ }
47
50
  await applyBatchStyle(id.value, (targetId: string) =>
48
51
  dataStyleStore.setMeshPolyhedraColor(targetId, newValue),
49
52
  );
@@ -95,9 +98,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor>>({
95
98
  hybridViewerStore.remoteRender();
96
99
  },
97
100
  });
98
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
99
- get: () =>
100
- dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
101
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
102
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value),
101
103
  set: async (newValue) => {
102
104
  await applyBatchStyle(id.value, (targetId: string) =>
103
105
  dataStyleStore.setMeshPolyhedraVertexAttributeNoDataColor(targetId, newValue),
@@ -152,9 +154,8 @@ const polyhedron_attribute_color_map = computed<Map<string, RGBAColor>>({
152
154
  hybridViewerStore.remoteRender();
153
155
  },
154
156
  });
155
- const polyhedron_attribute_no_data_color = computed<RGBAColor | undefined>({
156
- get: () =>
157
- dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value) as RGBAColor | undefined,
157
+ const polyhedron_attribute_no_data_color = computed<RGBAColor>({
158
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value),
158
159
  set: async (newValue) => {
159
160
  await applyBatchStyle(id.value, (targetId: string) =>
160
161
  dataStyleStore.setMeshPolyhedraPolyhedronAttributeNoDataColor(targetId, newValue),
@@ -44,7 +44,7 @@ const blocksVisibility = computed<boolean>({
44
44
  const blockVisibility = computed<boolean | undefined>({
45
45
  get: () => dataStyleStore.modelBlockVisibility(modelId, blockId) as boolean | undefined,
46
46
  set: async (newValue) => {
47
- if (blockId === undefined) {
47
+ if (newValue === undefined || blockId === undefined) {
48
48
  return;
49
49
  }
50
50
  await dataStyleStore.setModelBlocksVisibility(modelId, [blockId], newValue);
@@ -154,11 +154,8 @@ const blocksVertexAttributeColorMap = computed<Map<string, RGBAColor> | undefine
154
154
  },
155
155
  });
156
156
 
157
- const blocksVertexAttributeNoDataColor = computed<RGBAColor | undefined>({
158
- get: () =>
159
- dataStyleStore.modelBlocksVertexAttributeNoDataColor(modelId, referenceBlockId.value) as
160
- | RGBAColor
161
- | undefined,
157
+ const blocksVertexAttributeNoDataColor = computed<RGBAColor>({
158
+ get: () => dataStyleStore.modelBlocksVertexAttributeNoDataColor(modelId, referenceBlockId.value),
162
159
  set: async (newValue) => {
163
160
  await dataStyleStore.setModelBlocksVertexAttributeNoDataColor(
164
161
  modelId,
@@ -217,11 +214,9 @@ const blocksPolyhedronAttributeColorMap = computed<Map<string, RGBAColor> | unde
217
214
  },
218
215
  });
219
216
 
220
- const blocksPolyhedronAttributeNoDataColor = computed<RGBAColor | undefined>({
217
+ const blocksPolyhedronAttributeNoDataColor = computed<RGBAColor>({
221
218
  get: () =>
222
- dataStyleStore.modelBlocksPolyhedronAttributeNoDataColor(modelId, referenceBlockId.value) as
223
- | RGBAColor
224
- | undefined,
219
+ dataStyleStore.modelBlocksPolyhedronAttributeNoDataColor(modelId, referenceBlockId.value),
225
220
  set: async (newValue) => {
226
221
  await dataStyleStore.setModelBlocksPolyhedronAttributeNoDataColor(
227
222
  modelId,
@@ -278,9 +273,8 @@ const vertexAttributeColorMap = computed<Map<string, RGBAColor> | undefined>({
278
273
  },
279
274
  });
280
275
 
281
- const vertexAttributeNoDataColor = computed<RGBAColor | undefined>({
282
- get: () =>
283
- dataStyleStore.modelBlocksVertexAttributeNoDataColor(modelId, blockId) as RGBAColor | undefined,
276
+ const vertexAttributeNoDataColor = computed<RGBAColor>({
277
+ get: () => dataStyleStore.modelBlocksVertexAttributeNoDataColor(modelId, blockId),
284
278
  set: async (newValue) => {
285
279
  if (blockId === undefined) {
286
280
  return;
@@ -340,11 +334,8 @@ const polyhedronAttributeColorMap = computed<Map<string, RGBAColor> | undefined>
340
334
  },
341
335
  });
342
336
 
343
- const polyhedronAttributeNoDataColor = computed<RGBAColor | undefined>({
344
- get: () =>
345
- dataStyleStore.modelBlocksPolyhedronAttributeNoDataColor(modelId, blockId) as
346
- | RGBAColor
347
- | undefined,
337
+ const polyhedronAttributeNoDataColor = computed<RGBAColor>({
338
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeNoDataColor(modelId, blockId),
348
339
  set: async (newValue) => {
349
340
  if (blockId === undefined) {
350
341
  return;
@@ -44,7 +44,7 @@ const cornersVisibility = computed<boolean>({
44
44
  const cornerVisibility = computed<boolean | undefined>({
45
45
  get: () => dataStyleStore.modelCornerVisibility(modelId, cornerId) as boolean | undefined,
46
46
  set: async (newValue) => {
47
- if (cornerId === undefined) {
47
+ if (newValue === undefined || cornerId === undefined) {
48
48
  return;
49
49
  }
50
50
  await dataStyleStore.setModelCornersVisibility(modelId, [cornerId], newValue);
@@ -156,11 +156,9 @@ const cornersVertexAttributeColorMap = computed<ColorMap | undefined>({
156
156
  },
157
157
  });
158
158
 
159
- const cornersVertexAttributeNoDataColor = computed<RGBAColor | undefined>({
159
+ const cornersVertexAttributeNoDataColor = computed<RGBAColor>({
160
160
  get: () =>
161
- dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, referenceCornerId.value) as
162
- | RGBAColor
163
- | undefined,
161
+ dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, referenceCornerId.value),
164
162
  set: async (newValue) => {
165
163
  await dataStyleStore.setModelCornersVertexAttributeNoDataColor(
166
164
  modelId,
@@ -217,11 +215,8 @@ const vertexAttributeColorMap = computed<ColorMap | undefined>({
217
215
  },
218
216
  });
219
217
 
220
- const vertexAttributeNoDataColor = computed<RGBAColor | undefined>({
221
- get: () =>
222
- dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, cornerId) as
223
- | RGBAColor
224
- | undefined,
218
+ const vertexAttributeNoDataColor = computed<RGBAColor>({
219
+ get: () => dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, cornerId),
225
220
  set: async (newValue) => {
226
221
  if (cornerId === undefined) {
227
222
  return;
@@ -23,6 +23,9 @@ const id = computed(() => (itemProps.meta_data.modelId as string | undefined) ||
23
23
  const visibility = computed({
24
24
  get: () => dataStyleStore.modelEdgesVisibility(id.value),
25
25
  set: async (newValue) => {
26
+ if (newValue === undefined) {
27
+ return;
28
+ }
26
29
  await applyBatchStyle(id.value, (targetId: string) =>
27
30
  dataStyleStore.setModelEdgesVisibility(targetId, newValue),
28
31
  );
@@ -44,7 +44,7 @@ const linesVisibility = computed<boolean>({
44
44
  const lineVisibility = computed<boolean | undefined>({
45
45
  get: () => dataStyleStore.modelLineVisibility(modelId, lineId) as boolean | undefined,
46
46
  set: async (newValue) => {
47
- if (lineId === undefined) {
47
+ if (newValue === undefined || lineId === undefined) {
48
48
  return;
49
49
  }
50
50
  await dataStyleStore.setModelLinesVisibility(modelId, [lineId], newValue);
@@ -153,11 +153,8 @@ const linesVertexAttributeColorMap = computed<RGBAColorMap | undefined>({
153
153
  },
154
154
  });
155
155
 
156
- const linesVertexAttributeNoDataColor = computed<RGBAColor | undefined>({
157
- get: () =>
158
- dataStyleStore.modelLinesVertexAttributeNoDataColor(modelId, referenceLineId.value) as
159
- | RGBAColor
160
- | undefined,
156
+ const linesVertexAttributeNoDataColor = computed<RGBAColor>({
157
+ get: () => dataStyleStore.modelLinesVertexAttributeNoDataColor(modelId, referenceLineId.value),
161
158
  set: async (newValue) => {
162
159
  await dataStyleStore.setModelLinesVertexAttributeNoDataColor(modelId, targetLineIds, newValue);
163
160
  hybridViewerStore.remoteRender();
@@ -203,11 +200,8 @@ const linesEdgeAttributeColorMap = computed<Map<string, RGBAColor> | undefined>(
203
200
  },
204
201
  });
205
202
 
206
- const linesEdgeAttributeNoDataColor = computed<RGBAColor | undefined>({
207
- get: () =>
208
- dataStyleStore.modelLinesEdgeAttributeNoDataColor(modelId, referenceLineId.value) as
209
- | RGBAColor
210
- | undefined,
203
+ const linesEdgeAttributeNoDataColor = computed<RGBAColor>({
204
+ get: () => dataStyleStore.modelLinesEdgeAttributeNoDataColor(modelId, referenceLineId.value),
211
205
  set: async (newValue) => {
212
206
  await dataStyleStore.setModelLinesEdgeAttributeNoDataColor(modelId, targetLineIds, newValue);
213
207
  hybridViewerStore.remoteRender();
@@ -260,9 +254,8 @@ const vertexAttributeColorMap = computed<ColorMap | undefined>({
260
254
  },
261
255
  });
262
256
 
263
- const vertexAttributeNoDataColor = computed<RGBAColor | undefined>({
264
- get: () =>
265
- dataStyleStore.modelLinesVertexAttributeNoDataColor(modelId, lineId) as RGBAColor | undefined,
257
+ const vertexAttributeNoDataColor = computed<RGBAColor>({
258
+ get: () => dataStyleStore.modelLinesVertexAttributeNoDataColor(modelId, lineId),
266
259
  set: async (newValue) => {
267
260
  if (lineId === undefined) {
268
261
  return;
@@ -317,9 +310,8 @@ const edgeAttributeColorMap = computed<Map<string, RGBAColor> | undefined>({
317
310
  },
318
311
  });
319
312
 
320
- const edgeAttributeNoDataColor = computed<RGBAColor | undefined>({
321
- get: () =>
322
- dataStyleStore.modelLinesEdgeAttributeNoDataColor(modelId, lineId) as RGBAColor | undefined,
313
+ const edgeAttributeNoDataColor = computed<RGBAColor>({
314
+ get: () => dataStyleStore.modelLinesEdgeAttributeNoDataColor(modelId, lineId),
323
315
  set: async (newValue) => {
324
316
  if (lineId === undefined) {
325
317
  return;
@@ -160,11 +160,9 @@ const surfacesVertexAttributeColorMap = computed<Map<string, RGBAColor> | undefi
160
160
  },
161
161
  });
162
162
 
163
- const surfacesVertexAttributeNoDataColor = computed<RGBAColor | undefined>({
163
+ const surfacesVertexAttributeNoDataColor = computed<RGBAColor>({
164
164
  get: () =>
165
- dataStyleStore.modelSurfacesVertexAttributeNoDataColor(modelId, referenceSurfaceId.value) as
166
- | RGBAColor
167
- | undefined,
165
+ dataStyleStore.modelSurfacesVertexAttributeNoDataColor(modelId, referenceSurfaceId.value),
168
166
  set: async (newValue) => {
169
167
  await dataStyleStore.setModelSurfacesVertexAttributeNoDataColor(
170
168
  modelId,
@@ -224,11 +222,9 @@ const surfacesPolygonAttributeColorMap = computed<Map<string, RGBAColor> | undef
224
222
  },
225
223
  });
226
224
 
227
- const surfacesPolygonAttributeNoDataColor = computed<RGBAColor | undefined>({
225
+ const surfacesPolygonAttributeNoDataColor = computed<RGBAColor>({
228
226
  get: () =>
229
- dataStyleStore.modelSurfacesPolygonAttributeNoDataColor(modelId, referenceSurfaceId.value) as
230
- | RGBAColor
231
- | undefined,
227
+ dataStyleStore.modelSurfacesPolygonAttributeNoDataColor(modelId, referenceSurfaceId.value),
232
228
  set: async (newValue) => {
233
229
  await dataStyleStore.setModelSurfacesPolygonAttributeNoDataColor(
234
230
  modelId,
@@ -290,11 +286,8 @@ const vertexAttributeColorMap = computed<Map<string, RGBAColor> | undefined>({
290
286
  },
291
287
  });
292
288
 
293
- const vertexAttributeNoDataColor = computed<RGBAColor | undefined>({
294
- get: () =>
295
- dataStyleStore.modelSurfacesVertexAttributeNoDataColor(modelId, surfaceId) as
296
- | RGBAColor
297
- | undefined,
289
+ const vertexAttributeNoDataColor = computed<RGBAColor>({
290
+ get: () => dataStyleStore.modelSurfacesVertexAttributeNoDataColor(modelId, surfaceId),
298
291
  set: async (newValue) => {
299
292
  if (surfaceId === undefined) {
300
293
  return;
@@ -354,11 +347,8 @@ const polygonAttributeColorMap = computed<Map<string, RGBAColor> | undefined>({
354
347
  },
355
348
  });
356
349
 
357
- const polygonAttributeNoDataColor = computed<RGBAColor | undefined>({
358
- get: () =>
359
- dataStyleStore.modelSurfacesPolygonAttributeNoDataColor(modelId, surfaceId) as
360
- | RGBAColor
361
- | undefined,
350
+ const polygonAttributeNoDataColor = computed<RGBAColor>({
351
+ get: () => dataStyleStore.modelSurfacesPolygonAttributeNoDataColor(modelId, surfaceId),
362
352
  set: async (newValue) => {
363
353
  if (surfaceId === undefined) {
364
354
  return;
@@ -212,10 +212,6 @@ function getLeafViewerIds(item: CollectionTreeItem): number[] {
212
212
  const actualItem = item.raw || item;
213
213
  return extractIds(actualItem);
214
214
  }
215
-
216
- function getLeafViewerIdsForFocus(item: CollectionTreeItem): string[] {
217
- return getLeafViewerIds(item) as unknown as string[];
218
- }
219
215
  </script>
220
216
 
221
217
  <template>
@@ -272,7 +268,7 @@ function getLeafViewerIdsForFocus(item: CollectionTreeItem): string[] {
272
268
  @click.stop="
273
269
  hybridViewerStore.focusCameraOnObject(
274
270
  id,
275
- getLeafViewerIdsForFocus(item as unknown as CollectionTreeItem),
271
+ getLeafViewerIds(item as unknown as CollectionTreeItem),
276
272
  )
277
273
  "
278
274
  />
@@ -26,6 +26,9 @@ const id = toRef(() => itemProps.id);
26
26
  const visibility = computed({
27
27
  get: () => dataStyleStore.meshPointsVisibility(id.value),
28
28
  set: async (newValue) => {
29
+ if (newValue === undefined) {
30
+ return;
31
+ }
29
32
  await applyBatchStyle(id.value, (targetId: string) =>
30
33
  dataStyleStore.setMeshPointsVisibility(targetId, newValue),
31
34
  );
@@ -35,6 +38,9 @@ const visibility = computed({
35
38
  const size = computed({
36
39
  get: () => dataStyleStore.meshPointsSize(id.value),
37
40
  set: async (newValue) => {
41
+ if (newValue === undefined) {
42
+ return;
43
+ }
38
44
  await applyBatchStyle(id.value, (targetId: string) =>
39
45
  dataStyleStore.setMeshPointsSize(targetId, newValue),
40
46
  );
@@ -53,6 +59,9 @@ const coloring_style_key = computed({
53
59
  const color = computed<RGBAColor | undefined>({
54
60
  get: () => dataStyleStore.meshPointsColor(id.value) as RGBAColor | undefined,
55
61
  set: async (newValue) => {
62
+ if (newValue === undefined) {
63
+ return;
64
+ }
56
65
  await applyBatchStyle(id.value, (targetId: string) =>
57
66
  dataStyleStore.setMeshPointsColor(targetId, newValue),
58
67
  );
@@ -102,8 +111,8 @@ const vertex_attribute_color_map = computed({
102
111
  hybridViewerStore.remoteRender();
103
112
  },
104
113
  });
105
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
106
- get: () => dataStyleStore.meshPointsVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
114
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
115
+ get: () => dataStyleStore.meshPointsVertexAttributeNoDataColor(id.value),
107
116
  set: async (newValue) => {
108
117
  await applyBatchStyle(id.value, (targetId: string) =>
109
118
  dataStyleStore.setMeshPointsVertexAttributeNoDataColor(targetId, newValue),
@@ -44,6 +44,9 @@ const coloring_style_key = computed<string>({
44
44
  const color = computed<RGBAColor | undefined>({
45
45
  get: () => dataStyleStore.meshPolyhedraColor(id.value) as RGBAColor | undefined,
46
46
  set: async (newValue) => {
47
+ if (newValue === undefined) {
48
+ return;
49
+ }
47
50
  await applyBatchStyle(id.value, (targetId: string) =>
48
51
  dataStyleStore.setMeshPolyhedraColor(targetId, newValue),
49
52
  );
@@ -95,9 +98,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>(
95
98
  hybridViewerStore.remoteRender();
96
99
  },
97
100
  });
98
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
99
- get: () =>
100
- dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
101
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
102
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value),
101
103
  set: async (newValue) => {
102
104
  await applyBatchStyle(id.value, (targetId: string) =>
103
105
  dataStyleStore.setMeshPolyhedraVertexAttributeNoDataColor(targetId, newValue),
@@ -152,9 +154,8 @@ const polyhedron_attribute_color_map = computed<Map<string, RGBAColor> | undefin
152
154
  hybridViewerStore.remoteRender();
153
155
  },
154
156
  });
155
- const polyhedron_attribute_no_data_color = computed<RGBAColor | undefined>({
156
- get: () =>
157
- dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value) as RGBAColor | undefined,
157
+ const polyhedron_attribute_no_data_color = computed<RGBAColor>({
158
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value),
158
159
  set: async (newValue) => {
159
160
  await applyBatchStyle(id.value, (targetId: string) =>
160
161
  dataStyleStore.setMeshPolyhedraPolyhedronAttributeNoDataColor(targetId, newValue),
@@ -49,6 +49,9 @@ const coloring_style_key = computed<string>({
49
49
  const color = computed<RGBAColor | undefined>({
50
50
  get: () => dataStyleStore.meshPolygonsColor(id.value) as RGBAColor | undefined,
51
51
  set: async (newValue) => {
52
+ if (newValue === undefined) {
53
+ return;
54
+ }
52
55
  await applyBatchStyle(id.value, (targetId: string) =>
53
56
  dataStyleStore.setMeshPolygonsColor(targetId, newValue),
54
57
  );
@@ -58,6 +61,9 @@ const color = computed<RGBAColor | undefined>({
58
61
  const textures = computed<Texture[] | undefined>({
59
62
  get: () => dataStyleStore.meshPolygonsTextures(id.value) as Texture[] | undefined,
60
63
  set: async (newValue) => {
64
+ if (newValue === undefined) {
65
+ return;
66
+ }
61
67
  await applyBatchStyle(id.value, (targetId: string) =>
62
68
  dataStyleStore.setMeshPolygonsTextures(targetId, newValue),
63
69
  );
@@ -109,9 +115,8 @@ const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>(
109
115
  hybridViewerStore.remoteRender();
110
116
  },
111
117
  });
112
- const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
113
- get: () =>
114
- dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value) as RGBAColor | undefined,
118
+ const vertex_attribute_no_data_color = computed<RGBAColor>({
119
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value),
115
120
  set: async (newValue) => {
116
121
  await applyBatchStyle(id.value, (targetId: string) =>
117
122
  dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
@@ -164,9 +169,8 @@ const polygon_attribute_color_map = computed<Map<string, RGBAColor> | undefined>
164
169
  hybridViewerStore.remoteRender();
165
170
  },
166
171
  });
167
- const polygon_attribute_no_data_color = computed<RGBAColor | undefined>({
168
- get: () =>
169
- dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value) as RGBAColor | undefined,
172
+ const polygon_attribute_no_data_color = computed<RGBAColor>({
173
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value),
170
174
  set: async (newValue) => {
171
175
  await applyBatchStyle(id.value, (targetId: string) =>
172
176
  dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
@@ -1,12 +1,13 @@
1
- import type { JsonRpcSchema } from "@ogw_shared/utils/types";
1
+ import type { ParamsOf } from "@ogw_shared/utils/types";
2
2
  import { consola } from "consola";
3
3
  import { useDataStore } from "@ogw_front/stores/data";
4
4
  import { useViewerStore } from "@ogw_front/stores/viewer";
5
- import vtk_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
5
+ import vtk_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
6
6
 
7
7
  const HOVER_DELAY = 200;
8
8
 
9
9
  type HighlightType = "mesh" | "model";
10
+ type HighlightSchema = (typeof vtk_schemas)["opengeodeweb_viewer"][HighlightType]["highlight"];
10
11
  type BlockIdsProvider = readonly number[] | (() => readonly number[] | Promise<readonly number[]>);
11
12
 
12
13
  export function useHoverhighlight(): {
@@ -88,8 +89,8 @@ export function useHoverhighlight(): {
88
89
  type: HighlightType,
89
90
  id: string,
90
91
  request: {
91
- schema: JsonRpcSchema;
92
- params?: Record<string, unknown>;
92
+ schema: HighlightSchema;
93
+ params?: ParamsOf<HighlightSchema>;
93
94
  timeout?: number;
94
95
  },
95
96
  ): Promise<void> {