@geode/opengeodeweb-front 10.25.0-rc.7 → 10.25.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/Viewer/Generic/Model/BlocksOptions.vue +13 -17
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -17
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -17
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +29 -43
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +13 -17
- package/app/components/Viewer/Options/AttributeSelector.vue +6 -1
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +37 -15
- package/app/utils/default_styles/constants.js +15 -0
- package/app/utils/default_styles/index.js +6 -1
- package/app/utils/default_styles/meshes.js +19 -15
- package/app/utils/default_styles/models.js +74 -36
- package/internal/stores/data_style/mesh/cells/color.js +2 -2
- package/internal/stores/data_style/mesh/cells/index.js +1 -10
- package/internal/stores/data_style/mesh/edges/color.js +2 -2
- package/internal/stores/data_style/mesh/edges/index.js +1 -7
- package/internal/stores/data_style/mesh/points/color.js +2 -2
- package/internal/stores/data_style/mesh/points/index.js +1 -4
- package/internal/stores/data_style/mesh/polygons/color.js +2 -2
- package/internal/stores/data_style/mesh/polygons/index.js +1 -10
- package/internal/stores/data_style/mesh/polyhedra/color.js +2 -2
- package/internal/stores/data_style/mesh/polyhedra/index.js +1 -7
- package/internal/stores/data_style/model/blocks/color.js +86 -7
- package/internal/stores/data_style/model/blocks/common.js +15 -6
- package/internal/stores/data_style/model/blocks/index.js +28 -26
- package/internal/stores/data_style/model/blocks/polyhedron.js +7 -20
- package/internal/stores/data_style/model/blocks/vertex.js +7 -20
- package/internal/stores/data_style/model/color.js +58 -32
- package/internal/stores/data_style/model/common.js +19 -10
- package/internal/stores/data_style/model/corners/color.js +59 -7
- package/internal/stores/data_style/model/corners/common.js +15 -6
- package/internal/stores/data_style/model/corners/index.js +26 -24
- package/internal/stores/data_style/model/corners/vertex.js +7 -20
- package/internal/stores/data_style/model/lines/color.js +71 -7
- package/internal/stores/data_style/model/lines/common.js +15 -6
- package/internal/stores/data_style/model/lines/edge.js +7 -20
- package/internal/stores/data_style/model/lines/index.js +28 -26
- package/internal/stores/data_style/model/lines/vertex.js +7 -20
- package/internal/stores/data_style/model/surfaces/color.js +86 -8
- package/internal/stores/data_style/model/surfaces/common.js +15 -6
- package/internal/stores/data_style/model/surfaces/index.js +28 -26
- package/internal/stores/data_style/model/surfaces/polygon.js +7 -20
- package/internal/stores/data_style/model/surfaces/vertex.js +7 -20
- package/internal/stores/data_style/state.js +2 -2
- package/package.json +3 -3
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +1 -1
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +1 -1
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +1 -1
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +1 -1
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +1 -1
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +7 -7
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +5 -5
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -0
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +7 -7
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +7 -7
|
@@ -1,86 +1,100 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BLOCKS_DEFAULT_ACTIVE_COLORING,
|
|
2
3
|
BLOCKS_DEFAULT_COLOR,
|
|
3
4
|
BLOCKS_DEFAULT_VISIBILITY,
|
|
5
|
+
CORNERS_DEFAULT_ACTIVE_COLORING,
|
|
4
6
|
CORNERS_DEFAULT_COLOR,
|
|
5
7
|
CORNERS_DEFAULT_VISIBILITY,
|
|
6
8
|
EDGES_DEFAULT_VISIBILITY,
|
|
7
9
|
EDGES_DEFAULT_WIDTH,
|
|
10
|
+
LINES_DEFAULT_ACTIVE_COLORING,
|
|
8
11
|
LINES_DEFAULT_COLOR,
|
|
9
12
|
LINES_DEFAULT_VISIBILITY,
|
|
13
|
+
MODEL_DEFAULT_ACTIVE_COLORING,
|
|
14
|
+
MODEL_DEFAULT_COLOR,
|
|
10
15
|
POINTS_DEFAULT_SIZE,
|
|
11
16
|
POINTS_DEFAULT_VISIBILITY,
|
|
17
|
+
SURFACES_DEFAULT_ACTIVE_COLORING,
|
|
12
18
|
SURFACES_DEFAULT_COLOR,
|
|
13
19
|
SURFACES_DEFAULT_VISIBILITY,
|
|
14
20
|
} from "./constants";
|
|
15
21
|
|
|
16
22
|
function modelCornersDefaultStyle(
|
|
17
23
|
visibility = CORNERS_DEFAULT_VISIBILITY,
|
|
18
|
-
|
|
24
|
+
constant = CORNERS_DEFAULT_COLOR,
|
|
19
25
|
) {
|
|
20
26
|
return {
|
|
21
27
|
visibility,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
coloring: {
|
|
29
|
+
active: CORNERS_DEFAULT_ACTIVE_COLORING,
|
|
30
|
+
constant,
|
|
31
|
+
vertex: {
|
|
32
|
+
name: undefined,
|
|
33
|
+
storedConfigs: {},
|
|
34
|
+
},
|
|
27
35
|
},
|
|
28
36
|
};
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
function modelLinesDefaultStyle(
|
|
32
40
|
visibility = LINES_DEFAULT_VISIBILITY,
|
|
33
|
-
|
|
41
|
+
constant = LINES_DEFAULT_COLOR,
|
|
34
42
|
) {
|
|
35
43
|
return {
|
|
36
44
|
visibility,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
coloring: {
|
|
46
|
+
active: LINES_DEFAULT_ACTIVE_COLORING,
|
|
47
|
+
constant,
|
|
48
|
+
vertex: {
|
|
49
|
+
name: undefined,
|
|
50
|
+
storedConfigs: {},
|
|
51
|
+
},
|
|
52
|
+
edge: {
|
|
53
|
+
name: undefined,
|
|
54
|
+
storedConfigs: {},
|
|
55
|
+
},
|
|
46
56
|
},
|
|
47
57
|
};
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
function modelSurfacesDefaultStyle(
|
|
51
61
|
visibility = SURFACES_DEFAULT_VISIBILITY,
|
|
52
|
-
|
|
62
|
+
constant = SURFACES_DEFAULT_COLOR,
|
|
53
63
|
) {
|
|
54
64
|
return {
|
|
55
65
|
visibility,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
coloring: {
|
|
67
|
+
active: SURFACES_DEFAULT_ACTIVE_COLORING,
|
|
68
|
+
constant,
|
|
69
|
+
vertex: {
|
|
70
|
+
name: undefined,
|
|
71
|
+
storedConfigs: {},
|
|
72
|
+
},
|
|
73
|
+
polygon: {
|
|
74
|
+
name: undefined,
|
|
75
|
+
storedConfigs: {},
|
|
76
|
+
},
|
|
65
77
|
},
|
|
66
78
|
};
|
|
67
79
|
}
|
|
68
80
|
|
|
69
81
|
function modelBlocksDefaultStyle(
|
|
70
82
|
visibility = BLOCKS_DEFAULT_VISIBILITY,
|
|
71
|
-
|
|
83
|
+
constant = BLOCKS_DEFAULT_COLOR,
|
|
72
84
|
) {
|
|
73
85
|
return {
|
|
74
86
|
visibility,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
coloring: {
|
|
88
|
+
active: BLOCKS_DEFAULT_ACTIVE_COLORING,
|
|
89
|
+
constant,
|
|
90
|
+
vertex: {
|
|
91
|
+
name: undefined,
|
|
92
|
+
storedConfigs: {},
|
|
93
|
+
},
|
|
94
|
+
polyhedron: {
|
|
95
|
+
name: undefined,
|
|
96
|
+
storedConfigs: {},
|
|
97
|
+
},
|
|
84
98
|
},
|
|
85
99
|
};
|
|
86
100
|
}
|
|
@@ -109,6 +123,10 @@ const DEFAULT_MODEL_COMPONENT_TYPE_STYLES = {
|
|
|
109
123
|
function brepDefaultStyle() {
|
|
110
124
|
return {
|
|
111
125
|
visibility: true,
|
|
126
|
+
coloring: {
|
|
127
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
128
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
129
|
+
},
|
|
112
130
|
corners: modelCornersDefaultStyle(),
|
|
113
131
|
lines: modelLinesDefaultStyle(),
|
|
114
132
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -121,6 +139,10 @@ function brepDefaultStyle() {
|
|
|
121
139
|
function crossSectionDefaultStyle() {
|
|
122
140
|
return {
|
|
123
141
|
visibility: true,
|
|
142
|
+
coloring: {
|
|
143
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
144
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
145
|
+
},
|
|
124
146
|
corners: modelCornersDefaultStyle(),
|
|
125
147
|
lines: modelLinesDefaultStyle(),
|
|
126
148
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -132,6 +154,10 @@ function crossSectionDefaultStyle() {
|
|
|
132
154
|
function structuralModelDefaultStyle() {
|
|
133
155
|
return {
|
|
134
156
|
visibility: true,
|
|
157
|
+
coloring: {
|
|
158
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
159
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
160
|
+
},
|
|
135
161
|
corners: modelCornersDefaultStyle(),
|
|
136
162
|
lines: modelLinesDefaultStyle(),
|
|
137
163
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -144,6 +170,10 @@ function structuralModelDefaultStyle() {
|
|
|
144
170
|
function sectionDefaultStyle() {
|
|
145
171
|
return {
|
|
146
172
|
visibility: true,
|
|
173
|
+
coloring: {
|
|
174
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
175
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
176
|
+
},
|
|
147
177
|
corners: modelCornersDefaultStyle(),
|
|
148
178
|
lines: modelLinesDefaultStyle(),
|
|
149
179
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -155,6 +185,10 @@ function sectionDefaultStyle() {
|
|
|
155
185
|
function implicitCrossSectionDefaultStyle() {
|
|
156
186
|
return {
|
|
157
187
|
visibility: true,
|
|
188
|
+
coloring: {
|
|
189
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
190
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
191
|
+
},
|
|
158
192
|
corners: modelCornersDefaultStyle(),
|
|
159
193
|
lines: modelLinesDefaultStyle(),
|
|
160
194
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -166,6 +200,10 @@ function implicitCrossSectionDefaultStyle() {
|
|
|
166
200
|
function implicitStructuralModelDefaultStyle() {
|
|
167
201
|
return {
|
|
168
202
|
visibility: true,
|
|
203
|
+
coloring: {
|
|
204
|
+
active: MODEL_DEFAULT_ACTIVE_COLORING,
|
|
205
|
+
constant: MODEL_DEFAULT_COLOR,
|
|
206
|
+
},
|
|
169
207
|
corners: modelCornersDefaultStyle(),
|
|
170
208
|
lines: modelLinesDefaultStyle(),
|
|
171
209
|
surfaces: modelSurfacesDefaultStyle(),
|
|
@@ -13,7 +13,7 @@ export function useMeshCellsColorStyle() {
|
|
|
13
13
|
const meshCellsCommonStyle = useMeshCellsCommonStyle();
|
|
14
14
|
|
|
15
15
|
function meshCellsColor(id) {
|
|
16
|
-
return meshCellsCommonStyle.meshCellsColoring(id).
|
|
16
|
+
return meshCellsCommonStyle.meshCellsColoring(id).constant;
|
|
17
17
|
}
|
|
18
18
|
function setMeshCellsColor(id, color) {
|
|
19
19
|
const params = { id, color };
|
|
@@ -25,7 +25,7 @@ export function useMeshCellsColorStyle() {
|
|
|
25
25
|
{
|
|
26
26
|
response_function: () =>
|
|
27
27
|
meshCellsCommonStyle.mutateMeshCellsColoring(id, {
|
|
28
|
-
color,
|
|
28
|
+
constant: color,
|
|
29
29
|
}),
|
|
30
30
|
},
|
|
31
31
|
);
|
|
@@ -31,28 +31,19 @@ export function useMeshCellsStyle() {
|
|
|
31
31
|
coloring: { active: type },
|
|
32
32
|
});
|
|
33
33
|
console.log(setMeshCellsActiveColoring.name, { id }, type);
|
|
34
|
-
if (type === "
|
|
34
|
+
if (type === "constant") {
|
|
35
35
|
return meshCellsColorStyle.setMeshCellsColor(id, meshCellsColorStyle.meshCellsColor(id));
|
|
36
36
|
}
|
|
37
37
|
if (type === "textures") {
|
|
38
38
|
const textures = meshCellsTexturesStore.meshCellsTextures(id);
|
|
39
|
-
if (textures === undefined) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
39
|
return meshCellsTexturesStore.setMeshCellsTextures(id, textures);
|
|
43
40
|
}
|
|
44
41
|
if (type === "vertex") {
|
|
45
42
|
const name = meshCellsVertexAttributeStyle.meshCellsVertexAttributeName(id);
|
|
46
|
-
if (name === undefined) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
43
|
return meshCellsVertexAttributeStyle.setMeshCellsVertexAttributeName(id, name);
|
|
50
44
|
}
|
|
51
45
|
if (type === "cell") {
|
|
52
46
|
const name = meshCellsCellAttributeStyle.meshCellsCellAttributeName(id);
|
|
53
|
-
if (name === undefined) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
47
|
return meshCellsCellAttributeStyle.setMeshCellsCellAttributeName(id, name);
|
|
57
48
|
}
|
|
58
49
|
throw new Error(`Unknown mesh cells coloring type: ${type}`);
|
|
@@ -13,7 +13,7 @@ export function useMeshEdgesColorStyle() {
|
|
|
13
13
|
const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
|
|
14
14
|
|
|
15
15
|
function meshEdgesColor(id) {
|
|
16
|
-
return meshEdgesCommonStyle.meshEdgesColoring(id).
|
|
16
|
+
return meshEdgesCommonStyle.meshEdgesColoring(id).constant;
|
|
17
17
|
}
|
|
18
18
|
function setMeshEdgesColor(id, color) {
|
|
19
19
|
const params = { id, color };
|
|
@@ -25,7 +25,7 @@ export function useMeshEdgesColorStyle() {
|
|
|
25
25
|
{
|
|
26
26
|
response_function: () =>
|
|
27
27
|
meshEdgesCommonStyle.mutateMeshEdgesColoring(id, {
|
|
28
|
-
color,
|
|
28
|
+
constant: color,
|
|
29
29
|
}),
|
|
30
30
|
},
|
|
31
31
|
);
|
|
@@ -30,21 +30,15 @@ export function useMeshEdgesStyle() {
|
|
|
30
30
|
await meshEdgesCommonStyle.mutateMeshEdgesStyle(id, {
|
|
31
31
|
coloring: { active: type },
|
|
32
32
|
});
|
|
33
|
-
if (type === "
|
|
33
|
+
if (type === "constant") {
|
|
34
34
|
return meshEdgesColorStyle.setMeshEdgesColor(id, meshEdgesColorStyle.meshEdgesColor(id));
|
|
35
35
|
}
|
|
36
36
|
if (type === "vertex") {
|
|
37
37
|
const name = meshEdgesVertexAttributeStyle.meshEdgesVertexAttributeName(id);
|
|
38
|
-
if (name === undefined) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
38
|
return meshEdgesVertexAttributeStyle.setMeshEdgesVertexAttributeName(id, name);
|
|
42
39
|
}
|
|
43
40
|
if (type === "edge") {
|
|
44
41
|
const name = meshEdgesEdgeAttributeStyle.meshEdgesEdgeAttributeName(id);
|
|
45
|
-
if (name === undefined) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
42
|
return meshEdgesEdgeAttributeStyle.setMeshEdgesEdgeAttributeName(id, name);
|
|
49
43
|
}
|
|
50
44
|
throw new Error(`Unknown mesh edges coloring type: ${type}`);
|
|
@@ -13,7 +13,7 @@ export function useMeshPointsColorStyle() {
|
|
|
13
13
|
const meshPointsCommonStyle = useMeshPointsCommonStyle();
|
|
14
14
|
|
|
15
15
|
function meshPointsColor(id) {
|
|
16
|
-
return meshPointsCommonStyle.meshPointsColoring(id).
|
|
16
|
+
return meshPointsCommonStyle.meshPointsColoring(id).constant;
|
|
17
17
|
}
|
|
18
18
|
function setMeshPointsColor(id, color) {
|
|
19
19
|
const params = { id, color };
|
|
@@ -25,7 +25,7 @@ export function useMeshPointsColorStyle() {
|
|
|
25
25
|
{
|
|
26
26
|
response_function: () =>
|
|
27
27
|
meshPointsCommonStyle.mutateMeshPointsColoring(id, {
|
|
28
|
-
color,
|
|
28
|
+
constant: color,
|
|
29
29
|
}),
|
|
30
30
|
},
|
|
31
31
|
);
|
|
@@ -26,13 +26,10 @@ function useMeshPointsColoringStyle() {
|
|
|
26
26
|
await meshPointsCommonStyle.mutateMeshPointsStyle(id, {
|
|
27
27
|
coloring: { active: type },
|
|
28
28
|
});
|
|
29
|
-
if (type === "
|
|
29
|
+
if (type === "constant") {
|
|
30
30
|
return meshPointsColorStyle.setMeshPointsColor(id, meshPointsColorStyle.meshPointsColor(id));
|
|
31
31
|
} else if (type === "vertex") {
|
|
32
32
|
const name = meshPointsVertexAttributeStyle.meshPointsVertexAttributeName(id);
|
|
33
|
-
if (name === undefined) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
33
|
return meshPointsVertexAttributeStyle.setMeshPointsVertexAttributeName(id, name);
|
|
37
34
|
}
|
|
38
35
|
throw new Error(`Unknown mesh points coloring type: ${type}`);
|
|
@@ -13,7 +13,7 @@ export function useMeshPolygonsColorStyle() {
|
|
|
13
13
|
const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
|
|
14
14
|
|
|
15
15
|
function meshPolygonsColor(id) {
|
|
16
|
-
return meshPolygonsCommonStyle.meshPolygonsColoring(id).
|
|
16
|
+
return meshPolygonsCommonStyle.meshPolygonsColoring(id).constant;
|
|
17
17
|
}
|
|
18
18
|
function setMeshPolygonsColor(id, color) {
|
|
19
19
|
const params = { id, color };
|
|
@@ -25,7 +25,7 @@ export function useMeshPolygonsColorStyle() {
|
|
|
25
25
|
{
|
|
26
26
|
response_function: () =>
|
|
27
27
|
meshPolygonsCommonStyle.mutateMeshPolygonsColoring(id, {
|
|
28
|
-
color,
|
|
28
|
+
constant: color,
|
|
29
29
|
}),
|
|
30
30
|
},
|
|
31
31
|
);
|
|
@@ -29,28 +29,19 @@ function useMeshPolygonsColoringStyle() {
|
|
|
29
29
|
await meshPolygonsCommonStyle.mutateMeshPolygonsStyle(id, {
|
|
30
30
|
coloring: { active: type },
|
|
31
31
|
});
|
|
32
|
-
if (type === "
|
|
32
|
+
if (type === "constant") {
|
|
33
33
|
return meshPolygonsColorStyle.setMeshPolygonsColor(
|
|
34
34
|
id,
|
|
35
35
|
meshPolygonsColorStyle.meshPolygonsColor(id),
|
|
36
36
|
);
|
|
37
37
|
} else if (type === "textures") {
|
|
38
38
|
const textures = meshPolygonsTexturesStyle.meshPolygonsTextures(id);
|
|
39
|
-
if (textures === undefined) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
39
|
return meshPolygonsTexturesStyle.setMeshPolygonsTextures(id, textures);
|
|
43
40
|
} else if (type === "vertex") {
|
|
44
41
|
const name = meshPolygonsVertexAttributeStyle.meshPolygonsVertexAttributeName(id);
|
|
45
|
-
if (name === undefined) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
42
|
return meshPolygonsVertexAttributeStyle.setMeshPolygonsVertexAttributeName(id, name);
|
|
49
43
|
} else if (type === "polygon") {
|
|
50
44
|
const name = meshPolygonsPolygonAttributeStyle.meshPolygonsPolygonAttributeName(id);
|
|
51
|
-
if (name === undefined) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
45
|
return meshPolygonsPolygonAttributeStyle.setMeshPolygonsPolygonAttributeName(id, name);
|
|
55
46
|
}
|
|
56
47
|
throw new Error(`Unknown mesh polygons coloring type: ${type}`);
|
|
@@ -13,7 +13,7 @@ export function useMeshPolyhedraColorStyle() {
|
|
|
13
13
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
14
14
|
|
|
15
15
|
function meshPolyhedraColor(id) {
|
|
16
|
-
return meshPolyhedraCommonStyle.meshPolyhedraColoring(id).
|
|
16
|
+
return meshPolyhedraCommonStyle.meshPolyhedraColoring(id).constant;
|
|
17
17
|
}
|
|
18
18
|
function setMeshPolyhedraColor(id, color) {
|
|
19
19
|
const params = { id, color };
|
|
@@ -25,7 +25,7 @@ export function useMeshPolyhedraColorStyle() {
|
|
|
25
25
|
{
|
|
26
26
|
response_function: () =>
|
|
27
27
|
meshPolyhedraCommonStyle.mutateMeshPolyhedraColoring(id, {
|
|
28
|
-
color,
|
|
28
|
+
constant: color,
|
|
29
29
|
}),
|
|
30
30
|
},
|
|
31
31
|
);
|
|
@@ -30,7 +30,7 @@ export function useMeshPolyhedraStyle() {
|
|
|
30
30
|
coloring: { active: type },
|
|
31
31
|
});
|
|
32
32
|
console.log(setMeshPolyhedraActiveColoring.name, { id }, type);
|
|
33
|
-
if (type === "
|
|
33
|
+
if (type === "constant") {
|
|
34
34
|
return meshPolyhedraColorStyle.setMeshPolyhedraColor(
|
|
35
35
|
id,
|
|
36
36
|
meshPolyhedraColorStyle.meshPolyhedraColor(id),
|
|
@@ -38,16 +38,10 @@ export function useMeshPolyhedraStyle() {
|
|
|
38
38
|
}
|
|
39
39
|
if (type === "vertex") {
|
|
40
40
|
const name = meshPolyhedraVertexAttributeStyle.meshPolyhedraVertexAttributeName(id);
|
|
41
|
-
if (name === undefined) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
41
|
return meshPolyhedraVertexAttributeStyle.setMeshPolyhedraVertexAttributeName(id, name);
|
|
45
42
|
}
|
|
46
43
|
if (type === "polyhedron") {
|
|
47
44
|
const name = meshPolyhedraPolyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeName(id);
|
|
48
|
-
if (name === undefined) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
45
|
return meshPolyhedraPolyhedronAttributeStyle.setMeshPolyhedraPolyhedronAttributeName(
|
|
52
46
|
id,
|
|
53
47
|
name,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useModelBlocksCommonStyle } from "./common";
|
|
2
|
+
import { useModelBlocksPolyhedronAttribute } from "./polyhedron";
|
|
3
|
+
import { useModelBlocksVertexAttribute } from "./vertex";
|
|
2
4
|
import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
|
|
3
5
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
|
|
4
6
|
|
|
@@ -7,19 +9,96 @@ const schema = viewer_schemas.opengeodeweb_viewer.model.blocks.color;
|
|
|
7
9
|
export function useModelBlocksColor() {
|
|
8
10
|
const modelCommonStyle = useModelCommonStyle();
|
|
9
11
|
const modelBlocksCommonStyle = useModelBlocksCommonStyle();
|
|
12
|
+
const modelBlocksVertexAttribute = useModelBlocksVertexAttribute();
|
|
13
|
+
const modelBlocksPolyhedronAttribute = useModelBlocksPolyhedronAttribute();
|
|
14
|
+
|
|
15
|
+
function modelBlockColoring(id, block_id) {
|
|
16
|
+
return modelBlocksCommonStyle.modelBlockStyle(id, block_id).coloring;
|
|
17
|
+
}
|
|
10
18
|
|
|
11
19
|
function modelBlockColor(id, block_id) {
|
|
12
|
-
return
|
|
20
|
+
return modelBlockColoring(id, block_id).constant;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
function setModelBlocksColor(modelId, blocks_ids, color,
|
|
16
|
-
return modelCommonStyle.setModelTypeColor(modelId, blocks_ids, color, schema,
|
|
23
|
+
function setModelBlocksColor(modelId, blocks_ids, color, activeColoring = "constant") {
|
|
24
|
+
return modelCommonStyle.setModelTypeColor(modelId, blocks_ids, color, schema, activeColoring);
|
|
17
25
|
}
|
|
18
26
|
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
function modelBlockActiveColoring(id, block_id) {
|
|
28
|
+
return modelBlockColoring(id, block_id).active;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function setModelBlocksActiveColoring(modelId, blocks_ids, activeColoring) {
|
|
32
|
+
await modelCommonStyle.mutateComponentStyles(modelId, blocks_ids, {
|
|
33
|
+
coloring: { active: activeColoring },
|
|
34
|
+
});
|
|
35
|
+
if (activeColoring === "constant" || activeColoring === "random") {
|
|
36
|
+
const color = modelBlockColor(modelId, blocks_ids[0]);
|
|
37
|
+
return setModelBlocksColor(modelId, blocks_ids, color, activeColoring);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (activeColoring === "vertex") {
|
|
41
|
+
const name = modelBlocksVertexAttribute.modelBlocksVertexAttributeName(
|
|
42
|
+
modelId,
|
|
43
|
+
blocks_ids[0],
|
|
44
|
+
);
|
|
45
|
+
await modelBlocksVertexAttribute.setModelBlocksVertexAttributeName(modelId, blocks_ids, name);
|
|
46
|
+
const [min, max] = modelBlocksVertexAttribute.modelBlocksVertexAttributeRange(
|
|
47
|
+
modelId,
|
|
48
|
+
blocks_ids[0],
|
|
49
|
+
);
|
|
50
|
+
await modelBlocksVertexAttribute.setModelBlocksVertexAttributeRange(
|
|
51
|
+
modelId,
|
|
52
|
+
blocks_ids,
|
|
53
|
+
min,
|
|
54
|
+
max,
|
|
55
|
+
);
|
|
56
|
+
const colorMap = modelBlocksVertexAttribute.modelBlocksVertexAttributeColorMap(
|
|
57
|
+
modelId,
|
|
58
|
+
blocks_ids[0],
|
|
59
|
+
);
|
|
60
|
+
await modelBlocksVertexAttribute.setModelBlocksVertexAttributeColorMap(
|
|
61
|
+
modelId,
|
|
62
|
+
blocks_ids,
|
|
63
|
+
colorMap,
|
|
64
|
+
);
|
|
65
|
+
} else if (activeColoring === "polyhedron") {
|
|
66
|
+
const name = modelBlocksPolyhedronAttribute.modelBlocksPolyhedronAttributeName(
|
|
67
|
+
modelId,
|
|
68
|
+
blocks_ids[0],
|
|
69
|
+
);
|
|
70
|
+
await modelBlocksPolyhedronAttribute.setModelBlocksPolyhedronAttributeName(
|
|
71
|
+
modelId,
|
|
72
|
+
blocks_ids,
|
|
73
|
+
name,
|
|
74
|
+
);
|
|
75
|
+
const [min, max] = modelBlocksPolyhedronAttribute.modelBlocksPolyhedronAttributeRange(
|
|
76
|
+
modelId,
|
|
77
|
+
blocks_ids[0],
|
|
78
|
+
);
|
|
79
|
+
await modelBlocksPolyhedronAttribute.setModelBlocksPolyhedronAttributeRange(
|
|
80
|
+
modelId,
|
|
81
|
+
blocks_ids,
|
|
82
|
+
min,
|
|
83
|
+
max,
|
|
84
|
+
);
|
|
85
|
+
const colorMap = modelBlocksPolyhedronAttribute.modelBlocksPolyhedronAttributeColorMap(
|
|
86
|
+
modelId,
|
|
87
|
+
blocks_ids[0],
|
|
88
|
+
);
|
|
89
|
+
await modelBlocksPolyhedronAttribute.setModelBlocksPolyhedronAttributeColorMap(
|
|
90
|
+
modelId,
|
|
91
|
+
blocks_ids,
|
|
92
|
+
colorMap,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
22
95
|
}
|
|
23
96
|
|
|
24
|
-
return {
|
|
97
|
+
return {
|
|
98
|
+
setModelBlocksColor,
|
|
99
|
+
modelBlockColoring,
|
|
100
|
+
modelBlockColor,
|
|
101
|
+
modelBlockActiveColoring,
|
|
102
|
+
setModelBlocksActiveColoring,
|
|
103
|
+
};
|
|
25
104
|
}
|
|
@@ -16,18 +16,27 @@ export function useModelBlocksCommonStyle() {
|
|
|
16
16
|
return merge({}, groupStyle, individualStyle);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function
|
|
20
|
-
return
|
|
19
|
+
function modelBlockColoring(id, block_id) {
|
|
20
|
+
return modelBlockStyle(id, block_id).coloring;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
return modelCommonStyle.
|
|
23
|
+
function mutateModelBlocksColoring(id, blocks_ids, values) {
|
|
24
|
+
return modelCommonStyle.mutateComponentStyles(id, blocks_ids, {
|
|
25
|
+
coloring: values,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function mutateModelBlockColoring(id, block_id, values) {
|
|
30
|
+
return modelCommonStyle.mutateComponentStyle(id, block_id, {
|
|
31
|
+
coloring: values,
|
|
32
|
+
});
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
return {
|
|
28
36
|
modelBlocksStyle,
|
|
29
37
|
modelBlockStyle,
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
modelBlockColoring,
|
|
39
|
+
mutateModelBlocksColoring,
|
|
40
|
+
mutateModelBlockColoring,
|
|
32
41
|
};
|
|
33
42
|
}
|
|
@@ -36,34 +36,36 @@ export function useModelBlocksStyle() {
|
|
|
36
36
|
}
|
|
37
37
|
visibilityGroups[visibility].push(block_id);
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const coloring = modelColorStyle.modelBlockColoring(modelId, block_id);
|
|
40
|
+
const activeColoring = modelColorStyle.modelBlockActiveColoring(modelId, block_id);
|
|
41
|
+
if (activeColoring === "constant") {
|
|
42
|
+
const color = modelColorStyle.modelBlockColor(modelId, block_id);
|
|
43
|
+
const color_key = JSON.stringify(color);
|
|
42
44
|
if (!colorGroups[color_key]) {
|
|
43
|
-
colorGroups[color_key] = {
|
|
45
|
+
colorGroups[color_key] = { activeColoring, color, blocks_ids: [] };
|
|
44
46
|
}
|
|
45
47
|
colorGroups[color_key].blocks_ids.push(block_id);
|
|
48
|
+
} else if (activeColoring === "random") {
|
|
49
|
+
if (!colorGroups["random"]) {
|
|
50
|
+
colorGroups["random"] = { activeColoring, color: undefined, blocks_ids: [] };
|
|
51
|
+
}
|
|
52
|
+
colorGroups["random"].blocks_ids.push(block_id);
|
|
46
53
|
} else {
|
|
47
|
-
const
|
|
48
|
-
const attributeStyle = style[attributeTypeKey] || {};
|
|
54
|
+
const attributeStyle = coloring[activeColoring];
|
|
49
55
|
const { name } = attributeStyle;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
colorMap,
|
|
62
|
-
blocks_ids: [],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
attributeGroups[attributeGroupKey].blocks_ids.push(block_id);
|
|
56
|
+
const { minimum, maximum, colorMap } = attributeStyle.storedConfigs[name];
|
|
57
|
+
const attributeGroupKey = `${activeColoring}_${name}_${colorMap}_${minimum}_${maximum}`;
|
|
58
|
+
if (!attributeGroups[attributeGroupKey]) {
|
|
59
|
+
attributeGroups[attributeGroupKey] = {
|
|
60
|
+
activeColoring,
|
|
61
|
+
name,
|
|
62
|
+
minimum,
|
|
63
|
+
maximum,
|
|
64
|
+
colorMap,
|
|
65
|
+
blocks_ids: [],
|
|
66
|
+
};
|
|
66
67
|
}
|
|
68
|
+
attributeGroups[attributeGroupKey].blocks_ids.push(block_id);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -71,12 +73,12 @@ export function useModelBlocksStyle() {
|
|
|
71
73
|
...Object.entries(visibilityGroups).map(([visibility, ids]) =>
|
|
72
74
|
modelVisibilityStyle.setModelBlocksVisibility(modelId, ids, visibility === "true"),
|
|
73
75
|
),
|
|
74
|
-
...Object.values(colorGroups).map(({
|
|
75
|
-
modelColorStyle.setModelBlocksColor(modelId, ids, color,
|
|
76
|
+
...Object.values(colorGroups).map(({ activeColoring, color, blocks_ids: ids }) =>
|
|
77
|
+
modelColorStyle.setModelBlocksColor(modelId, ids, color, activeColoring),
|
|
76
78
|
),
|
|
77
79
|
...Object.values(attributeGroups).flatMap(
|
|
78
|
-
({
|
|
79
|
-
const isVertex =
|
|
80
|
+
({ activeColoring, name, minimum, maximum, colorMap, blocks_ids: ids }) => {
|
|
81
|
+
const isVertex = activeColoring === "vertex";
|
|
80
82
|
const attributeStyle = isVertex
|
|
81
83
|
? modelBlocksVertexAttribute
|
|
82
84
|
: modelBlocksPolyhedronAttribute;
|