@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,5 +1,5 @@
1
- import { Status } from "@ogw_front/utils/status"
2
- import { useFeedbackStore } from "@ogw_front/stores/feedback"
1
+ import { Status } from "@ogw_front/utils/status";
2
+ import { useFeedbackStore } from "@ogw_front/stores/feedback";
3
3
 
4
4
  export const useLambdaStore = defineStore("lambda", {
5
5
  state: () => ({
@@ -7,51 +7,51 @@ export const useLambdaStore = defineStore("lambda", {
7
7
  }),
8
8
  getters: {
9
9
  protocol() {
10
- return "https"
10
+ return "https";
11
11
  },
12
12
  port() {
13
- return "443"
13
+ return "443";
14
14
  },
15
15
  base_url() {
16
- const public_runtime_config = useRuntimeConfig().public
17
- const domain_name = public_runtime_config.API_URL
18
- const projectPath = `/${public_runtime_config.PROJECT}`
19
- const url = `${this.protocol}://${domain_name}:${this.port}${public_runtime_config.SITE_BRANCH}${projectPath}/createbackend`
20
- return url
16
+ const public_runtime_config = useRuntimeConfig().public;
17
+ const domain_name = public_runtime_config.API_URL;
18
+ const projectPath = `/${public_runtime_config.PROJECT}`;
19
+ const url = `${this.protocol}://${domain_name}:${this.port}${public_runtime_config.SITE_BRANCH}${projectPath}/createbackend`;
20
+ return url;
21
21
  },
22
22
  is_busy() {
23
- return false
23
+ return false;
24
24
  },
25
25
  },
26
26
  actions: {
27
27
  async launch() {
28
- console.log("[LAMBDA] Launching lambda backend...")
29
- const feedbackStore = useFeedbackStore()
28
+ console.log("[LAMBDA] Launching lambda backend...");
29
+ const feedbackStore = useFeedbackStore();
30
30
 
31
31
  const { data, error } = await useFetch(this.base_url, {
32
32
  method: "POST",
33
- })
33
+ });
34
34
 
35
35
  if (error.value || !data.value) {
36
- this.status = Status.NOT_CONNECTED
37
- feedbackStore.server_error = true
38
- console.error("[LAMBDA] Failed to launch lambda backend", error.value)
39
- throw new Error("Failed to launch lambda backend")
36
+ this.status = Status.NOT_CONNECTED;
37
+ feedbackStore.server_error = true;
38
+ console.error("[LAMBDA] Failed to launch lambda backend", error.value);
39
+ throw new Error("Failed to launch lambda backend");
40
40
  }
41
41
 
42
- this.status = Status.CONNECTED
43
- const id = data.value.ID
42
+ this.status = Status.CONNECTED;
43
+ const id = data.value.ID;
44
44
 
45
- console.log("[LAMBDA] Lambda launched, ID:", id)
46
- return id
45
+ console.log("[LAMBDA] Lambda launched, ID:", id);
46
+ return id;
47
47
  },
48
- async connect() {
49
- console.log("[LAMBDA] Lambda connected")
50
- this.status = Status.CONNECTED
51
- return Promise.resolve()
48
+ connect() {
49
+ console.log("[LAMBDA] Lambda connected");
50
+ this.status = Status.CONNECTED;
51
+ return Promise.resolve();
52
52
  },
53
53
  },
54
54
  share: {
55
55
  omit: ["status"],
56
56
  },
57
- })
57
+ });
@@ -1,96 +1,92 @@
1
1
  // PointSet components
2
- import PointSetPointsOptions from "@ogw_front/components/Viewer/PointSet/SpecificPointsOptions"
2
+ import PointSetPointsOptions from "@ogw_front/components/Viewer/PointSet/SpecificPointsOptions";
3
3
 
4
4
  // EdgedCurve components
5
- import EdgedCurveEdgesOptions from "@ogw_front/components/Viewer/EdgedCurve/SpecificEdgesOptions"
6
- import EdgedCurvePointsOptions from "@ogw_front/components/Viewer/EdgedCurve/PointsOptions"
5
+ import EdgedCurveEdgesOptions from "@ogw_front/components/Viewer/EdgedCurve/SpecificEdgesOptions";
6
+ import EdgedCurvePointsOptions from "@ogw_front/components/Viewer/EdgedCurve/PointsOptions";
7
7
 
8
8
  // PolygonalSurface components
9
- import PolygonalSurfaceEdgesOptions from "@ogw_front/components/Viewer/PolygonalSurface/EdgesOptions"
10
- import PolygonalSurfacePointsOptions from "@ogw_front/components/Viewer/PolygonalSurface/PointsOptions"
11
- import PolygonalSurfacePolygonsOptions from "@ogw_front/components/Viewer/PolygonalSurface/SpecificPolygonsOptions"
9
+ import PolygonalSurfaceEdgesOptions from "@ogw_front/components/Viewer/PolygonalSurface/EdgesOptions";
10
+ import PolygonalSurfacePointsOptions from "@ogw_front/components/Viewer/PolygonalSurface/PointsOptions";
11
+ import PolygonalSurfacePolygonsOptions from "@ogw_front/components/Viewer/PolygonalSurface/SpecificPolygonsOptions";
12
12
 
13
13
  // TriangulatedSurface components
14
- import TriangulatedSurfaceEdgesOptions from "@ogw_front/components/Viewer/TriangulatedSurface/EdgesOptions"
15
- import TriangulatedSurfacePointsOptions from "@ogw_front/components/Viewer/TriangulatedSurface/PointsOptions"
16
- import TriangulatedSurfaceTrianglesOptions from "@ogw_front/components/Viewer/TriangulatedSurface/TrianglesOptions"
14
+ import TriangulatedSurfaceEdgesOptions from "@ogw_front/components/Viewer/TriangulatedSurface/EdgesOptions";
15
+ import TriangulatedSurfacePointsOptions from "@ogw_front/components/Viewer/TriangulatedSurface/PointsOptions";
16
+ import TriangulatedSurfaceTrianglesOptions from "@ogw_front/components/Viewer/TriangulatedSurface/TrianglesOptions";
17
17
 
18
18
  // Grid 2D components
19
- import Grid2DCellsOptions from "@ogw_front/components/Viewer/Grid/2D/CellsOptions"
20
- import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOptions"
21
- import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions"
19
+ import Grid2DCellsOptions from "@ogw_front/components/Viewer/Grid/2D/CellsOptions";
20
+ import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOptions";
21
+ import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions";
22
22
 
23
23
  // Grid 3D components
24
- import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions"
25
- import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions"
26
- import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions"
24
+ import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions";
25
+ import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions";
26
+ import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions";
27
27
 
28
28
  // Solid components
29
- import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions"
30
- import SolidPointsOptions from "@ogw_front/components/Viewer/Solid/PointsOptions"
31
- import SolidPolygonsOptions from "@ogw_front/components/Viewer/Solid/PolygonsOptions"
32
- import SolidPolyhedraOptions from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraOptions"
29
+ import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions";
30
+ import SolidPointsOptions from "@ogw_front/components/Viewer/Solid/PointsOptions";
31
+ import SolidPolygonsOptions from "@ogw_front/components/Viewer/Solid/PolygonsOptions";
32
+ import SolidPolyhedraOptions from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraOptions";
33
33
 
34
34
  // TetrahedralSolid components
35
- import TetrahedralSolidTetrahedraOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TetrahedraOptions"
36
- import TetrahedralSolidTrianglesOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TrianglesOptions"
35
+ import TetrahedralSolidTetrahedraOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TetrahedraOptions";
36
+ import TetrahedralSolidTrianglesOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TrianglesOptions";
37
37
 
38
38
  // Model components
39
- import ModelEdgesOptions from "@ogw_front/components/Viewer/Generic/Model/EdgesOptions"
40
- import ModelPointsOptions from "@ogw_front/components/Viewer/Generic/Model/PointsOptions"
39
+ import ModelEdgesOptions from "@ogw_front/components/Viewer/Generic/Model/EdgesOptions";
40
+ import ModelPointsOptions from "@ogw_front/components/Viewer/Generic/Model/PointsOptions";
41
41
 
42
- const PointSet_menu = [PointSetPointsOptions]
42
+ const PointSet_menu = [PointSetPointsOptions];
43
43
 
44
- const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions]
44
+ const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions];
45
45
 
46
46
  const PolygonalSurface_menu = [
47
47
  PolygonalSurfacePointsOptions,
48
48
  PolygonalSurfaceEdgesOptions,
49
49
  PolygonalSurfacePolygonsOptions,
50
- ]
50
+ ];
51
51
 
52
52
  const TriangulatedSurface_menu = [
53
53
  TriangulatedSurfacePointsOptions,
54
54
  TriangulatedSurfaceEdgesOptions,
55
55
  TriangulatedSurfaceTrianglesOptions,
56
- ]
56
+ ];
57
57
 
58
- const Grid2D_menu = [
59
- Grid2DPointsOptions,
60
- Grid2DEdgesOptions,
61
- Grid2DCellsOptions,
62
- ]
58
+ const Grid2D_menu = [Grid2DPointsOptions, Grid2DEdgesOptions, Grid2DCellsOptions];
63
59
  const Grid3D_menu = [
64
60
  Grid3DPointsOptions,
65
61
  Grid3DEdgesOptions,
66
62
  // Grid3DFacetsOptions,
67
63
  Grid3DCellsOptions,
68
- ]
64
+ ];
69
65
 
70
66
  const Solid_menu = [
71
67
  SolidPointsOptions,
72
68
  SolidEdgesOptions,
73
69
  SolidPolygonsOptions,
74
70
  SolidPolyhedraOptions,
75
- ]
71
+ ];
76
72
 
77
73
  const TetrahedralSolid_menu = [
78
74
  SolidPointsOptions,
79
75
  SolidEdgesOptions,
80
76
  TetrahedralSolidTrianglesOptions,
81
77
  TetrahedralSolidTetrahedraOptions,
82
- ]
78
+ ];
83
79
 
84
- const BRep_menu = [ModelEdgesOptions, ModelPointsOptions]
80
+ const BRep_menu = [ModelEdgesOptions, ModelPointsOptions];
85
81
 
86
- const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]
82
+ const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions];
87
83
 
88
- const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]
89
- const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]
84
+ const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions];
85
+ const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions];
90
86
 
91
- const Section_menu = [ModelEdgesOptions, ModelPointsOptions]
87
+ const Section_menu = [ModelEdgesOptions, ModelPointsOptions];
92
88
 
93
- const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]
89
+ const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions];
94
90
 
95
91
  const menusData = {
96
92
  mesh: {
@@ -118,88 +114,85 @@ const menusData = {
118
114
  Section: Section_menu,
119
115
  StructuralModel: StructuralModel_menu,
120
116
  },
121
- }
117
+ };
122
118
 
123
119
  export const useMenuStore = defineStore("menu", () => {
124
- const menus = shallowRef(menusData)
125
- const display_menu = ref(false)
126
- const current_id = ref(undefined)
127
- const menuX = ref(0)
128
- const menuY = ref(0)
129
- const containerWidth = ref(window.innerWidth)
130
- const containerHeight = ref(window.innerHeight)
131
- const containerTop = ref(0)
132
- const containerLeft = ref(0)
133
- const active_item_index = ref(undefined)
134
- const current_meta_data = ref({})
120
+ const menus = shallowRef(menusData);
121
+ const display_menu = ref(false);
122
+ const current_id = ref(undefined);
123
+ const menuX = ref(0);
124
+ const menuY = ref(0);
125
+ const containerWidth = ref(window.innerWidth);
126
+ const containerHeight = ref(window.innerHeight);
127
+ const containerTop = ref(0);
128
+ const containerLeft = ref(0);
129
+ const active_item_index = ref(undefined);
130
+ const current_meta_data = ref({});
135
131
 
136
132
  function getMenuItems(objectType, geodeObject) {
137
133
  if (!objectType || !geodeObject || !menus.value[objectType]) {
138
- return []
134
+ return [];
139
135
  }
140
- return menus.value[objectType][geodeObject] || []
136
+ return menus.value[objectType][geodeObject] || [];
141
137
  }
142
138
 
143
139
  function closeMenu() {
144
- active_item_index.value = undefined
145
- current_id.value = undefined
146
- current_meta_data.value = {}
147
- menuX.value = 0
148
- menuY.value = 0
149
- display_menu.value = false
140
+ active_item_index.value = undefined;
141
+ current_id.value = undefined;
142
+ current_meta_data.value = {};
143
+ menuX.value = 0;
144
+ menuY.value = 0;
145
+ display_menu.value = false;
150
146
  }
151
147
 
152
148
  async function openMenu(id, x, y, width, height, top, left, meta_data) {
153
- await closeMenu()
149
+ await closeMenu();
154
150
 
155
151
  if (meta_data) {
156
- const items = getMenuItems(
157
- meta_data.viewer_type,
158
- meta_data.geode_object_type,
159
- )
152
+ const items = getMenuItems(meta_data.viewer_type, meta_data.geode_object_type);
160
153
  if (items.length === 0) {
161
- return
154
+ return;
162
155
  }
163
156
  }
164
157
 
165
- current_id.value = id
166
- current_meta_data.value = meta_data || {}
158
+ current_id.value = id;
159
+ current_meta_data.value = meta_data || {};
167
160
 
168
161
  if (x !== undefined && y !== undefined) {
169
- menuX.value = x
170
- menuY.value = y
162
+ menuX.value = x;
163
+ menuY.value = y;
171
164
  }
172
165
 
173
- containerWidth.value = width
174
- containerHeight.value = height
175
- containerTop.value = top
176
- containerLeft.value = left
166
+ containerWidth.value = width;
167
+ containerHeight.value = height;
168
+ containerTop.value = top;
169
+ containerLeft.value = left;
177
170
 
178
- display_menu.value = true
171
+ display_menu.value = true;
179
172
  }
180
173
 
181
174
  function setMenuPosition(x, y) {
182
- menuX.value = x
183
- menuY.value = y
175
+ menuX.value = x;
176
+ menuY.value = y;
184
177
  }
185
178
 
186
179
  function toggleItemOptions(index) {
187
180
  if (active_item_index.value === index) {
188
- active_item_index.value = undefined
181
+ active_item_index.value = undefined;
189
182
  } else {
190
- active_item_index.value = index
183
+ active_item_index.value = index;
191
184
  }
192
185
  }
193
186
 
194
- const router = useRouter()
187
+ const router = useRouter();
195
188
  watch(
196
189
  () => router.currentRoute.value.path,
197
190
  () => {
198
191
  if (display_menu.value || active_item_index.value !== null) {
199
- closeMenu()
192
+ closeMenu();
200
193
  }
201
194
  },
202
- )
195
+ );
203
196
 
204
197
  return {
205
198
  display_menu,
@@ -217,5 +210,5 @@ export const useMenuStore = defineStore("menu", () => {
217
210
  openMenu,
218
211
  setMenuPosition,
219
212
  toggleItemOptions,
220
- }
221
- })
213
+ };
214
+ });
@@ -1,67 +1,64 @@
1
1
  export const useTreeviewStore = defineStore("treeview", () => {
2
- const PANEL_WIDTH = 300
3
-
4
- const items = ref([])
5
- const selection = ref([])
6
- const components_selection = ref([])
7
- const isAdditionnalTreeDisplayed = ref(false)
8
- const panelWidth = ref(PANEL_WIDTH)
9
- const model_id = ref("")
10
- const isTreeCollection = ref(false)
11
- const selectedTree = ref(undefined)
12
- const isImporting = ref(false)
13
- const pendingSelectionIds = ref([])
2
+ const PANEL_WIDTH = 300;
3
+
4
+ const items = ref([]);
5
+ const selection = ref([]);
6
+ const components_selection = ref([]);
7
+ const isAdditionnalTreeDisplayed = ref(false);
8
+ const panelWidth = ref(PANEL_WIDTH);
9
+ const model_id = ref("");
10
+ const isTreeCollection = ref(false);
11
+ const selectedTree = ref(undefined);
12
+ const isImporting = ref(false);
13
+ const pendingSelectionIds = ref([]);
14
14
 
15
15
  // /** Functions **/
16
16
  function addItem(geode_object_type, name, id, viewer_type) {
17
- const child = { title: name, id, viewer_type }
17
+ const child = { title: name, id, viewer_type };
18
18
 
19
19
  for (let i = 0; i < items.value.length; i += 1) {
20
20
  if (items.value[i].title === geode_object_type) {
21
- items.value[i].children.push(child)
21
+ items.value[i].children.push(child);
22
22
  items.value[i].children.sort((element1, element2) =>
23
23
  element1.title.localeCompare(element2.title, undefined, {
24
24
  numeric: true,
25
25
  sensitivity: "base",
26
26
  }),
27
- )
28
- selection.value.push(child)
29
- return
27
+ );
28
+ selection.value.push(child);
29
+ return;
30
30
  }
31
31
  }
32
- items.value.push({ title: geode_object_type, children: [child] })
32
+ items.value.push({ title: geode_object_type, children: [child] });
33
33
  items.value.sort((element1, element2) =>
34
34
  element1.title.localeCompare(element2.title, undefined, {
35
35
  numeric: true,
36
36
  sensitivity: "base",
37
37
  }),
38
- )
39
- selection.value.push(child)
38
+ );
39
+ selection.value.push(child);
40
40
  }
41
41
 
42
42
  function displayAdditionalTree(id) {
43
- isAdditionnalTreeDisplayed.value = true
44
- model_id.value = id
43
+ isAdditionnalTreeDisplayed.value = true;
44
+ model_id.value = id;
45
45
  }
46
46
 
47
47
  function displayFileTree() {
48
- isAdditionnalTreeDisplayed.value = false
48
+ isAdditionnalTreeDisplayed.value = false;
49
49
  }
50
50
 
51
51
  function toggleTreeView() {
52
- isTreeCollection.value = !isTreeCollection.value
53
- console.log(
54
- "Switched to",
55
- isTreeCollection.value ? "TreeCollection" : "TreeComponent",
56
- )
52
+ isTreeCollection.value = !isTreeCollection.value;
53
+ console.log("Switched to", isTreeCollection.value ? "TreeCollection" : "TreeComponent");
57
54
  }
58
55
 
59
56
  function setPanelWidth(width) {
60
- panelWidth.value = width
57
+ panelWidth.value = width;
61
58
  }
62
59
 
63
60
  function exportStores() {
64
- const selectionIds = selection.value.map((store) => store.id)
61
+ const selectionIds = selection.value.map((store) => store.id);
65
62
  return {
66
63
  isAdditionnalTreeDisplayed: isAdditionnalTreeDisplayed.value,
67
64
  panelWidth: panelWidth.value,
@@ -69,76 +66,71 @@ export const useTreeviewStore = defineStore("treeview", () => {
69
66
  isTreeCollection: isTreeCollection.value,
70
67
  selectedTree: selectedTree.value,
71
68
  selectionIds,
72
- }
69
+ };
73
70
  }
74
71
 
75
- async function importStores(snapshot) {
76
- isAdditionnalTreeDisplayed.value =
77
- snapshot?.isAdditionnalTreeDisplayed || false
78
- panelWidth.value = snapshot?.panelWidth || PANEL_WIDTH
79
- model_id.value = snapshot?.model_id || ""
80
- isTreeCollection.value = snapshot?.isTreeCollection || false
81
- selectedTree.value = snapshot?.selectedTree || undefined
72
+ function importStores(snapshot) {
73
+ isAdditionnalTreeDisplayed.value = snapshot?.isAdditionnalTreeDisplayed || false;
74
+ panelWidth.value = snapshot?.panelWidth || PANEL_WIDTH;
75
+ model_id.value = snapshot?.model_id || "";
76
+ isTreeCollection.value = snapshot?.isTreeCollection || false;
77
+ selectedTree.value = snapshot?.selectedTree || undefined;
82
78
 
83
79
  pendingSelectionIds.value =
84
- snapshot?.selectionIds ||
85
- (snapshot?.selection || []).map((store) => store.id) ||
86
- []
80
+ snapshot?.selectionIds || (snapshot?.selection || []).map((store) => store.id) || [];
87
81
  }
88
82
 
89
83
  function finalizeImportSelection() {
90
- const ids = pendingSelectionIds.value || []
91
- const rebuilt = []
92
- if (!ids.length) {
84
+ const ids = pendingSelectionIds.value || [];
85
+ const rebuilt = [];
86
+ if (ids.length === 0) {
93
87
  for (const group of items.value) {
94
88
  for (const child of group.children) {
95
- rebuilt.push(child)
89
+ rebuilt.push(child);
96
90
  }
97
91
  }
98
92
  } else {
99
93
  for (const group of items.value) {
100
94
  for (const child of group.children) {
101
95
  if (ids.includes(child.id)) {
102
- rebuilt.push(child)
96
+ rebuilt.push(child);
103
97
  }
104
98
  }
105
99
  }
106
100
  }
107
- selection.value = rebuilt
108
- pendingSelectionIds.value = []
101
+ selection.value = rebuilt;
102
+ pendingSelectionIds.value = [];
109
103
  }
110
104
 
111
105
  function removeItem(id) {
112
106
  for (let i = 0; i < items.value.length; i += 1) {
113
- const group = items.value[i]
114
- const childIndex = group.children.findIndex((child) => child.id === id)
107
+ const group = items.value[i];
108
+ const childIndex = group.children.findIndex((child) => child.id === id);
115
109
 
116
110
  if (childIndex !== -1) {
117
- group.children.splice(childIndex, 1)
111
+ group.children.splice(childIndex, 1);
118
112
 
119
113
  if (group.children.length === 0) {
120
- items.value.splice(i, 1)
114
+ items.value.splice(i, 1);
121
115
  }
122
116
 
123
- const selectionIndex = selection.value.findIndex(
124
- (item) => item.id === id,
125
- )
117
+ const selectionIndex = selection.value.findIndex((item) => item.id === id);
126
118
  if (selectionIndex !== -1) {
127
- selection.value.splice(selectionIndex, 1)
119
+ selection.value.splice(selectionIndex, 1);
128
120
  }
129
121
 
130
- return
122
+ return;
131
123
  }
132
124
  }
133
125
  }
134
126
 
135
127
  function clear() {
136
- items.value = []
137
- selection.value = []
138
- components_selection.value = []
139
- pendingSelectionIds.value = []
140
- model_id.value = ""
141
- selectedTree.value = undefined
128
+ items.value = [];
129
+ selection.value = [];
130
+ components_selection.value = [];
131
+ pendingSelectionIds.value = [];
132
+ model_id.value = "";
133
+ selectedTree.value = undefined;
142
134
  }
143
135
 
144
136
  return {
@@ -160,5 +152,5 @@ export const useTreeviewStore = defineStore("treeview", () => {
160
152
  importStores,
161
153
  finalizeImportSelection,
162
154
  clear,
163
- }
164
- })
155
+ };
156
+ });