@geode/opengeodeweb-front 10.22.1-rc.1 → 10.22.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/app/components/CrsSelector.vue +7 -4
- package/app/components/ExtensionSelector.vue +2 -4
- package/app/components/FileSelector.vue +1 -1
- package/app/components/Inspector/InspectionButton.vue +10 -7
- package/app/components/MissingFilesSelector.vue +8 -9
- package/app/components/ObjectSelector.vue +9 -5
- package/app/components/PackagesVersions.vue +1 -2
- package/app/components/RemoteRenderingView.vue +3 -4
- package/app/components/Screenshot.vue +8 -4
- package/app/components/ViewToolbar.vue +6 -2
- package/app/components/Viewer/Options/AttributeSelector.vue +2 -2
- package/app/components/Viewer/Options/TextureItem.vue +9 -10
- package/app/composables/hover_highlight.js +2 -2
- package/app/composables/project_manager.js +3 -6
- package/app/composables/use_overlapping_picker.js +6 -3
- package/app/stores/app.js +10 -7
- package/app/stores/back.js +13 -11
- package/app/stores/camera_manager.js +3 -3
- package/app/stores/cloud.js +21 -18
- package/app/stores/data.js +6 -2
- package/app/stores/hybrid_viewer.js +13 -10
- package/app/stores/viewer.js +18 -16
- package/app/utils/extension.js +1 -1
- package/app/utils/import_workflow.js +4 -3
- package/internal/stores/data_style/mesh/cells/cell.js +19 -6
- package/internal/stores/data_style/mesh/cells/color.js +6 -3
- package/internal/stores/data_style/mesh/cells/textures.js +6 -3
- package/internal/stores/data_style/mesh/cells/vertex.js +10 -6
- package/internal/stores/data_style/mesh/cells/visibility.js +6 -3
- package/internal/stores/data_style/mesh/edges/color.js +6 -3
- package/internal/stores/data_style/mesh/edges/edge.js +13 -6
- package/internal/stores/data_style/mesh/edges/vertex.js +10 -6
- package/internal/stores/data_style/mesh/edges/visibility.js +6 -3
- package/internal/stores/data_style/mesh/edges/width.js +6 -3
- package/internal/stores/data_style/mesh/index.js +12 -4
- package/internal/stores/data_style/mesh/points/color.js +6 -3
- package/internal/stores/data_style/mesh/points/size.js +6 -3
- package/internal/stores/data_style/mesh/points/vertex.js +11 -6
- package/internal/stores/data_style/mesh/points/visibility.js +6 -3
- package/internal/stores/data_style/mesh/polygons/color.js +6 -3
- package/internal/stores/data_style/mesh/polygons/polygon.js +9 -6
- package/internal/stores/data_style/mesh/polygons/textures.js +6 -3
- package/internal/stores/data_style/mesh/polygons/vertex.js +10 -6
- package/internal/stores/data_style/mesh/polygons/visibility.js +6 -3
- package/internal/stores/data_style/mesh/polyhedra/color.js +6 -3
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +14 -6
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +14 -6
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +6 -3
- package/internal/stores/data_style/model/common.js +24 -22
- package/internal/stores/data_style/model/edges/visibility.js +3 -3
- package/internal/stores/data_style/model/points/size.js +6 -3
- package/internal/stores/data_style/model/points/visibility.js +3 -3
- package/internal/stores/data_style/model/visibility.js +3 -2
- package/internal/stores/hybrid_viewer.js +27 -33
- package/internal/stores/hybrid_viewer_camera.js +9 -6
- package/internal/stores/hybrid_viewer_constants.js +21 -0
- package/internal/stores/hybrid_viewer_highlight.js +2 -1
- package/internal/utils/api_fetch.js +2 -1
- package/internal/utils/viewer_call.js +2 -2
- package/package.json +3 -3
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +6 -4
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +6 -13
- package/tests/integration/stores/viewer.nuxt.test.js +1 -2
- package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/composables/api_fetch.nuxt.test.js +5 -6
- package/tests/vitest.config.js +0 -1
|
@@ -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
|
|
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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
21
|
-
|
|
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(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
22
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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
|
-
|
|
80
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
173
|
-
|
|
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
|
|
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
|
|
9
|
+
{ schema, params = {}, timeout },
|
|
10
|
+
{ request_error_function, response_function, response_error_function } = {},
|
|
11
11
|
) {
|
|
12
12
|
const feedbackStore = useFeedbackStore();
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.22.1
|
|
3
|
+
"version": "10.22.1",
|
|
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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"build": ""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@geode/opengeodeweb-back": "
|
|
38
|
-
"@geode/opengeodeweb-viewer": "
|
|
37
|
+
"@geode/opengeodeweb-back": "latest",
|
|
38
|
+
"@geode/opengeodeweb-viewer": "latest",
|
|
39
39
|
"@google-cloud/run": "3.2.0",
|
|
40
40
|
"@kitware/vtk.js": "33.3.0",
|
|
41
41
|
"@mdi/font": "7.4.47",
|
|
@@ -40,9 +40,10 @@ describe("mesh cells", () => {
|
|
|
40
40
|
const result = dataStyleStore.setMeshCellsVisibility(id, visibility);
|
|
41
41
|
expect(result).toBeInstanceOf(Promise);
|
|
42
42
|
await result;
|
|
43
|
+
const schema = mesh_cells_schemas.visibility;
|
|
44
|
+
const params = { id, visibility };
|
|
43
45
|
expect(spy).toHaveBeenCalledWith(
|
|
44
|
-
|
|
45
|
-
{ id, visibility },
|
|
46
|
+
{ schema, params },
|
|
46
47
|
{
|
|
47
48
|
response_function: expect.any(Function),
|
|
48
49
|
},
|
|
@@ -61,9 +62,10 @@ describe("mesh cells", () => {
|
|
|
61
62
|
const result = dataStyleStore.setMeshCellsColor(id, color);
|
|
62
63
|
expect(result).toBeInstanceOf(Promise);
|
|
63
64
|
await result;
|
|
65
|
+
const schema = mesh_cells_schemas.color;
|
|
66
|
+
const params = { id, color };
|
|
64
67
|
expect(spy).toHaveBeenCalledWith(
|
|
65
|
-
|
|
66
|
-
{ id, color },
|
|
68
|
+
{ schema, params },
|
|
67
69
|
{
|
|
68
70
|
response_function: expect.any(Function),
|
|
69
71
|
},
|
|
@@ -81,9 +83,10 @@ describe("mesh cells", () => {
|
|
|
81
83
|
const result = dataStyleStore.setMeshCellsVertexAttributeName(id, vertex_attribute.name);
|
|
82
84
|
expect(result).toBeInstanceOf(Promise);
|
|
83
85
|
await result;
|
|
86
|
+
const schema = mesh_cells_schemas.attribute.vertex.name;
|
|
87
|
+
const params = { id, ...vertex_attribute };
|
|
84
88
|
expect(spy).toHaveBeenCalledWith(
|
|
85
|
-
|
|
86
|
-
{ id, ...vertex_attribute },
|
|
89
|
+
{ schema, params },
|
|
87
90
|
{
|
|
88
91
|
response_function: expect.any(Function),
|
|
89
92
|
},
|
|
@@ -101,9 +104,10 @@ describe("mesh cells", () => {
|
|
|
101
104
|
const result = dataStyleStore.setMeshCellsCellAttributeName(id, cell_attribute.name);
|
|
102
105
|
expect(result).toBeInstanceOf(Promise);
|
|
103
106
|
await result;
|
|
107
|
+
const schema = mesh_cells_schemas.attribute.cell.name;
|
|
108
|
+
const params = { id, ...cell_attribute };
|
|
104
109
|
expect(spy).toHaveBeenCalledWith(
|
|
105
|
-
|
|
106
|
-
{ id, ...cell_attribute },
|
|
110
|
+
{ schema, params },
|
|
107
111
|
{
|
|
108
112
|
response_function: expect.any(Function),
|
|
109
113
|
},
|
|
@@ -38,9 +38,10 @@ describe("mesh edges", () => {
|
|
|
38
38
|
const result = dataStyleStore.setMeshEdgesVisibility(id, visibility);
|
|
39
39
|
expect(result).toBeInstanceOf(Promise);
|
|
40
40
|
await result;
|
|
41
|
+
const schema = mesh_edges_schemas.visibility;
|
|
42
|
+
const params = { id, visibility };
|
|
41
43
|
expect(spy).toHaveBeenCalledWith(
|
|
42
|
-
|
|
43
|
-
{ id, visibility },
|
|
44
|
+
{ schema, params },
|
|
44
45
|
{
|
|
45
46
|
response_function: expect.any(Function),
|
|
46
47
|
},
|
|
@@ -57,9 +58,10 @@ describe("mesh edges", () => {
|
|
|
57
58
|
const result = dataStyleStore.setMeshEdgesColor(id, color);
|
|
58
59
|
expect(result).toBeInstanceOf(Promise);
|
|
59
60
|
await result;
|
|
61
|
+
const schema = mesh_edges_schemas.color;
|
|
62
|
+
const params = { id, color };
|
|
60
63
|
expect(spy).toHaveBeenCalledWith(
|
|
61
|
-
|
|
62
|
-
{ id, color },
|
|
64
|
+
{ schema, params },
|
|
63
65
|
{
|
|
64
66
|
response_function: expect.any(Function),
|
|
65
67
|
},
|
|
@@ -74,9 +76,10 @@ describe("mesh edges", () => {
|
|
|
74
76
|
|
|
75
77
|
const spy = vi.spyOn(viewerStore, "request");
|
|
76
78
|
await dataStyleStore.setMeshEdgesVertexAttributeName(id, vertex_attribute.name);
|
|
79
|
+
const schema = mesh_edges_schemas.attribute.vertex.name;
|
|
80
|
+
const params = { id, ...vertex_attribute };
|
|
77
81
|
expect(spy).toHaveBeenCalledWith(
|
|
78
|
-
|
|
79
|
-
{ id, ...vertex_attribute },
|
|
82
|
+
{ schema, params },
|
|
80
83
|
{
|
|
81
84
|
response_function: expect.any(Function),
|
|
82
85
|
},
|
|
@@ -91,9 +94,10 @@ describe("mesh edges", () => {
|
|
|
91
94
|
|
|
92
95
|
const spy = vi.spyOn(viewerStore, "request");
|
|
93
96
|
await dataStyleStore.setMeshEdgesEdgeAttributeName(id, edge_attribute.name);
|
|
97
|
+
const schema = mesh_edges_schemas.attribute.edge.name;
|
|
98
|
+
const params = { id, ...edge_attribute };
|
|
94
99
|
expect(spy).toHaveBeenCalledWith(
|
|
95
|
-
|
|
96
|
-
{ id, ...edge_attribute },
|
|
100
|
+
{ schema, params },
|
|
97
101
|
{
|
|
98
102
|
response_function: expect.any(Function),
|
|
99
103
|
},
|
|
@@ -36,9 +36,10 @@ describe("mesh", () => {
|
|
|
36
36
|
const result = dataStyleStore.setMeshVisibility(id, visibility);
|
|
37
37
|
expect(result).toBeInstanceOf(Promise);
|
|
38
38
|
await result;
|
|
39
|
+
const schema = mesh_schemas.visibility;
|
|
40
|
+
const params = { id, visibility };
|
|
39
41
|
expect(spy).toHaveBeenCalledWith(
|
|
40
|
-
|
|
41
|
-
{ id, visibility },
|
|
42
|
+
{ schema, params },
|
|
42
43
|
{
|
|
43
44
|
response_function: expect.any(Function),
|
|
44
45
|
},
|