@geode/opengeodeweb-front 10.44.0-rc.5 → 10.44.0-rc.7

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 (41) hide show
  1. package/app/assets/geode_objects.ts +1 -0
  2. package/app/components/BasemapAttribution.vue +28 -0
  3. package/app/components/Viewer/Basemap/CropOptions.vue +50 -0
  4. package/app/components/Viewer/Basemap/OpacityOptions.vue +52 -0
  5. package/app/components/Viewer/ContextMenu/ContextMenu.vue +5 -1
  6. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +6 -2
  7. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +49 -10
  8. package/app/components/Viewer/Ui.vue +6 -1
  9. package/app/composables/project_manager.ts +6 -97
  10. package/app/composables/project_manager_helpers/reset.ts +34 -0
  11. package/app/composables/project_manager_helpers/restore.ts +58 -0
  12. package/app/composables/project_manager_helpers/types.ts +24 -0
  13. package/app/composables/project_manager_helpers/viewer_session.ts +25 -0
  14. package/app/composables/viewer_context_menu.ts +10 -0
  15. package/app/stores/basemap.ts +52 -0
  16. package/app/stores/basemap_detail.ts +51 -0
  17. package/app/stores/basemap_helpers/builds.ts +158 -0
  18. package/app/stores/basemap_helpers/detail_layers.ts +72 -0
  19. package/app/stores/basemap_helpers/detail_map.ts +62 -0
  20. package/app/stores/basemap_helpers/detail_refresh.ts +134 -0
  21. package/app/stores/basemap_helpers/detail_view.ts +94 -0
  22. package/app/stores/basemap_helpers/extent.ts +40 -0
  23. package/app/stores/basemap_helpers/georeferenced.ts +50 -0
  24. package/app/stores/basemap_helpers/layers.ts +66 -0
  25. package/app/stores/basemap_helpers/settings.ts +87 -0
  26. package/app/stores/basemap_helpers/viewer.ts +114 -0
  27. package/app/stores/menu_helpers/basemap.ts +10 -0
  28. package/app/stores/menu_helpers/menus_data.ts +18 -120
  29. package/app/stores/menu_helpers/mesh/edged_curve.ts +12 -0
  30. package/app/stores/menu_helpers/mesh/grid.ts +24 -0
  31. package/app/stores/menu_helpers/mesh/point_set.ts +11 -0
  32. package/app/stores/menu_helpers/mesh/solid.ts +29 -0
  33. package/app/stores/menu_helpers/mesh/surface.ts +22 -0
  34. package/app/stores/menu_helpers/model.ts +25 -0
  35. package/app/stores/menu_helpers/types.ts +5 -0
  36. package/app/stores/viewer.ts +0 -1
  37. package/app/utils/basemap_tree.ts +76 -0
  38. package/app/utils/treeview.ts +12 -1
  39. package/app/utils/visible_map_area.ts +129 -0
  40. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -1
  41. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ import { type Extent, boxesExtent } from "./extent.js";
2
+ import type { ComputedRef } from "vue";
3
+ import { sameCrs } from "@ogw_front/utils/crs";
4
+ import { useCrsStore } from "@ogw_front/stores/crs";
5
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
6
+
7
+ interface Georeferenced {
8
+ // A map needs at least one data in the project CRS to lie under
9
+ available: ComputedRef<boolean>;
10
+ georeferencedIds: () => string[];
11
+ dataBounds: () => Extent | undefined;
12
+ // Changes with the project CRS, the georeferenced data or their extent
13
+ dataKey: () => string;
14
+ }
15
+
16
+ // Data without a CRS is still in local coordinates, and data in another CRS than the
17
+ // Project would be misplaced: only the data in the project CRS are under the basemap
18
+ function useGeoreferenced(): Georeferenced {
19
+ const crsStore = useCrsStore();
20
+ const hybridViewerStore = useHybridViewerStore();
21
+
22
+ function georeferencedIds(): string[] {
23
+ return crsStore.crsItems
24
+ .filter((item) => sameCrs(item.crs, crsStore.projectCrs))
25
+ .map((item) => item.id);
26
+ }
27
+
28
+ const available = computed(
29
+ () => crsStore.projectCrs !== undefined && georeferencedIds().length > 0,
30
+ );
31
+
32
+ function dataBounds(): Extent | undefined {
33
+ const georeferenced = new Set(georeferencedIds());
34
+ return boxesExtent(
35
+ Object.entries(hybridViewerStore.hybridDb)
36
+ .filter(([id]) => georeferenced.has(id))
37
+ .map(([, entry]) => entry.polydata.getBounds()),
38
+ );
39
+ }
40
+
41
+ function dataKey(): string {
42
+ const crs = crsStore.projectCrs;
43
+ const extentKey = JSON.stringify(dataBounds() ?? "none");
44
+ return `${crs?.authority}:${crs?.code}|${georeferencedIds().join(",")}|${extentKey}`;
45
+ }
46
+
47
+ return { available, georeferencedIds, dataBounds, dataKey };
48
+ }
49
+
50
+ export { useGeoreferenced };
@@ -0,0 +1,66 @@
1
+ import type { ComputedRef, Ref } from "vue";
2
+ import { type Layer, useBasemapViewer } from "./viewer.js";
3
+ import type { BasemapBuildResponse } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
+ import type { MapStyle } from "@ogw_front/utils/basemap_tree";
5
+ import { everyMap } from "./extent.js";
6
+
7
+ interface BasemapLayers {
8
+ // The last chosen maps: shown again when the basemap is shown again
9
+ shown: Ref<MapStyle[]>;
10
+ // Shown as soon as the project has a CRS, until the user hides it
11
+ hidden: Ref<boolean>;
12
+ // The visible maps, from the bottom one to the top one
13
+ maps: ComputedRef<MapStyle[]>;
14
+ opacities: Ref<Record<MapStyle, number>>;
15
+ // Cropped: only draped on the top surfaces, out of the flat map around
16
+ crop: Ref<Record<MapStyle, boolean>>;
17
+ // The maps downloaded in the current basemap: the others need a build
18
+ built: Ref<MapStyle[]>;
19
+ layersParams: () => Layer[];
20
+ applyLayers: (id: string) => Promise<void>;
21
+ // Returns the layers sent: the states changed meanwhile are sent again
22
+ applyBasemap: (
23
+ response: BasemapBuildResponse,
24
+ name: string,
25
+ detailOf?: string,
26
+ ) => Promise<string>;
27
+ }
28
+
29
+ // The state of each map, and how it reaches the viewer
30
+ function useBasemapLayers(georeferencedIds: () => string[]): BasemapLayers {
31
+ const { sendLayers, showMap } = useBasemapViewer();
32
+ const shown = ref<MapStyle[]>(["satellite"]);
33
+ const hidden = ref(false);
34
+ const maps = computed<MapStyle[]>(() => (hidden.value ? [] : shown.value));
35
+ const opacities = ref<Record<MapStyle, number>>(everyMap(1));
36
+ const crop = ref<Record<MapStyle, boolean>>(everyMap(false));
37
+ const built = ref<MapStyle[]>([]);
38
+
39
+ function layersParams(): Layer[] {
40
+ return built.value.map((map) => ({
41
+ map,
42
+ visible: maps.value.includes(map),
43
+ opacity: opacities.value[map],
44
+ crop: crop.value[map],
45
+ }));
46
+ }
47
+
48
+ async function applyLayers(id: string): Promise<void> {
49
+ await sendLayers(id, layersParams());
50
+ }
51
+
52
+ async function applyBasemap(
53
+ response: BasemapBuildResponse,
54
+ name: string,
55
+ detailOf?: string,
56
+ ): Promise<string> {
57
+ const layers = layersParams();
58
+ await showMap({ response, name, layers, dataIds: georeferencedIds() }, detailOf);
59
+ return JSON.stringify(layers);
60
+ }
61
+
62
+ return { shown, hidden, maps, opacities, crop, built, layersParams, applyLayers, applyBasemap };
63
+ }
64
+
65
+ export type { BasemapLayers };
66
+ export { useBasemapLayers };
@@ -0,0 +1,87 @@
1
+ import { type MapStyle, sortedMaps } from "@ogw_front/utils/basemap_tree";
2
+ import type { BasemapLayers } from "./layers.js";
3
+ import type { Ref } from "vue";
4
+ import { coalesced } from "./viewer.js";
5
+ import { everyMap } from "./extent.js";
6
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
7
+
8
+ interface BasemapSnapshot {
9
+ maps?: MapStyle[];
10
+ opacities?: Partial<Record<MapStyle, number>>;
11
+ crop?: Partial<Record<MapStyle, boolean>>;
12
+ }
13
+
14
+ interface BasemapSettings {
15
+ setMaps: (newMaps: readonly MapStyle[]) => Promise<void>;
16
+ setOpacity: (mapStyle: MapStyle, value: number) => Promise<void>;
17
+ setCrop: (value: boolean, mapStyles: readonly MapStyle[]) => Promise<void>;
18
+ exportStores: () => Required<BasemapSnapshot>;
19
+ importStores: (snapshot: BasemapSnapshot | undefined) => Promise<void>;
20
+ }
21
+
22
+ // The choices of the user: a change already built only recomposes, the others rebuild
23
+ function useBasemapSettings(
24
+ layers: BasemapLayers,
25
+ basemapId: Ref<string | undefined>,
26
+ rebuild: () => Promise<void>,
27
+ ): BasemapSettings {
28
+ const hybridViewerStore = useHybridViewerStore();
29
+ const { shown, hidden, maps, opacities, crop, built, applyLayers } = layers;
30
+
31
+ const recompose = coalesced(async () => {
32
+ const id = basemapId.value;
33
+ if (id !== undefined) {
34
+ await applyLayers(id);
35
+ await hybridViewerStore.remoteRender();
36
+ }
37
+ });
38
+
39
+ // No map hides the basemap and keeps the last maps, to show them again. Hidden, the built
40
+ // Basemap stays with every layer invisible: shown again, it only recomposes
41
+ async function setMaps(newMaps: readonly MapStyle[]): Promise<void> {
42
+ if (newMaps.length === 0) {
43
+ hidden.value = true;
44
+ } else {
45
+ shown.value = sortedMaps(newMaps);
46
+ hidden.value = false;
47
+ }
48
+ const allBuilt = maps.value.every((mapStyle) => built.value.includes(mapStyle));
49
+ if (basemapId.value !== undefined && allBuilt) {
50
+ await recompose();
51
+ return;
52
+ }
53
+ await rebuild();
54
+ }
55
+
56
+ // No rebuild: each map keeps its opacity
57
+ async function setOpacity(mapStyle: MapStyle, value: number): Promise<void> {
58
+ opacities.value = { ...opacities.value, [mapStyle]: value };
59
+ await recompose();
60
+ }
61
+
62
+ // No rebuild
63
+ async function setCrop(value: boolean, mapStyles: readonly MapStyle[]): Promise<void> {
64
+ crop.value = {
65
+ ...crop.value,
66
+ ...Object.fromEntries(mapStyles.map((mapStyle) => [mapStyle, value])),
67
+ };
68
+ await recompose();
69
+ }
70
+
71
+ function exportStores(): Required<BasemapSnapshot> {
72
+ return { maps: maps.value, opacities: opacities.value, crop: crop.value };
73
+ }
74
+
75
+ // Called once the project data is imported. When the data is not displayed yet,
76
+ // The rebuild finds no bounds and the store rebuilds once it is displayed.
77
+ async function importStores(snapshot: BasemapSnapshot | undefined): Promise<void> {
78
+ opacities.value = { ...everyMap(1), ...snapshot?.opacities };
79
+ crop.value = { ...everyMap(false), ...snapshot?.crop };
80
+ await setMaps(sortedMaps(snapshot?.maps ?? ["satellite"]));
81
+ }
82
+
83
+ return { setMaps, setOpacity, setCrop, exportStores, importStores };
84
+ }
85
+
86
+ export type { BasemapSnapshot };
87
+ export { useBasemapSettings };
@@ -0,0 +1,114 @@
1
+ import back_schemas, {
2
+ type BasemapBuildResponse,
3
+ } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
+ import type { MapStyle } from "@ogw_front/utils/basemap_tree";
5
+ import { useBackStore } from "@ogw_front/stores/back";
6
+ import { useDataStore } from "@ogw_front/stores/data";
7
+ import { useViewerStore } from "@ogw_front/stores/viewer";
8
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
9
+
10
+ interface Layer {
11
+ map: MapStyle;
12
+ visible: boolean;
13
+ opacity: number;
14
+ crop: boolean;
15
+ }
16
+
17
+ function ignoreError(): void {
18
+ // Already reported by the request feedback
19
+ }
20
+
21
+ interface MapToShow {
22
+ response: BasemapBuildResponse;
23
+ name: string;
24
+ layers: Layer[];
25
+ dataIds: string[];
26
+ }
27
+
28
+ interface BasemapViewer {
29
+ discardMap: (id: string, registered: boolean) => Promise<void>;
30
+ sendLayers: (id: string, layers: Layer[]) => Promise<void>;
31
+ showMap: (map: Readonly<MapToShow>, detailOf?: string) => Promise<void>;
32
+ }
33
+
34
+ // The stores are taken once: a call still running after a project reset reaches its own stores
35
+ function useBasemapViewer(): BasemapViewer {
36
+ const backStore = useBackStore();
37
+ const dataStore = useDataStore();
38
+ const viewerStore = useViewerStore();
39
+
40
+ // Best effort: a map left behind is only a leftover, never an error to show twice.
41
+ // A registered map leaves the viewer before the back deletes its files
42
+ async function discardMap(id: string, registered: boolean): Promise<void> {
43
+ if (registered) {
44
+ await dataStore.deregisterObject(id).catch(ignoreError);
45
+ }
46
+ await backStore
47
+ .request({ schema: back_schemas.opengeodeweb_back.basemap.delete, params: { id } })
48
+ .catch(ignoreError);
49
+ }
50
+
51
+ // The viewer recomposes its textures: no download, no new mesh
52
+ async function sendLayers(id: string, layers: Layer[]): Promise<void> {
53
+ await viewerStore.request({
54
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.basemap_layers,
55
+ params: { id, layers },
56
+ });
57
+ }
58
+
59
+ // Registers a built map, shows it with the layers and drapes the top surfaces of the data
60
+ async function showMap(
61
+ { response, name, layers, dataIds }: Readonly<MapToShow>,
62
+ detailOf?: string,
63
+ ): Promise<void> {
64
+ await dataStore.registerObject(response.id, name);
65
+ await viewerStore.request({
66
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.apply_basemap,
67
+ params: {
68
+ id: response.id,
69
+ columns: response.columns,
70
+ rows: response.rows,
71
+ maps: response.maps,
72
+ layers,
73
+ detail_of: detailOf,
74
+ },
75
+ });
76
+ await viewerStore.request({
77
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.basemap_drape,
78
+ params: { id: response.id, data_ids: dataIds },
79
+ });
80
+ }
81
+
82
+ return { discardMap, sendLayers, showMap };
83
+ }
84
+
85
+ // At most one run at a time: calls made meanwhile (a slider dragged) run once more when it
86
+ // Returns, with the latest states
87
+ function coalesced(run: () => Promise<void>): () => Promise<void> {
88
+ let running: Promise<void> | undefined = undefined;
89
+ let again = false;
90
+ async function latest(): Promise<void> {
91
+ again = false;
92
+ await run();
93
+ if (again) {
94
+ await latest();
95
+ }
96
+ }
97
+ return async () => {
98
+ if (running !== undefined) {
99
+ again = true;
100
+ await running;
101
+ return;
102
+ }
103
+ running = latest();
104
+ try {
105
+ await running;
106
+ } finally {
107
+ running = undefined;
108
+ again = false;
109
+ }
110
+ };
111
+ }
112
+
113
+ export type { Layer };
114
+ export { coalesced, ignoreError, useBasemapViewer };
@@ -0,0 +1,10 @@
1
+ import BasemapCropOptions from "@ogw_front/components/Viewer/Basemap/CropOptions.vue";
2
+ import BasemapOpacityOptions from "@ogw_front/components/Viewer/Basemap/OpacityOptions.vue";
3
+ import type { MenuItems } from "./types.js";
4
+
5
+ const basemapMenus: Record<string, MenuItems> = {
6
+ Basemap: [BasemapCropOptions],
7
+ Map: [BasemapOpacityOptions, BasemapCropOptions],
8
+ };
9
+
10
+ export { basemapMenus };
@@ -1,127 +1,25 @@
1
- // PointSet components
2
- import PointSetPointsOptions from "@ogw_front/components/Viewer/PointSet/SpecificPointsOptions.vue";
3
-
4
- // EdgedCurve components
5
- import EdgedCurveEdgesOptions from "@ogw_front/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue";
6
- import EdgedCurvePointsOptions from "@ogw_front/components/Viewer/EdgedCurve/PointsOptions.vue";
7
-
8
- // Surface components
9
- import SurfaceEdgesOptions from "@ogw_front/components/Viewer/Surface/EdgesOptions.vue";
10
- import SurfacePointsOptions from "@ogw_front/components/Viewer/Surface/PointsOptions.vue";
11
- import SurfacePolygonsOptions from "@ogw_front/components/Viewer/Surface/PolygonsOptions.vue";
12
-
13
- // TriangulatedSurface components
14
- import TriangulatedSurfaceTrianglesOptions from "@ogw_front/components/Viewer/Surface/Triangulated/TrianglesOptions.vue";
15
-
16
- // Grid 2D components
17
- import Grid2DCellsOptions from "@ogw_front/components/Viewer/Grid/2D/CellsOptions.vue";
18
- import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOptions.vue";
19
- import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions.vue";
20
-
21
- // Grid 3D components
22
- import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions.vue";
23
- import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions.vue";
24
- import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions.vue";
25
-
26
- // Solid components
27
- import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions.vue";
28
- import SolidPointsOptions from "@ogw_front/components/Viewer/Solid/PointsOptions.vue";
29
- import SolidPolygonsOptions from "@ogw_front/components/Viewer/Solid/PolygonsOptions.vue";
30
- import SolidPolyhedraOptions from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraOptions.vue";
31
-
32
- // TetrahedralSolid components
33
- import TetrahedralSolidTetrahedraOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue";
34
- import TetrahedralSolidTrianglesOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TrianglesOptions.vue";
35
-
36
- // Model components
37
- import ModelEdgesOptions from "@ogw_front/components/Viewer/Generic/Model/EdgesOptions.vue";
38
- import ModelPointsOptions from "@ogw_front/components/Viewer/Generic/Model/PointsOptions.vue";
39
- import ModelStyleOptions from "@ogw_front/components/Viewer/Generic/Model/ModelStyleOptions.vue";
40
-
41
- import type { Component } from "vue";
42
-
43
- type MenuItems = Component[];
44
-
45
- const PointSet_menu = [PointSetPointsOptions];
46
-
47
- const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions];
48
-
49
- const PolygonalSurface_menu = [SurfacePointsOptions, SurfaceEdgesOptions, SurfacePolygonsOptions];
50
-
51
- const TriangulatedSurface_menu = [
52
- SurfacePointsOptions,
53
- SurfaceEdgesOptions,
54
- TriangulatedSurfaceTrianglesOptions,
55
- ];
56
-
57
- const Grid2D_menu = [Grid2DPointsOptions, Grid2DEdgesOptions, Grid2DCellsOptions];
58
- const Grid3D_menu = [
59
- Grid3DPointsOptions,
60
- Grid3DEdgesOptions,
61
- // Grid3DFacetsOptions,
62
- Grid3DCellsOptions,
63
- ];
64
-
65
- const Solid_menu = [
66
- SolidPointsOptions,
67
- SolidEdgesOptions,
68
- SolidPolygonsOptions,
69
- SolidPolyhedraOptions,
70
- ];
71
-
72
- const TetrahedralSolid_menu = [
73
- SolidPointsOptions,
74
- SolidEdgesOptions,
75
- TetrahedralSolidTrianglesOptions,
76
- TetrahedralSolidTetrahedraOptions,
77
- ];
78
-
79
- const BRep_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
80
-
81
- const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
82
-
83
- const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
84
- const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
85
-
86
- const Section_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
87
-
88
- const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
89
-
90
- const ModelComponent_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
1
+ import { modelComponentMenus, modelComponentTypeMenus, modelMenus } from "./model.js";
2
+ import type { MenuItems } from "./types.js";
3
+ import { basemapMenus } from "./basemap.js";
4
+ import { edgedCurveMenus } from "./mesh/edged_curve.js";
5
+ import { gridMenus } from "./mesh/grid.js";
6
+ import { pointSetMenus } from "./mesh/point_set.js";
7
+ import { solidMenus } from "./mesh/solid.js";
8
+ import { surfaceMenus } from "./mesh/surface.js";
91
9
 
92
10
  const menusData: Record<string, Record<string, MenuItems>> = {
93
11
  mesh: {
94
- EdgedCurve2D: EdgedCurve_menu,
95
- EdgedCurve3D: EdgedCurve_menu,
96
- HybridSolid3D: Solid_menu,
97
- LightRegularGrid2D: Grid2D_menu,
98
- LightRegularGrid3D: Grid3D_menu,
99
- PointSet2D: PointSet_menu,
100
- PointSet3D: PointSet_menu,
101
- PolygonalSurface2D: PolygonalSurface_menu,
102
- PolygonalSurface3D: PolygonalSurface_menu,
103
- PolyhedralSolid3D: Solid_menu,
104
- RegularGrid2D: Grid2D_menu,
105
- RegularGrid3D: Grid3D_menu,
106
- TetrahedralSolid3D: TetrahedralSolid_menu,
107
- TriangulatedSurface2D: TriangulatedSurface_menu,
108
- TriangulatedSurface3D: TriangulatedSurface_menu,
109
- },
110
- model: {
111
- BRep: BRep_menu,
112
- CrossSection: CrossSection_menu,
113
- ImplicitCrossSection: ImplicitCrossSection_menu,
114
- ImplicitStructuralModel: ImplicitStructuralModel_menu,
115
- Section: Section_menu,
116
- StructuralModel: StructuralModel_menu,
117
- },
118
- model_component_type: {
119
- type: ModelComponent_menu,
120
- },
121
- model_component: {
122
- component: ModelComponent_menu,
12
+ ...edgedCurveMenus,
13
+ ...gridMenus,
14
+ ...pointSetMenus,
15
+ ...solidMenus,
16
+ ...surfaceMenus,
123
17
  },
18
+ model: modelMenus,
19
+ model_component_type: modelComponentTypeMenus,
20
+ model_component: modelComponentMenus,
21
+ basemap: basemapMenus,
124
22
  };
125
23
 
126
24
  export { menusData };
127
- export type { MenuItems };
25
+ export type { MenuItems } from "./types.js";
@@ -0,0 +1,12 @@
1
+ import EdgedCurveEdgesOptions from "@ogw_front/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue";
2
+ import EdgedCurvePointsOptions from "@ogw_front/components/Viewer/EdgedCurve/PointsOptions.vue";
3
+ import type { MenuItems } from "@ogw_front/stores/menu_helpers/types";
4
+
5
+ const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions];
6
+
7
+ const edgedCurveMenus: Record<string, MenuItems> = {
8
+ EdgedCurve2D: EdgedCurve_menu,
9
+ EdgedCurve3D: EdgedCurve_menu,
10
+ };
11
+
12
+ export { edgedCurveMenus };
@@ -0,0 +1,24 @@
1
+ import Grid2DCellsOptions from "@ogw_front/components/Viewer/Grid/2D/CellsOptions.vue";
2
+ import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOptions.vue";
3
+ import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions.vue";
4
+ import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions.vue";
5
+ import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions.vue";
6
+ import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions.vue";
7
+ import type { MenuItems } from "@ogw_front/stores/menu_helpers/types";
8
+
9
+ const Grid2D_menu = [Grid2DPointsOptions, Grid2DEdgesOptions, Grid2DCellsOptions];
10
+ const Grid3D_menu = [
11
+ Grid3DPointsOptions,
12
+ Grid3DEdgesOptions,
13
+ // Grid3DFacetsOptions,
14
+ Grid3DCellsOptions,
15
+ ];
16
+
17
+ const gridMenus: Record<string, MenuItems> = {
18
+ LightRegularGrid2D: Grid2D_menu,
19
+ LightRegularGrid3D: Grid3D_menu,
20
+ RegularGrid2D: Grid2D_menu,
21
+ RegularGrid3D: Grid3D_menu,
22
+ };
23
+
24
+ export { gridMenus };
@@ -0,0 +1,11 @@
1
+ import type { MenuItems } from "@ogw_front/stores/menu_helpers/types";
2
+ import PointSetPointsOptions from "@ogw_front/components/Viewer/PointSet/SpecificPointsOptions.vue";
3
+
4
+ const PointSet_menu = [PointSetPointsOptions];
5
+
6
+ const pointSetMenus: Record<string, MenuItems> = {
7
+ PointSet2D: PointSet_menu,
8
+ PointSet3D: PointSet_menu,
9
+ };
10
+
11
+ export { pointSetMenus };
@@ -0,0 +1,29 @@
1
+ import type { MenuItems } from "@ogw_front/stores/menu_helpers/types";
2
+ import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions.vue";
3
+ import SolidPointsOptions from "@ogw_front/components/Viewer/Solid/PointsOptions.vue";
4
+ import SolidPolygonsOptions from "@ogw_front/components/Viewer/Solid/PolygonsOptions.vue";
5
+ import SolidPolyhedraOptions from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraOptions.vue";
6
+ import TetrahedralSolidTetrahedraOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue";
7
+ import TetrahedralSolidTrianglesOptions from "@ogw_front/components/Viewer/TetrahedralSolid/TrianglesOptions.vue";
8
+
9
+ const Solid_menu = [
10
+ SolidPointsOptions,
11
+ SolidEdgesOptions,
12
+ SolidPolygonsOptions,
13
+ SolidPolyhedraOptions,
14
+ ];
15
+
16
+ const TetrahedralSolid_menu = [
17
+ SolidPointsOptions,
18
+ SolidEdgesOptions,
19
+ TetrahedralSolidTrianglesOptions,
20
+ TetrahedralSolidTetrahedraOptions,
21
+ ];
22
+
23
+ const solidMenus: Record<string, MenuItems> = {
24
+ HybridSolid3D: Solid_menu,
25
+ PolyhedralSolid3D: Solid_menu,
26
+ TetrahedralSolid3D: TetrahedralSolid_menu,
27
+ };
28
+
29
+ export { solidMenus };
@@ -0,0 +1,22 @@
1
+ import type { MenuItems } from "@ogw_front/stores/menu_helpers/types";
2
+ import SurfaceEdgesOptions from "@ogw_front/components/Viewer/Surface/EdgesOptions.vue";
3
+ import SurfacePointsOptions from "@ogw_front/components/Viewer/Surface/PointsOptions.vue";
4
+ import SurfacePolygonsOptions from "@ogw_front/components/Viewer/Surface/PolygonsOptions.vue";
5
+ import TriangulatedSurfaceTrianglesOptions from "@ogw_front/components/Viewer/Surface/Triangulated/TrianglesOptions.vue";
6
+
7
+ const PolygonalSurface_menu = [SurfacePointsOptions, SurfaceEdgesOptions, SurfacePolygonsOptions];
8
+
9
+ const TriangulatedSurface_menu = [
10
+ SurfacePointsOptions,
11
+ SurfaceEdgesOptions,
12
+ TriangulatedSurfaceTrianglesOptions,
13
+ ];
14
+
15
+ const surfaceMenus: Record<string, MenuItems> = {
16
+ PolygonalSurface2D: PolygonalSurface_menu,
17
+ PolygonalSurface3D: PolygonalSurface_menu,
18
+ TriangulatedSurface2D: TriangulatedSurface_menu,
19
+ TriangulatedSurface3D: TriangulatedSurface_menu,
20
+ };
21
+
22
+ export { surfaceMenus };
@@ -0,0 +1,25 @@
1
+ import type { MenuItems } from "./types.js";
2
+ import ModelEdgesOptions from "@ogw_front/components/Viewer/Generic/Model/EdgesOptions.vue";
3
+ import ModelPointsOptions from "@ogw_front/components/Viewer/Generic/Model/PointsOptions.vue";
4
+ import ModelStyleOptions from "@ogw_front/components/Viewer/Generic/Model/ModelStyleOptions.vue";
5
+
6
+ const Model_menu = [ModelEdgesOptions, ModelPointsOptions, ModelStyleOptions];
7
+
8
+ const modelMenus: Record<string, MenuItems> = {
9
+ BRep: Model_menu,
10
+ CrossSection: Model_menu,
11
+ ImplicitCrossSection: Model_menu,
12
+ ImplicitStructuralModel: Model_menu,
13
+ Section: Model_menu,
14
+ StructuralModel: Model_menu,
15
+ };
16
+
17
+ const modelComponentTypeMenus: Record<string, MenuItems> = {
18
+ type: Model_menu,
19
+ };
20
+
21
+ const modelComponentMenus: Record<string, MenuItems> = {
22
+ component: Model_menu,
23
+ };
24
+
25
+ export { modelComponentMenus, modelComponentTypeMenus, modelMenus };
@@ -0,0 +1,5 @@
1
+ import type { Component } from "vue";
2
+
3
+ type MenuItems = Component[];
4
+
5
+ export type { MenuItems };
@@ -27,7 +27,6 @@ import type {
27
27
  RequestHandlers,
28
28
  ResponseOf,
29
29
  } from "@ogw_shared/utils/types.js";
30
- // oxlint-disable-next-line import/max-dependencies -- all imports above are required by this store.
31
30
  import type { RpcClient } from "@ogw_shared/utils/call_raw.js";
32
31
 
33
32
  interface PickedPoint {