@geode/opengeodeweb-front 10.44.0-rc.4 → 10.44.0-rc.6

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 (44) hide show
  1. package/app/assets/geode_objects.ts +1 -0
  2. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +12 -12
  3. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +17 -24
  4. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +12 -12
  5. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +13 -0
  6. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +17 -24
  7. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +12 -12
  8. package/app/components/Viewer/Options/ColoringTypeSelector.vue +12 -0
  9. package/app/components/Viewer/Options/Sliders/Opacity.vue +22 -0
  10. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +13 -0
  11. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +12 -12
  12. package/app/components/Viewer/Surface/PolygonsColoring.vue +17 -24
  13. package/app/components/Viewer/Ui.vue +0 -1
  14. package/app/composables/batch_style_model.ts +34 -0
  15. package/app/composables/project_manager.ts +6 -97
  16. package/app/composables/project_manager_helpers/reset.ts +31 -0
  17. package/app/composables/project_manager_helpers/restore.ts +55 -0
  18. package/app/composables/project_manager_helpers/types.ts +22 -0
  19. package/app/composables/project_manager_helpers/viewer_session.ts +25 -0
  20. package/app/stores/menu_helpers/menus_data.ts +16 -120
  21. package/app/stores/menu_helpers/mesh/edged_curve.ts +12 -0
  22. package/app/stores/menu_helpers/mesh/grid.ts +24 -0
  23. package/app/stores/menu_helpers/mesh/point_set.ts +11 -0
  24. package/app/stores/menu_helpers/mesh/solid.ts +29 -0
  25. package/app/stores/menu_helpers/mesh/surface.ts +22 -0
  26. package/app/stores/menu_helpers/model.ts +25 -0
  27. package/app/stores/menu_helpers/types.ts +5 -0
  28. package/app/stores/viewer.ts +0 -1
  29. package/internal/stores/data_style/mesh/cells/color.ts +3 -1
  30. package/internal/stores/data_style/mesh/cells/index.ts +17 -1
  31. package/internal/stores/data_style/mesh/cells/opacity.ts +54 -0
  32. package/internal/stores/data_style/mesh/edges/color.ts +3 -1
  33. package/internal/stores/data_style/mesh/edges/index.ts +17 -1
  34. package/internal/stores/data_style/mesh/edges/opacity.ts +54 -0
  35. package/internal/stores/data_style/mesh/points/color.ts +3 -1
  36. package/internal/stores/data_style/mesh/points/index.ts +17 -1
  37. package/internal/stores/data_style/mesh/points/opacity.ts +54 -0
  38. package/internal/stores/data_style/mesh/polygons/color.ts +3 -1
  39. package/internal/stores/data_style/mesh/polygons/index.ts +17 -1
  40. package/internal/stores/data_style/mesh/polygons/opacity.ts +54 -0
  41. package/internal/stores/data_style/mesh/polyhedra/color.ts +3 -1
  42. package/internal/stores/data_style/mesh/polyhedra/index.ts +17 -1
  43. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +54 -0
  44. package/package.json +1 -1
@@ -4,12 +4,13 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed
4
4
 
5
5
  // Local imports
6
6
  import { useMeshEdgesCommonStyle } from "./common";
7
+ import { useMeshEdgesOpacityStyle } from "./opacity";
7
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
8
9
 
9
10
  // Local constants
10
11
  const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.color;
11
12
 
12
- export function useMeshEdgesColorStyle(): {
13
+ export function useMeshEdgesColorStyle(): ReturnType<typeof useMeshEdgesOpacityStyle> & {
13
14
  meshEdgesColor: (id: string) => RGBAColor | undefined;
14
15
  setMeshEdgesColor: (id: string, color: RGBAColor) => Promise<unknown>;
15
16
  } {
@@ -42,5 +43,6 @@ export function useMeshEdgesColorStyle(): {
42
43
  return {
43
44
  meshEdgesColor,
44
45
  setMeshEdgesColor,
46
+ ...useMeshEdgesOpacityStyle(),
45
47
  };
46
48
  }
@@ -51,7 +51,7 @@ function handleMeshEdgesEdgeColoring(
51
51
  return edgeAttributeStyle.setMeshEdgesEdgeAttribute(id, edge_attribute);
52
52
  }
53
53
 
54
- async function setMeshEdgesActiveColoring(
54
+ async function applyMeshEdgesActiveColoring(
55
55
  id: string,
56
56
  type: string | undefined,
57
57
  deps: MeshEdgesActiveColoringDeps,
@@ -77,6 +77,22 @@ async function setMeshEdgesActiveColoring(
77
77
  throw new Error(`Unknown mesh edges coloring type: ${type}`);
78
78
  }
79
79
 
80
+ async function setMeshEdgesActiveColoring(
81
+ id: string,
82
+ type: string | undefined,
83
+ deps: MeshEdgesActiveColoringDeps,
84
+ ): Promise<unknown> {
85
+ const result = await applyMeshEdgesActiveColoring(id, type, deps);
86
+ if (type !== "constant") {
87
+ // Attribute and textures colorings keep the actor opacity: restore the stored one
88
+ await whenDefined(deps.colorStyle.meshEdgesOpacity(id), async (value) => {
89
+ const applied = await deps.colorStyle.setMeshEdgesOpacity(id, value);
90
+ return applied;
91
+ });
92
+ }
93
+ return result;
94
+ }
95
+
80
96
  async function applyMeshEdgesStyle(
81
97
  id: string,
82
98
  visibilityStyle: ReturnType<typeof useMeshEdgesVisibilityStyle>,
@@ -0,0 +1,54 @@
1
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ // Third party imports
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
+
5
+ // Local imports
6
+ import { useMeshEdgesCommonStyle } from "./common";
7
+ import { useViewerStore } from "@ogw_front/stores/viewer";
8
+
9
+ // Local constants
10
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.opacity;
11
+
12
+ // The opacity is the constant color alpha, the viewer applies it whatever the coloring
13
+ export function useMeshEdgesOpacityStyle(): {
14
+ meshEdgesOpacity: (id: string) => number | undefined;
15
+ setMeshEdgesOpacity: (id: string, opacity: number) => Promise<unknown>;
16
+ } {
17
+ const viewerStore = useViewerStore();
18
+ const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
19
+
20
+ function meshEdgesConstantColor(id: string): RGBAColor | undefined {
21
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
22
+ return meshEdgesCommonStyle.meshEdgesColoring(id).constant as RGBAColor | undefined;
23
+ }
24
+ function meshEdgesOpacity(id: string): number | undefined {
25
+ return meshEdgesConstantColor(id)?.alpha;
26
+ }
27
+ async function setMeshEdgesOpacity(id: string, opacity: number): Promise<unknown> {
28
+ const params = { id, opacity };
29
+ const result = await viewerStore.request(
30
+ {
31
+ schema,
32
+ params,
33
+ },
34
+ {
35
+ response_function: async () => {
36
+ const color = meshEdgesConstantColor(id);
37
+ if (color === undefined) {
38
+ return undefined;
39
+ }
40
+ const mutateResult = await meshEdgesCommonStyle.mutateMeshEdgesColoring(id, {
41
+ constant: { ...color, alpha: opacity },
42
+ });
43
+ return mutateResult;
44
+ },
45
+ },
46
+ );
47
+ return result;
48
+ }
49
+
50
+ return {
51
+ meshEdgesOpacity,
52
+ setMeshEdgesOpacity,
53
+ };
54
+ }
@@ -4,12 +4,13 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed
4
4
 
5
5
  // Local imports
6
6
  import { useMeshPointsCommonStyle } from "./common";
7
+ import { useMeshPointsOpacityStyle } from "./opacity";
7
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
8
9
 
9
10
  // Local constants
10
11
  const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.color;
11
12
 
12
- export function useMeshPointsColorStyle(): {
13
+ export function useMeshPointsColorStyle(): ReturnType<typeof useMeshPointsOpacityStyle> & {
13
14
  meshPointsColor: (id: string) => RGBAColor | undefined;
14
15
  setMeshPointsColor: (id: string, color: RGBAColor) => Promise<unknown>;
15
16
  } {
@@ -42,5 +43,6 @@ export function useMeshPointsColorStyle(): {
42
43
  return {
43
44
  meshPointsColor,
44
45
  setMeshPointsColor,
46
+ ...useMeshPointsOpacityStyle(),
45
47
  };
46
48
  }
@@ -33,7 +33,7 @@ function handleMeshPointsVertexColoring(
33
33
  return vertexAttributeStyle.setMeshPointsVertexAttribute(id, vertex_attribute);
34
34
  }
35
35
 
36
- async function setMeshPointsActiveColoring(
36
+ async function applyMeshPointsActiveColoring(
37
37
  id: string,
38
38
  type: string | undefined,
39
39
  deps: MeshPointsActiveColoringDeps,
@@ -55,6 +55,22 @@ async function setMeshPointsActiveColoring(
55
55
  throw new Error(`Unknown mesh points coloring type: ${type}`);
56
56
  }
57
57
 
58
+ async function setMeshPointsActiveColoring(
59
+ id: string,
60
+ type: string | undefined,
61
+ deps: MeshPointsActiveColoringDeps,
62
+ ): Promise<unknown> {
63
+ const result = await applyMeshPointsActiveColoring(id, type, deps);
64
+ if (type !== "constant") {
65
+ // Attribute and textures colorings keep the actor opacity: restore the stored one
66
+ await whenDefined(deps.colorStyle.meshPointsOpacity(id), async (value) => {
67
+ const applied = await deps.colorStyle.setMeshPointsOpacity(id, value);
68
+ return applied;
69
+ });
70
+ }
71
+ return result;
72
+ }
73
+
58
74
  async function applyMeshPointsStyle(
59
75
  id: string,
60
76
  visibilityStyle: ReturnType<typeof useMeshPointsVisibilityStyle>,
@@ -0,0 +1,54 @@
1
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ // Third party imports
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
+
5
+ // Local imports
6
+ import { useMeshPointsCommonStyle } from "./common";
7
+ import { useViewerStore } from "@ogw_front/stores/viewer";
8
+
9
+ // Local constants
10
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.opacity;
11
+
12
+ // The opacity is the constant color alpha, the viewer applies it whatever the coloring
13
+ export function useMeshPointsOpacityStyle(): {
14
+ meshPointsOpacity: (id: string) => number | undefined;
15
+ setMeshPointsOpacity: (id: string, opacity: number) => Promise<unknown>;
16
+ } {
17
+ const viewerStore = useViewerStore();
18
+ const meshPointsCommonStyle = useMeshPointsCommonStyle();
19
+
20
+ function meshPointsConstantColor(id: string): RGBAColor | undefined {
21
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
22
+ return meshPointsCommonStyle.meshPointsColoring(id).constant as RGBAColor | undefined;
23
+ }
24
+ function meshPointsOpacity(id: string): number | undefined {
25
+ return meshPointsConstantColor(id)?.alpha;
26
+ }
27
+ async function setMeshPointsOpacity(id: string, opacity: number): Promise<unknown> {
28
+ const params = { id, opacity };
29
+ const result = await viewerStore.request(
30
+ {
31
+ schema,
32
+ params,
33
+ },
34
+ {
35
+ response_function: async () => {
36
+ const color = meshPointsConstantColor(id);
37
+ if (color === undefined) {
38
+ return undefined;
39
+ }
40
+ const mutateResult = await meshPointsCommonStyle.mutateMeshPointsColoring(id, {
41
+ constant: { ...color, alpha: opacity },
42
+ });
43
+ return mutateResult;
44
+ },
45
+ },
46
+ );
47
+ return result;
48
+ }
49
+
50
+ return {
51
+ meshPointsOpacity,
52
+ setMeshPointsOpacity,
53
+ };
54
+ }
@@ -4,12 +4,13 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed
4
4
 
5
5
  // Local imports
6
6
  import { useMeshPolygonsCommonStyle } from "./common";
7
+ import { useMeshPolygonsOpacityStyle } from "./opacity";
7
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
8
9
 
9
10
  // Local constants
10
11
  const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.color;
11
12
 
12
- export function useMeshPolygonsColorStyle(): {
13
+ export function useMeshPolygonsColorStyle(): ReturnType<typeof useMeshPolygonsOpacityStyle> & {
13
14
  meshPolygonsColor: (id: string) => RGBAColor | undefined;
14
15
  setMeshPolygonsColor: (id: string, color: RGBAColor) => Promise<unknown>;
15
16
  } {
@@ -42,5 +43,6 @@ export function useMeshPolygonsColorStyle(): {
42
43
  return {
43
44
  meshPolygonsColor,
44
45
  setMeshPolygonsColor,
46
+ ...useMeshPolygonsOpacityStyle(),
45
47
  };
46
48
  }
@@ -62,7 +62,7 @@ function handleMeshPolygonsPolygonColoring(
62
62
  return polygonAttributeStyle.setMeshPolygonsPolygonAttribute(id, polygon_attribute);
63
63
  }
64
64
 
65
- async function setMeshPolygonsActiveColoring(
65
+ async function applyMeshPolygonsActiveColoring(
66
66
  id: string,
67
67
  type: string | undefined,
68
68
  deps: MeshPolygonsActiveColoringDeps,
@@ -97,6 +97,22 @@ async function setMeshPolygonsActiveColoring(
97
97
  throw new Error(`Unknown mesh polygons coloring type: ${type}`);
98
98
  }
99
99
 
100
+ async function setMeshPolygonsActiveColoring(
101
+ id: string,
102
+ type: string | undefined,
103
+ deps: MeshPolygonsActiveColoringDeps,
104
+ ): Promise<unknown> {
105
+ const result = await applyMeshPolygonsActiveColoring(id, type, deps);
106
+ if (type !== "constant") {
107
+ // Attribute and textures colorings keep the actor opacity: restore the stored one
108
+ await whenDefined(deps.colorStyle.meshPolygonsOpacity(id), async (value) => {
109
+ const applied = await deps.colorStyle.setMeshPolygonsOpacity(id, value);
110
+ return applied;
111
+ });
112
+ }
113
+ return result;
114
+ }
115
+
100
116
  async function applyMeshPolygonsStyle(
101
117
  id: string,
102
118
  visibilityStyle: ReturnType<typeof useMeshPolygonsVisibilityStyle>,
@@ -0,0 +1,54 @@
1
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ // Third party imports
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
+
5
+ // Local imports
6
+ import { useMeshPolygonsCommonStyle } from "./common";
7
+ import { useViewerStore } from "@ogw_front/stores/viewer";
8
+
9
+ // Local constants
10
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.opacity;
11
+
12
+ // The opacity is the constant color alpha, the viewer applies it whatever the coloring
13
+ export function useMeshPolygonsOpacityStyle(): {
14
+ meshPolygonsOpacity: (id: string) => number | undefined;
15
+ setMeshPolygonsOpacity: (id: string, opacity: number) => Promise<unknown>;
16
+ } {
17
+ const viewerStore = useViewerStore();
18
+ const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
19
+
20
+ function meshPolygonsConstantColor(id: string): RGBAColor | undefined {
21
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
22
+ return meshPolygonsCommonStyle.meshPolygonsColoring(id).constant as RGBAColor | undefined;
23
+ }
24
+ function meshPolygonsOpacity(id: string): number | undefined {
25
+ return meshPolygonsConstantColor(id)?.alpha;
26
+ }
27
+ async function setMeshPolygonsOpacity(id: string, opacity: number): Promise<unknown> {
28
+ const params = { id, opacity };
29
+ const result = await viewerStore.request(
30
+ {
31
+ schema,
32
+ params,
33
+ },
34
+ {
35
+ response_function: async () => {
36
+ const color = meshPolygonsConstantColor(id);
37
+ if (color === undefined) {
38
+ return undefined;
39
+ }
40
+ const mutateResult = await meshPolygonsCommonStyle.mutateMeshPolygonsColoring(id, {
41
+ constant: { ...color, alpha: opacity },
42
+ });
43
+ return mutateResult;
44
+ },
45
+ },
46
+ );
47
+ return result;
48
+ }
49
+
50
+ return {
51
+ meshPolygonsOpacity,
52
+ setMeshPolygonsOpacity,
53
+ };
54
+ }
@@ -4,12 +4,13 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed
4
4
 
5
5
  // Local imports
6
6
  import { useMeshPolyhedraCommonStyle } from "./common";
7
+ import { useMeshPolyhedraOpacityStyle } from "./opacity";
7
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
8
9
 
9
10
  // Local constants
10
11
  const schema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.color;
11
12
 
12
- export function useMeshPolyhedraColorStyle(): {
13
+ export function useMeshPolyhedraColorStyle(): ReturnType<typeof useMeshPolyhedraOpacityStyle> & {
13
14
  meshPolyhedraColor: (id: string) => RGBAColor | undefined;
14
15
  setMeshPolyhedraColor: (id: string, color: RGBAColor) => Promise<unknown>;
15
16
  } {
@@ -42,5 +43,6 @@ export function useMeshPolyhedraColorStyle(): {
42
43
  return {
43
44
  meshPolyhedraColor,
44
45
  setMeshPolyhedraColor,
46
+ ...useMeshPolyhedraOpacityStyle(),
45
47
  };
46
48
  }
@@ -63,7 +63,7 @@ function handleMeshPolyhedraPolyhedronColoring(
63
63
  return polyhedronAttributeStyle.setMeshPolyhedraPolyhedronAttribute(id, polyhedron_attribute);
64
64
  }
65
65
 
66
- async function setMeshPolyhedraActiveColoring(
66
+ async function applyMeshPolyhedraActiveColoring(
67
67
  id: string,
68
68
  type: string | undefined,
69
69
  deps: MeshPolyhedraActiveColoringDeps,
@@ -89,6 +89,22 @@ async function setMeshPolyhedraActiveColoring(
89
89
  throw new Error(`Unknown mesh polyhedra coloring type: ${type}`);
90
90
  }
91
91
 
92
+ async function setMeshPolyhedraActiveColoring(
93
+ id: string,
94
+ type: string | undefined,
95
+ deps: MeshPolyhedraActiveColoringDeps,
96
+ ): Promise<unknown> {
97
+ const result = await applyMeshPolyhedraActiveColoring(id, type, deps);
98
+ if (type !== "constant") {
99
+ // Attribute and textures colorings keep the actor opacity: restore the stored one
100
+ await whenDefined(deps.colorStyle.meshPolyhedraOpacity(id), async (value) => {
101
+ const applied = await deps.colorStyle.setMeshPolyhedraOpacity(id, value);
102
+ return applied;
103
+ });
104
+ }
105
+ return result;
106
+ }
107
+
92
108
  async function applyMeshPolyhedraStyle(
93
109
  id: string,
94
110
  visibilityStyle: ReturnType<typeof useMeshPolyhedraVisibilityStyle>,
@@ -0,0 +1,54 @@
1
+ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ // Third party imports
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
+
5
+ // Local imports
6
+ import { useMeshPolyhedraCommonStyle } from "./common";
7
+ import { useViewerStore } from "@ogw_front/stores/viewer";
8
+
9
+ // Local constants
10
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.opacity;
11
+
12
+ // The opacity is the constant color alpha, the viewer applies it whatever the coloring
13
+ export function useMeshPolyhedraOpacityStyle(): {
14
+ meshPolyhedraOpacity: (id: string) => number | undefined;
15
+ setMeshPolyhedraOpacity: (id: string, opacity: number) => Promise<unknown>;
16
+ } {
17
+ const viewerStore = useViewerStore();
18
+ const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
19
+
20
+ function meshPolyhedraConstantColor(id: string): RGBAColor | undefined {
21
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
22
+ return meshPolyhedraCommonStyle.meshPolyhedraColoring(id).constant as RGBAColor | undefined;
23
+ }
24
+ function meshPolyhedraOpacity(id: string): number | undefined {
25
+ return meshPolyhedraConstantColor(id)?.alpha;
26
+ }
27
+ async function setMeshPolyhedraOpacity(id: string, opacity: number): Promise<unknown> {
28
+ const params = { id, opacity };
29
+ const result = await viewerStore.request(
30
+ {
31
+ schema,
32
+ params,
33
+ },
34
+ {
35
+ response_function: async () => {
36
+ const color = meshPolyhedraConstantColor(id);
37
+ if (color === undefined) {
38
+ return undefined;
39
+ }
40
+ const mutateResult = await meshPolyhedraCommonStyle.mutateMeshPolyhedraColoring(id, {
41
+ constant: { ...color, alpha: opacity },
42
+ });
43
+ return mutateResult;
44
+ },
45
+ },
46
+ );
47
+ return result;
48
+ }
49
+
50
+ return {
51
+ meshPolyhedraOpacity,
52
+ setMeshPolyhedraOpacity,
53
+ };
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.44.0-rc.4",
3
+ "version": "10.44.0-rc.6",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {