@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
|
@@ -157,12 +157,12 @@ export function useDataStyleState() {
|
|
|
157
157
|
|
|
158
158
|
function getComponentStyle(id_model, id_component) {
|
|
159
159
|
const key = `${id_model}_${id_component}`;
|
|
160
|
-
return componentStyles.value[key] || {};
|
|
160
|
+
return componentStyles.value[key] || { coloring: {} };
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
function getModelComponentTypeStyle(id_model, type) {
|
|
164
164
|
const key = `${id_model}_${type}`;
|
|
165
|
-
return modelComponentTypeStyles.value[key] || {};
|
|
165
|
+
return modelComponentTypeStyles.value[key] || { coloring: {} };
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
function clear() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.25.0
|
|
3
|
+
"version": "10.25.0",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"build": ""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@geode/opengeodeweb-back": "
|
|
38
|
-
"@geode/opengeodeweb-viewer": "
|
|
37
|
+
"@geode/opengeodeweb-back": "latest",
|
|
38
|
+
"@geode/opengeodeweb-viewer": "latest",
|
|
39
39
|
"@google-cloud/run": "3.2.0",
|
|
40
40
|
"@kitware/vtk.js": "33.3.0",
|
|
41
41
|
"@mdi/font": "7.4.47",
|
|
@@ -121,7 +121,7 @@ describe("mesh cells", () => {
|
|
|
121
121
|
test("coloring color", async () => {
|
|
122
122
|
const dataStyleStore = useDataStyleStore();
|
|
123
123
|
const viewerStore = useViewerStore();
|
|
124
|
-
const coloringName = "
|
|
124
|
+
const coloringName = "constant";
|
|
125
125
|
const result = dataStyleStore.setMeshCellsActiveColoring(id, coloringName);
|
|
126
126
|
expect(result).toBeInstanceOf(Promise);
|
|
127
127
|
await result;
|
|
@@ -109,7 +109,7 @@ describe("mesh edges", () => {
|
|
|
109
109
|
test("coloring color", async () => {
|
|
110
110
|
const dataStyleStore = useDataStyleStore();
|
|
111
111
|
const viewerStore = useViewerStore();
|
|
112
|
-
const coloringName = "
|
|
112
|
+
const coloringName = "constant";
|
|
113
113
|
const result = dataStyleStore.setMeshEdgesActiveColoring(id, coloringName);
|
|
114
114
|
expect(result).toBeInstanceOf(Promise);
|
|
115
115
|
await result;
|
|
@@ -76,7 +76,7 @@ describe("mesh points", () => {
|
|
|
76
76
|
test("coloring color", async () => {
|
|
77
77
|
const dataStyleStore = useDataStyleStore();
|
|
78
78
|
const viewerStore = useViewerStore();
|
|
79
|
-
const coloringName = "
|
|
79
|
+
const coloringName = "constant";
|
|
80
80
|
const result = dataStyleStore.setMeshPointsActiveColoring(id, coloringName);
|
|
81
81
|
expect(result).toBeInstanceOf(Promise);
|
|
82
82
|
await result;
|
|
@@ -119,7 +119,7 @@ describe("mesh polygons", () => {
|
|
|
119
119
|
test("coloring color", async () => {
|
|
120
120
|
const dataStyleStore = useDataStyleStore();
|
|
121
121
|
const viewerStore = useViewerStore();
|
|
122
|
-
const coloringName = "
|
|
122
|
+
const coloringName = "constant";
|
|
123
123
|
const result = dataStyleStore.setMeshPolygonsActiveColoring(id, coloringName);
|
|
124
124
|
expect(result).toBeInstanceOf(Promise);
|
|
125
125
|
await result;
|
|
@@ -73,7 +73,7 @@ describe("mesh polyhedra", () => {
|
|
|
73
73
|
test("coloring color", async () => {
|
|
74
74
|
const dataStyleStore = useDataStyleStore();
|
|
75
75
|
const viewerStore = useViewerStore();
|
|
76
|
-
const coloringName = "
|
|
76
|
+
const coloringName = "constant";
|
|
77
77
|
const result = dataStyleStore.setMeshPolyhedraActiveColoring(id, coloringName);
|
|
78
78
|
expect(result).toBeInstanceOf(Promise);
|
|
79
79
|
await result;
|
|
@@ -180,11 +180,11 @@ describe("model blocks", () => {
|
|
|
180
180
|
const dataStore = useDataStore();
|
|
181
181
|
const block_ids = await dataStore.getBlocksGeodeIds(id);
|
|
182
182
|
const [block_id] = block_ids;
|
|
183
|
-
const coloringName = "
|
|
184
|
-
const result = dataStyleStore.
|
|
183
|
+
const coloringName = "constant";
|
|
184
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, block_id, coloringName);
|
|
185
185
|
expect(result).toBeInstanceOf(Promise);
|
|
186
186
|
await result;
|
|
187
|
-
expect(dataStyleStore.
|
|
187
|
+
expect(dataStyleStore.modelBlockActiveColoring(id, block_id)).toBe(coloringName);
|
|
188
188
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
189
189
|
});
|
|
190
190
|
|
|
@@ -196,10 +196,10 @@ describe("model blocks", () => {
|
|
|
196
196
|
const [block_id] = block_ids;
|
|
197
197
|
await dataStyleStore.setModelBlocksVertexAttributeName(id, [block_id], "points");
|
|
198
198
|
const coloringName = "vertex";
|
|
199
|
-
const result = dataStyleStore.
|
|
199
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, block_id, coloringName);
|
|
200
200
|
expect(result).toBeInstanceOf(Promise);
|
|
201
201
|
await result;
|
|
202
|
-
expect(dataStyleStore.
|
|
202
|
+
expect(dataStyleStore.modelBlockActiveColoring(id, block_id)).toBe(coloringName);
|
|
203
203
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
204
204
|
});
|
|
205
205
|
|
|
@@ -211,10 +211,10 @@ describe("model blocks", () => {
|
|
|
211
211
|
const [block_id] = block_ids;
|
|
212
212
|
await dataStyleStore.setModelBlocksPolyhedronAttributeName(id, [block_id], "test_attribute");
|
|
213
213
|
const coloringName = "polyhedron";
|
|
214
|
-
const result = dataStyleStore.
|
|
214
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, block_id, coloringName);
|
|
215
215
|
expect(result).toBeInstanceOf(Promise);
|
|
216
216
|
await result;
|
|
217
|
-
expect(dataStyleStore.
|
|
217
|
+
expect(dataStyleStore.modelBlockActiveColoring(id, block_id)).toBe(coloringName);
|
|
218
218
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
219
219
|
});
|
|
220
220
|
});
|
|
@@ -145,11 +145,11 @@ describe("model corners", () => {
|
|
|
145
145
|
const dataStore = useDataStore();
|
|
146
146
|
const corner_ids = await dataStore.getCornersGeodeIds(id);
|
|
147
147
|
const [corner_id] = corner_ids;
|
|
148
|
-
const coloringName = "
|
|
149
|
-
const result = dataStyleStore.
|
|
148
|
+
const coloringName = "constant";
|
|
149
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, corner_id, coloringName);
|
|
150
150
|
expect(result).toBeInstanceOf(Promise);
|
|
151
151
|
await result;
|
|
152
|
-
expect(dataStyleStore.
|
|
152
|
+
expect(dataStyleStore.modelCornerActiveColoring(id, corner_id)).toBe(coloringName);
|
|
153
153
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
154
154
|
});
|
|
155
155
|
|
|
@@ -161,10 +161,10 @@ describe("model corners", () => {
|
|
|
161
161
|
const [corner_id] = corner_ids;
|
|
162
162
|
await dataStyleStore.setModelCornersVertexAttributeName(id, [corner_id], "points");
|
|
163
163
|
const coloringName = "vertex";
|
|
164
|
-
const result = dataStyleStore.
|
|
164
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, corner_id, coloringName);
|
|
165
165
|
expect(result).toBeInstanceOf(Promise);
|
|
166
166
|
await result;
|
|
167
|
-
expect(dataStyleStore.
|
|
167
|
+
expect(dataStyleStore.modelCornerActiveColoring(id, corner_id)).toBe(coloringName);
|
|
168
168
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
169
169
|
});
|
|
170
170
|
});
|
|
@@ -6,6 +6,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
6
6
|
import { beforeAllTimeout, setupIntegrationTests } from "@ogw_tests/integration/setup";
|
|
7
7
|
import { Status } from "@ogw_front/utils/status";
|
|
8
8
|
import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
|
|
9
|
+
import { useDataStore } from "@ogw_front/stores/data";
|
|
9
10
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
10
11
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
11
12
|
|
|
@@ -58,4 +59,34 @@ describe("model", () => {
|
|
|
58
59
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
59
60
|
});
|
|
60
61
|
});
|
|
62
|
+
|
|
63
|
+
describe("model color inheritance", () => {
|
|
64
|
+
test("inheritance workflow model > surfaces > surface", async () => {
|
|
65
|
+
const dataStyleStore = useDataStyleStore();
|
|
66
|
+
const dataStore = useDataStore();
|
|
67
|
+
|
|
68
|
+
const surface_ids = await dataStore.getSurfacesGeodeIds(id);
|
|
69
|
+
const [surface_id] = surface_ids;
|
|
70
|
+
|
|
71
|
+
const red = { red: 255, green: 0, blue: 0, alpha: 1 };
|
|
72
|
+
const green = { red: 0, green: 255, blue: 0, alpha: 1 };
|
|
73
|
+
const blue = { red: 0, green: 0, blue: 255, alpha: 1 };
|
|
74
|
+
|
|
75
|
+
await dataStyleStore.mutateStyle(id, {
|
|
76
|
+
coloring: { constant: red, active: "constant" },
|
|
77
|
+
});
|
|
78
|
+
await dataStyleStore.setModelComponentsColor(id, surface_ids, red);
|
|
79
|
+
await sleep(SLEEP_MS);
|
|
80
|
+
|
|
81
|
+
await dataStyleStore.setModelComponentTypeColor(id, "Surface", green);
|
|
82
|
+
await sleep(SLEEP_MS);
|
|
83
|
+
|
|
84
|
+
await dataStyleStore.setModelSurfacesColor(id, [surface_id], blue);
|
|
85
|
+
await sleep(SLEEP_MS);
|
|
86
|
+
|
|
87
|
+
expect(dataStyleStore.getModelColor(id)).toStrictEqual(red);
|
|
88
|
+
expect(dataStyleStore.modelComponentTypeColor(id, "Surface")).toStrictEqual(green);
|
|
89
|
+
expect(dataStyleStore.modelSurfaceColor(id, surface_id)).toStrictEqual(blue);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
61
92
|
});
|
|
@@ -178,11 +178,11 @@ describe("model lines", () => {
|
|
|
178
178
|
const dataStore = useDataStore();
|
|
179
179
|
const line_ids = await dataStore.getLinesGeodeIds(id);
|
|
180
180
|
const [line_id] = line_ids;
|
|
181
|
-
const coloringName = "
|
|
182
|
-
const result = dataStyleStore.
|
|
181
|
+
const coloringName = "constant";
|
|
182
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, line_id, coloringName);
|
|
183
183
|
expect(result).toBeInstanceOf(Promise);
|
|
184
184
|
await result;
|
|
185
|
-
expect(dataStyleStore.
|
|
185
|
+
expect(dataStyleStore.modelLineActiveColoring(id, line_id)).toBe(coloringName);
|
|
186
186
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
187
187
|
});
|
|
188
188
|
|
|
@@ -194,10 +194,10 @@ describe("model lines", () => {
|
|
|
194
194
|
const [line_id] = line_ids;
|
|
195
195
|
await dataStyleStore.setModelLinesVertexAttributeName(id, [line_id], "points");
|
|
196
196
|
const coloringName = "vertex";
|
|
197
|
-
const result = dataStyleStore.
|
|
197
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, line_id, coloringName);
|
|
198
198
|
expect(result).toBeInstanceOf(Promise);
|
|
199
199
|
await result;
|
|
200
|
-
expect(dataStyleStore.
|
|
200
|
+
expect(dataStyleStore.modelLineActiveColoring(id, line_id)).toBe(coloringName);
|
|
201
201
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
202
202
|
});
|
|
203
203
|
|
|
@@ -209,10 +209,10 @@ describe("model lines", () => {
|
|
|
209
209
|
const [line_id] = line_ids;
|
|
210
210
|
await dataStyleStore.setModelLinesEdgeAttributeName(id, [line_id], "test_attribute");
|
|
211
211
|
const coloringName = "edge";
|
|
212
|
-
const result = dataStyleStore.
|
|
212
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, line_id, coloringName);
|
|
213
213
|
expect(result).toBeInstanceOf(Promise);
|
|
214
214
|
await result;
|
|
215
|
-
expect(dataStyleStore.
|
|
215
|
+
expect(dataStyleStore.modelLineActiveColoring(id, line_id)).toBe(coloringName);
|
|
216
216
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
217
217
|
});
|
|
218
218
|
});
|
|
@@ -182,11 +182,11 @@ describe("model surfaces", () => {
|
|
|
182
182
|
const dataStore = useDataStore();
|
|
183
183
|
const surface_ids = await dataStore.getSurfacesGeodeIds(id);
|
|
184
184
|
const [surface_id] = surface_ids;
|
|
185
|
-
const coloringName = "
|
|
186
|
-
const result = dataStyleStore.
|
|
185
|
+
const coloringName = "constant";
|
|
186
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, surface_id, coloringName);
|
|
187
187
|
expect(result).toBeInstanceOf(Promise);
|
|
188
188
|
await result;
|
|
189
|
-
expect(dataStyleStore.
|
|
189
|
+
expect(dataStyleStore.modelSurfaceActiveColoring(id, surface_id)).toBe(coloringName);
|
|
190
190
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
191
191
|
});
|
|
192
192
|
|
|
@@ -198,10 +198,10 @@ describe("model surfaces", () => {
|
|
|
198
198
|
const [surface_id] = surface_ids;
|
|
199
199
|
await dataStyleStore.setModelSurfacesVertexAttributeName(id, [surface_id], "points");
|
|
200
200
|
const coloringName = "vertex";
|
|
201
|
-
const result = dataStyleStore.
|
|
201
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, surface_id, coloringName);
|
|
202
202
|
expect(result).toBeInstanceOf(Promise);
|
|
203
203
|
await result;
|
|
204
|
-
expect(dataStyleStore.
|
|
204
|
+
expect(dataStyleStore.modelSurfaceActiveColoring(id, surface_id)).toBe(coloringName);
|
|
205
205
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
206
206
|
});
|
|
207
207
|
|
|
@@ -213,10 +213,10 @@ describe("model surfaces", () => {
|
|
|
213
213
|
const [surface_id] = surface_ids;
|
|
214
214
|
await dataStyleStore.setModelSurfacesPolygonAttributeName(id, [surface_id], "test_attribute");
|
|
215
215
|
const coloringName = "polygon";
|
|
216
|
-
const result = dataStyleStore.
|
|
216
|
+
const result = dataStyleStore.setModelComponentActiveColoring(id, surface_id, coloringName);
|
|
217
217
|
expect(result).toBeInstanceOf(Promise);
|
|
218
218
|
await result;
|
|
219
|
-
expect(dataStyleStore.
|
|
219
|
+
expect(dataStyleStore.modelSurfaceActiveColoring(id, surface_id)).toBe(coloringName);
|
|
220
220
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
221
221
|
});
|
|
222
222
|
});
|