@geode/opengeodeweb-front 10.44.0-rc.3 → 10.44.0-rc.4
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/.build/server/utils/microservices.js +9 -85
- package/.build/server/utils/microservices_process.js +85 -0
- package/app/components/ClippingPlanes.vue +16 -82
- package/app/components/DragAndDrop.vue +1 -74
- package/app/components/ThresholdCard.vue +205 -0
- package/app/components/ThresholdFilter.vue +77 -216
- package/app/components/ViewToolbar.vue +15 -231
- package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
- package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +228 -0
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
- package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
- package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +234 -0
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
- package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
- package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -294
- package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
- package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -425
- package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
- package/app/components/Viewer/Options/AttributeSelector.vue +26 -133
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +36 -74
- package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
- package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
- package/app/components/Viewer/Surface/PolygonsColoring.vue +231 -0
- package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
- package/app/composables/attribute_selector.ts +126 -0
- package/app/composables/clipping_slices.ts +166 -0
- package/app/composables/view_toolbar_options.ts +126 -0
- package/app/composables/view_toolbar_tool_options.ts +115 -0
- package/app/composables/view_toolbar_tools.ts +108 -0
- package/app/composables/virtual_tree.ts +20 -138
- package/app/composables/virtual_tree_flatten.ts +86 -0
- package/app/composables/virtual_tree_types.ts +81 -0
- package/app/stores/app.ts +8 -55
- package/app/stores/app_helpers/registry.ts +69 -0
- package/app/stores/menu.ts +1 -124
- package/app/stores/menu_helpers/menus_data.ts +127 -0
- package/app/stores/viewer.ts +17 -78
- package/app/stores/viewer_helpers/actions.ts +68 -0
- package/app/stores/viewer_helpers/request.ts +61 -0
- package/app/utils/clipping_planes.ts +4 -132
- package/app/utils/clipping_planes_scene.ts +131 -0
- package/app/utils/coloring_styles.ts +101 -0
- package/app/utils/default_styles/mesh_components.ts +168 -0
- package/app/utils/default_styles/meshes.ts +13 -153
- package/app/utils/default_styles/model_components.ts +170 -0
- package/app/utils/default_styles/models.ts +16 -153
- package/app/utils/drag_and_drop.ts +80 -0
- package/app/utils/model_component_coloring.ts +46 -0
- package/app/utils/threshold.ts +33 -0
- package/app/utils/threshold_sources.ts +51 -0
- package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
- package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
- package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
- package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
- package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
- package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
- package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
- package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
- package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
- package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
- package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
- package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
- package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
- package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
- package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
- package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
- package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
- package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
- package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
- package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
- package/internal/stores/data_style/model/blocks/index.ts +12 -140
- package/internal/stores/data_style/model/common.ts +10 -119
- package/internal/stores/data_style/model/common_mutations.ts +184 -0
- package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
- package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
- package/internal/stores/data_style/model/lines/index.ts +10 -134
- package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
- package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
- package/internal/stores/data_style/model/surfaces/index.ts +16 -160
- package/internal/stores/data_style/model/visibility.ts +3 -156
- package/internal/stores/data_style/model/visibility_dispatch.ts +160 -0
- package/internal/stores/data_style/state.ts +1 -181
- package/internal/stores/data_style/state_shared.ts +191 -0
- package/internal/stores/hybrid_viewer/camera.ts +7 -161
- package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
- package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
- package/internal/stores/hybrid_viewer/filters.ts +54 -11
- package/package.json +1 -1
- package/server/utils/microservices.ts +10 -109
- package/server/utils/microservices_process.ts +127 -0
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
6
|
-
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
7
|
-
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
8
|
-
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
3
|
+
import ViewerGenericModelCornerComponentOptions from "@ogw_front/components/Viewer/Generic/Model/CornerComponentOptions.vue";
|
|
4
|
+
import ViewerGenericModelCornersTypeOptions from "@ogw_front/components/Viewer/Generic/Model/CornersTypeOptions.vue";
|
|
9
5
|
|
|
10
6
|
interface Props {
|
|
11
7
|
modelId: string;
|
|
@@ -22,296 +18,19 @@ const {
|
|
|
22
18
|
collections = undefined,
|
|
23
19
|
activeTab = undefined,
|
|
24
20
|
} = defineProps<Props>();
|
|
25
|
-
|
|
26
|
-
const dataStyleStore = useDataStyleStore();
|
|
27
|
-
const hybridViewerStore = useHybridViewerStore();
|
|
28
|
-
|
|
29
|
-
const referenceCornerId = computed<string | undefined>(() =>
|
|
30
|
-
collections ? targetCornerIds[0] : undefined,
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const cornerComponentIds = computed<string[]>(() => (cornerId !== undefined && [cornerId]) || []);
|
|
34
|
-
|
|
35
|
-
// Visibility
|
|
36
|
-
const cornersVisibility = computed<boolean>({
|
|
37
|
-
get: () => {
|
|
38
|
-
if (collections) {
|
|
39
|
-
return targetCornerIds.every((id) => dataStyleStore.modelCornerVisibility(modelId, id));
|
|
40
|
-
}
|
|
41
|
-
return dataStyleStore.modelComponentTypeVisibility(modelId, "Corner");
|
|
42
|
-
},
|
|
43
|
-
set: async (newValue) => {
|
|
44
|
-
await dataStyleStore.setModelCornersVisibility(modelId, targetCornerIds, newValue);
|
|
45
|
-
hybridViewerStore.remoteRender();
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const cornerVisibility = computed<boolean | undefined>({
|
|
50
|
-
get: () => dataStyleStore.modelCornerVisibility(modelId, cornerId) as boolean | undefined,
|
|
51
|
-
set: async (newValue) => {
|
|
52
|
-
if (newValue === undefined || cornerId === undefined) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
await dataStyleStore.setModelCornersVisibility(modelId, [cornerId], newValue);
|
|
56
|
-
hybridViewerStore.remoteRender();
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Color
|
|
61
|
-
const cornersColor = computed<RGBAColor | undefined>({
|
|
62
|
-
get: () =>
|
|
63
|
-
dataStyleStore.modelCornerColor(modelId, referenceCornerId.value) as RGBAColor | undefined,
|
|
64
|
-
set: async (color) => {
|
|
65
|
-
await dataStyleStore.setModelCornersColor(modelId, targetCornerIds, color);
|
|
66
|
-
hybridViewerStore.remoteRender();
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const cornerColor = computed<RGBAColor | undefined>({
|
|
71
|
-
get: () => dataStyleStore.modelCornerColor(modelId, cornerId) as RGBAColor | undefined,
|
|
72
|
-
set: async (color) => {
|
|
73
|
-
if (cornerId === undefined) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
await dataStyleStore.setModelCornersColor(modelId, [cornerId], color);
|
|
77
|
-
hybridViewerStore.remoteRender();
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const cornersActiveColoring = computed<string | undefined>({
|
|
82
|
-
get: () =>
|
|
83
|
-
dataStyleStore.modelCornerActiveColoring(modelId, referenceCornerId.value) as
|
|
84
|
-
| string
|
|
85
|
-
| undefined,
|
|
86
|
-
set: async (coloringType) => {
|
|
87
|
-
if (typeof coloringType !== "string") {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (collections && coloringType === "random") {
|
|
91
|
-
await Promise.all(
|
|
92
|
-
collections.map((collection) =>
|
|
93
|
-
dataStyleStore.setModelCornersActiveColoring(
|
|
94
|
-
modelId,
|
|
95
|
-
collection.children.map((child) => child.id),
|
|
96
|
-
coloringType,
|
|
97
|
-
collection.id,
|
|
98
|
-
),
|
|
99
|
-
),
|
|
100
|
-
);
|
|
101
|
-
} else {
|
|
102
|
-
await dataStyleStore.setModelCornersActiveColoring(modelId, targetCornerIds, coloringType);
|
|
103
|
-
}
|
|
104
|
-
hybridViewerStore.remoteRender();
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
const cornerActiveColoring = computed<string | undefined>({
|
|
109
|
-
get: () => dataStyleStore.modelCornerActiveColoring(modelId, cornerId) as string | undefined,
|
|
110
|
-
set: async (coloringType) => {
|
|
111
|
-
if (cornerId === undefined || typeof coloringType !== "string") {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
await dataStyleStore.setModelCornersActiveColoring(modelId, [cornerId], coloringType);
|
|
115
|
-
hybridViewerStore.remoteRender();
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// Group Attributes
|
|
120
|
-
const cornersVertexAttributeName = computed<string | undefined>({
|
|
121
|
-
get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, referenceCornerId.value),
|
|
122
|
-
set: async (newValue) => {
|
|
123
|
-
if (newValue === undefined) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
await dataStyleStore.setModelCornersVertexAttributeName(modelId, targetCornerIds, newValue);
|
|
127
|
-
hybridViewerStore.remoteRender();
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
const cornersVertexAttributeTimeStep = computed<number | undefined>({
|
|
132
|
-
get: () => dataStyleStore.modelCornersVertexAttributeTimeStep(modelId, referenceCornerId.value),
|
|
133
|
-
set: async (newValue) => {
|
|
134
|
-
if (newValue === undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
await dataStyleStore.setModelCornersVertexAttributeTimeStep(modelId, targetCornerIds, newValue);
|
|
138
|
-
hybridViewerStore.remoteRender();
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const cornersVertexAttributeItem = computed<string | undefined>({
|
|
143
|
-
get: () => dataStyleStore.modelCornersVertexAttributeItem(modelId, referenceCornerId.value),
|
|
144
|
-
set: async (newValue) => {
|
|
145
|
-
await dataStyleStore.setModelCornersVertexAttributeItem(modelId, targetCornerIds, newValue);
|
|
146
|
-
hybridViewerStore.remoteRender();
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
const cornersVertexAttributeRange = computed<[number, number] | undefined>({
|
|
151
|
-
get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, referenceCornerId.value),
|
|
152
|
-
set: async (newValue) => {
|
|
153
|
-
const [minimum, maximum] = newValue;
|
|
154
|
-
if (minimum === undefined || maximum === undefined) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
await dataStyleStore.setModelCornersVertexAttributeRange(
|
|
158
|
-
modelId,
|
|
159
|
-
targetCornerIds,
|
|
160
|
-
minimum,
|
|
161
|
-
maximum,
|
|
162
|
-
);
|
|
163
|
-
hybridViewerStore.remoteRender();
|
|
164
|
-
},
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
const cornersVertexAttributeColorMap = computed<ColorMap | undefined>({
|
|
168
|
-
get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, referenceCornerId.value),
|
|
169
|
-
set: async (newValue) => {
|
|
170
|
-
await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, targetCornerIds, newValue);
|
|
171
|
-
hybridViewerStore.remoteRender();
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
const cornersVertexAttributeNoDataColor = computed<RGBAColor>({
|
|
176
|
-
get: () =>
|
|
177
|
-
dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, referenceCornerId.value),
|
|
178
|
-
set: async (newValue) => {
|
|
179
|
-
await dataStyleStore.setModelCornersVertexAttributeNoDataColor(
|
|
180
|
-
modelId,
|
|
181
|
-
targetCornerIds,
|
|
182
|
-
newValue,
|
|
183
|
-
);
|
|
184
|
-
hybridViewerStore.remoteRender();
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
// Individual Attributes
|
|
189
|
-
const vertexAttributeName = computed<string | undefined>({
|
|
190
|
-
get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, cornerId),
|
|
191
|
-
set: async (newValue) => {
|
|
192
|
-
if (cornerId === undefined || newValue === undefined) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
await dataStyleStore.setModelCornersVertexAttributeName(modelId, [cornerId], newValue);
|
|
196
|
-
hybridViewerStore.remoteRender();
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
const vertexAttributeTimeStep = computed<number | undefined>({
|
|
201
|
-
get: () => dataStyleStore.modelCornersVertexAttributeTimeStep(modelId, cornerId),
|
|
202
|
-
set: async (newValue) => {
|
|
203
|
-
if (cornerId === undefined || newValue === undefined) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
await dataStyleStore.setModelCornersVertexAttributeTimeStep(modelId, [cornerId], newValue);
|
|
207
|
-
hybridViewerStore.remoteRender();
|
|
208
|
-
},
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
const vertexAttributeItem = computed<string | undefined>({
|
|
212
|
-
get: () => dataStyleStore.modelCornersVertexAttributeItem(modelId, cornerId),
|
|
213
|
-
set: async (newValue) => {
|
|
214
|
-
if (cornerId === undefined) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
await dataStyleStore.setModelCornersVertexAttributeItem(modelId, [cornerId], newValue);
|
|
218
|
-
hybridViewerStore.remoteRender();
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
const vertexAttributeRange = computed<[number, number] | undefined>({
|
|
223
|
-
get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, cornerId),
|
|
224
|
-
set: async (newValue) => {
|
|
225
|
-
const [minimum, maximum] = newValue;
|
|
226
|
-
if (cornerId === undefined || minimum === undefined || maximum === undefined) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
await dataStyleStore.setModelCornersVertexAttributeRange(modelId, [cornerId], minimum, maximum);
|
|
230
|
-
hybridViewerStore.remoteRender();
|
|
231
|
-
},
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
const vertexAttributeColorMap = computed<ColorMap | undefined>({
|
|
235
|
-
get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, cornerId),
|
|
236
|
-
set: async (newValue) => {
|
|
237
|
-
if (cornerId === undefined) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, [cornerId], newValue);
|
|
241
|
-
hybridViewerStore.remoteRender();
|
|
242
|
-
},
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
const vertexAttributeNoDataColor = computed<RGBAColor>({
|
|
246
|
-
get: () => dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, cornerId),
|
|
247
|
-
set: async (newValue) => {
|
|
248
|
-
if (cornerId === undefined) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
await dataStyleStore.setModelCornersVertexAttributeNoDataColor(modelId, [cornerId], newValue);
|
|
252
|
-
hybridViewerStore.remoteRender();
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
const capabilities = {
|
|
257
|
-
color: { available: true },
|
|
258
|
-
textures: { available: false },
|
|
259
|
-
vertex: { available: true },
|
|
260
|
-
edge: { available: false },
|
|
261
|
-
cell: { available: false },
|
|
262
|
-
polygon: { available: false },
|
|
263
|
-
polyhedron: { available: false },
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
const backSchemas = back_schemas.opengeodeweb_back;
|
|
267
|
-
const attributeSchemas = {
|
|
268
|
-
vertex: {
|
|
269
|
-
names: backSchemas.model_component_vertex_attribute_names,
|
|
270
|
-
range: backSchemas.model_component_vertex_attribute_range,
|
|
271
|
-
},
|
|
272
|
-
};
|
|
273
21
|
</script>
|
|
274
22
|
|
|
275
23
|
<template>
|
|
276
|
-
<
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
v-model:vertex_attribute_name="cornersVertexAttributeName"
|
|
284
|
-
v-model:vertex_attribute_item="cornersVertexAttributeItem"
|
|
285
|
-
v-model:vertex_attribute_range="cornersVertexAttributeRange"
|
|
286
|
-
v-model:vertex_attribute_color_map="cornersVertexAttributeColorMap"
|
|
287
|
-
v-model:vertex_attribute_no_data_color="cornersVertexAttributeNoDataColor"
|
|
288
|
-
v-model:vertex_attribute_time_step="cornersVertexAttributeTimeStep"
|
|
289
|
-
:capabilities="capabilities"
|
|
290
|
-
:schemas="attributeSchemas"
|
|
291
|
-
:allowRandom="true"
|
|
292
|
-
/>
|
|
293
|
-
</div>
|
|
294
|
-
|
|
295
|
-
<div
|
|
24
|
+
<ViewerGenericModelCornersTypeOptions
|
|
25
|
+
:modelId="modelId"
|
|
26
|
+
:targetCornerIds="targetCornerIds"
|
|
27
|
+
:collections="collections"
|
|
28
|
+
:activeTab="activeTab"
|
|
29
|
+
/>
|
|
30
|
+
<ViewerGenericModelCornerComponentOptions
|
|
296
31
|
v-if="cornerId"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
<ViewerOptionsColoringTypeSelector
|
|
302
|
-
:id="modelId"
|
|
303
|
-
:componentIds="cornerComponentIds"
|
|
304
|
-
v-model:coloring_style_key="cornerActiveColoring"
|
|
305
|
-
v-model:color="cornerColor"
|
|
306
|
-
v-model:vertex_attribute_name="vertexAttributeName"
|
|
307
|
-
v-model:vertex_attribute_item="vertexAttributeItem"
|
|
308
|
-
v-model:vertex_attribute_range="vertexAttributeRange"
|
|
309
|
-
v-model:vertex_attribute_color_map="vertexAttributeColorMap"
|
|
310
|
-
v-model:vertex_attribute_no_data_color="vertexAttributeNoDataColor"
|
|
311
|
-
v-model:vertex_attribute_time_step="vertexAttributeTimeStep"
|
|
312
|
-
:capabilities="capabilities"
|
|
313
|
-
:schemas="attributeSchemas"
|
|
314
|
-
:allowRandom="true"
|
|
315
|
-
/>
|
|
316
|
-
</div>
|
|
32
|
+
:modelId="modelId"
|
|
33
|
+
:cornerId="cornerId"
|
|
34
|
+
:activeTab="activeTab"
|
|
35
|
+
/>
|
|
317
36
|
</template>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
|
|
3
|
+
import { MODEL_VERTEX_COLORING } from "@ogw_front/utils/model_component_coloring";
|
|
4
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
|
+
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
6
|
+
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
7
|
+
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
8
|
+
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
modelId: string;
|
|
12
|
+
targetCornerIds: string[];
|
|
13
|
+
collections?: CollectionComponent[];
|
|
14
|
+
activeTab?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
modelId,
|
|
19
|
+
targetCornerIds,
|
|
20
|
+
collections = undefined,
|
|
21
|
+
activeTab = undefined,
|
|
22
|
+
} = defineProps<Props>();
|
|
23
|
+
|
|
24
|
+
const dataStyleStore = useDataStyleStore();
|
|
25
|
+
const hybridViewerStore = useHybridViewerStore();
|
|
26
|
+
|
|
27
|
+
const referenceCornerId = computed<string | undefined>(() =>
|
|
28
|
+
collections ? targetCornerIds[0] : undefined,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Visibility
|
|
32
|
+
const cornersVisibility = computed<boolean>({
|
|
33
|
+
get: () => {
|
|
34
|
+
if (collections) {
|
|
35
|
+
return targetCornerIds.every((id) => dataStyleStore.modelCornerVisibility(modelId, id));
|
|
36
|
+
}
|
|
37
|
+
return dataStyleStore.modelComponentTypeVisibility(modelId, "Corner");
|
|
38
|
+
},
|
|
39
|
+
set: async (newValue) => {
|
|
40
|
+
await dataStyleStore.setModelCornersVisibility(modelId, targetCornerIds, newValue);
|
|
41
|
+
hybridViewerStore.remoteRender();
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Color
|
|
46
|
+
const cornersColor = computed<RGBAColor | undefined>({
|
|
47
|
+
get: () =>
|
|
48
|
+
dataStyleStore.modelCornerColor(modelId, referenceCornerId.value) as RGBAColor | undefined,
|
|
49
|
+
set: async (color) => {
|
|
50
|
+
await dataStyleStore.setModelCornersColor(modelId, targetCornerIds, color);
|
|
51
|
+
hybridViewerStore.remoteRender();
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const cornersActiveColoring = computed<string | undefined>({
|
|
56
|
+
get: () =>
|
|
57
|
+
dataStyleStore.modelCornerActiveColoring(modelId, referenceCornerId.value) as
|
|
58
|
+
| string
|
|
59
|
+
| undefined,
|
|
60
|
+
set: async (coloringType) => {
|
|
61
|
+
if (typeof coloringType !== "string") {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (collections && coloringType === "random") {
|
|
65
|
+
await Promise.all(
|
|
66
|
+
collections.map((collection) =>
|
|
67
|
+
dataStyleStore.setModelCornersActiveColoring(
|
|
68
|
+
modelId,
|
|
69
|
+
collection.children.map((child) => child.id),
|
|
70
|
+
coloringType,
|
|
71
|
+
collection.id,
|
|
72
|
+
),
|
|
73
|
+
),
|
|
74
|
+
);
|
|
75
|
+
} else {
|
|
76
|
+
await dataStyleStore.setModelCornersActiveColoring(modelId, targetCornerIds, coloringType);
|
|
77
|
+
}
|
|
78
|
+
hybridViewerStore.remoteRender();
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Group Attributes
|
|
83
|
+
const cornersVertexAttributeName = computed<string | undefined>({
|
|
84
|
+
get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, referenceCornerId.value),
|
|
85
|
+
set: async (newValue) => {
|
|
86
|
+
if (newValue === undefined) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
await dataStyleStore.setModelCornersVertexAttributeName(modelId, targetCornerIds, newValue);
|
|
90
|
+
hybridViewerStore.remoteRender();
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const cornersVertexAttributeTimeStep = computed<number | undefined>({
|
|
95
|
+
get: () => dataStyleStore.modelCornersVertexAttributeTimeStep(modelId, referenceCornerId.value),
|
|
96
|
+
set: async (newValue) => {
|
|
97
|
+
if (newValue === undefined) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
await dataStyleStore.setModelCornersVertexAttributeTimeStep(modelId, targetCornerIds, newValue);
|
|
101
|
+
hybridViewerStore.remoteRender();
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const cornersVertexAttributeItem = computed<string | undefined>({
|
|
106
|
+
get: () => dataStyleStore.modelCornersVertexAttributeItem(modelId, referenceCornerId.value),
|
|
107
|
+
set: async (newValue) => {
|
|
108
|
+
await dataStyleStore.setModelCornersVertexAttributeItem(modelId, targetCornerIds, newValue);
|
|
109
|
+
hybridViewerStore.remoteRender();
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const cornersVertexAttributeRange = computed<[number, number] | undefined>({
|
|
114
|
+
get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, referenceCornerId.value),
|
|
115
|
+
set: async (newValue) => {
|
|
116
|
+
const [minimum, maximum] = newValue;
|
|
117
|
+
if (minimum === undefined || maximum === undefined) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
await dataStyleStore.setModelCornersVertexAttributeRange(
|
|
121
|
+
modelId,
|
|
122
|
+
targetCornerIds,
|
|
123
|
+
minimum,
|
|
124
|
+
maximum,
|
|
125
|
+
);
|
|
126
|
+
hybridViewerStore.remoteRender();
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const cornersVertexAttributeColorMap = computed<ColorMap | undefined>({
|
|
131
|
+
get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, referenceCornerId.value),
|
|
132
|
+
set: async (newValue) => {
|
|
133
|
+
await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, targetCornerIds, newValue);
|
|
134
|
+
hybridViewerStore.remoteRender();
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const cornersVertexAttributeNoDataColor = computed<RGBAColor>({
|
|
139
|
+
get: () =>
|
|
140
|
+
dataStyleStore.modelCornersVertexAttributeNoDataColor(modelId, referenceCornerId.value),
|
|
141
|
+
set: async (newValue) => {
|
|
142
|
+
await dataStyleStore.setModelCornersVertexAttributeNoDataColor(
|
|
143
|
+
modelId,
|
|
144
|
+
targetCornerIds,
|
|
145
|
+
newValue,
|
|
146
|
+
);
|
|
147
|
+
hybridViewerStore.remoteRender();
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const { capabilities, schemas: attributeSchemas } = MODEL_VERTEX_COLORING;
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<template>
|
|
155
|
+
<div v-show="!activeTab || activeTab === 'type'" data-testid="modelComponentTypeOptions">
|
|
156
|
+
<VisibilitySwitch data-testid="modelCornersVisibilitySwitch" v-model="cornersVisibility" />
|
|
157
|
+
<ViewerOptionsColoringTypeSelector
|
|
158
|
+
:id="modelId"
|
|
159
|
+
:componentIds="targetCornerIds"
|
|
160
|
+
v-model:coloring_style_key="cornersActiveColoring"
|
|
161
|
+
v-model:color="cornersColor"
|
|
162
|
+
v-model:vertex_attribute_name="cornersVertexAttributeName"
|
|
163
|
+
v-model:vertex_attribute_item="cornersVertexAttributeItem"
|
|
164
|
+
v-model:vertex_attribute_range="cornersVertexAttributeRange"
|
|
165
|
+
v-model:vertex_attribute_color_map="cornersVertexAttributeColorMap"
|
|
166
|
+
v-model:vertex_attribute_no_data_color="cornersVertexAttributeNoDataColor"
|
|
167
|
+
v-model:vertex_attribute_time_step="cornersVertexAttributeTimeStep"
|
|
168
|
+
:capabilities="capabilities"
|
|
169
|
+
:schemas="attributeSchemas"
|
|
170
|
+
:allowRandom="true"
|
|
171
|
+
/>
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|