@geode/opengeodeweb-front 10.22.0 → 10.22.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 (82) hide show
  1. package/app/components/CrsSelector.vue +7 -4
  2. package/app/components/ExtensionSelector.vue +2 -4
  3. package/app/components/FileSelector.vue +1 -1
  4. package/app/components/Inspector/InspectionButton.vue +10 -7
  5. package/app/components/MissingFilesSelector.vue +8 -9
  6. package/app/components/ObjectSelector.vue +9 -5
  7. package/app/components/PackagesVersions.vue +1 -2
  8. package/app/components/RemoteRenderingView.vue +3 -4
  9. package/app/components/Screenshot.vue +8 -4
  10. package/app/components/ViewToolbar.vue +6 -2
  11. package/app/components/Viewer/Options/AttributeSelector.vue +2 -2
  12. package/app/components/Viewer/Options/TextureItem.vue +9 -10
  13. package/app/composables/hover_highlight.js +2 -2
  14. package/app/composables/project_manager.js +3 -6
  15. package/app/composables/use_overlapping_picker.js +6 -3
  16. package/app/stores/app.js +10 -7
  17. package/app/stores/back.js +13 -11
  18. package/app/stores/camera_manager.js +3 -3
  19. package/app/stores/cloud.js +21 -18
  20. package/app/stores/data.js +6 -2
  21. package/app/stores/hybrid_viewer.js +13 -10
  22. package/app/stores/viewer.js +18 -16
  23. package/app/utils/extension.js +1 -1
  24. package/app/utils/import_workflow.js +4 -3
  25. package/app/utils/local/microservices.js +7 -7
  26. package/app/utils/local/path.js +68 -13
  27. package/internal/stores/data_style/mesh/cells/cell.js +19 -6
  28. package/internal/stores/data_style/mesh/cells/color.js +6 -3
  29. package/internal/stores/data_style/mesh/cells/textures.js +6 -3
  30. package/internal/stores/data_style/mesh/cells/vertex.js +10 -6
  31. package/internal/stores/data_style/mesh/cells/visibility.js +6 -3
  32. package/internal/stores/data_style/mesh/edges/color.js +6 -3
  33. package/internal/stores/data_style/mesh/edges/edge.js +13 -6
  34. package/internal/stores/data_style/mesh/edges/vertex.js +10 -6
  35. package/internal/stores/data_style/mesh/edges/visibility.js +6 -3
  36. package/internal/stores/data_style/mesh/edges/width.js +6 -3
  37. package/internal/stores/data_style/mesh/index.js +12 -4
  38. package/internal/stores/data_style/mesh/points/color.js +6 -3
  39. package/internal/stores/data_style/mesh/points/size.js +6 -3
  40. package/internal/stores/data_style/mesh/points/vertex.js +11 -6
  41. package/internal/stores/data_style/mesh/points/visibility.js +6 -3
  42. package/internal/stores/data_style/mesh/polygons/color.js +6 -3
  43. package/internal/stores/data_style/mesh/polygons/polygon.js +9 -6
  44. package/internal/stores/data_style/mesh/polygons/textures.js +6 -3
  45. package/internal/stores/data_style/mesh/polygons/vertex.js +10 -6
  46. package/internal/stores/data_style/mesh/polygons/visibility.js +6 -3
  47. package/internal/stores/data_style/mesh/polyhedra/color.js +6 -3
  48. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +14 -6
  49. package/internal/stores/data_style/mesh/polyhedra/vertex.js +14 -6
  50. package/internal/stores/data_style/mesh/polyhedra/visibility.js +6 -3
  51. package/internal/stores/data_style/model/common.js +24 -22
  52. package/internal/stores/data_style/model/edges/visibility.js +3 -3
  53. package/internal/stores/data_style/model/points/size.js +6 -3
  54. package/internal/stores/data_style/model/points/visibility.js +3 -3
  55. package/internal/stores/data_style/model/visibility.js +3 -2
  56. package/internal/stores/hybrid_viewer.js +27 -33
  57. package/internal/stores/hybrid_viewer_camera.js +9 -6
  58. package/internal/stores/hybrid_viewer_constants.js +21 -0
  59. package/internal/stores/hybrid_viewer_highlight.js +2 -1
  60. package/internal/utils/api_fetch.js +2 -1
  61. package/internal/utils/viewer_call.js +2 -2
  62. package/package.json +3 -3
  63. package/server/api/extensions/run.post.js +4 -2
  64. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +12 -8
  65. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +12 -8
  66. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -2
  67. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +12 -8
  68. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +12 -8
  69. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +12 -8
  70. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +6 -13
  71. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +6 -13
  72. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -2
  73. package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -2
  74. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +6 -13
  75. package/tests/integration/stores/data_style/model/points.nuxt.test.js +6 -4
  76. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +6 -13
  77. package/tests/integration/stores/viewer.nuxt.test.js +1 -2
  78. package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
  79. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
  80. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
  81. package/tests/unit/composables/api_fetch.nuxt.test.js +5 -6
  82. package/tests/vitest.config.js +0 -1
@@ -6,7 +6,7 @@ import { useMeshPolygonsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPolygonsColorSchemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons.color;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.color;
10
10
 
11
11
  export function useMeshPolygonsColorStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPolygonsColorStyle() {
16
16
  return meshPolygonsCommonStyle.meshPolygonsColoring(id).color;
17
17
  }
18
18
  function setMeshPolygonsColor(id, color) {
19
+ const params = { id, color };
19
20
  return viewerStore.request(
20
- meshPolygonsColorSchemas,
21
- { id, color },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPolygonsCommonStyle.mutateMeshPolygonsColoring(id, {
@@ -52,9 +52,10 @@ export function useMeshPolygonsPolygonAttributeStyle() {
52
52
  }
53
53
 
54
54
  function setMeshPolygonsPolygonAttributeName(id, name) {
55
+ const schema = meshPolygonsPolygonAttributeSchemas.name;
56
+ const params = { id, name };
55
57
  return viewerStore.request(
56
- meshPolygonsPolygonAttributeSchemas.name,
57
- { id, name },
58
+ { schema, params },
58
59
  {
59
60
  response_function: () => {
60
61
  const updates = { name };
@@ -85,9 +86,10 @@ export function useMeshPolygonsPolygonAttributeStyle() {
85
86
  const name = meshPolygonsPolygonAttributeName(id);
86
87
  const points = getRGBPointsFromPreset(meshPolygonsPolygonAttributeColorMap(id));
87
88
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
89
+ const schema = meshPolygonsPolygonAttributeSchemas.color_map;
90
+ const params = { id, points, minimum, maximum };
88
91
  return viewerStore.request(
89
- meshPolygonsPolygonAttributeSchemas.color_map,
90
- { id, points, minimum, maximum },
92
+ { schema, params },
91
93
  {
92
94
  response_function: () =>
93
95
  setMeshPolygonsPolygonAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -113,9 +115,10 @@ export function useMeshPolygonsPolygonAttributeStyle() {
113
115
  const points = getRGBPointsFromPreset(colorMap);
114
116
  const { minimum, maximum } = storedConfig;
115
117
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
118
+ const schema = meshPolygonsPolygonAttributeSchemas.color_map;
119
+ const params = { id, points, minimum, maximum };
116
120
  return viewerStore.request(
117
- meshPolygonsPolygonAttributeSchemas.color_map,
118
- { id, points, minimum, maximum },
121
+ { schema, params },
119
122
  {
120
123
  response_function: () =>
121
124
  setMeshPolygonsPolygonAttributeStoredConfig(id, name, { colorMap }),
@@ -6,7 +6,7 @@ import { useMeshPolygonsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPolygonsTexturesSchemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons.apply_textures;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.apply_textures;
10
10
 
11
11
  export function useMeshPolygonsTexturesStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPolygonsTexturesStyle() {
16
16
  return meshPolygonsCommonStyle.meshPolygonsColoring(id).textures;
17
17
  }
18
18
  function setMeshPolygonsTextures(id, textures) {
19
+ const params = { id, textures };
19
20
  return viewerStore.request(
20
- meshPolygonsTexturesSchemas,
21
- { id, textures },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPolygonsCommonStyle.mutateMeshPolygonsStyle(id, {
@@ -10,6 +10,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
10
10
  const meshPolygonsVertexAttributeSchemas =
11
11
  viewer_schemas.opengeodeweb_viewer.mesh.polygons.attribute.vertex;
12
12
 
13
+ // oxlint-disable-next-line max-lines-per-function
13
14
  export function useMeshPolygonsVertexAttributeStyle() {
14
15
  const viewerStore = useViewerStore();
15
16
  const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
@@ -51,9 +52,10 @@ export function useMeshPolygonsVertexAttributeStyle() {
51
52
  }
52
53
 
53
54
  function setMeshPolygonsVertexAttributeName(id, name) {
55
+ const schema = meshPolygonsVertexAttributeSchemas.name;
56
+ const params = { id, name };
54
57
  return viewerStore.request(
55
- meshPolygonsVertexAttributeSchemas.name,
56
- { id, name },
58
+ { schema, params },
57
59
  {
58
60
  response_function: () => {
59
61
  const updates = { name };
@@ -84,9 +86,10 @@ export function useMeshPolygonsVertexAttributeStyle() {
84
86
  const name = meshPolygonsVertexAttributeName(id);
85
87
  const points = getRGBPointsFromPreset(meshPolygonsVertexAttributeColorMap(id));
86
88
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
89
+ const schema = meshPolygonsVertexAttributeSchemas.color_map;
90
+ const params = { id, points, minimum, maximum };
87
91
  return viewerStore.request(
88
- meshPolygonsVertexAttributeSchemas.color_map,
89
- { id, points, minimum, maximum },
92
+ { schema, params },
90
93
  {
91
94
  response_function: () =>
92
95
  setMeshPolygonsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -112,9 +115,10 @@ export function useMeshPolygonsVertexAttributeStyle() {
112
115
  const points = getRGBPointsFromPreset(colorMap);
113
116
  const { minimum, maximum } = storedConfig;
114
117
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
118
+ const schema = meshPolygonsVertexAttributeSchemas.color_map;
119
+ const params = { id, points, minimum, maximum };
115
120
  return viewerStore.request(
116
- meshPolygonsVertexAttributeSchemas.color_map,
117
- { id, points, minimum, maximum },
121
+ { schema, params },
118
122
  {
119
123
  response_function: () =>
120
124
  setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap }),
@@ -6,7 +6,7 @@ import { useMeshPolygonsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPolygonsVisibilitySchema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.visibility;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.visibility;
10
10
 
11
11
  export function useMeshPolygonsVisibilityStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPolygonsVisibilityStyle() {
16
16
  return meshPolygonsCommonStyle.meshPolygonsStyle(id).visibility;
17
17
  }
18
18
  function setMeshPolygonsVisibility(id, visibility) {
19
+ const params = { id, visibility };
19
20
  return viewerStore.request(
20
- meshPolygonsVisibilitySchema,
21
- { id, visibility },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPolygonsCommonStyle.mutateMeshPolygonsStyle(id, {
@@ -6,7 +6,7 @@ import { useMeshPolyhedraCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPolyhedraColorSchemas = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.color;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.color;
10
10
 
11
11
  export function useMeshPolyhedraColorStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPolyhedraColorStyle() {
16
16
  return meshPolyhedraCommonStyle.meshPolyhedraColoring(id).color;
17
17
  }
18
18
  function setMeshPolyhedraColor(id, color) {
19
+ const params = { id, color };
19
20
  return viewerStore.request(
20
- meshPolyhedraColorSchemas,
21
- { id, color },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPolyhedraCommonStyle.mutateMeshPolyhedraColoring(id, {
@@ -10,6 +10,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
10
10
  const meshPolyhedraPolyhedronAttributeSchemas =
11
11
  viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron;
12
12
 
13
+ // oxlint-disable-next-line max-lines-per-function
13
14
  function useMeshPolyhedraPolyhedronAttributeConfig() {
14
15
  const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
15
16
 
@@ -74,14 +75,19 @@ function useMeshPolyhedraPolyhedronAttributeConfig() {
74
75
  };
75
76
  }
76
77
 
78
+ // oxlint-disable-next-line max-lines-per-function
77
79
  function useMeshPolyhedraPolyhedronAttributeActions() {
78
80
  const viewerStore = useViewerStore();
79
81
  const config = useMeshPolyhedraPolyhedronAttributeConfig();
80
82
 
81
83
  function setMeshPolyhedraPolyhedronAttributeName(id, name) {
84
+ const schema = meshPolyhedraPolyhedronAttributeSchemas.name;
85
+ const params = { id, name };
82
86
  return viewerStore.request(
83
- meshPolyhedraPolyhedronAttributeSchemas.name,
84
- { id, name },
87
+ {
88
+ schema,
89
+ params,
90
+ },
85
91
  {
86
92
  response_function: () => {
87
93
  const updates = { name };
@@ -105,9 +111,10 @@ function useMeshPolyhedraPolyhedronAttributeActions() {
105
111
  const name = config.meshPolyhedraPolyhedronAttributeName(id);
106
112
  const points = getRGBPointsFromPreset(config.meshPolyhedraPolyhedronAttributeColorMap(id));
107
113
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
114
+ const schema = meshPolyhedraPolyhedronAttributeSchemas.color_map;
115
+ const params = { id, points, minimum, maximum };
108
116
  return viewerStore.request(
109
- meshPolyhedraPolyhedronAttributeSchemas.color_map,
110
- { id, points, minimum, maximum },
117
+ { schema, params },
111
118
  {
112
119
  response_function: () =>
113
120
  config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -126,9 +133,10 @@ function useMeshPolyhedraPolyhedronAttributeActions() {
126
133
  const points = getRGBPointsFromPreset(colorMap);
127
134
  const { minimum, maximum } = storedConfig;
128
135
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
136
+ const schema = meshPolyhedraPolyhedronAttributeSchemas.color_map;
137
+ const params = { id, points, minimum, maximum };
129
138
  return viewerStore.request(
130
- meshPolyhedraPolyhedronAttributeSchemas.color_map,
131
- { id, points, minimum, maximum },
139
+ { schema, params },
132
140
  {
133
141
  response_function: () =>
134
142
  config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap }),
@@ -10,6 +10,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
10
10
  const meshPolyhedraVertexAttributeSchemas =
11
11
  viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.vertex;
12
12
 
13
+ // oxlint-disable-next-line max-lines-per-function
13
14
  function useMeshPolyhedraVertexAttributeConfig() {
14
15
  const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
15
16
 
@@ -74,14 +75,19 @@ function useMeshPolyhedraVertexAttributeConfig() {
74
75
  };
75
76
  }
76
77
 
78
+ // oxlint-disable-next-line max-lines-per-function
77
79
  function useMeshPolyhedraVertexAttributeActions() {
78
80
  const viewerStore = useViewerStore();
79
81
  const config = useMeshPolyhedraVertexAttributeConfig();
80
82
 
81
83
  function setMeshPolyhedraVertexAttributeName(id, name) {
84
+ const schema = meshPolyhedraVertexAttributeSchemas.name;
85
+ const params = { id, name };
82
86
  return viewerStore.request(
83
- meshPolyhedraVertexAttributeSchemas.name,
84
- { id, name },
87
+ {
88
+ schema,
89
+ params,
90
+ },
85
91
  {
86
92
  response_function: () => {
87
93
  const updates = { name };
@@ -105,9 +111,10 @@ function useMeshPolyhedraVertexAttributeActions() {
105
111
  const name = config.meshPolyhedraVertexAttributeName(id);
106
112
  const points = getRGBPointsFromPreset(config.meshPolyhedraVertexAttributeColorMap(id));
107
113
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
114
+ const schema = meshPolyhedraVertexAttributeSchemas.color_map;
115
+ const params = { id, points, minimum, maximum };
108
116
  return viewerStore.request(
109
- meshPolyhedraVertexAttributeSchemas.color_map,
110
- { id, points, minimum, maximum },
117
+ { schema, params },
111
118
  {
112
119
  response_function: () =>
113
120
  config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -126,9 +133,10 @@ function useMeshPolyhedraVertexAttributeActions() {
126
133
  const points = getRGBPointsFromPreset(colorMap);
127
134
  const { minimum, maximum } = storedConfig;
128
135
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
136
+ const schema = meshPolyhedraVertexAttributeSchemas.color_map;
137
+ const params = { id, points, minimum, maximum };
129
138
  return viewerStore.request(
130
- meshPolyhedraVertexAttributeSchemas.color_map,
131
- { id, points, minimum, maximum },
139
+ { schema, params },
132
140
  {
133
141
  response_function: () =>
134
142
  config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { colorMap }),
@@ -6,7 +6,7 @@ import { useMeshPolyhedraCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPolyhedraVisibilitySchema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.visibility;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.visibility;
10
10
 
11
11
  export function useMeshPolyhedraVisibilityStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPolyhedraVisibilityStyle() {
16
16
  return meshPolyhedraCommonStyle.meshPolyhedraStyle(id).visibility;
17
17
  }
18
18
  function setMeshPolyhedraVisibility(id, visibility) {
19
+ const params = { id, visibility };
19
20
  return viewerStore.request(
20
- meshPolyhedraVisibilitySchema,
21
- { id, visibility },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPolyhedraCommonStyle.mutateMeshPolyhedraStyle(id, {
@@ -81,26 +81,29 @@ export function useModelCommonStyle() {
81
81
  params.color = color;
82
82
  }
83
83
 
84
- return viewerStore.request(schema, params, {
85
- response_function: async (colors) => {
86
- if (color_mode === "constant" && color !== undefined) {
87
- await mutateComponentStyles(id, component_ids, { color });
88
- return;
89
- }
90
-
91
- if (!colors?.length) {
92
- return;
93
- }
94
-
95
- await bulkMutateComponentStylesPerComponent(
96
- id,
97
- colors.map(({ geode_id, color: color_value }) => ({
98
- id_component: geode_id,
99
- values: { color: color_value },
100
- })),
101
- );
84
+ return viewerStore.request(
85
+ { schema, params },
86
+ {
87
+ response_function: async (colors) => {
88
+ if (color_mode === "constant" && color !== undefined) {
89
+ await mutateComponentStyles(id, component_ids, { color });
90
+ return;
91
+ }
92
+
93
+ if (!colors?.length) {
94
+ return;
95
+ }
96
+
97
+ await bulkMutateComponentStylesPerComponent(
98
+ id,
99
+ colors.map(({ geode_id, color: color_value }) => ({
100
+ id_component: geode_id,
101
+ values: { color: color_value },
102
+ })),
103
+ );
104
+ },
102
105
  },
103
- });
106
+ );
104
107
  }
105
108
 
106
109
  async function setModelTypeVisibility(id, component_ids, visibility, schema) {
@@ -112,10 +115,9 @@ export function useModelCommonStyle() {
112
115
  if (!viewer_ids?.length) {
113
116
  return;
114
117
  }
115
-
118
+ const params = { id, block_ids: viewer_ids, visibility };
116
119
  return viewerStore.request(
117
- schema,
118
- { id, block_ids: viewer_ids, visibility },
120
+ { schema, params },
119
121
  {
120
122
  response_function: () => mutateComponentStyles(id, component_ids, { visibility }),
121
123
  },
@@ -5,7 +5,7 @@ import { useModelEdgesCommonStyle } from "./common";
5
5
  import { useViewerStore } from "@ogw_front/stores/viewer";
6
6
 
7
7
  // Local constants
8
- const model_edges_schemas = viewer_schemas.opengeodeweb_viewer.model.edges;
8
+ const schema = viewer_schemas.opengeodeweb_viewer.model.edges.visibility;
9
9
 
10
10
  export function useModelEdgesVisibilityStyle() {
11
11
  const viewerStore = useViewerStore();
@@ -16,9 +16,9 @@ export function useModelEdgesVisibilityStyle() {
16
16
  }
17
17
 
18
18
  function setModelEdgesVisibility(id, visibility) {
19
+ const params = { id, visibility };
19
20
  return viewerStore.request(
20
- model_edges_schemas.visibility,
21
- { id, visibility },
21
+ { schema, params },
22
22
  {
23
23
  response_function: () => modelEdgesCommonStyle.mutateModelEdgesStyle(id, { visibility }),
24
24
  },
@@ -6,7 +6,7 @@ import { useModelPointsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.model.points.size;
10
10
 
11
11
  export function useModelPointsSizeStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -17,9 +17,12 @@ export function useModelPointsSizeStyle() {
17
17
  }
18
18
 
19
19
  function setModelPointsSize(id, size) {
20
+ const params = { id, size };
20
21
  return viewerStore.request(
21
- model_points_schemas.size,
22
- { id, size },
22
+ {
23
+ schema,
24
+ params,
25
+ },
23
26
  {
24
27
  response_function: () => modelPointsCommonStyle.mutateModelPointsStyle(id, { size }),
25
28
  },
@@ -6,7 +6,7 @@ import { useModelPointsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.model.points.visibility;
10
10
 
11
11
  export function useModelPointsVisibilityStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -17,9 +17,9 @@ export function useModelPointsVisibilityStyle() {
17
17
  }
18
18
 
19
19
  function setModelPointsVisibility(id, visibility) {
20
+ const params = { id, visibility };
20
21
  return viewerStore.request(
21
- model_points_schemas.visibility,
22
- { id, visibility },
22
+ { schema, params },
23
23
  {
24
24
  response_function: () =>
25
25
  modelPointsCommonStyle.mutateModelPointsStyle(id, {
@@ -128,9 +128,10 @@ function useModelVisibilityStyle(componentStyleFunctions) {
128
128
  }
129
129
 
130
130
  function setModelVisibility(modelId, visibility) {
131
+ const schema = model_schemas.visibility;
132
+ const params = { id: modelId, visibility };
131
133
  return viewerStore.request(
132
- model_schemas.visibility,
133
- { id: modelId, visibility },
134
+ { schema, params },
134
135
  {
135
136
  response_function: async () => {
136
137
  await hybridViewerStore.setVisibility(modelId, visibility);
@@ -1,19 +1,9 @@
1
+ import { BACKGROUND_GREY_VALUE, RGB_MAX } from "./hybrid_viewer_constants";
1
2
  import { centerCameraOnPosition } from "./hybrid_viewer_camera";
2
3
 
3
- const RGB_MAX = 255;
4
- const BACKGROUND_GREY_VALUE = 180;
5
- const ACTOR_DARK_VALUE = 20;
6
-
7
- const bgVal = BACKGROUND_GREY_VALUE / RGB_MAX;
8
- const BACKGROUND_COLOR = [bgVal, bgVal, bgVal];
9
- const actVal = ACTOR_DARK_VALUE / RGB_MAX;
10
- const ACTOR_COLOR = [actVal, actVal, actVal];
11
- const HOVER_THROTTLE_MS = 50,
12
- HOVER_TIMEOUT_MS = 500,
13
- WHEEL_TIME_OUT_MS = 600;
14
- const RGBA_CHANNELS = 4,
15
- SAMPLE_SIZE = 10,
16
- TOTAL_CHANNELS = 400;
4
+ const RGBA_CHANNELS = 4;
5
+ const SAMPLE_SIZE = 10;
6
+ const TOTAL_CHANNELS = 400;
17
7
 
18
8
  function mapRect(rect, latestImage, canvasRect) {
19
9
  const scaleX = latestImage.width / canvasRect.width;
@@ -73,11 +63,15 @@ function computeAverageBrightness(rect, options) {
73
63
  function performClickPicking(event, options) {
74
64
  const { container, viewerStore, viewer_schemas, genericRenderWindow, syncRemoteCamera } = options;
75
65
  const rect = container.getBoundingClientRect();
66
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.get_point_position;
67
+ const params = {
68
+ x: Math.round(event.clientX - rect.left),
69
+ y: Math.round(rect.height - (event.clientY - rect.top)),
70
+ };
76
71
  viewerStore.request(
77
- viewer_schemas.opengeodeweb_viewer.viewer.get_point_position,
78
72
  {
79
- x: Math.round(event.clientX - rect.left),
80
- y: Math.round(rect.height - (event.clientY - rect.top)),
73
+ schema,
74
+ params,
81
75
  },
82
76
  {
83
77
  response_function: ({ x, y, z }) => {
@@ -111,13 +105,17 @@ function performHoverHighlight(event, options) {
111
105
  return;
112
106
  }
113
107
  const rect = container.getBoundingClientRect();
108
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.get_point_position;
109
+ const params = {
110
+ x: Math.round(event.clientX - rect.left),
111
+ y: Math.round(rect.height - (event.clientY - rect.top)),
112
+ field_type: hover_highlight_field_type.value,
113
+ ids: Object.keys(hybridDb),
114
+ };
114
115
  viewerStore.request(
115
- viewer_schemas.opengeodeweb_viewer.viewer.highlight,
116
116
  {
117
- x: Math.round(event.clientX - rect.left),
118
- y: Math.round(rect.height - (event.clientY - rect.top)),
119
- field_type: hover_highlight_field_type.value,
120
- ids: Object.keys(hybridDb),
117
+ schema,
118
+ params,
121
119
  },
122
120
  {
123
121
  response_function: onResponse,
@@ -127,12 +125,14 @@ function performHoverHighlight(event, options) {
127
125
 
128
126
  function performClearHoverHighlight(options) {
129
127
  const { viewerStore, viewer_schemas, hover_highlight_field_type, hybridDb } = options;
130
- viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.highlight, {
128
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.clear_highlight;
129
+ const params = {
131
130
  x: -1,
132
131
  y: -1,
133
132
  field_type: hover_highlight_field_type.value,
134
133
  ids: Object.keys(hybridDb),
135
- });
134
+ };
135
+ viewerStore.request({ schema, params });
136
136
  }
137
137
 
138
138
  async function performAddItem(id, options) {
@@ -179,10 +179,9 @@ async function performSetZScaling(z_scale, options) {
179
179
  }
180
180
  renderer.resetCamera();
181
181
  genericRenderWindow.getRenderWindow().render();
182
- const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling;
183
- if (schema) {
184
- await viewerStore.request(schema, { z_scale });
185
- }
182
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.set_z_scaling;
183
+ const params = { z_scale };
184
+ await viewerStore.request({ schema, params });
186
185
  remoteRender();
187
186
  }
188
187
 
@@ -308,11 +307,6 @@ function performClear(options) {
308
307
  }
309
308
 
310
309
  export {
311
- BACKGROUND_COLOR,
312
- ACTOR_COLOR,
313
- WHEEL_TIME_OUT_MS,
314
- HOVER_THROTTLE_MS,
315
- HOVER_TIMEOUT_MS,
316
310
  computeAverageBrightness,
317
311
  performAddItem,
318
312
  performClearHoverHighlight,
@@ -140,10 +140,9 @@ async function performFocusCameraOnObject(id, options) {
140
140
 
141
141
  let bounds = [];
142
142
  if (block_ids.length > 0) {
143
- bounds = await viewerStore.request(viewer_schemas.opengeodeweb_viewer.model.get_blocks_bounds, {
144
- id,
145
- block_ids,
146
- });
143
+ const schema = viewer_schemas.opengeodeweb_viewer.model.get_blocks_bounds;
144
+ const params = { id, block_ids };
145
+ bounds = await viewerStore.request({ schema, params });
147
146
  } else {
148
147
  bounds = hybridDb[id].actor.getBounds();
149
148
  }
@@ -168,9 +167,13 @@ function performSyncRemoteCamera(options) {
168
167
  options;
169
168
  const camera = genericRenderWindow.getRenderer().getActiveCamera();
170
169
  const options_camera = getCameraOptions(camera);
170
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.update_camera;
171
+ const params = { camera_options: options_camera };
171
172
  viewerStore.request(
172
- viewer_schemas.opengeodeweb_viewer.viewer.update_camera,
173
- { camera_options: options_camera },
173
+ {
174
+ schema,
175
+ params,
176
+ },
174
177
  {
175
178
  response_function: () => {
176
179
  remoteRender();
@@ -0,0 +1,21 @@
1
+ const RGB_MAX = 255;
2
+ const BACKGROUND_GREY_VALUE = 180;
3
+ const ACTOR_DARK_VALUE = 20;
4
+
5
+ const bgVal = BACKGROUND_GREY_VALUE / RGB_MAX;
6
+ const BACKGROUND_COLOR = [bgVal, bgVal, bgVal];
7
+ const actVal = ACTOR_DARK_VALUE / RGB_MAX;
8
+ const ACTOR_COLOR = [actVal, actVal, actVal];
9
+ const HOVER_THROTTLE_MS = 50;
10
+ const HOVER_TIMEOUT_MS = 500;
11
+ const WHEEL_TIME_OUT_MS = 600;
12
+
13
+ export {
14
+ ACTOR_COLOR,
15
+ BACKGROUND_COLOR,
16
+ BACKGROUND_GREY_VALUE,
17
+ HOVER_THROTTLE_MS,
18
+ HOVER_TIMEOUT_MS,
19
+ RGB_MAX,
20
+ WHEEL_TIME_OUT_MS,
21
+ };
@@ -1,5 +1,6 @@
1
- import { HOVER_THROTTLE_MS, HOVER_TIMEOUT_MS, performHoverHighlight } from "./hybrid_viewer";
1
+ import { HOVER_THROTTLE_MS, HOVER_TIMEOUT_MS } from "./hybrid_viewer_constants";
2
2
  import { database } from "@ogw_internal/database/database.js";
3
+ import { performHoverHighlight } from "./hybrid_viewer";
3
4
 
4
5
  function createClearHoverData(hoverTimeoutRef, hoverData, currentHoverId) {
5
6
  return function clearHoverData() {
@@ -6,7 +6,7 @@ const ERROR_400 = 400;
6
6
 
7
7
  export function api_fetch(
8
8
  microservice,
9
- { schema, params },
9
+ { schema, params, headers },
10
10
  { request_error_function, response_function, response_error_function, timeout } = {},
11
11
  ) {
12
12
  const feedbackStore = useFeedbackStore();
@@ -28,6 +28,7 @@ export function api_fetch(
28
28
  const method = schema.methods.find((methodItem) => methodItem !== "OPTIONS");
29
29
  const request_options = {
30
30
  method,
31
+ headers,
31
32
  };
32
33
  if (!_.isEmpty(body)) {
33
34
  request_options.body = body;
@@ -6,8 +6,8 @@ const ERROR_400 = 400;
6
6
 
7
7
  export function viewer_call(
8
8
  microservice,
9
- { schema, params = {} },
10
- { request_error_function, response_function, response_error_function, timeout } = {},
9
+ { schema, params = {}, timeout },
10
+ { request_error_function, response_function, response_error_function } = {},
11
11
  ) {
12
12
  const feedbackStore = useFeedbackStore();
13
13