@geode/opengeodeweb-front 10.23.0-rc.1 → 10.23.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/Generic/Model/BlocksOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
- package/app/stores/app.js +1 -0
- package/internal/stores/data_style/model/blocks/color.js +1 -5
- package/internal/stores/data_style/model/corners/color.js +1 -5
- package/internal/stores/data_style/model/lines/color.js +1 -5
- package/internal/stores/data_style/model/surfaces/color.js +0 -5
- package/package.json +1 -1
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +46 -0
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +31 -0
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +46 -0
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +46 -0
|
@@ -63,7 +63,7 @@ const blockColorMode = computed({
|
|
|
63
63
|
get: () => dataStyleStore.modelBlockColorMode(modelId, blockId),
|
|
64
64
|
set: async (colorMode) => {
|
|
65
65
|
if (blockId) {
|
|
66
|
-
await dataStyleStore.
|
|
66
|
+
await dataStyleStore.setModelComponentColorMode(modelId, blockId, colorMode);
|
|
67
67
|
hybridViewerStore.remoteRender();
|
|
68
68
|
}
|
|
69
69
|
},
|
|
@@ -63,7 +63,7 @@ const cornerColorMode = computed({
|
|
|
63
63
|
get: () => dataStyleStore.modelCornerColorMode(modelId, cornerId),
|
|
64
64
|
set: async (colorMode) => {
|
|
65
65
|
if (cornerId) {
|
|
66
|
-
await dataStyleStore.
|
|
66
|
+
await dataStyleStore.setModelComponentColorMode(modelId, cornerId, colorMode);
|
|
67
67
|
hybridViewerStore.remoteRender();
|
|
68
68
|
}
|
|
69
69
|
},
|
|
@@ -63,7 +63,7 @@ const lineColorMode = computed({
|
|
|
63
63
|
get: () => dataStyleStore.modelLineColorMode(modelId, lineId),
|
|
64
64
|
set: async (colorMode) => {
|
|
65
65
|
if (lineId) {
|
|
66
|
-
await dataStyleStore.
|
|
66
|
+
await dataStyleStore.setModelComponentColorMode(modelId, lineId, colorMode);
|
|
67
67
|
hybridViewerStore.remoteRender();
|
|
68
68
|
}
|
|
69
69
|
},
|
|
@@ -63,7 +63,7 @@ const surfaceColorMode = computed({
|
|
|
63
63
|
get: () => dataStyleStore.modelSurfaceColorMode(modelId, surfaceId),
|
|
64
64
|
set: async (colorMode) => {
|
|
65
65
|
if (surfaceId) {
|
|
66
|
-
await dataStyleStore.
|
|
66
|
+
await dataStyleStore.setModelComponentColorMode(modelId, surfaceId, colorMode);
|
|
67
67
|
hybridViewerStore.remoteRender();
|
|
68
68
|
}
|
|
69
69
|
},
|
package/app/stores/app.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { api_fetch } from "@ogw_internal/utils/api_fetch.js";
|
|
3
3
|
import { upload_file } from "@ogw_internal/utils/upload_file.js";
|
|
4
4
|
|
|
5
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
5
6
|
export const useAppStore = defineStore("app", () => {
|
|
6
7
|
const stores = [];
|
|
7
8
|
|
|
@@ -21,9 +21,5 @@ export function useModelBlocksColor() {
|
|
|
21
21
|
return mode === "constant" ? "color" : mode;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
return modelCommonStyle.setModelComponentColorMode(modelId, block_id, color_mode);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return { setModelBlocksColor, modelBlockColor, modelBlockColorMode, setModelBlockColorMode };
|
|
24
|
+
return { setModelBlocksColor, modelBlockColor, modelBlockColorMode };
|
|
29
25
|
}
|
|
@@ -21,9 +21,5 @@ export function useModelCornersColor() {
|
|
|
21
21
|
return mode === "constant" ? "color" : mode;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
return modelCommonStyle.setModelComponentColorMode(modelId, corner_id, color_mode);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return { setModelCornersColor, modelCornerColor, modelCornerColorMode, setModelCornerColorMode };
|
|
24
|
+
return { setModelCornersColor, modelCornerColor, modelCornerColorMode };
|
|
29
25
|
}
|
|
@@ -21,9 +21,5 @@ export function useModelLinesColor() {
|
|
|
21
21
|
return mode === "constant" ? "color" : mode;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
return modelCommonStyle.setModelComponentColorMode(modelId, line_id, color_mode);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return { setModelLinesColor, modelLineColor, modelLineColorMode, setModelLineColorMode };
|
|
24
|
+
return { setModelLinesColor, modelLineColor, modelLineColorMode };
|
|
29
25
|
}
|
|
@@ -22,14 +22,9 @@ export function useModelSurfacesColor() {
|
|
|
22
22
|
return mode === "constant" ? "color" : mode;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function setModelSurfaceColorMode(modelId, surface_id, color_mode) {
|
|
26
|
-
return modelCommonStyle.setModelComponentColorMode(modelId, surface_id, color_mode);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
25
|
return {
|
|
30
26
|
setModelSurfacesColor,
|
|
31
27
|
modelSurfaceColor,
|
|
32
28
|
modelSurfaceColorMode,
|
|
33
|
-
setModelSurfaceColorMode,
|
|
34
29
|
};
|
|
35
30
|
}
|
package/package.json
CHANGED
|
@@ -172,4 +172,50 @@ describe("model blocks", () => {
|
|
|
172
172
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
|
+
|
|
176
|
+
describe("block component active coloring", () => {
|
|
177
|
+
test("coloring color", async () => {
|
|
178
|
+
const dataStyleStore = useDataStyleStore();
|
|
179
|
+
const viewerStore = useViewerStore();
|
|
180
|
+
const dataStore = useDataStore();
|
|
181
|
+
const block_ids = await dataStore.getBlocksGeodeIds(id);
|
|
182
|
+
const [block_id] = block_ids;
|
|
183
|
+
const coloringName = "color";
|
|
184
|
+
const result = dataStyleStore.setModelComponentColorMode(id, block_id, coloringName);
|
|
185
|
+
expect(result).toBeInstanceOf(Promise);
|
|
186
|
+
await result;
|
|
187
|
+
expect(dataStyleStore.modelBlockColorMode(id, block_id)).toBe(coloringName);
|
|
188
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test("coloring vertex", async () => {
|
|
192
|
+
const dataStyleStore = useDataStyleStore();
|
|
193
|
+
const viewerStore = useViewerStore();
|
|
194
|
+
const dataStore = useDataStore();
|
|
195
|
+
const block_ids = await dataStore.getBlocksGeodeIds(id);
|
|
196
|
+
const [block_id] = block_ids;
|
|
197
|
+
await dataStyleStore.setModelBlocksVertexAttributeName(id, [block_id], "points");
|
|
198
|
+
const coloringName = "vertex";
|
|
199
|
+
const result = dataStyleStore.setModelComponentColorMode(id, block_id, coloringName);
|
|
200
|
+
expect(result).toBeInstanceOf(Promise);
|
|
201
|
+
await result;
|
|
202
|
+
expect(dataStyleStore.modelBlockColorMode(id, block_id)).toBe(coloringName);
|
|
203
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
test("coloring polyhedron", async () => {
|
|
207
|
+
const dataStyleStore = useDataStyleStore();
|
|
208
|
+
const viewerStore = useViewerStore();
|
|
209
|
+
const dataStore = useDataStore();
|
|
210
|
+
const block_ids = await dataStore.getBlocksGeodeIds(id);
|
|
211
|
+
const [block_id] = block_ids;
|
|
212
|
+
await dataStyleStore.setModelBlocksPolyhedronAttributeName(id, [block_id], "test_attribute");
|
|
213
|
+
const coloringName = "polyhedron";
|
|
214
|
+
const result = dataStyleStore.setModelComponentColorMode(id, block_id, coloringName);
|
|
215
|
+
expect(result).toBeInstanceOf(Promise);
|
|
216
|
+
await result;
|
|
217
|
+
expect(dataStyleStore.modelBlockColorMode(id, block_id)).toBe(coloringName);
|
|
218
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
175
221
|
});
|
|
@@ -137,4 +137,35 @@ describe("model corners", () => {
|
|
|
137
137
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
+
|
|
141
|
+
describe("corner component active coloring", () => {
|
|
142
|
+
test("coloring color", async () => {
|
|
143
|
+
const dataStyleStore = useDataStyleStore();
|
|
144
|
+
const viewerStore = useViewerStore();
|
|
145
|
+
const dataStore = useDataStore();
|
|
146
|
+
const corner_ids = await dataStore.getCornersGeodeIds(id);
|
|
147
|
+
const [corner_id] = corner_ids;
|
|
148
|
+
const coloringName = "color";
|
|
149
|
+
const result = dataStyleStore.setModelComponentColorMode(id, corner_id, coloringName);
|
|
150
|
+
expect(result).toBeInstanceOf(Promise);
|
|
151
|
+
await result;
|
|
152
|
+
expect(dataStyleStore.modelCornerColorMode(id, corner_id)).toBe(coloringName);
|
|
153
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test("coloring vertex", async () => {
|
|
157
|
+
const dataStyleStore = useDataStyleStore();
|
|
158
|
+
const viewerStore = useViewerStore();
|
|
159
|
+
const dataStore = useDataStore();
|
|
160
|
+
const corner_ids = await dataStore.getCornersGeodeIds(id);
|
|
161
|
+
const [corner_id] = corner_ids;
|
|
162
|
+
await dataStyleStore.setModelCornersVertexAttributeName(id, [corner_id], "points");
|
|
163
|
+
const coloringName = "vertex";
|
|
164
|
+
const result = dataStyleStore.setModelComponentColorMode(id, corner_id, coloringName);
|
|
165
|
+
expect(result).toBeInstanceOf(Promise);
|
|
166
|
+
await result;
|
|
167
|
+
expect(dataStyleStore.modelCornerColorMode(id, corner_id)).toBe(coloringName);
|
|
168
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
140
171
|
});
|
|
@@ -170,4 +170,50 @@ describe("model lines", () => {
|
|
|
170
170
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
|
+
|
|
174
|
+
describe("line component active coloring", () => {
|
|
175
|
+
test("coloring color", async () => {
|
|
176
|
+
const dataStyleStore = useDataStyleStore();
|
|
177
|
+
const viewerStore = useViewerStore();
|
|
178
|
+
const dataStore = useDataStore();
|
|
179
|
+
const line_ids = await dataStore.getLinesGeodeIds(id);
|
|
180
|
+
const [line_id] = line_ids;
|
|
181
|
+
const coloringName = "color";
|
|
182
|
+
const result = dataStyleStore.setModelComponentColorMode(id, line_id, coloringName);
|
|
183
|
+
expect(result).toBeInstanceOf(Promise);
|
|
184
|
+
await result;
|
|
185
|
+
expect(dataStyleStore.modelLineColorMode(id, line_id)).toBe(coloringName);
|
|
186
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("coloring vertex", async () => {
|
|
190
|
+
const dataStyleStore = useDataStyleStore();
|
|
191
|
+
const viewerStore = useViewerStore();
|
|
192
|
+
const dataStore = useDataStore();
|
|
193
|
+
const line_ids = await dataStore.getLinesGeodeIds(id);
|
|
194
|
+
const [line_id] = line_ids;
|
|
195
|
+
await dataStyleStore.setModelLinesVertexAttributeName(id, [line_id], "points");
|
|
196
|
+
const coloringName = "vertex";
|
|
197
|
+
const result = dataStyleStore.setModelComponentColorMode(id, line_id, coloringName);
|
|
198
|
+
expect(result).toBeInstanceOf(Promise);
|
|
199
|
+
await result;
|
|
200
|
+
expect(dataStyleStore.modelLineColorMode(id, line_id)).toBe(coloringName);
|
|
201
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test("coloring edge", async () => {
|
|
205
|
+
const dataStyleStore = useDataStyleStore();
|
|
206
|
+
const viewerStore = useViewerStore();
|
|
207
|
+
const dataStore = useDataStore();
|
|
208
|
+
const line_ids = await dataStore.getLinesGeodeIds(id);
|
|
209
|
+
const [line_id] = line_ids;
|
|
210
|
+
await dataStyleStore.setModelLinesEdgeAttributeName(id, [line_id], "test_attribute");
|
|
211
|
+
const coloringName = "edge";
|
|
212
|
+
const result = dataStyleStore.setModelComponentColorMode(id, line_id, coloringName);
|
|
213
|
+
expect(result).toBeInstanceOf(Promise);
|
|
214
|
+
await result;
|
|
215
|
+
expect(dataStyleStore.modelLineColorMode(id, line_id)).toBe(coloringName);
|
|
216
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
217
|
+
});
|
|
218
|
+
});
|
|
173
219
|
});
|
|
@@ -174,4 +174,50 @@ describe("model surfaces", () => {
|
|
|
174
174
|
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
175
175
|
});
|
|
176
176
|
});
|
|
177
|
+
|
|
178
|
+
describe("surface component active coloring", () => {
|
|
179
|
+
test("coloring color", async () => {
|
|
180
|
+
const dataStyleStore = useDataStyleStore();
|
|
181
|
+
const viewerStore = useViewerStore();
|
|
182
|
+
const dataStore = useDataStore();
|
|
183
|
+
const surface_ids = await dataStore.getSurfacesGeodeIds(id);
|
|
184
|
+
const [surface_id] = surface_ids;
|
|
185
|
+
const coloringName = "color";
|
|
186
|
+
const result = dataStyleStore.setModelComponentColorMode(id, surface_id, coloringName);
|
|
187
|
+
expect(result).toBeInstanceOf(Promise);
|
|
188
|
+
await result;
|
|
189
|
+
expect(dataStyleStore.modelSurfaceColorMode(id, surface_id)).toBe(coloringName);
|
|
190
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test("coloring vertex", async () => {
|
|
194
|
+
const dataStyleStore = useDataStyleStore();
|
|
195
|
+
const viewerStore = useViewerStore();
|
|
196
|
+
const dataStore = useDataStore();
|
|
197
|
+
const surface_ids = await dataStore.getSurfacesGeodeIds(id);
|
|
198
|
+
const [surface_id] = surface_ids;
|
|
199
|
+
await dataStyleStore.setModelSurfacesVertexAttributeName(id, [surface_id], "points");
|
|
200
|
+
const coloringName = "vertex";
|
|
201
|
+
const result = dataStyleStore.setModelComponentColorMode(id, surface_id, coloringName);
|
|
202
|
+
expect(result).toBeInstanceOf(Promise);
|
|
203
|
+
await result;
|
|
204
|
+
expect(dataStyleStore.modelSurfaceColorMode(id, surface_id)).toBe(coloringName);
|
|
205
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
test("coloring polygon", async () => {
|
|
209
|
+
const dataStyleStore = useDataStyleStore();
|
|
210
|
+
const viewerStore = useViewerStore();
|
|
211
|
+
const dataStore = useDataStore();
|
|
212
|
+
const surface_ids = await dataStore.getSurfacesGeodeIds(id);
|
|
213
|
+
const [surface_id] = surface_ids;
|
|
214
|
+
await dataStyleStore.setModelSurfacesPolygonAttributeName(id, [surface_id], "test_attribute");
|
|
215
|
+
const coloringName = "polygon";
|
|
216
|
+
const result = dataStyleStore.setModelComponentColorMode(id, surface_id, coloringName);
|
|
217
|
+
expect(result).toBeInstanceOf(Promise);
|
|
218
|
+
await result;
|
|
219
|
+
expect(dataStyleStore.modelSurfaceColorMode(id, surface_id)).toBe(coloringName);
|
|
220
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
177
223
|
});
|