@geode/opengeodeweb-front 10.3.0 → 10.3.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 -0
- package/app/assets/geode_objects.js +1 -3
- package/app/components/Carousel.vue +7 -4
- package/app/components/CrsSelector.vue +5 -6
- package/app/components/DragAndDrop.vue +18 -8
- package/app/components/ExtensionSelector.vue +9 -17
- package/app/components/FeedBack/ErrorBanner.vue +1 -1
- package/app/components/FeedBack/Snackers.vue +4 -1
- package/app/components/FileSelector.vue +21 -10
- package/app/components/FileUploader.vue +15 -32
- package/app/components/HybridRenderingView.vue +5 -3
- package/app/components/Inspector/InspectionButton.vue +2 -2
- package/app/components/Inspector/ResultPanel.vue +4 -4
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading.vue +6 -6
- package/app/components/MissingFilesSelector.vue +23 -29
- package/app/components/ObjectSelector.vue +11 -10
- package/app/components/OptionCard.vue +1 -1
- package/app/components/PackagesVersions.vue +5 -3
- package/app/components/Recaptcha.vue +6 -4
- package/app/components/RemoteRenderingView.vue +4 -3
- package/app/components/Screenshot.vue +4 -4
- package/app/components/Step.vue +7 -7
- package/app/components/VeaseViewToolbar.vue +3 -3
- package/app/components/Viewer/BreadCrumb.vue +2 -4
- package/app/components/Viewer/ContextMenu.vue +77 -45
- package/app/components/Viewer/ContextMenuItem.vue +42 -33
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +3 -3
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -7
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +3 -3
- package/app/components/Viewer/Options/CellAttributeSelector.vue +23 -20
- package/app/components/Viewer/Options/ColorMapList.vue +75 -50
- package/app/components/Viewer/Options/ColorMapPicker.vue +38 -32
- package/app/components/Viewer/Options/ColorPicker.vue +3 -3
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +29 -21
- package/app/components/Viewer/Options/EdgeAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/TextureItem.vue +5 -5
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -5
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +7 -7
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +5 -5
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +6 -6
- package/app/components/Viewer/Solid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Solid/PointsOptions.vue +3 -3
- package/app/components/Viewer/Solid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +6 -6
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +3 -3
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +3 -3
- package/app/components/Viewer/Tree/ObjectTree.vue +7 -9
- package/app/components/Viewer/TreeComponent.vue +9 -13
- package/app/components/Viewer/TreeObject.vue +8 -9
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +3 -3
- package/app/components/Wrapper.vue +1 -2
- package/app/components/ZScaling.vue +1 -1
- package/app/composables/project_manager.js +6 -6
- package/app/plugins/auto_store_register.js +1 -1
- package/app/stores/app.js +45 -41
- package/app/stores/data.js +52 -51
- package/app/stores/data_style.js +12 -11
- package/app/stores/feedback.js +5 -1
- package/app/stores/geode.js +16 -13
- package/app/stores/hybrid_viewer.js +72 -44
- package/app/stores/infra.js +18 -16
- package/app/stores/lambda.js +1 -9
- package/app/stores/menu.js +13 -13
- package/app/stores/treeview.js +15 -13
- package/app/stores/viewer.js +39 -33
- package/app/utils/app_mode.js +4 -3
- package/app/utils/default_styles.js +55 -47
- package/app/utils/file_import_workflow.js +4 -17
- package/app/utils/local.js +195 -184
- package/app/utils/upload_file.js +1 -2
- package/eslint.config.js +2 -2
- package/internal/database/database.js +17 -32
- package/internal/database/extended_database.js +25 -0
- package/internal/stores/data_style/mesh/cells/cell.js +3 -3
- package/internal/stores/data_style/mesh/cells/color.js +1 -1
- package/internal/stores/data_style/mesh/cells/index.js +7 -7
- package/internal/stores/data_style/mesh/cells/textures.js +1 -1
- package/internal/stores/data_style/mesh/cells/vertex.js +3 -3
- package/internal/stores/data_style/mesh/cells/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/color.js +1 -1
- package/internal/stores/data_style/mesh/edges/edge.js +22 -22
- package/internal/stores/data_style/mesh/edges/index.js +7 -7
- package/internal/stores/data_style/mesh/edges/vertex.js +3 -3
- package/internal/stores/data_style/mesh/edges/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/width.js +1 -1
- package/internal/stores/data_style/mesh/index.js +4 -5
- package/internal/stores/data_style/mesh/points/color.js +1 -1
- package/internal/stores/data_style/mesh/points/index.js +6 -6
- package/internal/stores/data_style/mesh/points/size.js +1 -1
- package/internal/stores/data_style/mesh/points/vertex.js +3 -3
- package/internal/stores/data_style/mesh/points/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polygons/color.js +1 -1
- package/internal/stores/data_style/mesh/polygons/index.js +7 -7
- package/internal/stores/data_style/mesh/polygons/polygon.js +3 -3
- package/internal/stores/data_style/mesh/polygons/textures.js +1 -1
- package/internal/stores/data_style/mesh/polygons/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polygons/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/color.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/index.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +1 -1
- package/internal/stores/data_style/model/edges.js +1 -1
- package/internal/stores/data_style/model/index.js +32 -22
- package/internal/utils/api_fetch.js +8 -5
- package/internal/utils/viewer_call.js +42 -46
- package/nuxt.config.js +3 -3
- package/package.json +1 -1
- package/scripts/generate_geode_objects.js +8 -7
- package/tests/integration/setup.js +28 -21
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +17 -10
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +10 -6
- package/tests/integration/stores/viewer.nuxt.test.js +55 -39
- package/tests/setup_indexeddb.js +1 -0
- package/tests/unit/components/CrsSelector.nuxt.test.js +18 -19
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +24 -19
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -36
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +20 -25
- package/tests/unit/components/FileSelector.nuxt.test.js +27 -27
- package/tests/unit/components/FileUploader.nuxt.test.js +18 -17
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +9 -16
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +8 -6
- package/tests/unit/components/Launcher.nuxt.test.js +12 -17
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +16 -19
- package/tests/unit/components/ObjectSelector.nuxt.test.js +30 -34
- package/tests/unit/components/PackagesVersions.nuxt.test.js +8 -11
- package/tests/unit/components/Step.nuxt.test.js +8 -7
- package/tests/unit/components/Stepper.nuxt.test.js +14 -12
- package/tests/unit/composables/ProjectManager.nuxt.test.js +142 -100
- package/tests/unit/composables/api_fetch.nuxt.test.js +12 -39
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -61
- package/tests/unit/composables/upload_file.nuxt.test.js +21 -25
- package/tests/unit/plugins/project_load.nuxt.test.js +22 -21
- package/tests/unit/stores/App.nuxt.test.js +45 -43
- package/tests/unit/stores/Feedback.nuxt.test.js +16 -18
- package/tests/unit/stores/Geode.nuxt.test.js +135 -137
- package/tests/unit/stores/Infra.nuxt.test.js +20 -26
- package/tests/unit/stores/Lambda.nuxt.test.js +30 -31
- package/tests/unit/stores/Treeview.nuxt.test.js +53 -55
- package/tests/unit/stores/Viewer.nuxt.test.js +16 -23
- package/tests/unit/utils/validate_schema.nuxt.test.js +18 -18
- package/tests/utils.js +15 -2
- package/tests/vitest.config.js +6 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Status from "@ogw_front/utils/status"
|
|
3
3
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const { schema } = defineProps({
|
|
6
6
|
schema: { type: Object, required: true },
|
|
7
7
|
})
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
async function get_packages_versions() {
|
|
13
13
|
await geodeStore.request(
|
|
14
|
-
|
|
14
|
+
schema,
|
|
15
15
|
{},
|
|
16
16
|
{
|
|
17
17
|
response_function: (response) => {
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
watch(
|
|
25
25
|
() => geodeStore.status,
|
|
26
26
|
(value) => {
|
|
27
|
-
if (value
|
|
27
|
+
if (value === Status.CONNECTED) {
|
|
28
|
+
get_packages_versions()
|
|
29
|
+
}
|
|
28
30
|
},
|
|
29
31
|
)
|
|
30
32
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
3
3
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const RESPONSE_STATUS_OK = 200
|
|
6
|
+
|
|
7
|
+
const { button_label, button_color, color } = defineProps({
|
|
6
8
|
button_label: {
|
|
7
9
|
type: String,
|
|
8
10
|
required: false,
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
},
|
|
59
61
|
})
|
|
60
62
|
infraStore.$patch({
|
|
61
|
-
is_captcha_validated: response.status ===
|
|
63
|
+
is_captcha_validated: response.status === RESPONSE_STATUS_OK,
|
|
62
64
|
})
|
|
63
65
|
}
|
|
64
66
|
</script>
|
|
@@ -95,8 +97,8 @@
|
|
|
95
97
|
<VRow align="center" justify="center">
|
|
96
98
|
<VCol cols="4" class="d-flex justify-center align-center">
|
|
97
99
|
<VBtn
|
|
98
|
-
:text="
|
|
99
|
-
:color="
|
|
100
|
+
:text="button_label"
|
|
101
|
+
:color="color || button_color"
|
|
100
102
|
@click="submit_recaptcha"
|
|
101
103
|
/>
|
|
102
104
|
</VCol>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import vtkRemoteView from "@kitware/vtk.js/Rendering/Misc/RemoteView"
|
|
3
2
|
import { useElementSize, useWindowSize } from "@vueuse/core"
|
|
4
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
5
3
|
import Status from "@ogw_front/utils/status"
|
|
6
4
|
import ViewToolbar from "@ogw_front/components/ViewToolbar"
|
|
7
5
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
6
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
7
|
+
import vtkRemoteView from "@kitware/vtk.js/Rendering/Misc/RemoteView"
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const { viewId } = defineProps({
|
|
10
10
|
viewId: { type: String, default: "-1" },
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const connected = ref(false)
|
|
31
|
+
// oxlint-disable-next-line import/no-named-as-default-member
|
|
31
32
|
const view = vtkRemoteView.newInstance({
|
|
32
33
|
rpcWheelEvent: "viewport.mouse.zoom.wheel",
|
|
33
34
|
})
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
const emit = defineEmits(["close"])
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const { show_dialog, width } = defineProps({
|
|
10
10
|
show_dialog: { type: Boolean, required: true },
|
|
11
11
|
width: { type: Number, required: false, default: 400 },
|
|
12
12
|
})
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
response_function: async (response) => {
|
|
32
32
|
fileDownload(
|
|
33
33
|
response.blob,
|
|
34
|
-
filename.value
|
|
34
|
+
`${filename.value}.${output_extension.value}`,
|
|
35
35
|
)
|
|
36
36
|
},
|
|
37
37
|
},
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
</script>
|
|
48
48
|
<template>
|
|
49
49
|
<OptionCard
|
|
50
|
-
v-if="
|
|
50
|
+
v-if="show_dialog"
|
|
51
51
|
title="Take a screenshot"
|
|
52
|
-
:width="
|
|
52
|
+
:width="width"
|
|
53
53
|
class="position-absolute"
|
|
54
54
|
style="z-index: 2; top: 90px; right: 55px"
|
|
55
55
|
>
|
package/app/components/Step.vue
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
function truncate(text, maxLength) {
|
|
3
3
|
if (text.length > maxLength) {
|
|
4
|
-
return text.slice(0, maxLength)
|
|
4
|
+
return `${text.slice(0, maxLength)}...`
|
|
5
5
|
}
|
|
6
6
|
return text
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const { step_index } = defineProps({
|
|
10
10
|
step_index: { type: Number, required: true },
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function increment_step() {
|
|
29
|
-
stepper_tree.current_step_index
|
|
29
|
+
stepper_tree.current_step_index += 1
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function decrement_step() {
|
|
33
|
-
stepper_tree.current_step_index
|
|
33
|
+
stepper_tree.current_step_index -= 1
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const sortedChips = computed(() => {
|
|
37
|
-
const chips = steps.value[
|
|
38
|
-
return
|
|
39
|
-
|
|
37
|
+
const chips = steps.value[step_index]?.chips || []
|
|
38
|
+
return chips.toSorted((chipA, chipB) =>
|
|
39
|
+
chipA.localeCompare(chipB, undefined, {
|
|
40
40
|
numeric: true,
|
|
41
41
|
sensitivity: "base",
|
|
42
42
|
}),
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import Screenshot from "@ogw_front/components/Screenshot"
|
|
5
5
|
import ZScaling from "@ogw_front/components/ZScaling"
|
|
6
6
|
|
|
7
|
-
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
8
7
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
|
|
8
|
+
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
9
9
|
|
|
10
10
|
const hybridViewerStore = useHybridViewerStore()
|
|
11
11
|
const viewerStore = useViewerStore()
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
async function handleZScalingClose() {
|
|
25
25
|
await hybridViewerStore.setZScaling(zScale.value)
|
|
26
26
|
showZScaling.value = false
|
|
27
27
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
action: () => {
|
|
34
34
|
const { genericRenderWindow } = storeToRefs(hybridViewerStore)
|
|
35
35
|
const renderWindow = genericRenderWindow.value.value.getRenderWindow()
|
|
36
|
-
const renderer = renderWindow.getRenderers()
|
|
36
|
+
const [renderer] = renderWindow.getRenderers()
|
|
37
37
|
renderer.resetCamera()
|
|
38
38
|
renderWindow.render()
|
|
39
39
|
hybridViewerStore.syncRemoteCamera()
|
|
@@ -7,15 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
const selectedTree = computed(() => treeviewStore.selectedTree)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function goBackToFileTree() {
|
|
11
11
|
treeviewStore.displayFileTree()
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const model_id = computed(() => treeviewStore.model_id)
|
|
15
15
|
|
|
16
|
-
const metaDatas = computed(() =>
|
|
17
|
-
return dataStore.getItem(model_id.value).value
|
|
18
|
-
})
|
|
16
|
+
const metaDatas = computed(() => dataStore.getItem(model_id.value).value)
|
|
19
17
|
</script>
|
|
20
18
|
|
|
21
19
|
<template>
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useMenuStore } from "@ogw_front/stores/menu"
|
|
3
2
|
import { useDataStore } from "@ogw_front/stores/data"
|
|
4
3
|
import { useEventListener } from "@vueuse/core"
|
|
4
|
+
import { useMenuStore } from "@ogw_front/stores/menu"
|
|
5
|
+
|
|
6
|
+
const RADIUS = 80
|
|
7
|
+
const MARGIN_OFFSET = 40
|
|
8
|
+
const Z_INDEX_MENU = 1000
|
|
9
|
+
const Z_INDEX_ACTIVE_ITEM = 10
|
|
10
|
+
const Z_INDEX_BASE_ITEM = 1
|
|
11
|
+
const FULL_ANGLE = 360
|
|
12
|
+
const ANGLE_45 = 45
|
|
13
|
+
const ANGLE_135 = 135
|
|
14
|
+
const ANGLE_225 = 225
|
|
15
|
+
const ANGLE_315 = 315
|
|
16
|
+
const CLOSE_DELAY = 100
|
|
5
17
|
|
|
6
18
|
const menuStore = useMenuStore()
|
|
7
19
|
const dataStore = useDataStore()
|
|
8
20
|
|
|
9
|
-
const
|
|
21
|
+
const { id, x, y, containerWidth, containerHeight } = defineProps({
|
|
10
22
|
id: { type: String, required: true },
|
|
11
23
|
x: { type: Number, required: true },
|
|
12
24
|
y: { type: Number, required: true },
|
|
@@ -15,21 +27,22 @@
|
|
|
15
27
|
})
|
|
16
28
|
|
|
17
29
|
const meta_data = computed(() => {
|
|
18
|
-
const itemId =
|
|
19
|
-
if (!itemId)
|
|
30
|
+
const itemId = id || menuStore.current_id
|
|
31
|
+
if (!itemId) {
|
|
32
|
+
return {}
|
|
33
|
+
}
|
|
20
34
|
return dataStore.getItem(itemId).value || {}
|
|
21
35
|
})
|
|
22
36
|
|
|
23
|
-
const radius = 80
|
|
24
37
|
const show_menu = ref(true)
|
|
25
38
|
const isDragging = ref(false)
|
|
26
39
|
const dragStartX = ref(0)
|
|
27
40
|
const dragStartY = ref(0)
|
|
28
|
-
const menuX = ref(
|
|
29
|
-
const menuY = ref(
|
|
41
|
+
const menuX = ref(x)
|
|
42
|
+
const menuY = ref(y)
|
|
30
43
|
|
|
31
44
|
watch(
|
|
32
|
-
() => [
|
|
45
|
+
() => [x, y],
|
|
33
46
|
([newX, newY]) => {
|
|
34
47
|
const { x, y } = clampPosition(newX, newY)
|
|
35
48
|
menuX.value = x
|
|
@@ -40,94 +53,113 @@
|
|
|
40
53
|
)
|
|
41
54
|
|
|
42
55
|
useEventListener(
|
|
43
|
-
|
|
56
|
+
globalThis,
|
|
44
57
|
"mousemove",
|
|
45
|
-
(
|
|
46
|
-
if (!isDragging.value)
|
|
47
|
-
|
|
58
|
+
(event) => {
|
|
59
|
+
if (!isDragging.value) {
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
handleDrag(event)
|
|
48
63
|
},
|
|
49
64
|
{ passive: true },
|
|
50
65
|
)
|
|
51
66
|
|
|
52
|
-
useEventListener(
|
|
53
|
-
if (!isDragging.value)
|
|
54
|
-
|
|
67
|
+
useEventListener(globalThis, "mouseup", (event) => {
|
|
68
|
+
if (!isDragging.value) {
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
stopDrag(event)
|
|
55
72
|
})
|
|
56
73
|
|
|
57
74
|
const menu_items = shallowRef([])
|
|
58
75
|
watch(
|
|
59
76
|
() => [meta_data.value.viewer_type, meta_data.value.geode_object_type],
|
|
60
|
-
([
|
|
61
|
-
menu_items.value = menuStore.getMenuItems(
|
|
77
|
+
([viewer_type, geode_object_type]) => {
|
|
78
|
+
menu_items.value = menuStore.getMenuItems(viewer_type, geode_object_type)
|
|
62
79
|
},
|
|
63
80
|
{ immediate: true },
|
|
64
81
|
)
|
|
65
82
|
|
|
66
83
|
const menuItemCount = computed(() => menu_items.value.length)
|
|
67
84
|
|
|
68
|
-
function startDrag(
|
|
85
|
+
function startDrag(event) {
|
|
69
86
|
isDragging.value = true
|
|
70
|
-
dragStartX.value =
|
|
71
|
-
dragStartY.value =
|
|
72
|
-
|
|
87
|
+
dragStartX.value = event.clientX - menuX.value
|
|
88
|
+
dragStartY.value = event.clientY - menuY.value
|
|
89
|
+
event.preventDefault()
|
|
73
90
|
}
|
|
74
91
|
|
|
75
92
|
function clampPosition(x, y) {
|
|
76
|
-
const margin =
|
|
93
|
+
const margin = RADIUS + MARGIN_OFFSET
|
|
77
94
|
return {
|
|
78
|
-
x: Math.min(Math.max(x, margin),
|
|
79
|
-
y: Math.min(Math.max(y, margin),
|
|
95
|
+
x: Math.min(Math.max(x, margin), containerWidth - margin),
|
|
96
|
+
y: Math.min(Math.max(y, margin), containerHeight - margin),
|
|
80
97
|
}
|
|
81
98
|
}
|
|
82
99
|
|
|
83
|
-
function handleDrag(
|
|
100
|
+
function handleDrag(event) {
|
|
84
101
|
const { x, y } = clampPosition(
|
|
85
|
-
|
|
86
|
-
|
|
102
|
+
event.clientX - dragStartX.value,
|
|
103
|
+
event.clientY - dragStartY.value,
|
|
87
104
|
)
|
|
88
105
|
menuX.value = x
|
|
89
106
|
menuY.value = y
|
|
90
107
|
menuStore.setMenuPosition(x, y)
|
|
91
108
|
}
|
|
92
109
|
|
|
93
|
-
function stopDrag(
|
|
110
|
+
function stopDrag(event) {
|
|
94
111
|
isDragging.value = false
|
|
95
|
-
|
|
112
|
+
event.stopPropagation()
|
|
96
113
|
menuStore.setMenuPosition(menuX.value, menuY.value)
|
|
97
114
|
}
|
|
98
115
|
|
|
99
116
|
function getMenuStyle() {
|
|
100
117
|
return {
|
|
101
118
|
position: "fixed",
|
|
102
|
-
left: `${menuStore.containerLeft + menuX.value -
|
|
103
|
-
top: `${menuStore.containerTop + menuY.value -
|
|
104
|
-
zIndex:
|
|
119
|
+
left: `${menuStore.containerLeft + menuX.value - RADIUS}px`,
|
|
120
|
+
top: `${menuStore.containerTop + menuY.value - RADIUS}px`,
|
|
121
|
+
zIndex: Z_INDEX_MENU,
|
|
105
122
|
}
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
function getTooltipLocation(index) {
|
|
109
|
-
const angle = (index / menuItemCount.value) *
|
|
110
|
-
if (angle <
|
|
111
|
-
|
|
112
|
-
|
|
126
|
+
const angle = (index / menuItemCount.value) * FULL_ANGLE
|
|
127
|
+
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
128
|
+
return "right"
|
|
129
|
+
}
|
|
130
|
+
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
131
|
+
return "top"
|
|
132
|
+
}
|
|
133
|
+
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
134
|
+
return "left"
|
|
135
|
+
}
|
|
113
136
|
return "bottom"
|
|
114
137
|
}
|
|
115
138
|
|
|
116
139
|
function getTooltipOrigin(index) {
|
|
117
|
-
const angle = (index / menuItemCount.value) *
|
|
118
|
-
if (angle <
|
|
119
|
-
|
|
120
|
-
|
|
140
|
+
const angle = (index / menuItemCount.value) * FULL_ANGLE
|
|
141
|
+
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
142
|
+
return "left"
|
|
143
|
+
}
|
|
144
|
+
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
145
|
+
return "bottom"
|
|
146
|
+
}
|
|
147
|
+
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
148
|
+
return "right"
|
|
149
|
+
}
|
|
121
150
|
return "top"
|
|
122
151
|
}
|
|
123
152
|
|
|
124
153
|
function getItemStyle(index) {
|
|
125
154
|
const angle = (index / menuItemCount.value) * 2 * Math.PI
|
|
126
155
|
return {
|
|
127
|
-
transform: `translate(${Math.cos(angle) *
|
|
156
|
+
transform: `translate(${Math.cos(angle) * RADIUS}px, ${Math.sin(angle) * RADIUS}px)`,
|
|
128
157
|
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
129
158
|
position: "absolute",
|
|
130
|
-
zIndex:
|
|
159
|
+
zIndex:
|
|
160
|
+
menuStore.active_item_index === index
|
|
161
|
+
? Z_INDEX_ACTIVE_ITEM
|
|
162
|
+
: Z_INDEX_BASE_ITEM,
|
|
131
163
|
}
|
|
132
164
|
}
|
|
133
165
|
</script>
|
|
@@ -138,13 +170,13 @@
|
|
|
138
170
|
content-class="circular-menu-container"
|
|
139
171
|
:style="getMenuStyle()"
|
|
140
172
|
:close-on-content-click="false"
|
|
141
|
-
:close-delay="
|
|
173
|
+
:close-delay="CLOSE_DELAY"
|
|
142
174
|
:overlay="false"
|
|
143
175
|
>
|
|
144
176
|
<div class="circular-menu-drag-handle" @mousedown.stop="startDrag">
|
|
145
177
|
<div
|
|
146
178
|
class="circular-menu-items"
|
|
147
|
-
:style="{ width: `${
|
|
179
|
+
:style="{ width: `${RADIUS * 2}px`, height: `${RADIUS * 2}px` }"
|
|
148
180
|
>
|
|
149
181
|
<component
|
|
150
182
|
v-for="(item, index) in menu_items"
|
|
@@ -152,7 +184,7 @@
|
|
|
152
184
|
:key="index"
|
|
153
185
|
:index="index"
|
|
154
186
|
:itemProps="{
|
|
155
|
-
id:
|
|
187
|
+
id: id,
|
|
156
188
|
tooltip_location: getTooltipLocation(index),
|
|
157
189
|
tooltip_origin: getTooltipOrigin(index),
|
|
158
190
|
totalItems: menuItemCount,
|
|
@@ -1,66 +1,79 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useTheme } from "vuetify"
|
|
3
|
-
import { useMenuStore } from "@ogw_front/stores/menu"
|
|
4
2
|
import { useElementSize } from "@vueuse/core"
|
|
3
|
+
import { useMenuStore } from "@ogw_front/stores/menu"
|
|
4
|
+
import { useTheme } from "vuetify"
|
|
5
|
+
|
|
6
|
+
const CARD_WIDTH = 320
|
|
7
|
+
const CARD_HEIGHT = 500
|
|
8
|
+
const MARGIN = 60
|
|
9
|
+
const RADIUS = 80
|
|
10
|
+
const OFFSET = 40
|
|
5
11
|
|
|
6
12
|
const menuStore = useMenuStore()
|
|
7
13
|
const theme = useTheme()
|
|
8
14
|
const primaryColor = computed(() => theme.current.value.colors.primary)
|
|
9
|
-
const
|
|
15
|
+
const { index, itemProps, tooltip, btn_image } = defineProps({
|
|
10
16
|
index: { type: Number, required: true },
|
|
11
17
|
itemProps: { type: Object, required: true },
|
|
12
18
|
tooltip: { type: String, required: true },
|
|
13
19
|
btn_image: { type: String, required: true },
|
|
14
20
|
})
|
|
15
21
|
|
|
16
|
-
const is_active = computed(() => menuStore.active_item_index ===
|
|
17
|
-
const optionsRef = ref(
|
|
22
|
+
const is_active = computed(() => menuStore.active_item_index === index)
|
|
23
|
+
const optionsRef = ref(undefined)
|
|
18
24
|
const { height: optionsHeight } = useElementSize(optionsRef)
|
|
19
25
|
|
|
20
26
|
const maxCardHeight = computed(() =>
|
|
21
|
-
Math.min(
|
|
27
|
+
Math.min(CARD_HEIGHT, menuStore.containerHeight - OFFSET),
|
|
22
28
|
)
|
|
23
29
|
|
|
24
30
|
const optionsStyle = computed(() => {
|
|
25
|
-
if (!is_active.value || !optionsHeight.value)
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
if (!is_active.value || !optionsHeight.value) {
|
|
32
|
+
return {}
|
|
33
|
+
}
|
|
34
|
+
const angle = (index / itemProps.totalItems) * 2 * Math.PI
|
|
35
|
+
const radius = RADIUS
|
|
28
36
|
const absoluteButtonY = menuStore.menuY + Math.sin(angle) * radius
|
|
29
|
-
const
|
|
30
|
-
const margin =
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
if (absoluteButtonY -
|
|
34
|
-
|
|
35
|
-
} else if (
|
|
36
|
-
|
|
37
|
+
const height = optionsHeight.value
|
|
38
|
+
const margin = MARGIN
|
|
39
|
+
let offsetY = 0
|
|
40
|
+
|
|
41
|
+
if (absoluteButtonY - height / 2 < margin) {
|
|
42
|
+
offsetY = margin - (absoluteButtonY - height / 2)
|
|
43
|
+
} else if (
|
|
44
|
+
absoluteButtonY + height / 2 >
|
|
45
|
+
menuStore.containerHeight - margin
|
|
46
|
+
) {
|
|
47
|
+
offsetY =
|
|
48
|
+
menuStore.containerHeight - margin - (absoluteButtonY + height / 2)
|
|
37
49
|
}
|
|
38
|
-
return { top: `calc(50% + ${
|
|
50
|
+
return { top: `calc(50% + ${offsetY}px)` }
|
|
39
51
|
})
|
|
40
52
|
|
|
41
53
|
const optionsClass = computed(() => {
|
|
42
|
-
const loc =
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const radius = 80
|
|
54
|
+
const loc = itemProps.tooltip_location
|
|
55
|
+
const margin = MARGIN
|
|
56
|
+
const radius = RADIUS
|
|
46
57
|
if (loc === "right") {
|
|
47
|
-
return menuStore.menuX + radius + margin +
|
|
58
|
+
return menuStore.menuX + radius + margin + CARD_WIDTH >
|
|
48
59
|
menuStore.containerWidth
|
|
49
60
|
? "options-left"
|
|
50
61
|
: "options-right"
|
|
51
62
|
}
|
|
52
|
-
return menuStore.menuX - radius - margin -
|
|
63
|
+
return menuStore.menuX - radius - margin - CARD_WIDTH < 0
|
|
53
64
|
? "options-right"
|
|
54
65
|
: "options-left"
|
|
55
66
|
})
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
function toggleOptions() {
|
|
69
|
+
menuStore.toggleItemOptions(index)
|
|
70
|
+
}
|
|
58
71
|
</script>
|
|
59
72
|
<template>
|
|
60
73
|
<v-sheet class="menu-item-container transition-swing" color="transparent">
|
|
61
74
|
<v-tooltip
|
|
62
|
-
:location="
|
|
63
|
-
:origin="
|
|
75
|
+
:location="itemProps.tooltip_location"
|
|
76
|
+
:origin="itemProps.tooltip_origin"
|
|
64
77
|
>
|
|
65
78
|
<template v-slot:activator="{ props: tooltipProps }">
|
|
66
79
|
<v-btn
|
|
@@ -74,7 +87,7 @@
|
|
|
74
87
|
<v-img :src="btn_image" height="28" width="28" />
|
|
75
88
|
</v-btn>
|
|
76
89
|
</template>
|
|
77
|
-
<span>{{
|
|
90
|
+
<span>{{ tooltip }}</span>
|
|
78
91
|
</v-tooltip>
|
|
79
92
|
|
|
80
93
|
<v-sheet
|
|
@@ -86,11 +99,7 @@
|
|
|
86
99
|
color="transparent"
|
|
87
100
|
@click.stop
|
|
88
101
|
>
|
|
89
|
-
<OptionCard
|
|
90
|
-
:title="props.tooltip"
|
|
91
|
-
width="320"
|
|
92
|
-
:max-height="maxCardHeight"
|
|
93
|
-
>
|
|
102
|
+
<OptionCard :title="tooltip" width="320" :max-height="maxCardHeight">
|
|
94
103
|
<slot name="options" />
|
|
95
104
|
</OptionCard>
|
|
96
105
|
</v-sheet>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions"
|
|
3
2
|
import EdgedCurvePoints from "@ogw_front/assets/viewer_svgs/edged_curve_points.svg"
|
|
3
|
+
import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions"
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const { itemProps } = defineProps({
|
|
6
6
|
itemProps: { type: Object, required: true },
|
|
7
7
|
})
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
11
|
<ViewerGenericMeshPointsOptions
|
|
12
|
-
:itemProps="
|
|
12
|
+
:itemProps="itemProps"
|
|
13
13
|
:btn_image="EdgedCurvePoints"
|
|
14
14
|
/>
|
|
15
15
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import EdgedCurveEdges from "@ogw_front/assets/viewer_svgs/edged_curve_edges.svg"
|
|
2
3
|
import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
|
|
3
|
-
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
4
4
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
|
|
5
|
-
import
|
|
5
|
+
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
6
6
|
|
|
7
7
|
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
8
8
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
const dataStyleStore = useDataStyleStore()
|
|
11
11
|
const hybridViewerStore = useHybridViewerStore()
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const { itemProps } = defineProps({
|
|
14
14
|
itemProps: { type: Object, required: true },
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
const id = toRef(() =>
|
|
17
|
+
const id = toRef(() => itemProps.id)
|
|
18
18
|
|
|
19
19
|
const visibility = computed({
|
|
20
20
|
get: () => dataStyleStore.meshEdgesVisibility(id.value),
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
</script>
|
|
103
103
|
<template>
|
|
104
104
|
<ViewerContextMenuItem
|
|
105
|
-
:itemProps="
|
|
105
|
+
:itemProps="itemProps"
|
|
106
106
|
tooltip="Edges options"
|
|
107
107
|
:btn_image="EdgedCurveEdges"
|
|
108
108
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
|
|
3
|
-
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
4
3
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
|
|
4
|
+
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
5
5
|
|
|
6
6
|
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
7
7
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
const dataStyleStore = useDataStyleStore()
|
|
10
10
|
const hybridViewerStore = useHybridViewerStore()
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const { itemProps, btn_image, tooltip } = defineProps({
|
|
13
13
|
itemProps: { type: Object, required: true },
|
|
14
14
|
btn_image: { type: String, required: true },
|
|
15
15
|
tooltip: { type: String, required: false, default: "Cells options" },
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
const id = toRef(() =>
|
|
18
|
+
const id = toRef(() => itemProps.id)
|
|
19
19
|
|
|
20
20
|
const visibility = computed({
|
|
21
21
|
get: () => dataStyleStore.meshCellsVisibility(id.value),
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
|
|
107
107
|
<template>
|
|
108
108
|
<ViewerContextMenuItem
|
|
109
|
-
:itemProps="
|
|
110
|
-
:tooltip="
|
|
111
|
-
:btn_image="
|
|
109
|
+
:itemProps="itemProps"
|
|
110
|
+
:tooltip="tooltip"
|
|
111
|
+
:btn_image="btn_image"
|
|
112
112
|
>
|
|
113
113
|
<template #options>
|
|
114
114
|
<ViewerOptionsVisibilitySwitch v-model="visibility" />
|