@geode/opengeodeweb-front 10.4.0 → 10.4.1-rc.2

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 (38) hide show
  1. package/.oxlintrc.json +72 -7
  2. package/app/components/Viewer/BreadCrumb.vue +1 -1
  3. package/app/components/Viewer/ContextMenu.vue +1 -9
  4. package/app/stores/data.js +9 -7
  5. package/app/stores/data_style.js +2 -2
  6. package/app/stores/menu.js +4 -0
  7. package/internal/stores/data_style/model/blocks/color.js +64 -0
  8. package/internal/stores/data_style/model/blocks/common.js +21 -0
  9. package/internal/stores/data_style/model/blocks/index.js +35 -0
  10. package/internal/stores/data_style/model/blocks/visibility.js +63 -0
  11. package/internal/stores/data_style/model/corners/color.js +63 -0
  12. package/internal/stores/data_style/model/corners/common.js +21 -0
  13. package/internal/stores/data_style/model/corners/index.js +36 -0
  14. package/internal/stores/data_style/model/corners/visibility.js +64 -0
  15. package/internal/stores/data_style/model/edges/common.js +13 -0
  16. package/internal/stores/data_style/model/edges/index.js +21 -0
  17. package/internal/stores/data_style/model/{edges.js → edges/visibility.js} +5 -14
  18. package/internal/stores/data_style/model/index.js +3 -3
  19. package/internal/stores/data_style/model/lines/color.js +63 -0
  20. package/internal/stores/data_style/model/lines/common.js +21 -0
  21. package/internal/stores/data_style/model/lines/index.js +35 -0
  22. package/internal/stores/data_style/model/lines/visibility.js +63 -0
  23. package/internal/stores/data_style/model/points/common.js +13 -0
  24. package/internal/stores/data_style/model/points/index.js +25 -0
  25. package/internal/stores/data_style/model/points/size.js +36 -0
  26. package/internal/stores/data_style/model/points/visibility.js +40 -0
  27. package/internal/stores/data_style/model/surfaces/color.js +62 -0
  28. package/internal/stores/data_style/model/surfaces/common.js +21 -0
  29. package/internal/stores/data_style/model/surfaces/index.js +39 -0
  30. package/internal/stores/data_style/model/surfaces/visibility.js +62 -0
  31. package/package.json +3 -3
  32. package/tests/integration/microservices/back/requirements.txt +1 -1
  33. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  34. package/internal/stores/data_style/model/blocks.js +0 -126
  35. package/internal/stores/data_style/model/corners.js +0 -127
  36. package/internal/stores/data_style/model/lines.js +0 -124
  37. package/internal/stores/data_style/model/points.js +0 -69
  38. package/internal/stores/data_style/model/surfaces.js +0 -123
@@ -1,127 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../state"
7
- import { useViewerStore } from "@ogw_front/stores/viewer"
8
-
9
- // Local constants
10
- const model_corners_schemas = viewer_schemas.opengeodeweb_viewer.model.corners
11
-
12
- export function useModelCornersStyle() {
13
- const dataStyleStateStore = useDataStyleStateStore()
14
- const dataStore = useDataStore()
15
- const viewerStore = useViewerStore()
16
-
17
- function modelCornersStyle(id) {
18
- return dataStyleStateStore.getStyle(id).corners
19
- }
20
- function modelCornerStyle(id, corner_id) {
21
- if (!modelCornersStyle(id)[corner_id]) {
22
- modelCornersStyle(id)[corner_id] = {}
23
- }
24
- return modelCornersStyle(id)[corner_id]
25
- }
26
-
27
- function modelCornerVisibility(id, corner_id) {
28
- return modelCornerStyle(id, corner_id).visibility
29
- }
30
-
31
- function saveModelCornerVisibility(id, corner_id, visibility) {
32
- modelCornerStyle(id, corner_id).visibility = visibility
33
- }
34
- async function setModelCornersVisibility(id, corner_ids, visibility) {
35
- if (!corner_ids || corner_ids.length === 0) {
36
- return
37
- }
38
- const corner_viewer_ids = await dataStore.getMeshComponentsViewerIds(
39
- id,
40
- corner_ids,
41
- )
42
- if (!corner_viewer_ids || corner_viewer_ids.length === 0) {
43
- console.warn(
44
- "[setModelCornersVisibility] No viewer IDs found, skipping visibility request",
45
- { id, corner_ids },
46
- )
47
- return
48
- }
49
- return viewerStore.request(
50
- model_corners_schemas.visibility,
51
- { id, block_ids: corner_viewer_ids, visibility },
52
- {
53
- response_function: () => {
54
- for (const corner_id of corner_ids) {
55
- saveModelCornerVisibility(id, corner_id, visibility)
56
- }
57
- console.log(
58
- setModelCornersVisibility.name,
59
- { id },
60
- { corner_ids },
61
- modelCornerVisibility(id, corner_ids[0]),
62
- )
63
- },
64
- },
65
- )
66
- }
67
-
68
- function modelCornerColor(id, corner_id) {
69
- return modelCornerStyle(id, corner_id).color
70
- }
71
-
72
- function saveModelCornerColor(id, corner_id, color) {
73
- modelCornerStyle(id, corner_id).color = color
74
- }
75
-
76
- async function setModelCornersColor(id, corner_ids, color) {
77
- if (!corner_ids || corner_ids.length === 0) {
78
- return
79
- }
80
- const corner_viewer_ids = await dataStore.getMeshComponentsViewerIds(
81
- id,
82
- corner_ids,
83
- )
84
- if (!corner_viewer_ids || corner_viewer_ids.length === 0) {
85
- console.warn(
86
- "[setModelCornersColor] No viewer IDs found, skipping color request",
87
- { id, corner_ids },
88
- )
89
- return
90
- }
91
- return viewerStore.request(
92
- model_corners_schemas.color,
93
- { id, block_ids: corner_viewer_ids, color },
94
- {
95
- response_function: () => {
96
- for (const corner_id of corner_ids) {
97
- saveModelCornerColor(id, corner_id, color)
98
- }
99
- console.log(
100
- setModelCornersColor.name,
101
- { id },
102
- { corner_ids },
103
- JSON.stringify(modelCornerColor(id, corner_ids[0])),
104
- )
105
- },
106
- },
107
- )
108
- }
109
-
110
- async function applyModelCornersStyle(id) {
111
- const style = modelCornersStyle(id)
112
- const corner_ids = await dataStore.getCornersGeodeIds(id)
113
- console.log(applyModelCornersStyle.name, { id }, { corner_ids })
114
- return Promise.all([
115
- setModelCornersVisibility(id, corner_ids, style.visibility),
116
- setModelCornersColor(id, corner_ids, style.color),
117
- ])
118
- }
119
-
120
- return {
121
- modelCornerVisibility,
122
- modelCornerColor,
123
- setModelCornersVisibility,
124
- setModelCornersColor,
125
- applyModelCornersStyle,
126
- }
127
- }
@@ -1,124 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../state"
7
- import { useViewerStore } from "@ogw_front/stores/viewer"
8
-
9
- // Local constants
10
- const model_lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines
11
-
12
- export function useModelLinesStyle() {
13
- const dataStyleStateStore = useDataStyleStateStore()
14
- const dataStore = useDataStore()
15
- const viewerStore = useViewerStore()
16
-
17
- function modelLinesStyle(id) {
18
- return dataStyleStateStore.getStyle(id).lines
19
- }
20
- function modelLineStyle(id, line_id) {
21
- if (!modelLinesStyle(id)[line_id]) {
22
- modelLinesStyle(id)[line_id] = {}
23
- }
24
- return modelLinesStyle(id)[line_id]
25
- }
26
-
27
- function modelLineVisibility(id, line_id) {
28
- return modelLineStyle(id, line_id).visibility
29
- }
30
-
31
- function saveModelLineVisibility(id, line_id, visibility) {
32
- modelLineStyle(id, line_id).visibility = visibility
33
- }
34
- async function setModelLinesVisibility(id, line_ids, visibility) {
35
- if (!line_ids || line_ids.length === 0) {
36
- return
37
- }
38
- const line_viewer_ids = await dataStore.getMeshComponentsViewerIds(
39
- id,
40
- line_ids,
41
- )
42
- if (!line_viewer_ids || line_viewer_ids.length === 0) {
43
- console.warn(
44
- "[setModelLinesVisibility] No viewer IDs found, skipping visibility request",
45
- { id, line_ids },
46
- )
47
- return
48
- }
49
- return viewerStore.request(
50
- model_lines_schemas.visibility,
51
- { id, block_ids: line_viewer_ids, visibility },
52
- {
53
- response_function: () => {
54
- for (const line_id of line_ids) {
55
- saveModelLineVisibility(id, line_id, visibility)
56
- }
57
- console.log(
58
- setModelLinesVisibility.name,
59
- { id },
60
- { line_ids },
61
- modelLineVisibility(id, line_ids[0]),
62
- )
63
- },
64
- },
65
- )
66
- }
67
-
68
- function modelLineColor(id, line_id) {
69
- return modelLineStyle(id, line_id).color
70
- }
71
- function saveModelLineColor(id, line_id, color) {
72
- modelLineStyle(id, line_id).color = color
73
- }
74
- async function setModelLinesColor(id, line_ids, color) {
75
- if (!line_ids || line_ids.length === 0) {
76
- return
77
- }
78
- const line_viewer_ids = await dataStore.getMeshComponentsViewerIds(
79
- id,
80
- line_ids,
81
- )
82
- if (!line_viewer_ids || line_viewer_ids.length === 0) {
83
- console.warn(
84
- "[setModelLinesColor] No viewer IDs found, skipping color request",
85
- { id, line_ids },
86
- )
87
- return
88
- }
89
- return viewerStore.request(
90
- model_lines_schemas.color,
91
- { id, block_ids: line_viewer_ids, color },
92
- {
93
- response_function: () => {
94
- for (const line_id of line_ids) {
95
- saveModelLineColor(id, line_id, color)
96
- }
97
- console.log(
98
- setModelLinesColor.name,
99
- { id },
100
- { line_ids },
101
- JSON.stringify(modelLineColor(id, line_ids[0])),
102
- )
103
- },
104
- },
105
- )
106
- }
107
-
108
- async function applyModelLinesStyle(id) {
109
- const style = modelLinesStyle(id)
110
- const line_ids = await dataStore.getLinesGeodeIds(id)
111
- return Promise.all([
112
- setModelLinesVisibility(id, line_ids, style.visibility),
113
- setModelLinesColor(id, line_ids, style.color),
114
- ])
115
- }
116
-
117
- return {
118
- modelLineVisibility,
119
- modelLineColor,
120
- setModelLinesVisibility,
121
- setModelLinesColor,
122
- applyModelLinesStyle,
123
- }
124
- }
@@ -1,69 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStyleStateStore } from "../state"
6
- import { useViewerStore } from "@ogw_front/stores/viewer"
7
-
8
- // Local constants
9
- const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points
10
-
11
- export function useModelPointsStyle() {
12
- const dataStyleStateStore = useDataStyleStateStore()
13
- const viewerStore = useViewerStore()
14
-
15
- function modelPointsStyle(id) {
16
- return dataStyleStateStore.getStyle(id).points
17
- }
18
- function modelPointsVisibility(id) {
19
- return modelPointsStyle(id).visibility
20
- }
21
- function setModelPointsVisibility(id, visibility) {
22
- return viewerStore.request(
23
- model_points_schemas.visibility,
24
- { id, visibility },
25
- {
26
- response_function: () => {
27
- modelPointsStyle(id).visibility = visibility
28
- console.log(
29
- setModelPointsVisibility.name,
30
- { id },
31
- modelPointsVisibility(id),
32
- )
33
- },
34
- },
35
- )
36
- }
37
-
38
- function modelPointsSize(id) {
39
- return modelPointsStyle(id).size
40
- }
41
- function setModelPointsSize(id, size) {
42
- return viewerStore.request(
43
- model_points_schemas.size,
44
- { id, size },
45
- {
46
- response_function: () => {
47
- modelPointsStyle(id).size = size
48
- console.log(setModelPointsSize.name, { id }, modelPointsSize(id))
49
- },
50
- },
51
- )
52
- }
53
-
54
- function applyModelPointsStyle(id) {
55
- const style = modelPointsStyle(id)
56
- return Promise.all([
57
- setModelPointsVisibility(id, style.visibility),
58
- setModelPointsSize(id, style.size),
59
- ])
60
- }
61
-
62
- return {
63
- modelPointsVisibility,
64
- modelPointsSize,
65
- setModelPointsVisibility,
66
- setModelPointsSize,
67
- applyModelPointsStyle,
68
- }
69
- }
@@ -1,123 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../state"
7
- import { useViewerStore } from "@ogw_front/stores/viewer"
8
-
9
- // Local constants
10
- const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces
11
-
12
- export function useModelSurfacesStyle() {
13
- const dataStyleStateStore = useDataStyleStateStore()
14
- const dataStore = useDataStore()
15
- const viewerStore = useViewerStore()
16
-
17
- function modelSurfacesStyle(id) {
18
- return dataStyleStateStore.getStyle(id).surfaces
19
- }
20
- function modelSurfaceStyle(id, surface_id) {
21
- if (!modelSurfacesStyle(id)[surface_id]) {
22
- modelSurfacesStyle(id)[surface_id] = {}
23
- }
24
- return modelSurfacesStyle(id)[surface_id]
25
- }
26
-
27
- function modelSurfaceVisibility(id, surface_id) {
28
- return modelSurfaceStyle(id, surface_id).visibility
29
- }
30
- function saveModelSurfaceVisibility(id, surface_id, visibility) {
31
- modelSurfaceStyle(id, surface_id).visibility = visibility
32
- }
33
- async function setModelSurfacesVisibility(id, surface_ids, visibility) {
34
- if (!surface_ids || surface_ids.length === 0) {
35
- return
36
- }
37
- const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(
38
- id,
39
- surface_ids,
40
- )
41
- if (!surface_viewer_ids || surface_viewer_ids.length === 0) {
42
- console.warn(
43
- "[setModelSurfacesVisibility] No viewer IDs found, skipping visibility request",
44
- { id, surface_ids },
45
- )
46
- return
47
- }
48
- return viewerStore.request(
49
- model_surfaces_schemas.visibility,
50
- { id, block_ids: surface_viewer_ids, visibility },
51
- {
52
- response_function: () => {
53
- for (const surface_id of surface_ids) {
54
- saveModelSurfaceVisibility(id, surface_id, visibility)
55
- }
56
- console.log(
57
- setModelSurfacesVisibility.name,
58
- { id },
59
- { surface_ids },
60
- modelSurfaceVisibility(id, surface_ids[0]),
61
- )
62
- },
63
- },
64
- )
65
- }
66
- function modelSurfaceColor(id, surface_id) {
67
- return modelSurfaceStyle(id, surface_id).color
68
- }
69
- function saveModelSurfaceColor(id, surface_id, color) {
70
- modelSurfaceStyle(id, surface_id).color = color
71
- }
72
-
73
- async function setModelSurfacesColor(id, surface_ids, color) {
74
- if (!surface_ids || surface_ids.length === 0) {
75
- return
76
- }
77
- const surface_viewer_ids = await dataStore.getMeshComponentsViewerIds(
78
- id,
79
- surface_ids,
80
- )
81
- if (!surface_viewer_ids || surface_viewer_ids.length === 0) {
82
- console.warn(
83
- "[setModelSurfacesColor] No viewer IDs found, skipping color request",
84
- { id, surface_ids },
85
- )
86
- return
87
- }
88
- return viewerStore.request(
89
- model_surfaces_schemas.color,
90
- { id, block_ids: surface_viewer_ids, color },
91
- {
92
- response_function: () => {
93
- for (const surface_id of surface_ids) {
94
- saveModelSurfaceColor(id, surface_id, color)
95
- }
96
- console.log(
97
- setModelSurfacesColor.name,
98
- { id },
99
- { surface_ids },
100
- JSON.stringify(modelSurfaceColor(id, surface_ids[0])),
101
- )
102
- },
103
- },
104
- )
105
- }
106
-
107
- async function applyModelSurfacesStyle(id) {
108
- const style = modelSurfacesStyle(id)
109
- const surface_ids = await dataStore.getSurfacesGeodeIds(id)
110
- return Promise.all([
111
- setModelSurfacesVisibility(id, surface_ids, style.visibility),
112
- setModelSurfacesColor(id, surface_ids, style.color),
113
- ])
114
- }
115
-
116
- return {
117
- modelSurfaceVisibility,
118
- modelSurfaceColor,
119
- setModelSurfacesVisibility,
120
- setModelSurfacesColor,
121
- applyModelSurfacesStyle,
122
- }
123
- }