@geode/opengeodeweb-front 10.36.0 → 10.37.0
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 +6 -4
- package/app/components/ViewToolbar.vue +4 -2
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +7 -4
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +10 -4
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +7 -4
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -2
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +10 -6
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +7 -6
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +9 -18
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +5 -10
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -0
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +9 -17
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +8 -18
- package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +1 -5
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +11 -2
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +7 -6
- package/app/components/Viewer/Surface/PolygonsOptions.vue +10 -6
- package/app/composables/hover_highlight.ts +5 -4
- package/app/composables/project_manager.ts +1 -1
- package/app/composables/use_overlapping_picker.ts +4 -73
- package/app/composables/use_quick_colormap.ts +4 -14
- package/app/stores/back.ts +4 -10
- package/app/stores/camera_manager.ts +1 -1
- package/app/stores/data.ts +1 -1
- package/app/stores/viewer.ts +33 -19
- package/internal/stores/data_style/mesh/cells/cell.ts +26 -23
- package/internal/stores/data_style/mesh/cells/color.ts +8 -6
- package/internal/stores/data_style/mesh/cells/index.ts +13 -6
- package/internal/stores/data_style/mesh/cells/textures.ts +17 -6
- package/internal/stores/data_style/mesh/cells/vertex.ts +29 -23
- package/internal/stores/data_style/mesh/cells/visibility.ts +3 -6
- package/internal/stores/data_style/mesh/edges/color.ts +8 -6
- package/internal/stores/data_style/mesh/edges/edge.ts +26 -23
- package/internal/stores/data_style/mesh/edges/index.ts +13 -3
- package/internal/stores/data_style/mesh/edges/vertex.ts +29 -23
- package/internal/stores/data_style/mesh/edges/visibility.ts +3 -6
- package/internal/stores/data_style/mesh/edges/width.ts +3 -3
- package/internal/stores/data_style/mesh/index.ts +24 -11
- package/internal/stores/data_style/mesh/points/color.ts +8 -6
- package/internal/stores/data_style/mesh/points/index.ts +13 -6
- package/internal/stores/data_style/mesh/points/size.ts +3 -3
- package/internal/stores/data_style/mesh/points/vertex.ts +29 -23
- package/internal/stores/data_style/mesh/points/visibility.ts +5 -11
- package/internal/stores/data_style/mesh/polygons/color.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/index.ts +13 -9
- package/internal/stores/data_style/mesh/polygons/polygon.ts +26 -23
- package/internal/stores/data_style/mesh/polygons/textures.ts +17 -6
- package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -23
- package/internal/stores/data_style/mesh/polygons/visibility.ts +3 -6
- package/internal/stores/data_style/mesh/polyhedra/color.ts +8 -6
- package/internal/stores/data_style/mesh/polyhedra/index.ts +9 -5
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +28 -23
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -23
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +3 -6
- package/internal/stores/data_style/model/blocks/color.ts +8 -6
- package/internal/stores/data_style/model/blocks/index.ts +9 -22
- package/internal/stores/data_style/model/blocks/polyhedron.ts +28 -23
- package/internal/stores/data_style/model/blocks/vertex.ts +26 -23
- package/internal/stores/data_style/model/blocks/visibility.ts +3 -3
- package/internal/stores/data_style/model/color.ts +10 -7
- package/internal/stores/data_style/model/common.ts +36 -20
- package/internal/stores/data_style/model/corners/color.ts +8 -6
- package/internal/stores/data_style/model/corners/index.ts +8 -14
- package/internal/stores/data_style/model/corners/vertex.ts +26 -23
- package/internal/stores/data_style/model/corners/visibility.ts +3 -3
- package/internal/stores/data_style/model/edges/visibility.ts +8 -8
- package/internal/stores/data_style/model/lines/color.ts +8 -6
- package/internal/stores/data_style/model/lines/edge.ts +26 -23
- package/internal/stores/data_style/model/lines/index.ts +9 -22
- package/internal/stores/data_style/model/lines/vertex.ts +26 -23
- package/internal/stores/data_style/model/lines/visibility.ts +3 -3
- package/internal/stores/data_style/model/points/index.ts +14 -4
- package/internal/stores/data_style/model/points/size.ts +3 -3
- package/internal/stores/data_style/model/points/visibility.ts +3 -6
- package/internal/stores/data_style/model/surfaces/color.ts +8 -6
- package/internal/stores/data_style/model/surfaces/index.ts +9 -22
- package/internal/stores/data_style/model/surfaces/polygon.ts +29 -23
- package/internal/stores/data_style/model/surfaces/vertex.ts +26 -23
- package/internal/stores/data_style/model/surfaces/visibility.ts +3 -3
- package/internal/stores/data_style/model/visibility.ts +1 -1
- package/internal/stores/data_style/when_defined.ts +13 -0
- package/internal/stores/hybrid_viewer/camera.ts +14 -15
- package/internal/stores/hybrid_viewer/core.ts +1 -1
- package/internal/stores/hybrid_viewer/filters.ts +12 -6
- package/internal/stores/hybrid_viewer/highlight.ts +9 -18
- package/internal/stores/hybrid_viewer/ruler.ts +10 -13
- package/internal/stores/hybrid_viewer/scene.ts +1 -1
- package/internal/utils/viewer_call.ts +1 -1
- package/package.json +1 -1
- package/server/utils/ws_client.ts +4 -4
- package/shared/utils/call_raw.ts +3 -3
- package/shared/utils/call_schema.ts +10 -8
- package/shared/utils/types.ts +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
|
|
1
|
+
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
2
2
|
// Third party imports
|
|
3
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
6
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
@@ -15,7 +15,7 @@ interface AttributeStoredConfig {
|
|
|
15
15
|
minimum: number | undefined;
|
|
16
16
|
maximum: number | undefined;
|
|
17
17
|
colorMap: string | undefined;
|
|
18
|
-
no_data_color:
|
|
18
|
+
no_data_color: RGBAColor;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface AttributeState {
|
|
@@ -30,22 +30,25 @@ interface AttributeInput {
|
|
|
30
30
|
minimum: number | undefined;
|
|
31
31
|
maximum: number | undefined;
|
|
32
32
|
colorMap: string | undefined;
|
|
33
|
-
no_data_color?:
|
|
33
|
+
no_data_color?: RGBAColor;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
name
|
|
38
|
-
item
|
|
39
|
-
minimum
|
|
40
|
-
maximum
|
|
41
|
-
colorMap
|
|
42
|
-
|
|
36
|
+
interface ValidAttributeInput {
|
|
37
|
+
name: string;
|
|
38
|
+
item: number;
|
|
39
|
+
minimum: number;
|
|
40
|
+
maximum: number;
|
|
41
|
+
colorMap: string;
|
|
42
|
+
no_data_color?: RGBAColor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isMeshPolyhedraVertexAttributeValid(input: AttributeInput): input is ValidAttributeInput {
|
|
43
46
|
return (
|
|
44
|
-
name !== undefined &&
|
|
45
|
-
item !== undefined &&
|
|
46
|
-
minimum !== undefined &&
|
|
47
|
-
maximum !== undefined &&
|
|
48
|
-
colorMap !== undefined
|
|
47
|
+
input.name !== undefined &&
|
|
48
|
+
input.item !== undefined &&
|
|
49
|
+
input.minimum !== undefined &&
|
|
50
|
+
input.maximum !== undefined &&
|
|
51
|
+
input.colorMap !== undefined
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -59,7 +62,7 @@ interface UseMeshPolyhedraVertexAttributeStyleReturn {
|
|
|
59
62
|
name: string | undefined,
|
|
60
63
|
item: number | undefined,
|
|
61
64
|
) => AttributeStoredConfig;
|
|
62
|
-
setMeshPolyhedraVertexAttribute: (id: string, input:
|
|
65
|
+
setMeshPolyhedraVertexAttribute: (id: string, input: ValidAttributeInput) => Promise<unknown>;
|
|
63
66
|
setMeshPolyhedraVertexAttributeName: (id: string, name: string) => Promise<unknown>;
|
|
64
67
|
setMeshPolyhedraVertexAttributeItem: (id: string, item: number) => Promise<unknown>;
|
|
65
68
|
setMeshPolyhedraVertexAttributeRange: (
|
|
@@ -71,10 +74,10 @@ interface UseMeshPolyhedraVertexAttributeStyleReturn {
|
|
|
71
74
|
id: string,
|
|
72
75
|
colorMap: string | undefined,
|
|
73
76
|
) => Promise<unknown>;
|
|
74
|
-
meshPolyhedraVertexAttributeNoDataColor: (id: string) =>
|
|
77
|
+
meshPolyhedraVertexAttributeNoDataColor: (id: string) => RGBAColor;
|
|
75
78
|
setMeshPolyhedraVertexAttributeNoDataColor: (
|
|
76
79
|
id: string,
|
|
77
|
-
no_data_color:
|
|
80
|
+
no_data_color: RGBAColor,
|
|
78
81
|
) => Promise<unknown>;
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -155,7 +158,7 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
|
|
|
155
158
|
maximum,
|
|
156
159
|
colorMap,
|
|
157
160
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
158
|
-
}:
|
|
161
|
+
}: ValidAttributeInput,
|
|
159
162
|
): Promise<unknown> {
|
|
160
163
|
await mutateMeshPolyhedraVertexStyle(id, {
|
|
161
164
|
name,
|
|
@@ -167,7 +170,7 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
|
|
|
167
170
|
colorMap,
|
|
168
171
|
no_data_color,
|
|
169
172
|
});
|
|
170
|
-
const points = getRGBPointsFromPreset(colorMap
|
|
173
|
+
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
171
174
|
const schema = meshPolyhedraVertexAttributeSchemas.attribute;
|
|
172
175
|
const params = {
|
|
173
176
|
id,
|
|
@@ -251,7 +254,7 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
|
|
|
251
254
|
});
|
|
252
255
|
return applyVertexAttribute(id);
|
|
253
256
|
}
|
|
254
|
-
function meshPolyhedraVertexAttributeNoDataColor(id: string):
|
|
257
|
+
function meshPolyhedraVertexAttributeNoDataColor(id: string): RGBAColor {
|
|
255
258
|
const name = meshPolyhedraVertexAttributeName(id);
|
|
256
259
|
const item = meshPolyhedraVertexAttributeItem(id);
|
|
257
260
|
const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name, item);
|
|
@@ -259,7 +262,7 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
|
|
|
259
262
|
}
|
|
260
263
|
async function setMeshPolyhedraVertexAttributeNoDataColor(
|
|
261
264
|
id: string,
|
|
262
|
-
no_data_color:
|
|
265
|
+
no_data_color: RGBAColor,
|
|
263
266
|
): Promise<unknown> {
|
|
264
267
|
const name = meshPolyhedraVertexAttributeName(id);
|
|
265
268
|
const item = meshPolyhedraVertexAttributeItem(id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
2
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
3
3
|
|
|
4
4
|
// Local imports
|
|
5
5
|
import { useMeshPolyhedraCommonStyle } from "./common";
|
|
@@ -10,7 +10,7 @@ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.visibility;
|
|
|
10
10
|
|
|
11
11
|
export function useMeshPolyhedraVisibilityStyle(): {
|
|
12
12
|
meshPolyhedraVisibility: (id: string) => boolean | undefined;
|
|
13
|
-
setMeshPolyhedraVisibility: (id: string, visibility: boolean
|
|
13
|
+
setMeshPolyhedraVisibility: (id: string, visibility: boolean) => Promise<unknown>;
|
|
14
14
|
} {
|
|
15
15
|
const viewerStore = useViewerStore();
|
|
16
16
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
@@ -19,10 +19,7 @@ export function useMeshPolyhedraVisibilityStyle(): {
|
|
|
19
19
|
// oxlint-disable-next-line no-unsafe-type-assertion -- visibility is defined as boolean in the data style schema.
|
|
20
20
|
return meshPolyhedraCommonStyle.meshPolyhedraStyle(id).visibility as boolean | undefined;
|
|
21
21
|
}
|
|
22
|
-
async function setMeshPolyhedraVisibility(
|
|
23
|
-
id: string,
|
|
24
|
-
visibility: boolean | undefined,
|
|
25
|
-
): Promise<unknown> {
|
|
22
|
+
async function setMeshPolyhedraVisibility(id: string, visibility: boolean): Promise<unknown> {
|
|
26
23
|
const params = { id, visibility };
|
|
27
24
|
const result = await viewerStore.request(
|
|
28
25
|
{
|
|
@@ -3,21 +3,22 @@ import {
|
|
|
3
3
|
useModelBlocksPolyhedronAttribute,
|
|
4
4
|
} from "./polyhedron";
|
|
5
5
|
import { isModelBlocksVertexAttributeValid, useModelBlocksVertexAttribute } from "./vertex";
|
|
6
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
6
7
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
7
8
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
8
9
|
import { useModelBlocksCommonStyle } from "./common";
|
|
9
10
|
import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
|
|
10
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
11
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
11
12
|
|
|
12
13
|
const schema = viewer_schemas.opengeodeweb_viewer.model.blocks.color;
|
|
13
14
|
|
|
14
15
|
export function useModelBlocksColor(): {
|
|
15
16
|
modelBlockColoring: (id: string, block_id?: string) => StyleValues;
|
|
16
|
-
modelBlockColor: (id: string, block_id?: string) =>
|
|
17
|
+
modelBlockColor: (id: string, block_id?: string) => RGBAColor | undefined;
|
|
17
18
|
setModelBlocksColor: (
|
|
18
19
|
modelId: string,
|
|
19
20
|
blocks_ids: string[],
|
|
20
|
-
color:
|
|
21
|
+
color: RGBAColor | undefined,
|
|
21
22
|
activeColoring?: string,
|
|
22
23
|
collectionId?: string,
|
|
23
24
|
) => Promise<unknown>;
|
|
@@ -40,14 +41,15 @@ export function useModelBlocksColor(): {
|
|
|
40
41
|
return modelBlocksCommonStyle.modelBlockStyle(id, block_id).coloring as StyleValues;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
function modelBlockColor(id: string, block_id?: string):
|
|
44
|
-
|
|
44
|
+
function modelBlockColor(id: string, block_id?: string): RGBAColor | undefined {
|
|
45
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
|
|
46
|
+
return modelBlockColoring(id, block_id).constant as RGBAColor | undefined;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
async function setModelBlocksColor(
|
|
48
50
|
modelId: string,
|
|
49
51
|
blocks_ids: string[],
|
|
50
|
-
color:
|
|
52
|
+
color: RGBAColor | undefined,
|
|
51
53
|
activeColoring = "constant",
|
|
52
54
|
collectionId?: string,
|
|
53
55
|
): Promise<unknown> {
|
|
@@ -3,22 +3,23 @@ import {
|
|
|
3
3
|
useModelBlocksPolyhedronAttribute,
|
|
4
4
|
} from "./polyhedron";
|
|
5
5
|
import { isModelBlocksVertexAttributeValid, useModelBlocksVertexAttribute } from "./vertex";
|
|
6
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
6
7
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
7
8
|
import { useModelBlocksColor } from "./color";
|
|
8
9
|
import { useModelBlocksCommonStyle } from "./common";
|
|
9
10
|
import { useModelBlocksVisibility } from "./visibility";
|
|
10
11
|
|
|
11
12
|
interface ColorGroup {
|
|
12
|
-
color:
|
|
13
|
+
color: RGBAColor | undefined;
|
|
13
14
|
blocks_ids: string[];
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
interface AttributeGroup {
|
|
17
|
-
name: string
|
|
18
|
-
item: number
|
|
19
|
-
minimum: number
|
|
20
|
-
maximum: number
|
|
21
|
-
colorMap: string
|
|
18
|
+
name: string;
|
|
19
|
+
item: number;
|
|
20
|
+
minimum: number;
|
|
21
|
+
maximum: number;
|
|
22
|
+
colorMap: string;
|
|
22
23
|
blocks_ids: string[];
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -123,14 +124,7 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
|
|
|
123
124
|
continue;
|
|
124
125
|
}
|
|
125
126
|
const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
|
|
126
|
-
vertexGroups[key] ??= {
|
|
127
|
-
name,
|
|
128
|
-
item,
|
|
129
|
-
minimum,
|
|
130
|
-
maximum,
|
|
131
|
-
colorMap,
|
|
132
|
-
blocks_ids: [],
|
|
133
|
-
};
|
|
127
|
+
vertexGroups[key] ??= { ...attribute, blocks_ids: [] };
|
|
134
128
|
vertexGroups[key].blocks_ids.push(block_id);
|
|
135
129
|
}
|
|
136
130
|
coloringPromises.push(
|
|
@@ -173,14 +167,7 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
|
|
|
173
167
|
continue;
|
|
174
168
|
}
|
|
175
169
|
const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
|
|
176
|
-
polyhedronGroups[key] ??= {
|
|
177
|
-
name,
|
|
178
|
-
item,
|
|
179
|
-
minimum,
|
|
180
|
-
maximum,
|
|
181
|
-
colorMap,
|
|
182
|
-
blocks_ids: [],
|
|
183
|
-
};
|
|
170
|
+
polyhedronGroups[key] ??= { ...attribute, blocks_ids: [] };
|
|
184
171
|
polyhedronGroups[key].blocks_ids.push(block_id);
|
|
185
172
|
}
|
|
186
173
|
coloringPromises.push(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
|
-
import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
|
|
2
|
+
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
3
3
|
// Third party imports
|
|
4
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
4
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
7
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
@@ -17,7 +17,7 @@ interface AttributeStoredConfig {
|
|
|
17
17
|
minimum: number | undefined;
|
|
18
18
|
maximum: number | undefined;
|
|
19
19
|
colorMap: string | undefined;
|
|
20
|
-
no_data_color:
|
|
20
|
+
no_data_color: RGBAColor;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface AttributeState {
|
|
@@ -32,22 +32,27 @@ interface AttributeInput {
|
|
|
32
32
|
minimum: number | undefined;
|
|
33
33
|
maximum: number | undefined;
|
|
34
34
|
colorMap: string | undefined;
|
|
35
|
-
no_data_color?:
|
|
35
|
+
no_data_color?: RGBAColor;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
name
|
|
40
|
-
item
|
|
41
|
-
minimum
|
|
42
|
-
maximum
|
|
43
|
-
colorMap
|
|
44
|
-
|
|
38
|
+
interface ValidAttributeInput {
|
|
39
|
+
name: string;
|
|
40
|
+
item: number;
|
|
41
|
+
minimum: number;
|
|
42
|
+
maximum: number;
|
|
43
|
+
colorMap: string;
|
|
44
|
+
no_data_color?: RGBAColor;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function isModelBlocksPolyhedronAttributeValid(
|
|
48
|
+
input: AttributeInput,
|
|
49
|
+
): input is ValidAttributeInput {
|
|
45
50
|
return (
|
|
46
|
-
name !== undefined &&
|
|
47
|
-
item !== undefined &&
|
|
48
|
-
minimum !== undefined &&
|
|
49
|
-
maximum !== undefined &&
|
|
50
|
-
colorMap !== undefined
|
|
51
|
+
input.name !== undefined &&
|
|
52
|
+
input.item !== undefined &&
|
|
53
|
+
input.minimum !== undefined &&
|
|
54
|
+
input.maximum !== undefined &&
|
|
55
|
+
input.colorMap !== undefined
|
|
51
56
|
);
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -68,7 +73,7 @@ interface UseModelBlocksPolyhedronAttributeReturn {
|
|
|
68
73
|
setModelBlocksPolyhedronAttribute: (
|
|
69
74
|
modelId: string,
|
|
70
75
|
blockIds: string[],
|
|
71
|
-
input:
|
|
76
|
+
input: ValidAttributeInput,
|
|
72
77
|
) => Promise<unknown>;
|
|
73
78
|
setModelBlocksPolyhedronAttributeName: (
|
|
74
79
|
modelId: string,
|
|
@@ -91,11 +96,11 @@ interface UseModelBlocksPolyhedronAttributeReturn {
|
|
|
91
96
|
blockIds: string[],
|
|
92
97
|
colorMap: string | undefined,
|
|
93
98
|
) => Promise<unknown>;
|
|
94
|
-
modelBlocksPolyhedronAttributeNoDataColor: (modelId: string, blockId?: string) =>
|
|
99
|
+
modelBlocksPolyhedronAttributeNoDataColor: (modelId: string, blockId?: string) => RGBAColor;
|
|
95
100
|
setModelBlocksPolyhedronAttributeNoDataColor: (
|
|
96
101
|
modelId: string,
|
|
97
102
|
blockIds: string[],
|
|
98
|
-
no_data_color:
|
|
103
|
+
no_data_color: RGBAColor,
|
|
99
104
|
) => Promise<unknown>;
|
|
100
105
|
}
|
|
101
106
|
|
|
@@ -220,7 +225,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
220
225
|
maximum,
|
|
221
226
|
colorMap,
|
|
222
227
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
223
|
-
}:
|
|
228
|
+
}: ValidAttributeInput,
|
|
224
229
|
): Promise<unknown> {
|
|
225
230
|
await mutateModelBlocksPolyhedronStyle(modelId, blockIds, {
|
|
226
231
|
name,
|
|
@@ -232,7 +237,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
232
237
|
colorMap,
|
|
233
238
|
no_data_color,
|
|
234
239
|
});
|
|
235
|
-
const points = getRGBPointsFromPreset(colorMap
|
|
240
|
+
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
236
241
|
const viewer_ids = await dataStore.getMeshComponentsViewerIds(modelId, blockIds);
|
|
237
242
|
const params = {
|
|
238
243
|
id: modelId,
|
|
@@ -320,7 +325,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
320
325
|
});
|
|
321
326
|
return applyPolyhedronAttribute(modelId, blockIds);
|
|
322
327
|
}
|
|
323
|
-
function modelBlocksPolyhedronAttributeNoDataColor(modelId: string, blockId?: string):
|
|
328
|
+
function modelBlocksPolyhedronAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
|
|
324
329
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
|
|
325
330
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
|
|
326
331
|
const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
|
|
@@ -329,7 +334,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
329
334
|
async function setModelBlocksPolyhedronAttributeNoDataColor(
|
|
330
335
|
modelId: string,
|
|
331
336
|
blockIds: string[],
|
|
332
|
-
no_data_color:
|
|
337
|
+
no_data_color: RGBAColor,
|
|
333
338
|
): Promise<unknown> {
|
|
334
339
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
335
340
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockIds[0]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
|
-
import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
|
|
2
|
+
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
3
3
|
// Third party imports
|
|
4
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
4
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
7
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
@@ -16,7 +16,7 @@ interface AttributeStoredConfig {
|
|
|
16
16
|
minimum: number | undefined;
|
|
17
17
|
maximum: number | undefined;
|
|
18
18
|
colorMap: string | undefined;
|
|
19
|
-
no_data_color:
|
|
19
|
+
no_data_color: RGBAColor;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface AttributeState {
|
|
@@ -31,22 +31,25 @@ interface AttributeInput {
|
|
|
31
31
|
minimum: number | undefined;
|
|
32
32
|
maximum: number | undefined;
|
|
33
33
|
colorMap: string | undefined;
|
|
34
|
-
no_data_color?:
|
|
34
|
+
no_data_color?: RGBAColor;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
name
|
|
39
|
-
item
|
|
40
|
-
minimum
|
|
41
|
-
maximum
|
|
42
|
-
colorMap
|
|
43
|
-
|
|
37
|
+
interface ValidAttributeInput {
|
|
38
|
+
name: string;
|
|
39
|
+
item: number;
|
|
40
|
+
minimum: number;
|
|
41
|
+
maximum: number;
|
|
42
|
+
colorMap: string;
|
|
43
|
+
no_data_color?: RGBAColor;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isModelBlocksVertexAttributeValid(input: AttributeInput): input is ValidAttributeInput {
|
|
44
47
|
return (
|
|
45
|
-
name !== undefined &&
|
|
46
|
-
item !== undefined &&
|
|
47
|
-
minimum !== undefined &&
|
|
48
|
-
maximum !== undefined &&
|
|
49
|
-
colorMap !== undefined
|
|
48
|
+
input.name !== undefined &&
|
|
49
|
+
input.item !== undefined &&
|
|
50
|
+
input.minimum !== undefined &&
|
|
51
|
+
input.maximum !== undefined &&
|
|
52
|
+
input.colorMap !== undefined
|
|
50
53
|
);
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -67,7 +70,7 @@ interface UseModelBlocksVertexAttributeReturn {
|
|
|
67
70
|
setModelBlocksVertexAttribute: (
|
|
68
71
|
modelId: string,
|
|
69
72
|
blockIds: string[],
|
|
70
|
-
input:
|
|
73
|
+
input: ValidAttributeInput,
|
|
71
74
|
) => Promise<unknown>;
|
|
72
75
|
setModelBlocksVertexAttributeName: (
|
|
73
76
|
modelId: string,
|
|
@@ -90,11 +93,11 @@ interface UseModelBlocksVertexAttributeReturn {
|
|
|
90
93
|
blockIds: string[],
|
|
91
94
|
colorMap: string | undefined,
|
|
92
95
|
) => Promise<unknown>;
|
|
93
|
-
modelBlocksVertexAttributeNoDataColor: (modelId: string, blockId?: string) =>
|
|
96
|
+
modelBlocksVertexAttributeNoDataColor: (modelId: string, blockId?: string) => RGBAColor;
|
|
94
97
|
setModelBlocksVertexAttributeNoDataColor: (
|
|
95
98
|
modelId: string,
|
|
96
99
|
blockIds: string[],
|
|
97
|
-
no_data_color:
|
|
100
|
+
no_data_color: RGBAColor,
|
|
98
101
|
) => Promise<unknown>;
|
|
99
102
|
}
|
|
100
103
|
|
|
@@ -216,7 +219,7 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
216
219
|
maximum,
|
|
217
220
|
colorMap,
|
|
218
221
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
219
|
-
}:
|
|
222
|
+
}: ValidAttributeInput,
|
|
220
223
|
): Promise<unknown> {
|
|
221
224
|
await mutateModelBlocksVertexStyle(modelId, blockIds, {
|
|
222
225
|
name,
|
|
@@ -228,7 +231,7 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
228
231
|
colorMap,
|
|
229
232
|
no_data_color,
|
|
230
233
|
});
|
|
231
|
-
const points = getRGBPointsFromPreset(colorMap
|
|
234
|
+
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
232
235
|
const block_viewer_ids = await dataStore.getMeshComponentsViewerIds(modelId, blockIds);
|
|
233
236
|
const params = {
|
|
234
237
|
id: modelId,
|
|
@@ -311,7 +314,7 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
311
314
|
});
|
|
312
315
|
return applyVertexAttribute(modelId, blockIds);
|
|
313
316
|
}
|
|
314
|
-
function modelBlocksVertexAttributeNoDataColor(modelId: string, blockId?: string):
|
|
317
|
+
function modelBlocksVertexAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
|
|
315
318
|
const name = modelBlocksVertexAttributeName(modelId, blockId);
|
|
316
319
|
const item = modelBlocksVertexAttributeItem(modelId, blockId);
|
|
317
320
|
const storedConfig = modelBlocksVertexAttributeStoredConfig(modelId, blockId, name, item);
|
|
@@ -320,7 +323,7 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
320
323
|
async function setModelBlocksVertexAttributeNoDataColor(
|
|
321
324
|
modelId: string,
|
|
322
325
|
blockIds: string[],
|
|
323
|
-
no_data_color:
|
|
326
|
+
no_data_color: RGBAColor,
|
|
324
327
|
): Promise<unknown> {
|
|
325
328
|
const name = modelBlocksVertexAttributeName(modelId, blockIds[0]);
|
|
326
329
|
const item = modelBlocksVertexAttributeItem(modelId, blockIds[0]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useModelBlocksCommonStyle } from "./common";
|
|
2
2
|
import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
|
|
3
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
4
4
|
|
|
5
5
|
const schema = viewer_schemas.opengeodeweb_viewer.model.blocks.visibility;
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ export function useModelBlocksVisibility(): {
|
|
|
8
8
|
setModelBlocksVisibility: (
|
|
9
9
|
modelId: string,
|
|
10
10
|
blocks_ids: string[],
|
|
11
|
-
visibility: boolean
|
|
11
|
+
visibility: boolean,
|
|
12
12
|
) => Promise<unknown>;
|
|
13
13
|
modelBlockVisibility: (id: string, block_id?: string) => unknown;
|
|
14
14
|
} {
|
|
@@ -22,7 +22,7 @@ export function useModelBlocksVisibility(): {
|
|
|
22
22
|
async function setModelBlocksVisibility(
|
|
23
23
|
modelId: string,
|
|
24
24
|
blocks_ids: string[],
|
|
25
|
-
visibility: boolean
|
|
25
|
+
visibility: boolean,
|
|
26
26
|
): Promise<unknown> {
|
|
27
27
|
const result = await modelCommonStyle.setModelTypeVisibility(
|
|
28
28
|
modelId,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
1
2
|
// oxlint-disable eslint/max-lines
|
|
2
3
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
3
4
|
import { dispatchToComponentTypes } from "./visibility";
|
|
@@ -47,14 +48,14 @@ function attributeFn<Signature>(method: unknown): Signature {
|
|
|
47
48
|
|
|
48
49
|
// oxlint-disable-next-line max-lines-per-function
|
|
49
50
|
function useModelColorStyle(componentStyleFunctions: ComponentStyleFunctions): {
|
|
50
|
-
getModelColor: (modelId: string) =>
|
|
51
|
+
getModelColor: (modelId: string) => RGBAColor | undefined;
|
|
51
52
|
getModelActiveColoring: (modelId: string) => unknown;
|
|
52
53
|
getModelComponentColor: (modelId: string, componentId: string) => unknown;
|
|
53
54
|
getModelComponentEffectiveColor: (modelId: string, componentId: string, type: string) => unknown;
|
|
54
55
|
getModelComponentActiveColoring: (modelId: string, componentId: string) => unknown;
|
|
55
56
|
modelComponentTypeColor: (modelId: string, type: string) => unknown;
|
|
56
57
|
getModelComponentTypeActiveColoring: (modelId: string, type: string) => unknown;
|
|
57
|
-
setModelComponentTypeColor: (modelId: string, type: string, color:
|
|
58
|
+
setModelComponentTypeColor: (modelId: string, type: string, color: RGBAColor) => Promise<void>;
|
|
58
59
|
setModelComponentTypeActiveColoring: (
|
|
59
60
|
modelId: string,
|
|
60
61
|
type: string,
|
|
@@ -68,7 +69,7 @@ function useModelColorStyle(componentStyleFunctions: ComponentStyleFunctions): {
|
|
|
68
69
|
setModelComponentsColor: (
|
|
69
70
|
modelId: string,
|
|
70
71
|
componentIds: string[],
|
|
71
|
-
color:
|
|
72
|
+
color: RGBAColor | undefined,
|
|
72
73
|
activeColoring?: string,
|
|
73
74
|
) => Promise<unknown[]>;
|
|
74
75
|
} {
|
|
@@ -205,7 +206,7 @@ function useModelColorStyle(componentStyleFunctions: ComponentStyleFunctions): {
|
|
|
205
206
|
async function setModelComponentsColor(
|
|
206
207
|
modelId: string,
|
|
207
208
|
componentIds: string[],
|
|
208
|
-
color:
|
|
209
|
+
color: RGBAColor | undefined,
|
|
209
210
|
activeColoring = "constant",
|
|
210
211
|
): Promise<unknown[]> {
|
|
211
212
|
await modelCommonStyle.mutateComponentStyles(modelId, componentIds, {
|
|
@@ -228,7 +229,7 @@ function useModelColorStyle(componentStyleFunctions: ComponentStyleFunctions): {
|
|
|
228
229
|
async function setModelComponentTypeColor(
|
|
229
230
|
modelId: string,
|
|
230
231
|
type: string,
|
|
231
|
-
color:
|
|
232
|
+
color: RGBAColor,
|
|
232
233
|
): Promise<void> {
|
|
233
234
|
await modelCommonStyle.mutateModelComponentTypeStyle(modelId, type, {
|
|
234
235
|
coloring: {
|
|
@@ -323,9 +324,11 @@ function useModelColorStyle(componentStyleFunctions: ComponentStyleFunctions): {
|
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
|
-
function getModelColor(modelId: string):
|
|
327
|
+
function getModelColor(modelId: string): RGBAColor | undefined {
|
|
327
328
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
|
|
328
|
-
return (dataStyleState.getStyle(modelId).coloring as StyleValues).constant
|
|
329
|
+
return (dataStyleState.getStyle(modelId).coloring as StyleValues).constant as
|
|
330
|
+
| RGBAColor
|
|
331
|
+
| undefined;
|
|
329
332
|
}
|
|
330
333
|
function getModelActiveColoring(modelId: string): unknown {
|
|
331
334
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
|