@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.
- package/.eslintrc.cjs +1 -1
- package/.oxlintrc.json +3 -22
- package/app/assets/geode_objects.js +26 -26
- package/app/components/Carousel.vue +62 -66
- package/app/components/CrsSelector.vue +48 -52
- package/app/components/DeleteDialog.vue +21 -37
- package/app/components/DragAndDrop.vue +35 -41
- package/app/components/ExtensionSelector.vue +50 -63
- package/app/components/FeedBack/ErrorBanner.vue +7 -10
- package/app/components/FeedBack/Snackers.vue +12 -14
- package/app/components/FetchingData.vue +1 -6
- package/app/components/FileSelector.vue +41 -47
- package/app/components/FileUploader.vue +62 -79
- package/app/components/GlassCard.vue +19 -19
- package/app/components/HybridRenderingView.vue +37 -38
- package/app/components/InfraConnected.vue +3 -3
- package/app/components/Inspector/InspectionButton.vue +27 -31
- package/app/components/Inspector/ResultPanel.vue +13 -24
- package/app/components/Launcher.vue +13 -13
- package/app/components/Loading.vue +63 -69
- package/app/components/MissingFilesSelector.vue +53 -73
- package/app/components/ObjectSelector.vue +81 -99
- package/app/components/PackagesVersions.vue +27 -30
- package/app/components/Recaptcha.vue +60 -71
- package/app/components/RemoteRenderingView.vue +102 -108
- package/app/components/Screenshot.vue +36 -42
- package/app/components/SearchBar.vue +5 -5
- package/app/components/Step.vue +37 -44
- package/app/components/Stepper.vue +29 -35
- package/app/components/VeaseViewToolbar.vue +69 -78
- package/app/components/ViewToolbar.vue +41 -45
- package/app/components/Viewer/BreadCrumb.vue +18 -30
- package/app/components/Viewer/ContextMenu.vue +176 -179
- package/app/components/Viewer/ContextMenuItem.vue +105 -117
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +6 -9
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +82 -93
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +84 -99
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +83 -98
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +62 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -108
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +82 -105
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +19 -23
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +26 -30
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +6 -9
- package/app/components/Viewer/Options/AttributeColorBar.vue +8 -8
- package/app/components/Viewer/Options/AttributeSelector.vue +73 -78
- package/app/components/Viewer/Options/ColorMapList.vue +115 -140
- package/app/components/Viewer/Options/ColorMapPicker.vue +128 -142
- package/app/components/Viewer/Options/ColorPicker.vue +9 -9
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -91
- package/app/components/Viewer/Options/TextureItem.vue +54 -58
- package/app/components/Viewer/Options/TexturesSelector.vue +22 -26
- package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +61 -68
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +83 -103
- package/app/components/Viewer/Solid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Solid/PointsOptions.vue +6 -9
- package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +82 -105
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +5 -5
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +5 -5
- package/app/components/Viewer/Tree/ObjectTree.vue +80 -89
- package/app/components/Viewer/TreeComponent.vue +43 -49
- package/app/components/Viewer/TreeObject.vue +48 -50
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +5 -5
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +5 -5
- package/app/components/Wrapper.vue +8 -8
- package/app/components/ZScaling.vue +18 -27
- package/app/composables/project_manager.js +57 -67
- package/app/composables/run_function_when_microservices_connected.js +8 -8
- package/app/plugins/auto_store_register.js +11 -13
- package/app/stores/app.js +118 -138
- package/app/stores/data.js +52 -68
- package/app/stores/data_style.js +36 -36
- package/app/stores/feedback.js +17 -20
- package/app/stores/geode.js +54 -55
- package/app/stores/hybrid_viewer.js +164 -177
- package/app/stores/infra.js +45 -55
- package/app/stores/lambda.js +26 -26
- package/app/stores/menu.js +78 -85
- package/app/stores/treeview.js +57 -65
- package/app/stores/viewer.js +92 -104
- package/app/utils/colormap.js +3 -3
- package/app/utils/config.js +16 -22
- package/app/utils/default_styles.js +50 -62
- package/app/utils/extension.js +44 -44
- package/app/utils/file_import_workflow.js +50 -64
- package/app/utils/local/app_mode.js +2 -2
- package/app/utils/local/cleanup.js +66 -72
- package/app/utils/local/microservices.js +61 -71
- package/app/utils/local/path.js +16 -19
- package/app/utils/local/scripts.js +22 -22
- package/app/utils/recaptcha.js +6 -6
- package/app/utils/server.js +21 -24
- package/app/utils/status.js +2 -2
- package/app/utils/treeview.js +4 -4
- package/app/utils/validate_schema.js +7 -7
- package/commitlint.config.js +2 -2
- package/eslint.config.js +4 -4
- package/internal/database/database.js +38 -46
- package/internal/database/extended_database.js +9 -10
- package/internal/database/tables/data.js +2 -3
- package/internal/database/tables/model_components.js +1 -1
- package/internal/database/tables/model_components_relation.js +1 -1
- package/internal/stores/data_style/mesh/cells/cell.js +47 -63
- package/internal/stores/data_style/mesh/cells/color.js +11 -16
- package/internal/stores/data_style/mesh/cells/common.js +6 -6
- package/internal/stores/data_style/mesh/cells/index.js +37 -47
- package/internal/stores/data_style/mesh/cells/textures.js +11 -12
- package/internal/stores/data_style/mesh/cells/vertex.js +47 -58
- package/internal/stores/data_style/mesh/cells/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/color.js +11 -16
- package/internal/stores/data_style/mesh/edges/common.js +6 -6
- package/internal/stores/data_style/mesh/edges/edge.js +47 -63
- package/internal/stores/data_style/mesh/edges/index.js +38 -52
- package/internal/stores/data_style/mesh/edges/vertex.js +47 -58
- package/internal/stores/data_style/mesh/edges/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/width.js +11 -16
- package/internal/stores/data_style/mesh/index.js +34 -34
- package/internal/stores/data_style/mesh/points/color.js +11 -16
- package/internal/stores/data_style/mesh/points/common.js +6 -6
- package/internal/stores/data_style/mesh/points/index.js +35 -49
- package/internal/stores/data_style/mesh/points/size.js +11 -16
- package/internal/stores/data_style/mesh/points/vertex.js +47 -58
- package/internal/stores/data_style/mesh/points/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polygons/color.js +11 -16
- package/internal/stores/data_style/mesh/polygons/common.js +6 -6
- package/internal/stores/data_style/mesh/polygons/index.js +36 -45
- package/internal/stores/data_style/mesh/polygons/polygon.js +45 -56
- package/internal/stores/data_style/mesh/polygons/textures.js +11 -16
- package/internal/stores/data_style/mesh/polygons/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polygons/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/color.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/common.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/index.js +29 -42
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +43 -47
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +11 -17
- package/internal/stores/data_style/model/blocks/color.js +21 -24
- package/internal/stores/data_style/model/blocks/common.js +6 -6
- package/internal/stores/data_style/model/blocks/index.js +13 -17
- package/internal/stores/data_style/model/blocks/visibility.js +21 -24
- package/internal/stores/data_style/model/corners/color.js +21 -24
- package/internal/stores/data_style/model/corners/common.js +6 -6
- package/internal/stores/data_style/model/corners/index.js +14 -18
- package/internal/stores/data_style/model/corners/visibility.js +21 -25
- package/internal/stores/data_style/model/edges/common.js +4 -4
- package/internal/stores/data_style/model/edges/index.js +7 -7
- package/internal/stores/data_style/model/edges/visibility.js +11 -15
- package/internal/stores/data_style/model/index.js +84 -100
- package/internal/stores/data_style/model/lines/color.js +21 -24
- package/internal/stores/data_style/model/lines/common.js +6 -6
- package/internal/stores/data_style/model/lines/index.js +13 -17
- package/internal/stores/data_style/model/lines/visibility.js +21 -24
- package/internal/stores/data_style/model/points/common.js +4 -4
- package/internal/stores/data_style/model/points/index.js +9 -9
- package/internal/stores/data_style/model/points/size.js +11 -11
- package/internal/stores/data_style/model/points/visibility.js +11 -15
- package/internal/stores/data_style/model/surfaces/color.js +21 -24
- package/internal/stores/data_style/model/surfaces/common.js +6 -6
- package/internal/stores/data_style/model/surfaces/index.js +14 -22
- package/internal/stores/data_style/model/surfaces/visibility.js +18 -22
- package/internal/stores/data_style/state.js +11 -11
- package/internal/utils/api_fetch.js +24 -34
- package/internal/utils/upload_file.js +19 -24
- package/internal/utils/viewer_call.js +23 -36
- package/nuxt.config.js +7 -11
- package/package.json +3 -3
- package/scripts/generate_geode_objects.js +14 -16
- package/server/api/app/kill.post.js +4 -4
- package/server/api/app/project_folder_path.post.js +11 -11
- package/server/api/app/run_back.post.js +12 -12
- package/server/api/app/run_viewer.post.js +12 -12
- package/server/api/extensions/run.post.js +34 -41
- package/server/api/extensions/upload.put.js +48 -62
- package/tests/integration/setup.js +43 -53
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +90 -116
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +81 -107
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +38 -41
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +85 -101
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +89 -113
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +81 -105
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +56 -73
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +59 -76
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +39 -42
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -34
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +60 -73
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +52 -55
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +59 -80
- package/tests/integration/stores/viewer.nuxt.test.js +35 -38
- package/tests/setup_indexeddb.js +2 -2
- package/tests/unit/components/CrsSelector.nuxt.test.js +28 -28
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +33 -35
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -23
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +18 -18
- package/tests/unit/components/FileSelector.nuxt.test.js +57 -59
- package/tests/unit/components/FileUploader.nuxt.test.js +35 -39
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +28 -28
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +22 -27
- package/tests/unit/components/Launcher.nuxt.test.js +20 -22
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +37 -37
- package/tests/unit/components/ObjectSelector.nuxt.test.js +62 -62
- package/tests/unit/components/PackagesVersions.nuxt.test.js +16 -16
- package/tests/unit/components/Step.nuxt.test.js +18 -19
- package/tests/unit/components/Stepper.nuxt.test.js +18 -18
- package/tests/unit/composables/api_fetch.nuxt.test.js +34 -36
- package/tests/unit/composables/project_manager.nuxt.test.js +93 -112
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -36
- package/tests/unit/composables/upload_file.nuxt.test.js +27 -29
- package/tests/unit/plugins/project_load.nuxt.test.js +31 -33
- package/tests/unit/stores/app.nuxt.test.js +90 -92
- package/tests/unit/stores/feedback.nuxt.test.js +47 -57
- package/tests/unit/stores/geode.nuxt.test.js +111 -115
- package/tests/unit/stores/infra.nuxt.test.js +148 -148
- package/tests/unit/stores/lambda.nuxt.test.js +72 -74
- package/tests/unit/stores/treeview.nuxt.test.js +19 -21
- package/tests/unit/stores/viewer.nuxt.test.js +109 -122
- package/tests/unit/utils/recaptcha.nuxt.test.js +25 -29
- package/tests/unit/utils/validate_schema.nuxt.test.js +17 -17
- package/tests/utils.js +11 -11
- package/tests/vitest.config.js +9 -9
- package/vuetify_config.js +2 -2
package/app/stores/lambda.js
CHANGED
|
@@ -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
|
-
|
|
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
|
+
});
|
package/app/stores/menu.js
CHANGED
|
@@ -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
|
+
});
|
package/app/stores/treeview.js
CHANGED
|
@@ -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
|
-
|
|
76
|
-
isAdditionnalTreeDisplayed.value =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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 (
|
|
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
|
+
});
|