@geode/opengeodeweb-front 10.43.2 → 10.44.0-rc.10

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 (254) 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/scripts.js +34 -23
  5. package/.build/server/utils/typed_handler.js +5 -1
  6. package/.build/server/utils/ws_client.js +7 -2
  7. package/.build/shared/utils/fetch_raw.js +2 -2
  8. package/.build/shared/utils/parse_boolean.js +2 -1
  9. package/app/assets/geode_objects.ts +1 -0
  10. package/app/components/BasemapAttribution.vue +28 -0
  11. package/app/components/ClippingPlanes.vue +22 -78
  12. package/app/components/CrsSelector.vue +53 -46
  13. package/app/components/DragAndDrop.vue +16 -79
  14. package/app/components/FeedBack/Snackers.vue +27 -0
  15. package/app/components/FileSelector.vue +9 -6
  16. package/app/components/HybridViewerTooltip.vue +8 -2
  17. package/app/components/MissingFilesSelector.vue +40 -23
  18. package/app/components/ObjectSelector.vue +34 -20
  19. package/app/components/ProjectCrs.vue +37 -0
  20. package/app/components/Screenshot.vue +17 -59
  21. package/app/components/ThresholdCard.vue +205 -0
  22. package/app/components/ThresholdFilter.vue +81 -216
  23. package/app/components/ViewToolbar.vue +15 -231
  24. package/app/components/Viewer/Basemap/CropOptions.vue +50 -0
  25. package/app/components/Viewer/Basemap/OpacityOptions.vue +52 -0
  26. package/app/components/Viewer/ContextMenu/CircularItems.vue +1 -2
  27. package/app/components/Viewer/ContextMenu/ContextMenu.vue +11 -6
  28. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -7
  29. package/app/components/Viewer/ContextMenu/InfoCard.vue +30 -0
  30. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  31. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  32. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +221 -0
  33. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  34. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  35. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  36. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +13 -0
  37. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +227 -0
  38. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  39. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  40. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  41. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +14 -12
  42. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  43. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  44. package/app/components/Viewer/Generic/Model/CornersOptions.vue +15 -294
  45. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  46. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  47. package/app/components/Viewer/Generic/Model/LinesOptions.vue +15 -427
  48. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  49. package/app/components/Viewer/Generic/Model/ModelCardTabs.vue +35 -0
  50. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +34 -25
  51. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +34 -25
  52. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +17 -5
  53. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -12
  54. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  55. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +71 -1
  56. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +55 -10
  57. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  58. package/app/components/Viewer/Options/AttributeSelector.vue +40 -136
  59. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  60. package/app/components/Viewer/Options/ColoringTypeSelector.vue +48 -74
  61. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  62. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  63. package/app/components/Viewer/Options/Sliders/Opacity.vue +22 -0
  64. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +13 -0
  65. package/app/components/Viewer/Scene/BackgroundOptions.vue +37 -0
  66. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +48 -0
  67. package/app/components/Viewer/Scene/TextOptions.vue +63 -0
  68. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  69. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  70. package/app/components/Viewer/Surface/PolygonsColoring.vue +224 -0
  71. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  72. package/app/components/Viewer/Ui.vue +9 -0
  73. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  74. package/app/composables/attribute_coloring_style.ts +8 -2
  75. package/app/composables/attribute_selector.ts +126 -0
  76. package/app/composables/batch_style_model.ts +34 -0
  77. package/app/composables/clipping_slices.ts +166 -0
  78. package/app/composables/global_attribute_style.ts +4 -3
  79. package/app/composables/hover_highlight.ts +19 -18
  80. package/app/composables/live_data_item.ts +39 -0
  81. package/app/composables/model_tabs.ts +86 -0
  82. package/app/composables/overlapping_picker_menu.ts +43 -0
  83. package/app/composables/project_manager.ts +5 -81
  84. package/app/composables/project_manager_helpers/reset.ts +34 -0
  85. package/app/composables/project_manager_helpers/restore.ts +67 -0
  86. package/app/composables/project_manager_helpers/types.ts +24 -0
  87. package/app/composables/project_manager_helpers/viewer_session.ts +25 -0
  88. package/app/composables/stepper_tree.ts +10 -2
  89. package/app/composables/tree_filter.ts +11 -2
  90. package/app/composables/tree_keyboard_nav.ts +4 -2
  91. package/app/composables/use_overlapping_picker.ts +30 -42
  92. package/app/composables/view_toolbar_options.ts +126 -0
  93. package/app/composables/view_toolbar_tool_options.ts +115 -0
  94. package/app/composables/view_toolbar_tools.ts +108 -0
  95. package/app/composables/viewer_context_menu.ts +19 -1
  96. package/app/composables/virtual_tree.ts +20 -131
  97. package/app/composables/virtual_tree_flatten.ts +109 -0
  98. package/app/composables/virtual_tree_types.ts +81 -0
  99. package/app/stores/app.ts +8 -55
  100. package/app/stores/app_helpers/extension.ts +90 -51
  101. package/app/stores/app_helpers/registry.ts +69 -0
  102. package/app/stores/basemap.ts +52 -0
  103. package/app/stores/basemap_detail.ts +51 -0
  104. package/app/stores/basemap_helpers/builds.ts +158 -0
  105. package/app/stores/basemap_helpers/detail_layers.ts +72 -0
  106. package/app/stores/basemap_helpers/detail_map.ts +62 -0
  107. package/app/stores/basemap_helpers/detail_refresh.ts +134 -0
  108. package/app/stores/basemap_helpers/detail_view.ts +94 -0
  109. package/app/stores/basemap_helpers/extent.ts +40 -0
  110. package/app/stores/basemap_helpers/georeferenced.ts +50 -0
  111. package/app/stores/basemap_helpers/layers.ts +66 -0
  112. package/app/stores/basemap_helpers/settings.ts +87 -0
  113. package/app/stores/basemap_helpers/viewer.ts +114 -0
  114. package/app/stores/crs.ts +136 -0
  115. package/app/stores/data.ts +24 -1
  116. package/app/stores/data_style.ts +8 -0
  117. package/app/stores/feedback.ts +12 -2
  118. package/app/stores/hybrid_viewer.ts +1 -1
  119. package/app/stores/infra.ts +26 -21
  120. package/app/stores/menu.ts +8 -124
  121. package/app/stores/menu_helpers/basemap.ts +10 -0
  122. package/app/stores/menu_helpers/menus_data.ts +27 -0
  123. package/app/stores/menu_helpers/mesh/edged_curve.ts +12 -0
  124. package/app/stores/menu_helpers/mesh/grid.ts +24 -0
  125. package/app/stores/menu_helpers/mesh/point_set.ts +11 -0
  126. package/app/stores/menu_helpers/mesh/solid.ts +29 -0
  127. package/app/stores/menu_helpers/mesh/surface.ts +22 -0
  128. package/app/stores/menu_helpers/model.ts +25 -0
  129. package/app/stores/menu_helpers/scene.ts +10 -0
  130. package/app/stores/menu_helpers/types.ts +5 -0
  131. package/app/stores/treeview.ts +17 -10
  132. package/app/stores/viewer.ts +17 -79
  133. package/app/stores/viewer_helpers/actions.ts +68 -0
  134. package/app/stores/viewer_helpers/request.ts +61 -0
  135. package/app/utils/basemap_tree.ts +76 -0
  136. package/app/utils/clipping_planes.ts +4 -131
  137. package/app/utils/clipping_planes_scene.ts +131 -0
  138. package/app/utils/color_picker.ts +18 -15
  139. package/app/utils/coloring_styles.ts +101 -0
  140. package/app/utils/crs.ts +38 -0
  141. package/app/utils/default_styles/constants.ts +10 -0
  142. package/app/utils/default_styles/index.ts +17 -1
  143. package/app/utils/default_styles/mesh_components.ts +168 -0
  144. package/app/utils/default_styles/meshes.ts +13 -153
  145. package/app/utils/default_styles/model_components.ts +170 -0
  146. package/app/utils/default_styles/models.ts +16 -153
  147. package/app/utils/drag_and_drop.ts +80 -0
  148. package/app/utils/extension.ts +1 -1
  149. package/app/utils/import_workflow.ts +26 -11
  150. package/app/utils/model_component_coloring.ts +46 -0
  151. package/app/utils/threshold.ts +33 -0
  152. package/app/utils/threshold_sources.ts +51 -0
  153. package/app/utils/treeview.ts +12 -1
  154. package/app/utils/upload_path.ts +15 -9
  155. package/app/utils/visible_map_area.ts +129 -0
  156. package/internal/database/base_database.ts +2 -0
  157. package/internal/database/database.ts +47 -29
  158. package/internal/database/tables/scene_style.ts +6 -0
  159. package/internal/stores/data_style/mesh/base_style.ts +74 -0
  160. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  161. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  162. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  163. package/internal/stores/data_style/mesh/cells/color.ts +3 -1
  164. package/internal/stores/data_style/mesh/cells/index.ts +17 -1
  165. package/internal/stores/data_style/mesh/cells/opacity.ts +54 -0
  166. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  167. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  168. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  169. package/internal/stores/data_style/mesh/edges/color.ts +3 -1
  170. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  171. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  172. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  173. package/internal/stores/data_style/mesh/edges/index.ts +17 -1
  174. package/internal/stores/data_style/mesh/edges/opacity.ts +54 -0
  175. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  176. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  177. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  178. package/internal/stores/data_style/mesh/index.ts +2 -57
  179. package/internal/stores/data_style/mesh/points/color.ts +3 -1
  180. package/internal/stores/data_style/mesh/points/index.ts +17 -1
  181. package/internal/stores/data_style/mesh/points/opacity.ts +54 -0
  182. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  183. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  184. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  185. package/internal/stores/data_style/mesh/polygons/color.ts +3 -1
  186. package/internal/stores/data_style/mesh/polygons/index.ts +17 -1
  187. package/internal/stores/data_style/mesh/polygons/opacity.ts +54 -0
  188. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  189. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  190. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  191. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  192. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  193. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  194. package/internal/stores/data_style/mesh/polyhedra/color.ts +3 -1
  195. package/internal/stores/data_style/mesh/polyhedra/index.ts +17 -1
  196. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +54 -0
  197. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  198. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  199. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  200. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  201. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  202. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  203. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  204. package/internal/stores/data_style/model/blocks/color.ts +58 -57
  205. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  206. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  207. package/internal/stores/data_style/model/blocks/polyhedron.ts +102 -54
  208. package/internal/stores/data_style/model/blocks/vertex.ts +102 -54
  209. package/internal/stores/data_style/model/color.ts +25 -26
  210. package/internal/stores/data_style/model/common.ts +10 -119
  211. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  212. package/internal/stores/data_style/model/corners/index.ts +85 -78
  213. package/internal/stores/data_style/model/corners/vertex.ts +97 -49
  214. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  215. package/internal/stores/data_style/model/lines/color.ts +53 -40
  216. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  217. package/internal/stores/data_style/model/lines/edge.ts +102 -54
  218. package/internal/stores/data_style/model/lines/index.ts +10 -134
  219. package/internal/stores/data_style/model/lines/vertex.ts +102 -54
  220. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  221. package/internal/stores/data_style/model/surfaces/color.ts +68 -56
  222. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  223. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  224. package/internal/stores/data_style/model/surfaces/polygon.ts +94 -46
  225. package/internal/stores/data_style/model/surfaces/vertex.ts +94 -46
  226. package/internal/stores/data_style/model/visibility.ts +3 -156
  227. package/internal/stores/data_style/model/visibility_dispatch.ts +110 -0
  228. package/internal/stores/data_style/scene.ts +118 -0
  229. package/internal/stores/data_style/state.ts +5 -181
  230. package/internal/stores/data_style/state_shared.ts +199 -0
  231. package/internal/stores/data_style/types.ts +24 -1
  232. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  233. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  234. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  235. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  236. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  237. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  238. package/internal/stores/hybrid_viewer/highlight.ts +80 -63
  239. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  240. package/internal/stores/hybrid_viewer/scene.ts +34 -26
  241. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -1
  242. package/internal/utils/ws_client.ts +8 -1
  243. package/package.json +5 -5
  244. package/server/api/local/extensions/run.post.ts +6 -4
  245. package/server/api/local/extensions/upload.put.ts +47 -20
  246. package/server/utils/cleanup.ts +12 -2
  247. package/server/utils/microservices.ts +10 -102
  248. package/server/utils/microservices_process.ts +127 -0
  249. package/server/utils/scripts.ts +35 -30
  250. package/server/utils/typed_handler.ts +8 -1
  251. package/server/utils/ws_client.ts +15 -2
  252. package/shared/utils/fetch_raw.ts +2 -2
  253. package/shared/utils/parse_boolean.ts +4 -1
  254. package/app/components/Viewer/Options/OptionsSection.vue +0 -76
@@ -0,0 +1,24 @@
1
+ import type { ModelComponentRelationRecord, NewDataItem } from "@ogw_front/stores/data";
2
+ import type { BasemapSnapshot } from "@ogw_front/stores/basemap";
3
+ import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
+ import type { CameraSnapshot } from "@ogw_internal/stores/hybrid_viewer/camera";
5
+ import type { DataStyleSnapshot } from "@ogw_front/stores/data_style";
6
+ import type { ModelComponentRecord } from "@ogw_front/stores/data_helpers/mesh.js";
7
+ import type { TreeviewSnapshot } from "@ogw_front/stores/treeview";
8
+
9
+ interface ProjectDataSnapshot {
10
+ items: NewDataItem[];
11
+ modelComponents: ModelComponentRecord[];
12
+ modelComponentsRelations: ModelComponentRelationRecord[];
13
+ }
14
+
15
+ interface ProjectSnapshot {
16
+ treeview?: TreeviewSnapshot;
17
+ data?: ProjectDataSnapshot;
18
+ hybridViewer?: CameraSnapshot;
19
+ dataStyle?: DataStyleSnapshot;
20
+ crs?: { projectCrs?: CRSList };
21
+ basemap?: BasemapSnapshot;
22
+ }
23
+
24
+ export type { ProjectSnapshot };
@@ -0,0 +1,25 @@
1
+ import type { useViewerStore } from "@ogw_front/stores/viewer";
2
+
3
+ type ViewerClient = ReturnType<typeof useViewerStore>["client"];
4
+
5
+ async function releaseViewerDatabase(client: ViewerClient): Promise<void> {
6
+ if (
7
+ client !== undefined &&
8
+ client.getConnection !== undefined &&
9
+ client.getConnection().getSession !== undefined
10
+ ) {
11
+ await client.getConnection().getSession().call("opengeodeweb_viewer.release_database", [{}]);
12
+ }
13
+ }
14
+
15
+ async function importProjectToViewer(client: ViewerClient): Promise<void> {
16
+ if (
17
+ client !== undefined &&
18
+ client.getConnection !== undefined &&
19
+ client.getConnection().getSession !== undefined
20
+ ) {
21
+ await client.getConnection().getSession().call("opengeodeweb_viewer.import_project", [{}]);
22
+ }
23
+ }
24
+
25
+ export { importProjectToViewer, releaseViewerDatabase };
@@ -21,7 +21,11 @@ function build_initial_state_unref(
21
21
  const initial_state_unref: Record<string, unknown> = {};
22
22
  for (const [key, value] of Object.entries(initial_state)) {
23
23
  const unref_val: unknown = unref(value);
24
- initial_state_unref[key] = isUnknownArray(unref_val) ? [...unref_val] : unref_val;
24
+ if (isUnknownArray(unref_val)) {
25
+ initial_state_unref[key] = [...unref_val];
26
+ } else {
27
+ initial_state_unref[key] = unref_val;
28
+ }
25
29
  }
26
30
  return initial_state_unref;
27
31
  }
@@ -65,7 +69,11 @@ export function useStepperTree(
65
69
  state.current_step_index = 0;
66
70
  state.navigating_back = false;
67
71
  for (const [key, initial_val] of Object.entries(initial_state_unref)) {
68
- state[key] = isUnknownArray(initial_val) ? [...initial_val] : initial_val;
72
+ if (isUnknownArray(initial_val)) {
73
+ state[key] = [...initial_val];
74
+ } else {
75
+ state[key] = initial_val;
76
+ }
69
77
  }
70
78
  }
71
79
 
@@ -1,4 +1,4 @@
1
- import type { Ref } from "vue";
1
+ import type { ComputedRef, Ref } from "vue";
2
2
 
3
3
  // Same shape as Vue's MaybeRefOrGetter<T>, kept as a local alias for readability at call sites.
4
4
  type ReadonlyMaybeRefOrGetter<Value> = Value | Ref<Value> | (() => Value);
@@ -98,11 +98,20 @@ function sortAndFormatItems(
98
98
  return sorted;
99
99
  }
100
100
 
101
+ function toItemsRef(
102
+ itemsIn: ReadonlyMaybeRefOrGetter<readonly FilterableItem[]>,
103
+ ): ComputedRef<readonly FilterableItem[]> | Ref<readonly FilterableItem[]> {
104
+ if (typeof itemsIn === "function") {
105
+ return computed(itemsIn);
106
+ }
107
+ return toRef(itemsIn);
108
+ }
109
+
101
110
  function useTreeFilter(
102
111
  itemsIn: ReadonlyMaybeRefOrGetter<readonly FilterableItem[]>,
103
112
  options: TreeFilterOptions = {},
104
113
  ): UseTreeFilterReturn {
105
- const rawItems = typeof itemsIn === "function" ? computed(itemsIn) : toRef(itemsIn);
114
+ const rawItems = toItemsRef(itemsIn);
106
115
  const search = ref("");
107
116
  const sortType = ref(options.defaultSort ?? "name");
108
117
  const filterOptions = ref<Record<string, boolean>>({ ...options.defaultFilters });
@@ -82,8 +82,10 @@ export function useTreeKeyboardNav(
82
82
  return undefined;
83
83
  }
84
84
  const firstVisible = Math.max(0, Math.floor(info.scrollTop / info.itemHeight));
85
- const visibleCount =
86
- info.containerHeight > 0 ? Math.floor(info.containerHeight / info.itemHeight) : 1;
85
+ let visibleCount = 1;
86
+ if (info.containerHeight > 0) {
87
+ visibleCount = Math.floor(info.containerHeight / info.itemHeight);
88
+ }
87
89
  const lastVisible = Math.max(firstVisible, firstVisible + visibleCount - 1);
88
90
  return { firstVisible, lastVisible };
89
91
  }
@@ -2,6 +2,7 @@ import { ref } from "vue";
2
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
3
3
 
4
4
  import { type DataItem, useDataStore } from "@ogw_front/stores/data";
5
+ import { computeMenuPosition } from "@ogw_front/composables/overlapping_picker_menu";
5
6
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
6
7
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
8
 
@@ -21,6 +22,8 @@ interface ProposedItem {
21
22
  interface ViewerIdResult {
22
23
  id: string | undefined;
23
24
  viewer_id: number | undefined;
25
+ // True when objects were under the cursor but the user closed the picker without choosing
26
+ dismissed?: boolean;
24
27
  }
25
28
 
26
29
  interface GetViewerIdParams {
@@ -102,13 +105,7 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
102
105
  }
103
106
  }
104
107
 
105
- async function get_viewer_id({
106
- x,
107
- y,
108
- containerWidth,
109
- containerHeight,
110
- containerRect,
111
- }: GetViewerIdParams): Promise<ViewerIdResult> {
108
+ async function getViewableIds(): Promise<string[]> {
112
109
  const activeIds = new Set(dataItems.value.map((i: DataItem) => i.id));
113
110
  const visibleStyleIds = Object.keys(dataStyleStore.styles).filter(
114
111
  (styleId) => activeIds.has(styleId) && dataStyleStore.objectVisibility(styleId) === true,
@@ -123,15 +120,30 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
123
120
  }
124
121
  }),
125
122
  );
126
- const ids = viewableChecks.filter((id): id is string => Boolean(id));
123
+ return viewableChecks.filter((id): id is string => Boolean(id));
124
+ }
125
+
126
+ function showIntermediateMenu(
127
+ { x, y, containerWidth, containerHeight, containerRect }: GetViewerIdParams,
128
+ itemCount: number,
129
+ ): void {
130
+ const position = computeMenuPosition({ x, y, containerWidth, containerHeight, itemCount });
131
+ intermediateMenuX.value = containerRect.left + position.x;
132
+ intermediateMenuY.value = containerRect.top + position.y;
133
+ displayIntermediate.value = true;
134
+ }
135
+
136
+ async function get_viewer_id(params: GetViewerIdParams): Promise<ViewerIdResult> {
137
+ const ids = await getViewableIds();
127
138
 
128
- const result: ViewerIdResult = { id: undefined, viewer_id: undefined };
129
139
  const schema = viewer_schemas.opengeodeweb_viewer.viewer.picked_ids;
130
- const params = { x, y, ids };
131
- const { array_ids, viewer_id } = await viewerStore.request({ schema, params });
140
+ const { array_ids, viewer_id } = await viewerStore.request({
141
+ schema,
142
+ params: { x: params.x, y: params.y, ids },
143
+ });
132
144
 
133
145
  if (array_ids.length === 0) {
134
- return result;
146
+ return { id: undefined, viewer_id: undefined };
135
147
  }
136
148
 
137
149
  const pickedList: PickedItem[] = array_ids.map((pickId) => ({ id: pickId, viewer_id }));
@@ -142,41 +154,17 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
142
154
 
143
155
  const proposedItems = await fetchProposedItems(pickedList);
144
156
  intermediateItems.value = proposedItems;
145
-
146
- const yUI = containerHeight - y;
147
- const MENU_WIDTH = 340;
148
- const MENU_BASE_HEIGHT = 55;
149
- const MENU_ITEM_HEIGHT = 48;
150
- const MENU_HEIGHT = MENU_BASE_HEIGHT + proposedItems.length * MENU_ITEM_HEIGHT;
151
- const CLAMP_MARGIN = 10;
152
- const clampedX = Math.min(
153
- Math.max(x, CLAMP_MARGIN),
154
- containerWidth - MENU_WIDTH - CLAMP_MARGIN,
155
- );
156
- let clampedY = yUI;
157
- if (yUI + MENU_HEIGHT > containerHeight - CLAMP_MARGIN) {
158
- clampedY = Math.max(yUI - MENU_HEIGHT, CLAMP_MARGIN);
159
- } else {
160
- clampedY = Math.max(yUI, CLAMP_MARGIN);
161
- }
162
- clampedY = Math.min(
163
- Math.max(clampedY, CLAMP_MARGIN),
164
- containerHeight - MENU_HEIGHT - CLAMP_MARGIN,
165
- );
166
-
167
- intermediateMenuX.value = containerRect.left + clampedX;
168
- intermediateMenuY.value = containerRect.top + clampedY;
169
- displayIntermediate.value = true;
157
+ showIntermediateMenu(params, proposedItems.length);
170
158
 
171
159
  /* eslint-disable-next-line promise/avoid-new */
172
160
  return new Promise<ViewerIdResult>((resolve) => {
173
161
  resolveIntermediate = (chosenResult: ProposedItem | undefined): void => {
174
162
  displayIntermediate.value = false;
175
- resolve(
176
- chosenResult
177
- ? { id: chosenResult.id, viewer_id: chosenResult.viewer_id }
178
- : { id: undefined, viewer_id: undefined },
179
- );
163
+ if (chosenResult) {
164
+ resolve({ id: chosenResult.id, viewer_id: chosenResult.viewer_id });
165
+ } else {
166
+ resolve({ id: undefined, viewer_id: undefined, dismissed: true });
167
+ }
180
168
  };
181
169
  });
182
170
  }
@@ -0,0 +1,126 @@
1
+ import {
2
+ type CameraOptionAction,
3
+ controlOptions,
4
+ filterOptions,
5
+ panelOptions,
6
+ rulerOption,
7
+ } from "@ogw_front/composables/view_toolbar_tool_options";
8
+ import type { ViewToolbarTools } from "@ogw_front/composables/view_toolbar_tools";
9
+ import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
10
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
11
+ import { useViewerStore } from "@ogw_front/stores/viewer";
12
+
13
+ type HybridViewerStore = ReturnType<typeof useHybridViewerStore>;
14
+
15
+ function pickingOptions(
16
+ hybridViewerStore: HybridViewerStore,
17
+ tools: ViewToolbarTools,
18
+ ): CameraOptionAction[] {
19
+ return [
20
+ {
21
+ testId: "resetCameraButton",
22
+ tooltip: "Reset camera",
23
+ icon: "mdi-cube-scan",
24
+ action: (): void => {
25
+ hybridViewerStore.resetCamera();
26
+ },
27
+ },
28
+ {
29
+ testId: "centerOnClickButton",
30
+ tooltip: "Center on click",
31
+ icon: "mdi-crosshairs-question",
32
+ color: hybridViewerStore.is_picking ? "primary" : undefined,
33
+ action: (): void => {
34
+ tools.toggleTool(tools.is_picking);
35
+ },
36
+ },
37
+ {
38
+ testId: "zoomToBoxButton",
39
+ tooltip: "Zoom to box",
40
+ icon: "mdi-magnify-scan",
41
+ color: hybridViewerStore.is_zoom_box_active ? "primary" : undefined,
42
+ action: (): void => {
43
+ tools.toggleTool(tools.is_zoom_box_active);
44
+ },
45
+ },
46
+ ];
47
+ }
48
+
49
+ function hoverHighlightOption(
50
+ hybridViewerStore: HybridViewerStore,
51
+ tools: ViewToolbarTools,
52
+ ): CameraOptionAction {
53
+ return {
54
+ testId: "highlightOnHoverButton",
55
+ tooltip: "Highlight on hover",
56
+ icon: "mdi-cursor-default-click",
57
+ color: hybridViewerStore.is_hover_highlight ? "primary" : undefined,
58
+ action: hybridViewerStore.is_hover_highlight ? tools.stopHoverHighlight : undefined,
59
+ menu: [
60
+ {
61
+ title: "Cells",
62
+ testId: "highlightOnHoverCellsButton",
63
+ icon: "mdi-select-all",
64
+ action: (): void => {
65
+ tools.toggleHoverHighlight("CELL");
66
+ },
67
+ },
68
+ {
69
+ title: "Points",
70
+ testId: "highlightOnHoverPointsButton",
71
+ icon: "mdi-select-drag",
72
+ action: (): void => {
73
+ tools.toggleHoverHighlight("POINT");
74
+ },
75
+ },
76
+ ],
77
+ };
78
+ }
79
+
80
+ function gridScaleOption(
81
+ hybridViewerStore: HybridViewerStore,
82
+ viewerStore: ReturnType<typeof useViewerStore>,
83
+ gridScale: Ref<boolean>,
84
+ ): CameraOptionAction {
85
+ return {
86
+ testId: "gridScaleButton",
87
+ tooltip: "Toggle grid scale",
88
+ icon: "mdi-ruler-square",
89
+ color: gridScale.value ? "primary" : undefined,
90
+ action: (): void => {
91
+ const schema = schemas.opengeodeweb_viewer.viewer.grid_scale;
92
+ const params = { visibility: !gridScale.value };
93
+ void viewerStore.request(
94
+ {
95
+ schema,
96
+ params,
97
+ },
98
+ {
99
+ response_function: () => {
100
+ gridScale.value = !gridScale.value;
101
+ void hybridViewerStore.remoteRender();
102
+ },
103
+ },
104
+ );
105
+ },
106
+ };
107
+ }
108
+
109
+ // The buttons of the view toolbar
110
+ function useViewToolbarOptions(tools: ViewToolbarTools): ComputedRef<CameraOptionAction[]> {
111
+ const hybridViewerStore = useHybridViewerStore();
112
+ const viewerStore = useViewerStore();
113
+ const gridScale = ref<boolean>(false);
114
+
115
+ return computed<CameraOptionAction[]>(() => [
116
+ ...pickingOptions(hybridViewerStore, tools),
117
+ hoverHighlightOption(hybridViewerStore, tools),
118
+ ...panelOptions(tools),
119
+ gridScaleOption(hybridViewerStore, viewerStore, gridScale),
120
+ ...controlOptions(tools),
121
+ ...filterOptions(tools),
122
+ rulerOption(tools),
123
+ ]);
124
+ }
125
+
126
+ export { useViewToolbarOptions };
@@ -0,0 +1,115 @@
1
+ import CameraBookmarkIcon from "@ogw_front/assets/viewer_svgs/camera-bookmark.svg";
2
+ import type { ViewToolbarTools } from "@ogw_front/composables/view_toolbar_tools";
3
+
4
+ interface CameraOptionAction {
5
+ title?: string;
6
+ testId: string;
7
+ tooltip?: string;
8
+ icon: string;
9
+ iconSize?: number;
10
+ color?: string;
11
+ action?: () => void;
12
+ menu?: CameraOptionAction[];
13
+ }
14
+
15
+ // The buttons opening a panel
16
+ function panelOptions(tools: ViewToolbarTools): CameraOptionAction[] {
17
+ return [
18
+ {
19
+ testId: "cameraOrientationButton",
20
+ tooltip: "Camera orientation",
21
+ icon: "mdi-rotate-3d",
22
+ action: (): void => {
23
+ tools.toggleTool(tools.showCameraOrientation);
24
+ },
25
+ },
26
+ {
27
+ testId: "cameraManagerButton",
28
+ tooltip: "Manage camera positions",
29
+ icon: CameraBookmarkIcon,
30
+ iconSize: 34,
31
+ action: (): void => {
32
+ tools.toggleTool(tools.showCameraManager);
33
+ },
34
+ },
35
+ {
36
+ testId: "screenshotButton",
37
+ tooltip: "Take a screenshot",
38
+ icon: "mdi-camera",
39
+ action: (): void => {
40
+ tools.toggleTool(tools.showScreenshot);
41
+ },
42
+ },
43
+ ];
44
+ }
45
+
46
+ // The buttons opening the scene controls
47
+ function controlOptions(tools: ViewToolbarTools): CameraOptionAction[] {
48
+ return [
49
+ {
50
+ testId: "zScalingButton",
51
+ tooltip: "Z Scaling Control",
52
+ icon: "mdi-sort",
53
+ action: (): void => {
54
+ tools.toggleTool(tools.showZScaling);
55
+ },
56
+ },
57
+ {
58
+ testId: "clippingPlanesButton",
59
+ tooltip: "Clipping Planes",
60
+ icon: "mdi-content-cut",
61
+ color: tools.showClippingPlanes.value ? "primary" : undefined,
62
+ action: (): void => {
63
+ tools.toggleTool(tools.showClippingPlanes);
64
+ },
65
+ },
66
+ ];
67
+ }
68
+
69
+ // The buttons opening the filters
70
+ function filterOptions(tools: ViewToolbarTools): CameraOptionAction[] {
71
+ return [
72
+ {
73
+ testId: "shrinkFilterButton",
74
+ tooltip: "Shrink Filter",
75
+ icon: "mdi-arrow-collapse-all",
76
+ color: tools.showShrinkFilter.value ? "primary" : undefined,
77
+ action: (): void => {
78
+ tools.toggleTool(tools.showShrinkFilter);
79
+ },
80
+ },
81
+ {
82
+ testId: "explodeFilterButton",
83
+ tooltip: "Exploded View",
84
+ icon: "mdi-arrow-expand-all",
85
+ color: tools.showExplodeFilter.value ? "primary" : undefined,
86
+ action: (): void => {
87
+ tools.toggleTool(tools.showExplodeFilter);
88
+ },
89
+ },
90
+ {
91
+ testId: "thresholdFilterButton",
92
+ tooltip: "Threshold Filter",
93
+ icon: "mdi-filter-variant",
94
+ color: tools.showThresholdFilter.value ? "primary" : undefined,
95
+ action: (): void => {
96
+ tools.toggleTool(tools.showThresholdFilter);
97
+ },
98
+ },
99
+ ];
100
+ }
101
+
102
+ function rulerOption(tools: ViewToolbarTools): CameraOptionAction {
103
+ return {
104
+ testId: "rulerButton",
105
+ tooltip: "Ruler",
106
+ icon: "mdi-ruler",
107
+ color: tools.showRuler.value ? "primary" : undefined,
108
+ action: (): void => {
109
+ tools.toggleTool(tools.showRuler);
110
+ },
111
+ };
112
+ }
113
+
114
+ export { controlOptions, filterOptions, panelOptions, rulerOption };
115
+ export type { CameraOptionAction };
@@ -0,0 +1,108 @@
1
+ import type { PickedFieldType } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
2
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
3
+ import { useViewerStore } from "@ogw_front/stores/viewer";
4
+
5
+ interface ToolRefs {
6
+ showScreenshot: Ref<boolean>;
7
+ showCameraManager: Ref<boolean>;
8
+ showCameraOrientation: Ref<boolean>;
9
+ showZScaling: Ref<boolean>;
10
+ showClippingPlanes: Ref<boolean>;
11
+ showShrinkFilter: Ref<boolean>;
12
+ showExplodeFilter: Ref<boolean>;
13
+ showThresholdFilter: Ref<boolean>;
14
+ showRuler: Ref<boolean>;
15
+ }
16
+
17
+ interface ViewToolbarTools extends ToolRefs {
18
+ is_picking: Ref<boolean>;
19
+ is_zoom_box_active: Ref<boolean>;
20
+ stopHoverHighlight: () => void;
21
+ toggleTool: (toolRef: Ref<boolean>) => void;
22
+ toggleHoverHighlight: (fieldType: PickedFieldType) => void;
23
+ }
24
+
25
+ function createToolRefs(): ToolRefs {
26
+ return {
27
+ showScreenshot: ref<boolean>(false),
28
+ showCameraManager: ref<boolean>(false),
29
+ showCameraOrientation: ref<boolean>(false),
30
+ showZScaling: ref<boolean>(false),
31
+ showClippingPlanes: ref<boolean>(false),
32
+ showShrinkFilter: ref<boolean>(false),
33
+ showExplodeFilter: ref<boolean>(false),
34
+ showThresholdFilter: ref<boolean>(false),
35
+ showRuler: ref<boolean>(false),
36
+ };
37
+ }
38
+
39
+ function exclusiveTools(toolRefs: ToolRefs, pickingTools: Ref<boolean>[]): Ref<boolean>[] {
40
+ return [
41
+ toolRefs.showCameraOrientation,
42
+ toolRefs.showCameraManager,
43
+ toolRefs.showScreenshot,
44
+ toolRefs.showZScaling,
45
+ toolRefs.showClippingPlanes,
46
+ toolRefs.showShrinkFilter,
47
+ toolRefs.showExplodeFilter,
48
+ toolRefs.showThresholdFilter,
49
+ toolRefs.showRuler,
50
+ ...pickingTools,
51
+ ];
52
+ }
53
+
54
+ // The toolbar tools are exclusive: opening one closes the others
55
+ function useViewToolbarTools(): ViewToolbarTools {
56
+ const hybridViewerStore = useHybridViewerStore();
57
+ const viewerStore = useViewerStore();
58
+ const { is_picking, is_zoom_box_active } = storeToRefs(hybridViewerStore);
59
+ const { picking_mode } = storeToRefs(viewerStore);
60
+ const toolRefs = createToolRefs();
61
+ const allTools = exclusiveTools(toolRefs, [is_picking, is_zoom_box_active, picking_mode]);
62
+
63
+ function stopHoverHighlight(): void {
64
+ hybridViewerStore.is_hover_highlight = false;
65
+ hybridViewerStore.clearHoverHighlight();
66
+ }
67
+
68
+ function closeAllToolsExcept(toolRef: Ref<boolean>): void {
69
+ for (const tool of allTools) {
70
+ if (tool !== toolRef) {
71
+ tool.value = false;
72
+ }
73
+ }
74
+ if (toolRef !== toolRefs.showRuler) {
75
+ void nextTick(stopHoverHighlight);
76
+ }
77
+ }
78
+
79
+ function toggleTool(toolRef: Ref<boolean>): void {
80
+ closeAllToolsExcept(toolRef);
81
+ toolRef.value = !toolRef.value;
82
+ }
83
+
84
+ function toggleHoverHighlight(fieldType: PickedFieldType): void {
85
+ const activate =
86
+ !hybridViewerStore.is_hover_highlight ||
87
+ hybridViewerStore.hover_highlight_field_type !== fieldType;
88
+ closeAllToolsExcept(toolRefs.showRuler);
89
+ if (activate) {
90
+ hybridViewerStore.is_hover_highlight = true;
91
+ hybridViewerStore.hover_highlight_field_type = fieldType;
92
+ } else {
93
+ stopHoverHighlight();
94
+ }
95
+ }
96
+
97
+ return {
98
+ ...toolRefs,
99
+ is_picking,
100
+ is_zoom_box_active,
101
+ stopHoverHighlight,
102
+ toggleTool,
103
+ toggleHoverHighlight,
104
+ };
105
+ }
106
+
107
+ export { useViewToolbarTools };
108
+ export type { ViewToolbarTools };
@@ -1,5 +1,6 @@
1
1
  import { type MenuMetaData, useMenuStore } from "@ogw_front/stores/menu";
2
2
  import type { Ref, ShallowRef } from "vue";
3
+ import { BASEMAP_GROUP_ID } from "@ogw_front/utils/basemap_tree";
3
4
  import type { TreeMenuPayload } from "@ogw_front/utils/treeview";
4
5
  import type { ViewerIdResult } from "@ogw_front/composables/use_overlapping_picker";
5
6
  import { useDataStore } from "@ogw_front/stores/data";
@@ -14,10 +15,24 @@ interface MenuTarget {
14
15
  meta_data: MenuMetaData;
15
16
  }
16
17
 
18
+ const SCENE_MENU_TARGET: MenuTarget = {
19
+ id: "scene",
20
+ meta_data: { viewer_type: "scene", geode_object_type: "scene" },
21
+ };
22
+
17
23
  async function treeMenuTarget(
18
24
  dataStore: ReturnType<typeof useDataStore>,
19
25
  payload: TreeMenuPayload,
20
26
  ): Promise<MenuTarget | undefined> {
27
+ if (payload.context_type === "basemap") {
28
+ return {
29
+ id: payload.itemId,
30
+ meta_data: {
31
+ viewer_type: "basemap",
32
+ geode_object_type: payload.itemId === BASEMAP_GROUP_ID ? "Basemap" : "Map",
33
+ },
34
+ };
35
+ }
21
36
  if (payload.context_type === "geode_object_type") {
22
37
  const [referenceId] = payload.targetIds;
23
38
  if (referenceId === undefined) {
@@ -112,8 +127,11 @@ export function useViewerContextMenu(
112
127
  const rect = element.getBoundingClientRect();
113
128
  const x = event.clientX - rect.left;
114
129
  const yPicking = containerHeight.value - (event.clientY - rect.top);
115
- const { id: pickedId, viewer_id } = await viewerComponent.get_viewer_id(x, yPicking);
130
+ const { id: pickedId, viewer_id, dismissed } = await viewerComponent.get_viewer_id(x, yPicking);
116
131
  if (pickedId === undefined) {
132
+ if (dismissed !== true) {
133
+ openMenuAt(event, element, SCENE_MENU_TARGET);
134
+ }
117
135
  return;
118
136
  }
119
137
  openMenuAt(event, element, await viewerMenuTarget(dataStore, pickedId, viewer_id));