@geode/opengeodeweb-front 10.41.0 → 10.42.0-rc.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/Screenshot.vue +148 -25
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +8 -1
- package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +223 -0
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +2 -27
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +159 -0
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +5 -1
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +5 -1
- package/app/components/Viewer/Solid/EdgesOptions.vue +5 -1
- package/app/components/Viewer/Surface/EdgesOptions.vue +5 -1
- package/internal/stores/data_style/model/blocks/edges.ts +51 -0
- package/internal/stores/data_style/model/blocks/index.ts +4 -0
- package/internal/stores/data_style/model/component_style.ts +27 -0
- package/internal/stores/data_style/model/edges/component.ts +406 -0
- package/internal/stores/data_style/model/edges/index.ts +5 -1
- package/internal/stores/data_style/model/edges/visibility.ts +24 -3
- package/internal/stores/data_style/model/edges/width.ts +56 -0
- package/internal/stores/data_style/model/index.ts +3 -1
- package/internal/stores/data_style/model/points/component.ts +5 -23
- package/internal/stores/data_style/model/surfaces/edges.ts +51 -0
- package/internal/stores/data_style/model/surfaces/index.ts +4 -0
- package/internal/stores/hybrid_viewer/scene.ts +23 -2
- package/package.json +4 -4
- package/server/api/microservice/app/set_is_app_ready.post.ts +0 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Third party imports
|
|
2
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
3
|
+
|
|
4
|
+
// Local imports
|
|
5
|
+
import {
|
|
6
|
+
EDGES_COMPONENT_TYPES,
|
|
7
|
+
useModelComponentEdgesStyle,
|
|
8
|
+
} from "@ogw_internal/stores/data_style/model/edges/component";
|
|
9
|
+
import { useModelEdgesCommonStyle } from "./common";
|
|
10
|
+
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
11
|
+
|
|
12
|
+
// Local constants
|
|
13
|
+
const schema = viewer_schemas.opengeodeweb_viewer.model.edges.width;
|
|
14
|
+
|
|
15
|
+
export function useModelEdgesWidthStyle(): {
|
|
16
|
+
modelEdgesWidth: (id: string) => number | undefined;
|
|
17
|
+
setModelEdgesWidth: (id: string, width: number) => Promise<unknown>;
|
|
18
|
+
} {
|
|
19
|
+
const viewerStore = useViewerStore();
|
|
20
|
+
const modelEdgesCommonStyle = useModelEdgesCommonStyle();
|
|
21
|
+
const componentsEdgesStyles = EDGES_COMPONENT_TYPES.map((type) =>
|
|
22
|
+
useModelComponentEdgesStyle(type),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
function modelEdgesWidth(id: string): number | undefined {
|
|
26
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- edges style values are dynamically typed at runtime.
|
|
27
|
+
return modelEdgesCommonStyle.modelEdgesStyle(id).width as number | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function setModelEdgesWidth(id: string, width: number): Promise<unknown> {
|
|
31
|
+
const params = { id, width };
|
|
32
|
+
const result = await viewerStore.request(
|
|
33
|
+
{
|
|
34
|
+
schema,
|
|
35
|
+
params,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
response_function: async () => {
|
|
39
|
+
const [mutateResult] = await Promise.all([
|
|
40
|
+
modelEdgesCommonStyle.mutateModelEdgesStyle(id, { width }),
|
|
41
|
+
...componentsEdgesStyles.map(async (edgesStyle) => {
|
|
42
|
+
await edgesStyle.mutateStyledEdges(id, { width });
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
return mutateResult;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
modelEdgesWidth,
|
|
54
|
+
setModelEdgesWidth,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -61,11 +61,13 @@ function useModelStyle(): UseModelStyleReturn {
|
|
|
61
61
|
modelPointsStyle.applyModelPointsStyle(modelId),
|
|
62
62
|
modelEdgesStyle.applyModelEdgesStyle(modelId),
|
|
63
63
|
]);
|
|
64
|
-
// Components points come after the model
|
|
64
|
+
// Components points and edges come after the model ones, which override every component
|
|
65
65
|
await Promise.all([
|
|
66
66
|
modelSurfacesStyle.applyModelSurfacesPointsStyle(modelId),
|
|
67
67
|
modelLinesStyle.applyModelLinesPointsStyle(modelId),
|
|
68
68
|
modelBlocksStyle.applyModelBlocksPointsStyle(modelId),
|
|
69
|
+
modelSurfacesStyle.applyModelSurfacesEdgesStyle(modelId),
|
|
70
|
+
modelBlocksStyle.applyModelBlocksEdgesStyle(modelId),
|
|
69
71
|
]);
|
|
70
72
|
return results;
|
|
71
73
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
|
+
import {
|
|
3
|
+
type AttributeState,
|
|
4
|
+
type AttributeStoredConfig,
|
|
5
|
+
groupBy,
|
|
6
|
+
} from "@ogw_internal/stores/data_style/model/component_style";
|
|
2
7
|
import {
|
|
3
8
|
DEFAULT_NO_DATA_COLOR,
|
|
4
9
|
POINTS_DEFAULT_COLOR,
|
|
@@ -34,29 +39,6 @@ type PointsRequestSchema =
|
|
|
34
39
|
| PointsSchemas["color"]
|
|
35
40
|
| PointsSchemas["attribute"]["vertex"]["attribute"];
|
|
36
41
|
|
|
37
|
-
function groupBy(componentIds: string[], key: (componentId: string) => string): string[][] {
|
|
38
|
-
const groups: Record<string, string[]> = {};
|
|
39
|
-
for (const componentId of componentIds) {
|
|
40
|
-
const groupKey = key(componentId);
|
|
41
|
-
groups[groupKey] ??= [];
|
|
42
|
-
groups[groupKey].push(componentId);
|
|
43
|
-
}
|
|
44
|
-
return Object.values(groups);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface AttributeStoredConfig {
|
|
48
|
-
minimum: number | undefined;
|
|
49
|
-
maximum: number | undefined;
|
|
50
|
-
colorMap: string | undefined;
|
|
51
|
-
no_data_color: RGBAColor;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface AttributeState {
|
|
55
|
-
name?: string;
|
|
56
|
-
item?: number;
|
|
57
|
-
storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
42
|
interface PointsStyle {
|
|
61
43
|
visibility?: boolean;
|
|
62
44
|
size?: number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ModelComponentEdgesStyle,
|
|
3
|
+
useModelComponentEdgesStyle,
|
|
4
|
+
} from "@ogw_internal/stores/data_style/model/edges/component";
|
|
5
|
+
|
|
6
|
+
interface UseModelSurfacesEdgesStyleReturn {
|
|
7
|
+
modelSurfaceEdgesVisibility: ModelComponentEdgesStyle["visibility"];
|
|
8
|
+
modelSurfaceEdgesWidth: ModelComponentEdgesStyle["width"];
|
|
9
|
+
modelSurfaceEdgesColor: ModelComponentEdgesStyle["color"];
|
|
10
|
+
modelSurfaceEdgesActiveColoring: ModelComponentEdgesStyle["activeColoring"];
|
|
11
|
+
modelSurfaceEdgesVertexAttributeName: ModelComponentEdgesStyle["vertexAttributeName"];
|
|
12
|
+
modelSurfaceEdgesVertexAttributeItem: ModelComponentEdgesStyle["vertexAttributeItem"];
|
|
13
|
+
modelSurfaceEdgesVertexAttributeRange: ModelComponentEdgesStyle["vertexAttributeRange"];
|
|
14
|
+
modelSurfaceEdgesVertexAttributeColorMap: ModelComponentEdgesStyle["vertexAttributeColorMap"];
|
|
15
|
+
modelSurfaceEdgesVertexAttributeNoDataColor: ModelComponentEdgesStyle["vertexAttributeNoDataColor"];
|
|
16
|
+
setModelSurfacesEdgesVisibility: ModelComponentEdgesStyle["setVisibility"];
|
|
17
|
+
setModelSurfacesEdgesWidth: ModelComponentEdgesStyle["setWidth"];
|
|
18
|
+
setModelSurfacesEdgesColor: ModelComponentEdgesStyle["setColor"];
|
|
19
|
+
setModelSurfacesEdgesActiveColoring: ModelComponentEdgesStyle["setActiveColoring"];
|
|
20
|
+
setModelSurfacesEdgesVertexAttributeName: ModelComponentEdgesStyle["setVertexAttributeName"];
|
|
21
|
+
setModelSurfacesEdgesVertexAttributeItem: ModelComponentEdgesStyle["setVertexAttributeItem"];
|
|
22
|
+
setModelSurfacesEdgesVertexAttributeRange: ModelComponentEdgesStyle["setVertexAttributeRange"];
|
|
23
|
+
setModelSurfacesEdgesVertexAttributeColorMap: ModelComponentEdgesStyle["setVertexAttributeColorMap"];
|
|
24
|
+
setModelSurfacesEdgesVertexAttributeNoDataColor: ModelComponentEdgesStyle["setVertexAttributeNoDataColor"];
|
|
25
|
+
applyModelSurfacesEdgesStyle: ModelComponentEdgesStyle["applyEdgesStyle"];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useModelSurfacesEdgesStyle(): UseModelSurfacesEdgesStyleReturn {
|
|
29
|
+
const edges = useModelComponentEdgesStyle("Surface");
|
|
30
|
+
return {
|
|
31
|
+
modelSurfaceEdgesVisibility: edges.visibility,
|
|
32
|
+
modelSurfaceEdgesWidth: edges.width,
|
|
33
|
+
modelSurfaceEdgesColor: edges.color,
|
|
34
|
+
modelSurfaceEdgesActiveColoring: edges.activeColoring,
|
|
35
|
+
modelSurfaceEdgesVertexAttributeName: edges.vertexAttributeName,
|
|
36
|
+
modelSurfaceEdgesVertexAttributeItem: edges.vertexAttributeItem,
|
|
37
|
+
modelSurfaceEdgesVertexAttributeRange: edges.vertexAttributeRange,
|
|
38
|
+
modelSurfaceEdgesVertexAttributeColorMap: edges.vertexAttributeColorMap,
|
|
39
|
+
modelSurfaceEdgesVertexAttributeNoDataColor: edges.vertexAttributeNoDataColor,
|
|
40
|
+
setModelSurfacesEdgesVisibility: edges.setVisibility,
|
|
41
|
+
setModelSurfacesEdgesWidth: edges.setWidth,
|
|
42
|
+
setModelSurfacesEdgesColor: edges.setColor,
|
|
43
|
+
setModelSurfacesEdgesActiveColoring: edges.setActiveColoring,
|
|
44
|
+
setModelSurfacesEdgesVertexAttributeName: edges.setVertexAttributeName,
|
|
45
|
+
setModelSurfacesEdgesVertexAttributeItem: edges.setVertexAttributeItem,
|
|
46
|
+
setModelSurfacesEdgesVertexAttributeRange: edges.setVertexAttributeRange,
|
|
47
|
+
setModelSurfacesEdgesVertexAttributeColorMap: edges.setVertexAttributeColorMap,
|
|
48
|
+
setModelSurfacesEdgesVertexAttributeNoDataColor: edges.setVertexAttributeNoDataColor,
|
|
49
|
+
applyModelSurfacesEdgesStyle: edges.applyEdgesStyle,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -4,6 +4,7 @@ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
|
4
4
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
5
5
|
import { useModelSurfacesColor } from "./color";
|
|
6
6
|
import { useModelSurfacesCommonStyle } from "./common";
|
|
7
|
+
import { useModelSurfacesEdgesStyle } from "./edges";
|
|
7
8
|
import { useModelSurfacesPointsStyle } from "./points";
|
|
8
9
|
import { useModelSurfacesVisibility } from "./visibility";
|
|
9
10
|
|
|
@@ -30,6 +31,7 @@ type UseModelSurfacesStyleReturn = ReturnType<typeof useModelSurfacesCommonStyle
|
|
|
30
31
|
ReturnType<typeof useModelSurfacesVisibility> &
|
|
31
32
|
ReturnType<typeof useModelSurfacesColor> &
|
|
32
33
|
ReturnType<typeof useModelSurfacesPointsStyle> &
|
|
34
|
+
ReturnType<typeof useModelSurfacesEdgesStyle> &
|
|
33
35
|
ReturnType<typeof useModelSurfacesVertexAttribute> &
|
|
34
36
|
ReturnType<typeof useModelSurfacesPolygonAttribute> & {
|
|
35
37
|
applyModelSurfacesStyle: (modelId: string) => Promise<void>;
|
|
@@ -45,6 +47,7 @@ export function useModelSurfacesStyle(): UseModelSurfacesStyleReturn {
|
|
|
45
47
|
const modelSurfacesVertexAttribute = useModelSurfacesVertexAttribute();
|
|
46
48
|
const modelSurfacesPolygonAttribute = useModelSurfacesPolygonAttribute();
|
|
47
49
|
const modelSurfacesPointsStyle = useModelSurfacesPointsStyle();
|
|
50
|
+
const modelSurfacesEdgesStyle = useModelSurfacesEdgesStyle();
|
|
48
51
|
|
|
49
52
|
async function applyModelSurfacesVisibilityStyle(
|
|
50
53
|
modelId: string,
|
|
@@ -268,5 +271,6 @@ export function useModelSurfacesStyle(): UseModelSurfacesStyleReturn {
|
|
|
268
271
|
...modelSurfacesVertexAttribute,
|
|
269
272
|
...modelSurfacesPolygonAttribute,
|
|
270
273
|
...modelSurfacesPointsStyle,
|
|
274
|
+
...modelSurfacesEdgesStyle,
|
|
271
275
|
};
|
|
272
276
|
}
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
+
import { ACTOR_COLOR, RGB_MAX } from "./constants";
|
|
1
2
|
import type { HybridDb, vtkActor as VtkActorInstance } from "./vtk_types";
|
|
2
3
|
import { requireRenderWindow, useHybridViewerCore } from "./core";
|
|
3
|
-
import {
|
|
4
|
+
import viewer_schemas, {
|
|
5
|
+
type ViewerSetBackgroundColorParams,
|
|
6
|
+
} from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
4
7
|
import { base64ToArrayBuffer } from "./base64";
|
|
5
8
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
6
9
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
7
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
8
10
|
import { newInstance as vtkActor } from "@kitware/vtk.js/Rendering/Core/Actor";
|
|
9
11
|
import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper";
|
|
10
12
|
import type vtkPolyData from "@kitware/vtk.js/Common/DataModel/PolyData";
|
|
11
13
|
import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader";
|
|
12
14
|
|
|
15
|
+
async function setBackgroundColor(color: ViewerSetBackgroundColorParams["color"]): Promise<void> {
|
|
16
|
+
const { genericRenderWindow, remoteRender } = useHybridViewerCore();
|
|
17
|
+
const renderer = requireRenderWindow(genericRenderWindow).getRenderer();
|
|
18
|
+
renderer.setBackground([color.r / RGB_MAX, color.g / RGB_MAX, color.b / RGB_MAX]);
|
|
19
|
+
const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
|
|
20
|
+
renderWindow.render();
|
|
21
|
+
const viewerStore = useViewerStore();
|
|
22
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.set_background_color;
|
|
23
|
+
const params = {
|
|
24
|
+
color,
|
|
25
|
+
};
|
|
26
|
+
await viewerStore.request({
|
|
27
|
+
schema,
|
|
28
|
+
params,
|
|
29
|
+
});
|
|
30
|
+
await remoteRender();
|
|
31
|
+
}
|
|
32
|
+
|
|
13
33
|
// Shared via createSharedComposable (rather than merged into the parent hybridViewer store) so sibling slices, e.g. camera.ts and ruler.ts, can read hybridDb/setZScaling directly without importing the parent store and creating a cycle. A Pinia store would work too but its $id/$patch/... properties would leak into the composed store's spread and collapse its inferred type.
|
|
14
34
|
const useHybridViewerScene = createSharedComposable(() => {
|
|
15
35
|
const hybridDb = reactive<HybridDb>({});
|
|
@@ -122,6 +142,7 @@ const useHybridViewerScene = createSharedComposable(() => {
|
|
|
122
142
|
removeItem,
|
|
123
143
|
setVisibility,
|
|
124
144
|
setZScaling,
|
|
145
|
+
setBackgroundColor,
|
|
125
146
|
clear,
|
|
126
147
|
};
|
|
127
148
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.42.0-rc.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": {
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"prepublishOnly": "npm run build"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@geode/cloud-api": "
|
|
68
|
-
"@geode/opengeodeweb-back": "
|
|
69
|
-
"@geode/opengeodeweb-viewer": "
|
|
67
|
+
"@geode/cloud-api": "next",
|
|
68
|
+
"@geode/opengeodeweb-back": "next",
|
|
69
|
+
"@geode/opengeodeweb-viewer": "next",
|
|
70
70
|
"@kitware/vtk.js": "33.3.0",
|
|
71
71
|
"@mdi/font": "7.4.47",
|
|
72
72
|
"@msgpack/msgpack": "2.8.0",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { consola } from "consola";
|
|
3
|
-
import { createError } from "h3";
|
|
4
3
|
|
|
5
4
|
// Local imports
|
|
6
5
|
import { setIsAppReady } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -11,9 +10,6 @@ import schemas from "@geode/opengeodeweb-front/opengeodeweb_front_typed_schemas.
|
|
|
11
10
|
export default defineTypedEventHandler(
|
|
12
11
|
schemas.api.microservice.app.set_is_app_ready,
|
|
13
12
|
({ isReady }) => {
|
|
14
|
-
if (!isReady) {
|
|
15
|
-
throw createError({ statusCode: 400, statusMessage: "isReady is required" });
|
|
16
|
-
}
|
|
17
13
|
setIsAppReady(isReady);
|
|
18
14
|
consola.info(`Updated IS_APP_READY to ${isReady}`);
|
|
19
15
|
return { statusCode: 200, isReady };
|