@geode/opengeodeweb-front 10.28.1-rc.4 → 10.29.0-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.
- package/app/components/Viewer/ContextMenu/InfoCard.vue +56 -21
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +21 -0
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +21 -0
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +80 -0
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +10 -0
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +81 -0
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +20 -0
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +36 -0
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +18 -0
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +36 -0
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +36 -0
- package/app/components/Viewer/Options/AttributeSelector.vue +47 -38
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +26 -22
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +10 -0
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +20 -0
- package/app/components/Viewer/Surface/PolygonsOptions.vue +20 -0
- package/internal/stores/data_style/mesh/cells/cell.js +94 -60
- package/internal/stores/data_style/mesh/cells/index.js +21 -22
- package/internal/stores/data_style/mesh/cells/vertex.js +83 -64
- package/internal/stores/data_style/mesh/edges/edge.js +83 -67
- package/internal/stores/data_style/mesh/edges/index.js +22 -19
- package/internal/stores/data_style/mesh/edges/vertex.js +87 -65
- package/internal/stores/data_style/mesh/points/index.js +9 -9
- package/internal/stores/data_style/mesh/points/vertex.js +96 -99
- package/internal/stores/data_style/mesh/polygons/index.js +26 -16
- package/internal/stores/data_style/mesh/polygons/polygon.js +88 -66
- package/internal/stores/data_style/mesh/polygons/vertex.js +88 -66
- package/internal/stores/data_style/mesh/polyhedra/index.js +33 -22
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +101 -103
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +101 -103
- package/internal/stores/data_style/model/blocks/color.js +27 -28
- package/internal/stores/data_style/model/blocks/index.js +140 -72
- package/internal/stores/data_style/model/blocks/polyhedron.js +114 -58
- package/internal/stores/data_style/model/blocks/vertex.js +107 -57
- package/internal/stores/data_style/model/common.js +6 -6
- package/internal/stores/data_style/model/corners/color.js +12 -16
- package/internal/stores/data_style/model/corners/index.js +95 -63
- package/internal/stores/data_style/model/corners/vertex.js +108 -58
- package/internal/stores/data_style/model/lines/color.js +18 -23
- package/internal/stores/data_style/model/lines/edge.js +106 -54
- package/internal/stores/data_style/model/lines/index.js +132 -71
- package/internal/stores/data_style/model/lines/vertex.js +107 -54
- package/internal/stores/data_style/model/surfaces/color.js +24 -32
- package/internal/stores/data_style/model/surfaces/index.js +142 -74
- package/internal/stores/data_style/model/surfaces/polygon.js +114 -58
- package/internal/stores/data_style/model/surfaces/vertex.js +114 -58
- package/internal/stores/data_style/state.js +105 -94
- package/package.json +1 -1
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +200 -24
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +132 -34
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +60 -11
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +116 -22
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +145 -34
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +206 -33
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +94 -15
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +187 -30
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +379 -31
|
@@ -10,25 +10,39 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
10
10
|
const meshPolygonsVertexAttributeSchemas =
|
|
11
11
|
viewer_schemas.opengeodeweb_viewer.mesh.polygons.attribute.vertex;
|
|
12
12
|
|
|
13
|
+
function isMeshPolygonsVertexAttributeValid({ name, item, minimum, maximum, colorMap }) {
|
|
14
|
+
return (
|
|
15
|
+
name !== undefined &&
|
|
16
|
+
item !== undefined &&
|
|
17
|
+
minimum !== undefined &&
|
|
18
|
+
maximum !== undefined &&
|
|
19
|
+
colorMap !== undefined
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
// oxlint-disable-next-line max-lines-per-function
|
|
14
|
-
|
|
24
|
+
function useMeshPolygonsVertexAttributeStyle() {
|
|
15
25
|
const viewerStore = useViewerStore();
|
|
16
26
|
const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
|
|
17
27
|
|
|
28
|
+
function meshPolygonsColoring(id) {
|
|
29
|
+
return meshPolygonsCommonStyle.meshPolygonsStyle(id).coloring;
|
|
30
|
+
}
|
|
31
|
+
|
|
18
32
|
function meshPolygonsVertexAttribute(id) {
|
|
19
|
-
return
|
|
33
|
+
return meshPolygonsColoring(id).vertex;
|
|
20
34
|
}
|
|
21
35
|
|
|
22
|
-
function meshPolygonsVertexAttributeStoredConfig(id, name) {
|
|
36
|
+
function meshPolygonsVertexAttributeStoredConfig(id, name, item) {
|
|
23
37
|
const { storedConfigs } = meshPolygonsVertexAttribute(id);
|
|
24
|
-
if (name in storedConfigs) {
|
|
25
|
-
return storedConfigs[name];
|
|
38
|
+
if (storedConfigs && name in storedConfigs && item in storedConfigs[name]) {
|
|
39
|
+
return storedConfigs[name][item];
|
|
26
40
|
}
|
|
27
|
-
return
|
|
41
|
+
return {
|
|
28
42
|
minimum: undefined,
|
|
29
43
|
maximum: undefined,
|
|
30
44
|
colorMap: undefined,
|
|
31
|
-
}
|
|
45
|
+
};
|
|
32
46
|
}
|
|
33
47
|
|
|
34
48
|
function mutateMeshPolygonsVertexStyle(id, values) {
|
|
@@ -39,102 +53,110 @@ export function useMeshPolygonsVertexAttributeStyle() {
|
|
|
39
53
|
});
|
|
40
54
|
}
|
|
41
55
|
|
|
42
|
-
function setMeshPolygonsVertexAttributeStoredConfig(id, name, config) {
|
|
56
|
+
function setMeshPolygonsVertexAttributeStoredConfig(id, name, item, config) {
|
|
43
57
|
return mutateMeshPolygonsVertexStyle(id, {
|
|
44
58
|
storedConfigs: {
|
|
45
|
-
[name]:
|
|
59
|
+
[name]: {
|
|
60
|
+
lastItem: item,
|
|
61
|
+
[item]: config,
|
|
62
|
+
},
|
|
46
63
|
},
|
|
47
64
|
});
|
|
48
65
|
}
|
|
49
66
|
|
|
67
|
+
function applyVertexAttribute(id) {
|
|
68
|
+
const name = meshPolygonsVertexAttributeName(id);
|
|
69
|
+
const item = meshPolygonsVertexAttributeItem(id);
|
|
70
|
+
const storedConfig = meshPolygonsVertexAttributeStoredConfig(id, name, item);
|
|
71
|
+
const attribute = {
|
|
72
|
+
name,
|
|
73
|
+
item,
|
|
74
|
+
minimum: storedConfig.minimum,
|
|
75
|
+
maximum: storedConfig.maximum,
|
|
76
|
+
colorMap: storedConfig.colorMap,
|
|
77
|
+
};
|
|
78
|
+
if (isMeshPolygonsVertexAttributeValid(attribute)) {
|
|
79
|
+
return setMeshPolygonsVertexAttribute(id, attribute);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
50
83
|
function meshPolygonsVertexAttributeName(id) {
|
|
51
84
|
return meshPolygonsVertexAttribute(id).name;
|
|
52
85
|
}
|
|
53
86
|
|
|
54
87
|
function setMeshPolygonsVertexAttributeName(id, name) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
const item = meshPolygonsVertexAttributeLastItem(id, name);
|
|
89
|
+
mutateMeshPolygonsVertexStyle(id, { name, item });
|
|
90
|
+
return applyVertexAttribute(id);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function meshPolygonsVertexAttributeItem(id) {
|
|
94
|
+
const { item, name } = meshPolygonsVertexAttribute(id);
|
|
95
|
+
return item ?? meshPolygonsVertexAttributeLastItem(id, name);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function setMeshPolygonsVertexAttributeItem(id, item) {
|
|
99
|
+
mutateMeshPolygonsVertexStyle(id, { item });
|
|
100
|
+
return applyVertexAttribute(id);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function meshPolygonsVertexAttributeLastItem(id, name) {
|
|
104
|
+
const { storedConfigs } = meshPolygonsVertexAttribute(id);
|
|
105
|
+
if (storedConfigs && name in storedConfigs) {
|
|
106
|
+
return storedConfigs[name].lastItem;
|
|
107
|
+
}
|
|
108
|
+
return 0;
|
|
76
109
|
}
|
|
77
110
|
|
|
78
111
|
function meshPolygonsVertexAttributeRange(id) {
|
|
79
112
|
const name = meshPolygonsVertexAttributeName(id);
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
return [minimum, maximum];
|
|
113
|
+
const item = meshPolygonsVertexAttributeItem(id);
|
|
114
|
+
const storedConfig = meshPolygonsVertexAttributeStoredConfig(id, name, item);
|
|
115
|
+
return [storedConfig.minimum, storedConfig.maximum];
|
|
83
116
|
}
|
|
84
117
|
|
|
85
118
|
function setMeshPolygonsVertexAttributeRange(id, minimum, maximum) {
|
|
86
119
|
const name = meshPolygonsVertexAttributeName(id);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const params = { id, points, minimum, maximum };
|
|
91
|
-
return viewerStore.request(
|
|
92
|
-
{ schema, params },
|
|
93
|
-
{
|
|
94
|
-
response_function: () =>
|
|
95
|
-
setMeshPolygonsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
|
|
96
|
-
},
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
return setMeshPolygonsVertexAttributeStoredConfig(id, name, {
|
|
100
|
-
minimum,
|
|
101
|
-
maximum,
|
|
102
|
-
});
|
|
120
|
+
const item = meshPolygonsVertexAttributeItem(id);
|
|
121
|
+
setMeshPolygonsVertexAttributeStoredConfig(id, name, item, { minimum, maximum });
|
|
122
|
+
return applyVertexAttribute(id);
|
|
103
123
|
}
|
|
104
124
|
|
|
105
125
|
function meshPolygonsVertexAttributeColorMap(id) {
|
|
106
126
|
const name = meshPolygonsVertexAttributeName(id);
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
return colorMap;
|
|
127
|
+
const item = meshPolygonsVertexAttributeItem(id);
|
|
128
|
+
const storedConfig = meshPolygonsVertexAttributeStoredConfig(id, name, item);
|
|
129
|
+
return storedConfig.colorMap;
|
|
110
130
|
}
|
|
111
131
|
|
|
112
132
|
function setMeshPolygonsVertexAttributeColorMap(id, colorMap) {
|
|
113
133
|
const name = meshPolygonsVertexAttributeName(id);
|
|
114
|
-
const
|
|
134
|
+
const item = meshPolygonsVertexAttributeItem(id);
|
|
135
|
+
setMeshPolygonsVertexAttributeStoredConfig(id, name, item, { colorMap });
|
|
136
|
+
return applyVertexAttribute(id);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function setMeshPolygonsVertexAttribute(id, { name, item, minimum, maximum, colorMap }) {
|
|
140
|
+
mutateMeshPolygonsVertexStyle(id, { name, item });
|
|
141
|
+
setMeshPolygonsVertexAttributeStoredConfig(id, name, item, { minimum, maximum, colorMap });
|
|
115
142
|
const points = getRGBPointsFromPreset(colorMap);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const params = { id, points, minimum, maximum };
|
|
120
|
-
return viewerStore.request(
|
|
121
|
-
{ schema, params },
|
|
122
|
-
{
|
|
123
|
-
response_function: () =>
|
|
124
|
-
setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap }),
|
|
125
|
-
},
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
return setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap });
|
|
143
|
+
const schema = meshPolygonsVertexAttributeSchemas.attribute;
|
|
144
|
+
const params = { id, name, item, points, minimum, maximum };
|
|
145
|
+
return viewerStore.request({ schema, params });
|
|
129
146
|
}
|
|
130
147
|
|
|
131
148
|
return {
|
|
132
149
|
meshPolygonsVertexAttributeName,
|
|
150
|
+
meshPolygonsVertexAttributeItem,
|
|
133
151
|
meshPolygonsVertexAttributeRange,
|
|
134
152
|
meshPolygonsVertexAttributeColorMap,
|
|
135
153
|
meshPolygonsVertexAttributeStoredConfig,
|
|
154
|
+
setMeshPolygonsVertexAttribute,
|
|
136
155
|
setMeshPolygonsVertexAttributeName,
|
|
156
|
+
setMeshPolygonsVertexAttributeItem,
|
|
137
157
|
setMeshPolygonsVertexAttributeRange,
|
|
138
158
|
setMeshPolygonsVertexAttributeColorMap,
|
|
139
159
|
};
|
|
140
160
|
}
|
|
161
|
+
|
|
162
|
+
export { isMeshPolygonsVertexAttributeValid, useMeshPolygonsVertexAttributeStyle };
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
|
|
3
3
|
// Local imports
|
|
4
|
-
|
|
4
|
+
import {
|
|
5
|
+
isMeshPolyhedraPolyhedronAttributeValid,
|
|
6
|
+
useMeshPolyhedraPolyhedronAttributeStyle,
|
|
7
|
+
} from "./polyhedron";
|
|
8
|
+
import {
|
|
9
|
+
isMeshPolyhedraVertexAttributeValid,
|
|
10
|
+
useMeshPolyhedraVertexAttributeStyle,
|
|
11
|
+
} from "./vertex";
|
|
5
12
|
import { useMeshPolyhedraColorStyle } from "./color";
|
|
6
13
|
import { useMeshPolyhedraCommonStyle } from "./common";
|
|
7
|
-
import { useMeshPolyhedraPolyhedronAttributeStyle } from "./polyhedron";
|
|
8
|
-
import { useMeshPolyhedraVertexAttributeStyle } from "./vertex";
|
|
9
14
|
import { useMeshPolyhedraVisibilityStyle } from "./visibility";
|
|
10
15
|
|
|
11
16
|
// Local constants
|
|
@@ -29,7 +34,6 @@ export function useMeshPolyhedraStyle() {
|
|
|
29
34
|
await meshPolyhedraCommonStyle.mutateMeshPolyhedraStyle(id, {
|
|
30
35
|
coloring: { active: type },
|
|
31
36
|
});
|
|
32
|
-
console.log(setMeshPolyhedraActiveColoring.name, { id }, type);
|
|
33
37
|
if (type === "constant") {
|
|
34
38
|
return meshPolyhedraColorStyle.setMeshPolyhedraColor(
|
|
35
39
|
id,
|
|
@@ -38,27 +42,34 @@ export function useMeshPolyhedraStyle() {
|
|
|
38
42
|
}
|
|
39
43
|
if (type === "vertex") {
|
|
40
44
|
const name = meshPolyhedraVertexAttributeStyle.meshPolyhedraVertexAttributeName(id);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
const item = meshPolyhedraVertexAttributeStyle.meshPolyhedraVertexAttributeItem(id);
|
|
46
|
+
const [minimum, maximum] =
|
|
47
|
+
meshPolyhedraVertexAttributeStyle.meshPolyhedraVertexAttributeRange(id);
|
|
48
|
+
const colorMap = meshPolyhedraVertexAttributeStyle.meshPolyhedraVertexAttributeColorMap(id);
|
|
49
|
+
const vertex_attribute = { name, item, minimum, maximum, colorMap };
|
|
50
|
+
if (!isMeshPolyhedraVertexAttributeValid(vertex_attribute)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
return meshPolyhedraVertexAttributeStyle.setMeshPolyhedraVertexAttribute(
|
|
54
|
+
id,
|
|
55
|
+
vertex_attribute,
|
|
56
|
+
);
|
|
47
57
|
}
|
|
48
58
|
if (type === "polyhedron") {
|
|
49
59
|
const name = meshPolyhedraPolyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeName(id);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
const item = meshPolyhedraPolyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeItem(id);
|
|
61
|
+
const [minimum, maximum] =
|
|
62
|
+
meshPolyhedraPolyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeRange(id);
|
|
63
|
+
const colorMap =
|
|
64
|
+
meshPolyhedraPolyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeColorMap(id);
|
|
65
|
+
const polyhedron_attribute = { name, item, minimum, maximum, colorMap };
|
|
66
|
+
if (!isMeshPolyhedraPolyhedronAttributeValid(polyhedron_attribute)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
return meshPolyhedraPolyhedronAttributeStyle.setMeshPolyhedraPolyhedronAttribute(
|
|
70
|
+
id,
|
|
71
|
+
polyhedron_attribute,
|
|
72
|
+
);
|
|
62
73
|
}
|
|
63
74
|
throw new Error(`Unknown mesh polyhedra coloring type: ${type}`);
|
|
64
75
|
}
|
|
@@ -10,12 +10,39 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
10
10
|
const meshPolyhedraPolyhedronAttributeSchemas =
|
|
11
11
|
viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron;
|
|
12
12
|
|
|
13
|
+
function isMeshPolyhedraPolyhedronAttributeValid({ name, item, minimum, maximum, colorMap }) {
|
|
14
|
+
return (
|
|
15
|
+
name !== undefined &&
|
|
16
|
+
item !== undefined &&
|
|
17
|
+
minimum !== undefined &&
|
|
18
|
+
maximum !== undefined &&
|
|
19
|
+
colorMap !== undefined
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
// oxlint-disable-next-line max-lines-per-function
|
|
14
|
-
function
|
|
24
|
+
function useMeshPolyhedraPolyhedronAttributeStyle() {
|
|
25
|
+
const viewerStore = useViewerStore();
|
|
15
26
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
16
27
|
|
|
28
|
+
function meshPolyhedraColoring(id) {
|
|
29
|
+
return meshPolyhedraCommonStyle.meshPolyhedraStyle(id).coloring;
|
|
30
|
+
}
|
|
31
|
+
|
|
17
32
|
function meshPolyhedraPolyhedronAttribute(id) {
|
|
18
|
-
return
|
|
33
|
+
return meshPolyhedraColoring(id).polyhedron;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item) {
|
|
37
|
+
const { storedConfigs } = meshPolyhedraPolyhedronAttribute(id);
|
|
38
|
+
if (storedConfigs && name in storedConfigs && item in storedConfigs[name]) {
|
|
39
|
+
return storedConfigs[name][item];
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
minimum: undefined,
|
|
43
|
+
maximum: undefined,
|
|
44
|
+
colorMap: undefined,
|
|
45
|
+
};
|
|
19
46
|
}
|
|
20
47
|
|
|
21
48
|
function mutateMeshPolyhedraPolyhedronStyle(id, values) {
|
|
@@ -26,139 +53,110 @@ function useMeshPolyhedraPolyhedronAttributeConfig() {
|
|
|
26
53
|
});
|
|
27
54
|
}
|
|
28
55
|
|
|
29
|
-
function setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, config) {
|
|
56
|
+
function setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, item, config) {
|
|
30
57
|
return mutateMeshPolyhedraPolyhedronStyle(id, {
|
|
31
58
|
storedConfigs: {
|
|
32
|
-
[name]:
|
|
59
|
+
[name]: {
|
|
60
|
+
lastItem: item,
|
|
61
|
+
[item]: config,
|
|
62
|
+
},
|
|
33
63
|
},
|
|
34
64
|
});
|
|
35
65
|
}
|
|
36
66
|
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
67
|
+
function applyPolyhedronAttribute(id) {
|
|
68
|
+
const name = meshPolyhedraPolyhedronAttributeName(id);
|
|
69
|
+
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
70
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item);
|
|
71
|
+
const attribute = {
|
|
72
|
+
name,
|
|
73
|
+
item,
|
|
74
|
+
minimum: storedConfig.minimum,
|
|
75
|
+
maximum: storedConfig.maximum,
|
|
76
|
+
colorMap: storedConfig.colorMap,
|
|
77
|
+
};
|
|
78
|
+
if (isMeshPolyhedraPolyhedronAttributeValid(attribute)) {
|
|
79
|
+
return setMeshPolyhedraPolyhedronAttribute(id, attribute);
|
|
41
80
|
}
|
|
42
|
-
return setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, {
|
|
43
|
-
minimum: undefined,
|
|
44
|
-
maximum: undefined,
|
|
45
|
-
colorMap: undefined,
|
|
46
|
-
});
|
|
47
81
|
}
|
|
48
82
|
|
|
49
83
|
function meshPolyhedraPolyhedronAttributeName(id) {
|
|
50
84
|
return meshPolyhedraPolyhedronAttribute(id).name;
|
|
51
85
|
}
|
|
52
86
|
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return [minimum, maximum];
|
|
87
|
+
function setMeshPolyhedraPolyhedronAttributeName(id, name) {
|
|
88
|
+
const item = meshPolyhedraPolyhedronAttributeLastItem(id, name);
|
|
89
|
+
mutateMeshPolyhedraPolyhedronStyle(id, { name, item });
|
|
90
|
+
return applyPolyhedronAttribute(id);
|
|
58
91
|
}
|
|
59
92
|
|
|
60
|
-
function
|
|
61
|
-
const name =
|
|
62
|
-
|
|
63
|
-
const { colorMap } = storedConfig;
|
|
64
|
-
return colorMap;
|
|
93
|
+
function meshPolyhedraPolyhedronAttributeItem(id) {
|
|
94
|
+
const { item, name } = meshPolyhedraPolyhedronAttribute(id);
|
|
95
|
+
return item ?? meshPolyhedraPolyhedronAttributeLastItem(id, name);
|
|
65
96
|
}
|
|
66
97
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
mutateMeshPolyhedraPolyhedronStyle,
|
|
72
|
-
meshPolyhedraPolyhedronAttributeName,
|
|
73
|
-
meshPolyhedraPolyhedronAttributeRange,
|
|
74
|
-
meshPolyhedraPolyhedronAttributeColorMap,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
98
|
+
function setMeshPolyhedraPolyhedronAttributeItem(id, item) {
|
|
99
|
+
mutateMeshPolyhedraPolyhedronStyle(id, { item });
|
|
100
|
+
return applyPolyhedronAttribute(id);
|
|
101
|
+
}
|
|
77
102
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
103
|
+
function meshPolyhedraPolyhedronAttributeLastItem(id, name) {
|
|
104
|
+
const { storedConfigs } = meshPolyhedraPolyhedronAttribute(id);
|
|
105
|
+
if (storedConfigs && name in storedConfigs) {
|
|
106
|
+
return storedConfigs[name].lastItem;
|
|
107
|
+
}
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
82
110
|
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
schema,
|
|
89
|
-
params,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
response_function: () => {
|
|
93
|
-
const updates = { name };
|
|
94
|
-
const polyhedron = config.meshPolyhedraPolyhedronAttribute(id);
|
|
95
|
-
if (!(name in polyhedron.storedConfigs)) {
|
|
96
|
-
updates.storedConfigs = {
|
|
97
|
-
[name]: {
|
|
98
|
-
minimum: undefined,
|
|
99
|
-
maximum: undefined,
|
|
100
|
-
colorMap: undefined,
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
return config.mutateMeshPolyhedraPolyhedronStyle(id, updates);
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
);
|
|
111
|
+
function meshPolyhedraPolyhedronAttributeRange(id) {
|
|
112
|
+
const name = meshPolyhedraPolyhedronAttributeName(id);
|
|
113
|
+
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
114
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item);
|
|
115
|
+
return [storedConfig.minimum, storedConfig.maximum];
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
function setMeshPolyhedraPolyhedronAttributeRange(id, minimum, maximum) {
|
|
111
|
-
const name =
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, {
|
|
125
|
-
minimum,
|
|
126
|
-
maximum,
|
|
127
|
-
});
|
|
119
|
+
const name = meshPolyhedraPolyhedronAttributeName(id);
|
|
120
|
+
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
121
|
+
setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, item, { minimum, maximum });
|
|
122
|
+
return applyPolyhedronAttribute(id);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function meshPolyhedraPolyhedronAttributeColorMap(id) {
|
|
126
|
+
const name = meshPolyhedraPolyhedronAttributeName(id);
|
|
127
|
+
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
128
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item);
|
|
129
|
+
return storedConfig.colorMap;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
function setMeshPolyhedraPolyhedronAttributeColorMap(id, colorMap) {
|
|
131
|
-
const name =
|
|
132
|
-
const
|
|
133
|
+
const name = meshPolyhedraPolyhedronAttributeName(id);
|
|
134
|
+
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
135
|
+
setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, item, { colorMap });
|
|
136
|
+
return applyPolyhedronAttribute(id);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function setMeshPolyhedraPolyhedronAttribute(id, { name, item, minimum, maximum, colorMap }) {
|
|
140
|
+
mutateMeshPolyhedraPolyhedronStyle(id, { name, item });
|
|
141
|
+
setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, item, { minimum, maximum, colorMap });
|
|
133
142
|
const points = getRGBPointsFromPreset(colorMap);
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const params = { id, points, minimum, maximum };
|
|
138
|
-
return viewerStore.request(
|
|
139
|
-
{ schema, params },
|
|
140
|
-
{
|
|
141
|
-
response_function: () =>
|
|
142
|
-
config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap }),
|
|
143
|
-
},
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
return config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap });
|
|
143
|
+
const schema = meshPolyhedraPolyhedronAttributeSchemas.attribute;
|
|
144
|
+
const params = { id, name, item, points, minimum, maximum };
|
|
145
|
+
return viewerStore.request({ schema, params });
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
return {
|
|
149
|
+
meshPolyhedraPolyhedronAttributeName,
|
|
150
|
+
meshPolyhedraPolyhedronAttributeItem,
|
|
151
|
+
meshPolyhedraPolyhedronAttributeRange,
|
|
152
|
+
meshPolyhedraPolyhedronAttributeColorMap,
|
|
153
|
+
meshPolyhedraPolyhedronAttributeStoredConfig,
|
|
154
|
+
setMeshPolyhedraPolyhedronAttribute,
|
|
150
155
|
setMeshPolyhedraPolyhedronAttributeName,
|
|
156
|
+
setMeshPolyhedraPolyhedronAttributeItem,
|
|
151
157
|
setMeshPolyhedraPolyhedronAttributeRange,
|
|
152
158
|
setMeshPolyhedraPolyhedronAttributeColorMap,
|
|
153
159
|
};
|
|
154
160
|
}
|
|
155
161
|
|
|
156
|
-
export
|
|
157
|
-
const config = useMeshPolyhedraPolyhedronAttributeConfig();
|
|
158
|
-
const actions = useMeshPolyhedraPolyhedronAttributeActions();
|
|
159
|
-
|
|
160
|
-
return {
|
|
161
|
-
...config,
|
|
162
|
-
...actions,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
162
|
+
export { isMeshPolyhedraPolyhedronAttributeValid, useMeshPolyhedraPolyhedronAttributeStyle };
|