@geode/opengeodeweb-front 10.6.2 → 10.6.3-rc.1

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 (235) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/.oxlintrc.json +3 -22
  3. package/app/assets/geode_objects.js +26 -26
  4. package/app/components/Carousel.vue +62 -66
  5. package/app/components/CrsSelector.vue +48 -52
  6. package/app/components/DeleteDialog.vue +21 -37
  7. package/app/components/DragAndDrop.vue +35 -41
  8. package/app/components/ExtensionSelector.vue +50 -63
  9. package/app/components/FeedBack/ErrorBanner.vue +7 -10
  10. package/app/components/FeedBack/Snackers.vue +12 -14
  11. package/app/components/FetchingData.vue +1 -6
  12. package/app/components/FileSelector.vue +41 -47
  13. package/app/components/FileUploader.vue +62 -79
  14. package/app/components/GlassCard.vue +19 -19
  15. package/app/components/HybridRenderingView.vue +37 -38
  16. package/app/components/InfraConnected.vue +3 -3
  17. package/app/components/Inspector/InspectionButton.vue +27 -31
  18. package/app/components/Inspector/ResultPanel.vue +13 -24
  19. package/app/components/Launcher.vue +13 -13
  20. package/app/components/Loading.vue +63 -69
  21. package/app/components/MissingFilesSelector.vue +53 -73
  22. package/app/components/ObjectSelector.vue +81 -99
  23. package/app/components/PackagesVersions.vue +27 -30
  24. package/app/components/Recaptcha.vue +60 -71
  25. package/app/components/RemoteRenderingView.vue +102 -108
  26. package/app/components/Screenshot.vue +36 -42
  27. package/app/components/SearchBar.vue +5 -5
  28. package/app/components/Step.vue +37 -44
  29. package/app/components/Stepper.vue +29 -35
  30. package/app/components/VeaseViewToolbar.vue +69 -78
  31. package/app/components/ViewToolbar.vue +41 -45
  32. package/app/components/Viewer/BreadCrumb.vue +18 -30
  33. package/app/components/Viewer/ContextMenu.vue +176 -179
  34. package/app/components/Viewer/ContextMenuItem.vue +105 -117
  35. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +6 -9
  36. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +82 -93
  37. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +84 -99
  38. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +83 -98
  39. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +62 -73
  40. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -108
  41. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +82 -105
  42. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +19 -23
  43. package/app/components/Viewer/Generic/Model/PointsOptions.vue +26 -30
  44. package/app/components/Viewer/Grid/2D/CellsOptions.vue +5 -5
  45. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -9
  46. package/app/components/Viewer/Grid/2D/PointsOptions.vue +6 -9
  47. package/app/components/Viewer/Grid/3D/CellsOptions.vue +5 -5
  48. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -9
  49. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +5 -5
  50. package/app/components/Viewer/Grid/3D/PointsOptions.vue +6 -9
  51. package/app/components/Viewer/HybridSolid/EdgesOptions.vue +6 -9
  52. package/app/components/Viewer/HybridSolid/PointsOptions.vue +6 -9
  53. package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +6 -9
  54. package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +6 -9
  55. package/app/components/Viewer/Options/AttributeColorBar.vue +8 -8
  56. package/app/components/Viewer/Options/AttributeSelector.vue +73 -78
  57. package/app/components/Viewer/Options/ColorMapList.vue +115 -140
  58. package/app/components/Viewer/Options/ColorMapPicker.vue +128 -142
  59. package/app/components/Viewer/Options/ColorPicker.vue +9 -9
  60. package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -91
  61. package/app/components/Viewer/Options/TextureItem.vue +54 -58
  62. package/app/components/Viewer/Options/TexturesSelector.vue +22 -26
  63. package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
  64. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +61 -68
  65. package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +6 -9
  66. package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +6 -9
  67. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +83 -103
  68. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -9
  69. package/app/components/Viewer/Solid/PointsOptions.vue +6 -9
  70. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -9
  71. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +82 -105
  72. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +5 -5
  73. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +5 -5
  74. package/app/components/Viewer/Tree/ObjectTree.vue +80 -89
  75. package/app/components/Viewer/TreeComponent.vue +43 -49
  76. package/app/components/Viewer/TreeObject.vue +48 -50
  77. package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +6 -9
  78. package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +5 -5
  79. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +5 -5
  80. package/app/components/Wrapper.vue +8 -8
  81. package/app/components/ZScaling.vue +18 -27
  82. package/app/composables/project_manager.js +57 -67
  83. package/app/composables/run_function_when_microservices_connected.js +8 -8
  84. package/app/plugins/auto_store_register.js +11 -13
  85. package/app/stores/app.js +118 -138
  86. package/app/stores/data.js +52 -68
  87. package/app/stores/data_style.js +36 -36
  88. package/app/stores/feedback.js +17 -20
  89. package/app/stores/geode.js +54 -55
  90. package/app/stores/hybrid_viewer.js +164 -177
  91. package/app/stores/infra.js +45 -55
  92. package/app/stores/lambda.js +26 -26
  93. package/app/stores/menu.js +78 -85
  94. package/app/stores/treeview.js +57 -65
  95. package/app/stores/viewer.js +92 -104
  96. package/app/utils/colormap.js +3 -3
  97. package/app/utils/config.js +16 -22
  98. package/app/utils/default_styles.js +50 -62
  99. package/app/utils/extension.js +44 -44
  100. package/app/utils/file_import_workflow.js +50 -64
  101. package/app/utils/local/app_mode.js +2 -2
  102. package/app/utils/local/cleanup.js +66 -72
  103. package/app/utils/local/microservices.js +61 -71
  104. package/app/utils/local/path.js +16 -19
  105. package/app/utils/local/scripts.js +22 -22
  106. package/app/utils/recaptcha.js +6 -6
  107. package/app/utils/server.js +21 -24
  108. package/app/utils/status.js +2 -2
  109. package/app/utils/treeview.js +4 -4
  110. package/app/utils/validate_schema.js +7 -7
  111. package/commitlint.config.js +2 -2
  112. package/eslint.config.js +4 -4
  113. package/internal/database/database.js +38 -46
  114. package/internal/database/extended_database.js +9 -10
  115. package/internal/database/tables/data.js +2 -3
  116. package/internal/database/tables/model_components.js +1 -1
  117. package/internal/database/tables/model_components_relation.js +1 -1
  118. package/internal/stores/data_style/mesh/cells/cell.js +47 -63
  119. package/internal/stores/data_style/mesh/cells/color.js +11 -16
  120. package/internal/stores/data_style/mesh/cells/common.js +6 -6
  121. package/internal/stores/data_style/mesh/cells/index.js +37 -47
  122. package/internal/stores/data_style/mesh/cells/textures.js +11 -12
  123. package/internal/stores/data_style/mesh/cells/vertex.js +47 -58
  124. package/internal/stores/data_style/mesh/cells/visibility.js +11 -16
  125. package/internal/stores/data_style/mesh/edges/color.js +11 -16
  126. package/internal/stores/data_style/mesh/edges/common.js +6 -6
  127. package/internal/stores/data_style/mesh/edges/edge.js +47 -63
  128. package/internal/stores/data_style/mesh/edges/index.js +38 -52
  129. package/internal/stores/data_style/mesh/edges/vertex.js +47 -58
  130. package/internal/stores/data_style/mesh/edges/visibility.js +11 -16
  131. package/internal/stores/data_style/mesh/edges/width.js +11 -16
  132. package/internal/stores/data_style/mesh/index.js +34 -34
  133. package/internal/stores/data_style/mesh/points/color.js +11 -16
  134. package/internal/stores/data_style/mesh/points/common.js +6 -6
  135. package/internal/stores/data_style/mesh/points/index.js +35 -49
  136. package/internal/stores/data_style/mesh/points/size.js +11 -16
  137. package/internal/stores/data_style/mesh/points/vertex.js +47 -58
  138. package/internal/stores/data_style/mesh/points/visibility.js +11 -16
  139. package/internal/stores/data_style/mesh/polygons/color.js +11 -16
  140. package/internal/stores/data_style/mesh/polygons/common.js +6 -6
  141. package/internal/stores/data_style/mesh/polygons/index.js +36 -45
  142. package/internal/stores/data_style/mesh/polygons/polygon.js +45 -56
  143. package/internal/stores/data_style/mesh/polygons/textures.js +11 -16
  144. package/internal/stores/data_style/mesh/polygons/vertex.js +47 -58
  145. package/internal/stores/data_style/mesh/polygons/visibility.js +11 -16
  146. package/internal/stores/data_style/mesh/polyhedra/color.js +11 -16
  147. package/internal/stores/data_style/mesh/polyhedra/common.js +6 -6
  148. package/internal/stores/data_style/mesh/polyhedra/index.js +29 -42
  149. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +43 -47
  150. package/internal/stores/data_style/mesh/polyhedra/vertex.js +47 -58
  151. package/internal/stores/data_style/mesh/polyhedra/visibility.js +11 -17
  152. package/internal/stores/data_style/model/blocks/color.js +21 -24
  153. package/internal/stores/data_style/model/blocks/common.js +6 -6
  154. package/internal/stores/data_style/model/blocks/index.js +13 -17
  155. package/internal/stores/data_style/model/blocks/visibility.js +21 -24
  156. package/internal/stores/data_style/model/corners/color.js +21 -24
  157. package/internal/stores/data_style/model/corners/common.js +6 -6
  158. package/internal/stores/data_style/model/corners/index.js +14 -18
  159. package/internal/stores/data_style/model/corners/visibility.js +21 -25
  160. package/internal/stores/data_style/model/edges/common.js +4 -4
  161. package/internal/stores/data_style/model/edges/index.js +7 -7
  162. package/internal/stores/data_style/model/edges/visibility.js +11 -15
  163. package/internal/stores/data_style/model/index.js +84 -100
  164. package/internal/stores/data_style/model/lines/color.js +21 -24
  165. package/internal/stores/data_style/model/lines/common.js +6 -6
  166. package/internal/stores/data_style/model/lines/index.js +13 -17
  167. package/internal/stores/data_style/model/lines/visibility.js +21 -24
  168. package/internal/stores/data_style/model/points/common.js +4 -4
  169. package/internal/stores/data_style/model/points/index.js +9 -9
  170. package/internal/stores/data_style/model/points/size.js +11 -11
  171. package/internal/stores/data_style/model/points/visibility.js +11 -15
  172. package/internal/stores/data_style/model/surfaces/color.js +21 -24
  173. package/internal/stores/data_style/model/surfaces/common.js +6 -6
  174. package/internal/stores/data_style/model/surfaces/index.js +14 -22
  175. package/internal/stores/data_style/model/surfaces/visibility.js +18 -22
  176. package/internal/stores/data_style/state.js +11 -11
  177. package/internal/utils/api_fetch.js +24 -34
  178. package/internal/utils/upload_file.js +19 -24
  179. package/internal/utils/viewer_call.js +23 -36
  180. package/nuxt.config.js +7 -11
  181. package/package.json +3 -3
  182. package/scripts/generate_geode_objects.js +14 -16
  183. package/server/api/app/kill.post.js +4 -4
  184. package/server/api/app/project_folder_path.post.js +11 -11
  185. package/server/api/app/run_back.post.js +12 -12
  186. package/server/api/app/run_viewer.post.js +12 -12
  187. package/server/api/extensions/run.post.js +34 -41
  188. package/server/api/extensions/upload.put.js +48 -62
  189. package/tests/integration/setup.js +43 -53
  190. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +90 -116
  191. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +81 -107
  192. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +38 -41
  193. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +85 -101
  194. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +89 -113
  195. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +81 -105
  196. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +56 -73
  197. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +59 -76
  198. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +39 -42
  199. package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -34
  200. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +60 -73
  201. package/tests/integration/stores/data_style/model/points.nuxt.test.js +52 -55
  202. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +59 -80
  203. package/tests/integration/stores/viewer.nuxt.test.js +35 -38
  204. package/tests/setup_indexeddb.js +2 -2
  205. package/tests/unit/components/CrsSelector.nuxt.test.js +28 -28
  206. package/tests/unit/components/ExtensionSelector.nuxt.test.js +33 -35
  207. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -23
  208. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +18 -18
  209. package/tests/unit/components/FileSelector.nuxt.test.js +57 -59
  210. package/tests/unit/components/FileUploader.nuxt.test.js +35 -39
  211. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +28 -28
  212. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +22 -27
  213. package/tests/unit/components/Launcher.nuxt.test.js +20 -22
  214. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +37 -37
  215. package/tests/unit/components/ObjectSelector.nuxt.test.js +62 -62
  216. package/tests/unit/components/PackagesVersions.nuxt.test.js +16 -16
  217. package/tests/unit/components/Step.nuxt.test.js +18 -19
  218. package/tests/unit/components/Stepper.nuxt.test.js +18 -18
  219. package/tests/unit/composables/api_fetch.nuxt.test.js +34 -36
  220. package/tests/unit/composables/project_manager.nuxt.test.js +93 -112
  221. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -36
  222. package/tests/unit/composables/upload_file.nuxt.test.js +27 -29
  223. package/tests/unit/plugins/project_load.nuxt.test.js +31 -33
  224. package/tests/unit/stores/app.nuxt.test.js +90 -92
  225. package/tests/unit/stores/feedback.nuxt.test.js +47 -57
  226. package/tests/unit/stores/geode.nuxt.test.js +111 -115
  227. package/tests/unit/stores/infra.nuxt.test.js +148 -148
  228. package/tests/unit/stores/lambda.nuxt.test.js +72 -74
  229. package/tests/unit/stores/treeview.nuxt.test.js +19 -21
  230. package/tests/unit/stores/viewer.nuxt.test.js +109 -122
  231. package/tests/unit/utils/recaptcha.nuxt.test.js +25 -29
  232. package/tests/unit/utils/validate_schema.nuxt.test.js +17 -17
  233. package/tests/utils.js +11 -11
  234. package/tests/vitest.config.js +9 -9
  235. package/vuetify_config.js +2 -2
@@ -1,137 +1,137 @@
1
1
  // oxlint-disable-next-line import/no-unassigned-import
2
- import "@kitware/vtk.js/Rendering/Profiles/Geometry"
3
- import { newInstance as vtkActor } from "@kitware/vtk.js/Rendering/Core/Actor"
4
- import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow"
5
- import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper"
6
- import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader"
2
+ import "@kitware/vtk.js/Rendering/Profiles/Geometry";
3
+ import { newInstance as vtkActor } from "@kitware/vtk.js/Rendering/Core/Actor";
4
+ import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
5
+ import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper";
6
+ import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader";
7
7
 
8
- import { Status } from "@ogw_front/utils/status"
9
- import { useDataStore } from "@ogw_front/stores/data"
10
- import { useViewerStore } from "@ogw_front/stores/viewer"
11
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
8
+ import { Status } from "@ogw_front/utils/status";
9
+ import { useDataStore } from "@ogw_front/stores/data";
10
+ import { useViewerStore } from "@ogw_front/stores/viewer";
11
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
12
12
 
13
- const RGB_MAX = 255
14
- const BACKGROUND_GREY_VALUE = 180
15
- const ACTOR_DARK_VALUE = 20
13
+ const RGB_MAX = 255;
14
+ const BACKGROUND_GREY_VALUE = 180;
15
+ const ACTOR_DARK_VALUE = 20;
16
16
  const BACKGROUND_COLOR = [
17
17
  BACKGROUND_GREY_VALUE / RGB_MAX,
18
18
  BACKGROUND_GREY_VALUE / RGB_MAX,
19
19
  BACKGROUND_GREY_VALUE / RGB_MAX,
20
- ]
20
+ ];
21
21
  const ACTOR_COLOR = [
22
22
  ACTOR_DARK_VALUE / RGB_MAX,
23
23
  ACTOR_DARK_VALUE / RGB_MAX,
24
24
  ACTOR_DARK_VALUE / RGB_MAX,
25
- ]
26
- const WHEEL_TIME_OUT_MS = 600
25
+ ];
26
+ const WHEEL_TIME_OUT_MS = 600;
27
27
 
28
28
  export const useHybridViewerStore = defineStore("hybridViewer", () => {
29
- const dataStore = useDataStore()
30
- const viewerStore = useViewerStore()
31
- const hybridDb = reactive({})
32
- const status = ref(Status.NOT_CREATED)
33
- const camera_options = reactive({})
34
- const genericRenderWindow = reactive({})
35
- const is_moving = ref(false)
36
- const zScale = ref(1)
37
- let viewStream = undefined
38
- const gridActor = undefined
29
+ const dataStore = useDataStore();
30
+ const viewerStore = useViewerStore();
31
+ const hybridDb = reactive({});
32
+ const status = ref(Status.NOT_CREATED);
33
+ const camera_options = reactive({});
34
+ const genericRenderWindow = reactive({});
35
+ const is_moving = ref(false);
36
+ const zScale = ref(1);
37
+ let viewStream = undefined;
38
+ const gridActor = undefined;
39
39
 
40
40
  async function initHybridViewer() {
41
41
  if (status.value !== Status.NOT_CREATED) {
42
- return
42
+ return;
43
43
  }
44
- status.value = Status.CREATING
44
+ status.value = Status.CREATING;
45
45
  genericRenderWindow.value = vtkGenericRenderWindow({
46
46
  background: BACKGROUND_COLOR,
47
47
  listenWindowResize: false,
48
- })
48
+ });
49
49
 
50
- const webGLRenderWindow =
51
- genericRenderWindow.value.getApiSpecificRenderWindow()
52
- const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style
53
- imageStyle.transition = "opacity 0.1s ease-in"
54
- imageStyle.zIndex = 1
50
+ const webGLRenderWindow = genericRenderWindow.value.getApiSpecificRenderWindow();
51
+ const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style;
52
+ imageStyle.transition = "opacity 0.1s ease-in";
53
+ imageStyle.zIndex = 1;
55
54
 
56
- await viewerStore.ws_connect()
57
- viewStream = viewerStore.client.getImageStream().createViewStream("-1")
55
+ await viewerStore.ws_connect();
56
+ viewStream = viewerStore.client.getImageStream().createViewStream("-1");
58
57
  viewStream.onImageReady((event) => {
59
58
  if (is_moving.value) {
60
- return
59
+ return;
61
60
  }
62
- webGLRenderWindow.setBackgroundImage(event.image)
63
- imageStyle.opacity = 1
64
- })
61
+ webGLRenderWindow.setBackgroundImage(event.image);
62
+ imageStyle.opacity = 1;
63
+ });
65
64
 
66
- status.value = Status.CREATED
65
+ status.value = Status.CREATED;
67
66
  }
68
67
 
69
68
  async function addItem(id) {
70
69
  if (!genericRenderWindow.value) {
71
- return
70
+ return;
72
71
  }
73
- const value = await dataStore.item(id)
74
- console.log("hybridViewerStore.addItem", { value })
75
- const reader = vtkXMLPolyDataReader()
76
- const textEncoder = new TextEncoder()
77
- await reader.parseAsArrayBuffer(
78
- textEncoder.encode(value.binary_light_viewable),
79
- )
80
- const polydata = reader.getOutputData(0)
81
- const mapper = vtkMapper()
82
- mapper.setInputData(polydata)
83
- const actor = vtkActor()
84
- actor.getProperty().setColor(ACTOR_COLOR)
85
- actor.setMapper(mapper)
86
- const renderer = genericRenderWindow.value.getRenderer()
87
- const renderWindow = genericRenderWindow.value.getRenderWindow()
88
- renderer.addActor(actor)
89
- renderer.resetCamera()
90
- renderWindow.render()
91
- hybridDb[id] = { actor, polydata, mapper }
72
+ const value = await dataStore.item(id);
73
+ console.log("hybridViewerStore.addItem", { value });
74
+ const reader = vtkXMLPolyDataReader();
75
+ const textEncoder = new TextEncoder();
76
+ await reader.parseAsArrayBuffer(textEncoder.encode(value.binary_light_viewable));
77
+ const polydata = reader.getOutputData(0);
78
+ const mapper = vtkMapper();
79
+ mapper.setInputData(polydata);
80
+ const actor = vtkActor();
81
+ actor.getProperty().setColor(ACTOR_COLOR);
82
+ actor.setMapper(mapper);
83
+ const renderer = genericRenderWindow.value.getRenderer();
84
+ const renderWindow = genericRenderWindow.value.getRenderWindow();
85
+ renderer.addActor(actor);
86
+ renderer.resetCamera();
87
+ renderWindow.render();
88
+ hybridDb[id] = { actor, polydata, mapper };
92
89
  }
93
90
 
94
- async function removeItem(id) {
91
+ function removeItem(id) {
95
92
  if (!hybridDb[id]) {
96
- return
93
+ return;
97
94
  }
98
- const renderer = genericRenderWindow.value.getRenderer()
99
- renderer.removeActor(hybridDb[id].actor)
100
- genericRenderWindow.value.getRenderWindow().render()
101
- delete hybridDb[id]
95
+ const renderer = genericRenderWindow.value.getRenderer();
96
+ renderer.removeActor(hybridDb[id].actor);
97
+ genericRenderWindow.value.getRenderWindow().render();
98
+ delete hybridDb[id];
102
99
  }
103
100
 
104
- async function setVisibility(id, visibility) {
105
- hybridDb[id].actor.setVisibility(visibility)
106
- const renderWindow = genericRenderWindow.value.getRenderWindow()
107
- renderWindow.render()
101
+ function setVisibility(id, visibility) {
102
+ if (!hybridDb[id]) {
103
+ return;
104
+ }
105
+ hybridDb[id].actor.setVisibility(visibility);
106
+ const renderWindow = genericRenderWindow.value.getRenderWindow();
107
+ renderWindow.render();
108
108
  }
109
109
  async function setZScaling(z_scale) {
110
- zScale.value = z_scale
111
- const renderer = genericRenderWindow.value.getRenderer()
112
- const actors = renderer.getActors()
110
+ zScale.value = z_scale;
111
+ const renderer = genericRenderWindow.value.getRenderer();
112
+ const actors = renderer.getActors();
113
113
  for (const actor of actors) {
114
114
  if (actor !== gridActor) {
115
- const scale = actor.getScale()
116
- actor.setScale(scale[0], scale[1], z_scale)
115
+ const scale = actor.getScale();
116
+ actor.setScale(scale[0], scale[1], z_scale);
117
117
  }
118
118
  }
119
- renderer.resetCamera()
120
- genericRenderWindow.value.getRenderWindow().render()
121
- const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling
119
+ renderer.resetCamera();
120
+ genericRenderWindow.value.getRenderWindow().render();
121
+ const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling;
122
122
  if (!schema) {
123
- return
123
+ return;
124
124
  }
125
125
  await viewerStore.request(schema, {
126
126
  z_scale,
127
- })
128
- remoteRender()
127
+ });
128
+ remoteRender();
129
129
  }
130
130
 
131
131
  function syncRemoteCamera() {
132
- console.log("syncRemoteCamera")
133
- const renderer = genericRenderWindow.value.getRenderer()
134
- const camera = renderer.getActiveCamera()
132
+ console.log("syncRemoteCamera");
133
+ const renderer = genericRenderWindow.value.getRenderer();
134
+ const camera = renderer.getActiveCamera();
135
135
  const params = {
136
136
  camera_options: {
137
137
  focal_point: [...camera.getFocalPoint()],
@@ -141,93 +141,84 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
141
141
  clipping_range: [...camera.getClippingRange()],
142
142
  distance: camera.getDistance(),
143
143
  },
144
- }
145
- viewerStore.request(
146
- viewer_schemas.opengeodeweb_viewer.viewer.update_camera,
147
- params,
148
- {
149
- response_function: () => {
150
- remoteRender()
151
- for (const key in params.camera_options) {
152
- if (Object.hasOwn(params.camera_options, key)) {
153
- camera_options[key] = params.camera_options[key]
154
- }
144
+ };
145
+ viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.update_camera, params, {
146
+ response_function: () => {
147
+ remoteRender();
148
+ for (const key in params.camera_options) {
149
+ if (Object.hasOwn(params.camera_options, key)) {
150
+ camera_options[key] = params.camera_options[key];
155
151
  }
156
- },
152
+ }
157
153
  },
158
- )
154
+ });
159
155
  }
160
156
 
161
157
  function remoteRender() {
162
- return viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.render)
158
+ return viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.render);
163
159
  }
164
160
 
165
161
  function setContainer(container) {
166
- genericRenderWindow.value.setContainer(container.value.$el)
167
- const webGLRenderWindow =
168
- genericRenderWindow.value.getApiSpecificRenderWindow()
169
- webGLRenderWindow.setUseBackgroundImage(true)
170
- const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style
171
- imageStyle.transition = "opacity 0.1s ease-in"
172
- imageStyle.zIndex = 1
173
- resize(container.value.$el.offsetWidth, container.value.$el.offsetHeight)
174
- console.log("setContainer", container.value.$el)
162
+ genericRenderWindow.value.setContainer(container.value.$el);
163
+ const webGLRenderWindow = genericRenderWindow.value.getApiSpecificRenderWindow();
164
+ webGLRenderWindow.setUseBackgroundImage(true);
165
+ const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style;
166
+ imageStyle.transition = "opacity 0.1s ease-in";
167
+ imageStyle.zIndex = 1;
168
+ resize(container.value.$el.offsetWidth, container.value.$el.offsetHeight);
169
+ console.log("setContainer", container.value.$el);
175
170
 
176
171
  useMousePressed({
177
172
  target: container,
178
173
  onPressed: (event) => {
179
- console.log("onPressed")
174
+ console.log("onPressed");
180
175
  if (event.button === 0) {
181
- is_moving.value = true
182
- event.stopPropagation()
183
- imageStyle.opacity = 0
176
+ is_moving.value = true;
177
+ event.stopPropagation();
178
+ imageStyle.opacity = 0;
184
179
  }
185
180
  },
186
181
  onReleased: () => {
187
182
  if (!is_moving.value) {
188
- return
183
+ return;
189
184
  }
190
- is_moving.value = false
191
- console.log("onReleased")
192
- syncRemoteCamera()
185
+ is_moving.value = false;
186
+ console.log("onReleased");
187
+ syncRemoteCamera();
193
188
  },
194
- })
189
+ });
195
190
 
196
- let wheelEventEndTimeout = undefined
191
+ let wheelEventEndTimeout = undefined;
197
192
  useEventListener(container, "wheel", () => {
198
- is_moving.value = true
199
- imageStyle.opacity = 0
200
- clearTimeout(wheelEventEndTimeout)
193
+ is_moving.value = true;
194
+ imageStyle.opacity = 0;
195
+ clearTimeout(wheelEventEndTimeout);
201
196
  wheelEventEndTimeout = setTimeout(() => {
202
- is_moving.value = false
203
- syncRemoteCamera()
204
- }, WHEEL_TIME_OUT_MS)
205
- })
197
+ is_moving.value = false;
198
+ syncRemoteCamera();
199
+ }, WHEEL_TIME_OUT_MS);
200
+ });
206
201
  }
207
202
 
208
203
  async function resize(width, height) {
209
- if (
210
- viewerStore.status !== Status.CONNECTED ||
211
- status.value !== Status.CREATED
212
- ) {
213
- return
204
+ if (viewerStore.status !== Status.CONNECTED || status.value !== Status.CREATED) {
205
+ return;
214
206
  }
215
- const webGLRenderWindow =
216
- genericRenderWindow.value.getApiSpecificRenderWindow()
217
- const canvas = webGLRenderWindow.getCanvas()
218
- canvas.width = width
219
- canvas.height = height
220
- await nextTick()
221
- webGLRenderWindow.setSize(width, height)
222
- viewStream.setSize(width, height)
223
- const renderWindow = genericRenderWindow.value.getRenderWindow()
224
- renderWindow.render()
225
- remoteRender()
207
+ const webGLRenderWindow = genericRenderWindow.value.getApiSpecificRenderWindow();
208
+ const canvas = webGLRenderWindow.getCanvas();
209
+ canvas.width = width;
210
+ canvas.height = height;
211
+ await nextTick();
212
+ webGLRenderWindow.setSize(width, height);
213
+ viewStream.setSize(width, height);
214
+ const renderWindow = genericRenderWindow.value.getRenderWindow();
215
+ renderWindow.render();
216
+ remoteRender();
226
217
  }
227
218
 
228
219
  function exportStores() {
229
- const renderer = genericRenderWindow.value.getRenderer()
230
- const camera = renderer.getActiveCamera()
220
+ const renderer = genericRenderWindow.value.getRenderer();
221
+ const camera = renderer.getActiveCamera();
231
222
  const cameraSnapshot = camera
232
223
  ? {
233
224
  focal_point: [...camera.getFocalPoint()],
@@ -237,33 +228,33 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
237
228
  clipping_range: [...camera.getClippingRange()],
238
229
  distance: camera.getDistance(),
239
230
  }
240
- : camera_options
241
- return { zScale: zScale.value, camera_options: cameraSnapshot }
231
+ : camera_options;
232
+ return { zScale: zScale.value, camera_options: cameraSnapshot };
242
233
  }
243
234
 
244
235
  async function importStores(snapshot) {
245
236
  if (!snapshot) {
246
- console.warn("importStores called with undefined snapshot")
247
- return
237
+ console.warn("importStores called with undefined snapshot");
238
+ return;
248
239
  }
249
- const z_scale = snapshot.zScale
240
+ const z_scale = snapshot.zScale;
250
241
 
251
242
  function applyCamera() {
252
- const { camera_options: snapshot_camera_options } = snapshot
243
+ const { camera_options: snapshot_camera_options } = snapshot;
253
244
  if (!snapshot_camera_options) {
254
- return
245
+ return;
255
246
  }
256
247
 
257
- const renderer = genericRenderWindow.value.getRenderer()
258
- const camera = renderer.getActiveCamera()
248
+ const renderer = genericRenderWindow.value.getRenderer();
249
+ const camera = renderer.getActiveCamera();
259
250
 
260
- camera.setFocalPoint(...snapshot_camera_options.focal_point)
261
- camera.setViewUp(...snapshot_camera_options.view_up)
262
- camera.setPosition(...snapshot_camera_options.position)
263
- camera.setViewAngle(snapshot_camera_options.view_angle)
264
- camera.setClippingRange(...snapshot_camera_options.clipping_range)
251
+ camera.setFocalPoint(...snapshot_camera_options.focal_point);
252
+ camera.setViewUp(...snapshot_camera_options.view_up);
253
+ camera.setPosition(...snapshot_camera_options.position);
254
+ camera.setViewAngle(snapshot_camera_options.view_angle);
255
+ camera.setClippingRange(...snapshot_camera_options.clipping_range);
265
256
 
266
- genericRenderWindow.value.getRenderWindow().render()
257
+ genericRenderWindow.value.getRenderWindow().render();
267
258
 
268
259
  const payload = {
269
260
  camera_options: {
@@ -273,35 +264,31 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
273
264
  view_angle: snapshot_camera_options.view_angle,
274
265
  clipping_range: [...snapshot_camera_options.clipping_range],
275
266
  },
276
- }
277
- return viewerStore.request(
278
- viewer_schemas.opengeodeweb_viewer.viewer.update_camera,
279
- payload,
280
- {
281
- response_function: () => {
282
- remoteRender()
283
- Object.assign(camera_options, payload.camera_options)
284
- },
267
+ };
268
+ return viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.update_camera, payload, {
269
+ response_function: () => {
270
+ remoteRender();
271
+ Object.assign(camera_options, payload.camera_options);
285
272
  },
286
- )
273
+ });
287
274
  }
288
275
 
289
276
  if (typeof z_scale === "number") {
290
- await setZScaling(z_scale)
291
- return await applyCamera()
277
+ await setZScaling(z_scale);
278
+ return await applyCamera();
292
279
  }
293
- return await applyCamera()
280
+ return await applyCamera();
294
281
  }
295
282
 
296
283
  function clear() {
297
- const renderer = genericRenderWindow.value.getRenderer()
298
- const actors = renderer.getActors()
284
+ const renderer = genericRenderWindow.value.getRenderer();
285
+ const actors = renderer.getActors();
299
286
  for (const actor of actors) {
300
- renderer.removeActor(actor)
287
+ renderer.removeActor(actor);
301
288
  }
302
- genericRenderWindow.value.getRenderWindow().render()
289
+ genericRenderWindow.value.getRenderWindow().render();
303
290
  for (const id of Object.keys(hybridDb)) {
304
- delete hybridDb[id]
291
+ delete hybridDb[id];
305
292
  }
306
293
  }
307
294
 
@@ -321,5 +308,5 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
321
308
  clear,
322
309
  exportStores,
323
310
  importStores,
324
- }
325
- })
311
+ };
312
+ });
@@ -1,8 +1,8 @@
1
- import { Status } from "@ogw_front/utils/status"
2
- import { appMode } from "@ogw_front/utils/local/app_mode"
3
- import { registerRunningExtensions } from "@ogw_front/utils/extension"
4
- import { useAppStore } from "@ogw_front/stores/app"
5
- import { useLambdaStore } from "@ogw_front/stores/lambda"
1
+ import { Status } from "@ogw_front/utils/status";
2
+ import { appMode } from "@ogw_front/utils/local/app_mode";
3
+ import { registerRunningExtensions } from "@ogw_front/utils/extension";
4
+ import { useAppStore } from "@ogw_front/stores/app";
5
+ import { useLambdaStore } from "@ogw_front/stores/lambda";
6
6
 
7
7
  export const useInfraStore = defineStore("infra", {
8
8
  state: () => ({
@@ -15,96 +15,86 @@ export const useInfraStore = defineStore("infra", {
15
15
  getters: {
16
16
  domain_name() {
17
17
  if (this.app_mode === appMode.CLOUD) {
18
- return useRuntimeConfig().public.API_URL
18
+ return useRuntimeConfig().public.API_URL;
19
19
  }
20
- return "localhost"
20
+ return "localhost";
21
21
  },
22
22
  microservices_connected() {
23
- console.log("microservices", this.microservices)
24
- return this.microservices.every(
25
- (store) => store.status === Status.CONNECTED,
26
- )
23
+ console.log("microservices", this.microservices);
24
+ return this.microservices.every((store) => store.status === Status.CONNECTED);
27
25
  },
28
26
  microservices_busy() {
29
- return this.microservices.some((store) => store.is_busy === true)
27
+ return this.microservices.some((store) => store.is_busy === true);
30
28
  },
31
29
  },
32
30
  actions: {
33
31
  register_microservice(store) {
34
- const store_name = store.$id
35
- console.log("[INFRA] Registering microservice:", store_name)
32
+ const store_name = store.$id;
33
+ console.log("[INFRA] Registering microservice:", store_name);
36
34
 
37
- if (
38
- !this.microservices.find(
39
- (microservice) => microservice.$id === store_name,
40
- )
41
- ) {
42
- this.microservices.push(store)
43
- console.log("[INFRA] Microservice registered:", store_name)
35
+ if (!this.microservices.some((microservice) => microservice.$id === store_name)) {
36
+ this.microservices.push(store);
37
+ console.log("[INFRA] Microservice registered:", store_name);
44
38
  }
45
39
  },
46
- async create_backend() {
47
- console.log("[INFRA] Starting create_backend - Mode:", this.app_mode)
40
+ create_backend() {
41
+ console.log("[INFRA] Starting create_backend - Mode:", this.app_mode);
48
42
  console.log(
49
43
  "[INFRA] Registered microservices:",
50
44
  this.microservices.map((store) => store.$id),
51
- )
45
+ );
52
46
  if (this.status === Status.CREATED) {
53
- return
47
+ return;
54
48
  }
55
49
  return navigator.locks.request("infra.create_backend", async () => {
56
- this.status = Status.CREATING
50
+ this.status = Status.CREATING;
57
51
  if (this.status === Status.CREATED) {
58
- return
52
+ return;
59
53
  }
60
- console.log("[INFRA] Lock granted for create_backend")
54
+ console.log("[INFRA] Lock granted for create_backend");
61
55
  if (this.app_mode === appMode.CLOUD) {
62
- console.log("[INFRA] CLOUD mode - Launching lambda...")
63
- const lambdaStore = useLambdaStore()
64
- this.ID = await lambdaStore.launch()
65
- console.log("[INFRA] Lambda launched successfully")
56
+ console.log("[INFRA] CLOUD mode - Launching lambda...");
57
+ const lambdaStore = useLambdaStore();
58
+ this.ID = await lambdaStore.launch();
59
+ console.log("[INFRA] Lambda launched successfully");
66
60
  } else {
67
- console.log(
68
- `[INFRA] ${this.app_mode} mode - Launching microservices...`,
69
- )
70
- const appStore = useAppStore()
71
- await appStore.createProjectFolder()
61
+ console.log(`[INFRA] ${this.app_mode} mode - Launching microservices...`);
62
+ const appStore = useAppStore();
63
+ await appStore.createProjectFolder();
72
64
  if (this.app_mode === appMode.DESKTOP) {
73
65
  globalThis.electronAPI.project_folder_path({
74
66
  projectFolderPath: appStore.projectFolderPath,
75
- })
67
+ });
76
68
  }
77
- const microservices_with_launch = this.microservices.filter(
78
- (store) => store.launch,
79
- )
69
+ const microservices_with_launch = this.microservices.filter((store) => store.launch);
80
70
  const launch_promises = microservices_with_launch.map((store) =>
81
71
  store.launch({ projectFolderPath: appStore.projectFolderPath }),
82
- )
83
- launch_promises.push(registerRunningExtensions())
84
- await Promise.all(launch_promises)
72
+ );
73
+ launch_promises.push(registerRunningExtensions());
74
+ await Promise.all(launch_promises);
85
75
  }
86
- this.status = Status.CREATED
87
- console.log("[INFRA] Backend created successfully")
88
- return this.create_connection()
89
- })
76
+ this.status = Status.CREATED;
77
+ console.log("[INFRA] Backend created successfully");
78
+ return this.create_connection();
79
+ });
90
80
  },
91
81
  async create_connection() {
92
- console.log("[INFRA] Starting create_connection")
82
+ console.log("[INFRA] Starting create_connection");
93
83
  console.log(
94
84
  "[INFRA] Connecting microservices:",
95
85
  this.microservices.map((store) => store.$id),
96
- )
86
+ );
97
87
 
98
88
  await Promise.all(
99
89
  this.microservices.map(async (store) => {
100
- await store.connect()
101
- console.log("[INFRA] Microservice connected:", store.$id)
90
+ await store.connect();
91
+ console.log("[INFRA] Microservice connected:", store.$id);
102
92
  }),
103
- )
104
- console.log("[INFRA] All microservices connected")
93
+ );
94
+ console.log("[INFRA] All microservices connected");
105
95
  },
106
96
  },
107
97
  share: {
108
98
  omit: ["microservices"],
109
99
  },
110
- })
100
+ });