@geode/opengeodeweb-front 10.44.0 → 10.44.1
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/ClippingPlanes.vue +7 -5
- package/app/components/CrsSelector.vue +2 -1
- package/app/components/ExtensionSelector.vue +8 -7
- package/app/components/FactorFilterPanel.vue +4 -4
- package/app/components/MissingFilesSelector.vue +2 -1
- package/app/components/ObjectSelector.vue +4 -3
- package/app/components/ThresholdCard.vue +6 -5
- package/app/components/ThresholdFilter.vue +11 -10
- package/app/components/TimeSeriesTargetSelector.vue +10 -7
- package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -10
- package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +72 -63
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +76 -71
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +72 -63
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +54 -45
- package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +76 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +72 -67
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +29 -21
- package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +15 -7
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +13 -6
- package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +19 -11
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +17 -10
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +2 -1
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +29 -21
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +2 -2
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -3
- package/app/components/Viewer/Options/AttributeSelector.vue +11 -7
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -13
- package/app/components/Viewer/Options/TextureItem.vue +5 -4
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -8
- package/app/components/Viewer/Options/TimeStepSlider.vue +3 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +6 -13
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +40 -38
- package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +69 -65
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Surface/PolygonsColoring.vue +73 -71
- package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -6
- package/app/composables/attribute_coloring_style.ts +17 -12
- package/app/composables/attribute_selector.ts +9 -15
- package/app/composables/batch_style.ts +25 -16
- package/app/composables/batch_style_model.ts +6 -5
- package/app/composables/clipping_planes_widget.ts +2 -5
- package/app/composables/clipping_slices.ts +2 -1
- package/app/composables/hover_highlight.ts +17 -16
- package/app/composables/live_data_item.ts +3 -2
- package/app/composables/model_attribute_style.ts +2 -1
- package/app/composables/model_menu_context.ts +3 -4
- package/app/composables/model_tree.ts +3 -2
- package/app/composables/project_manager_helpers/types.ts +10 -4
- package/app/composables/tree_filter.ts +3 -3
- package/app/composables/tree_keyboard_nav.ts +1 -6
- package/app/composables/tree_scroll.ts +2 -0
- package/app/composables/use_overlapping_picker.ts +9 -9
- package/app/stores/basemap_helpers/georeferenced.ts +1 -1
- package/app/stores/basemap_helpers/viewer.ts +2 -1
- package/app/stores/crs.ts +6 -5
- package/app/stores/data.ts +84 -69
- package/app/stores/data_helpers/collections.ts +13 -21
- package/app/stores/data_helpers/mesh.ts +19 -24
- package/app/stores/data_helpers/relations.ts +12 -12
- package/app/stores/data_style.ts +26 -20
- package/app/stores/menu.ts +17 -11
- package/app/stores/treeview.ts +28 -27
- package/app/types/attribute.ts +37 -0
- package/app/types/identifiers.ts +72 -0
- package/app/types/style.ts +13 -0
- package/app/types/texture.ts +6 -0
- package/app/types/tree.ts +17 -0
- package/app/utils/attribute_range.ts +2 -1
- package/app/utils/attributes.ts +13 -4
- package/app/utils/basemap_tree.ts +3 -5
- package/app/utils/clipping_planes.ts +6 -4
- package/app/utils/clipping_planes_scene.ts +4 -3
- package/app/utils/crs.ts +4 -1
- package/app/utils/default_styles/constants.ts +8 -1
- package/app/utils/default_styles/mesh_components.ts +21 -25
- package/app/utils/default_styles/meshes.ts +7 -22
- package/app/utils/default_styles/model_components.ts +22 -26
- package/app/utils/default_styles/models.ts +11 -13
- package/app/utils/import_workflow.ts +37 -29
- package/app/utils/legacy_data_id.ts +16 -0
- package/app/utils/slice.ts +7 -2
- package/app/utils/threshold.ts +1 -8
- package/app/utils/threshold_sources.ts +8 -5
- package/app/utils/treeview.ts +3 -2
- package/internal/database/tables/data.ts +1 -1
- package/internal/database/tables/data_style.ts +1 -1
- package/internal/database/tables/model_components.ts +1 -1
- package/internal/database/tables/model_components_relation.ts +1 -1
- package/internal/stores/data_style/attribute_default.ts +14 -0
- package/internal/stores/data_style/attribute_types.ts +59 -0
- package/internal/stores/data_style/attribute_valid.ts +16 -0
- package/internal/stores/data_style/mesh/base_style.ts +17 -15
- package/internal/stores/data_style/mesh/cells/cell.ts +64 -49
- package/internal/stores/data_style/mesh/cells/cell_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/cells/cell_config.ts +59 -53
- package/internal/stores/data_style/mesh/cells/color.ts +8 -7
- package/internal/stores/data_style/mesh/cells/common.ts +16 -15
- package/internal/stores/data_style/mesh/cells/index.ts +49 -47
- package/internal/stores/data_style/mesh/cells/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/cells/textures.ts +8 -7
- package/internal/stores/data_style/mesh/cells/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/cells/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/cells/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/color.ts +8 -7
- package/internal/stores/data_style/mesh/edges/common.ts +13 -12
- package/internal/stores/data_style/mesh/edges/edge.ts +64 -49
- package/internal/stores/data_style/mesh/edges/edge_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/edges/edge_config.ts +59 -53
- package/internal/stores/data_style/mesh/edges/index.ts +49 -47
- package/internal/stores/data_style/mesh/edges/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/edges/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/edges/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/edges/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/width.ts +9 -7
- package/internal/stores/data_style/mesh/index.ts +27 -24
- package/internal/stores/data_style/mesh/points/color.ts +8 -7
- package/internal/stores/data_style/mesh/points/common.ts +16 -14
- package/internal/stores/data_style/mesh/points/index.ts +39 -37
- package/internal/stores/data_style/mesh/points/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/points/size.ts +9 -7
- package/internal/stores/data_style/mesh/points/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/points/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/points/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/points/visibility.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/color.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/common.ts +19 -15
- package/internal/stores/data_style/mesh/polygons/index.ts +49 -50
- package/internal/stores/data_style/mesh/polygons/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polygons/polygon.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/polygon_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/textures.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/visibility.ts +12 -7
- package/internal/stores/data_style/mesh/polyhedra/color.ts +13 -9
- package/internal/stores/data_style/mesh/polyhedra/common.ts +13 -12
- package/internal/stores/data_style/mesh/polyhedra/index.ts +51 -51
- package/internal/stores/data_style/mesh/polyhedra/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +59 -53
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +46 -69
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +65 -55
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +12 -7
- package/internal/stores/data_style/model/blocks/apply_coloring.ts +11 -12
- package/internal/stores/data_style/model/blocks/color.ts +25 -26
- package/internal/stores/data_style/model/blocks/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/blocks/common.ts +26 -22
- package/internal/stores/data_style/model/blocks/index.ts +8 -7
- package/internal/stores/data_style/model/blocks/polyhedron.ts +114 -135
- package/internal/stores/data_style/model/blocks/vertex.ts +110 -132
- package/internal/stores/data_style/model/blocks/visibility.ts +11 -9
- package/internal/stores/data_style/model/color.ts +55 -41
- package/internal/stores/data_style/model/common.ts +16 -14
- package/internal/stores/data_style/model/component_style.ts +0 -16
- package/internal/stores/data_style/model/corners/color.ts +21 -19
- package/internal/stores/data_style/model/corners/common.ts +26 -22
- package/internal/stores/data_style/model/corners/index.ts +21 -24
- package/internal/stores/data_style/model/corners/vertex.ts +103 -122
- package/internal/stores/data_style/model/corners/visibility.ts +11 -9
- package/internal/stores/data_style/model/edges/common.ts +7 -6
- package/internal/stores/data_style/model/edges/component.ts +63 -55
- package/internal/stores/data_style/model/edges/visibility.ts +24 -16
- package/internal/stores/data_style/model/edges/width.ts +10 -8
- package/internal/stores/data_style/model/index.ts +7 -6
- package/internal/stores/data_style/model/lines/apply_coloring.ts +11 -9
- package/internal/stores/data_style/model/lines/color.ts +25 -23
- package/internal/stores/data_style/model/lines/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/lines/common.ts +29 -21
- package/internal/stores/data_style/model/lines/edge.ts +109 -128
- package/internal/stores/data_style/model/lines/index.ts +8 -7
- package/internal/stores/data_style/model/lines/vertex.ts +109 -128
- package/internal/stores/data_style/model/lines/visibility.ts +11 -9
- package/internal/stores/data_style/model/points/common.ts +7 -6
- package/internal/stores/data_style/model/points/component.ts +62 -54
- package/internal/stores/data_style/model/points/index.ts +12 -7
- package/internal/stores/data_style/model/points/size.ts +10 -8
- package/internal/stores/data_style/model/points/visibility.ts +13 -8
- package/internal/stores/data_style/model/selection.ts +6 -11
- package/internal/stores/data_style/model/surfaces/apply_coloring.ts +11 -15
- package/internal/stores/data_style/model/surfaces/color.ts +31 -23
- package/internal/stores/data_style/model/surfaces/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/surfaces/common.ts +26 -22
- package/internal/stores/data_style/model/surfaces/index.ts +8 -7
- package/internal/stores/data_style/model/surfaces/polygon.ts +113 -138
- package/internal/stores/data_style/model/surfaces/vertex.ts +117 -133
- package/internal/stores/data_style/model/surfaces/visibility.ts +11 -9
- package/internal/stores/data_style/model/visibility.ts +18 -16
- package/internal/stores/data_style/model/visibility_dispatch.ts +4 -4
- package/internal/stores/data_style/state.ts +7 -6
- package/internal/stores/data_style/state_shared.ts +11 -10
- package/internal/stores/data_style/time_step.ts +21 -15
- package/internal/stores/data_style/types.ts +4 -3
- package/internal/stores/hybrid_viewer/camera.ts +11 -6
- package/internal/stores/hybrid_viewer/filters.ts +16 -14
- package/internal/stores/hybrid_viewer/highlight.ts +6 -5
- package/internal/stores/hybrid_viewer/scene.ts +20 -18
- package/internal/stores/hybrid_viewer/vtk_types.ts +2 -2
- package/internal/utils/api_fetch.ts +1 -1
- package/internal/utils/upload_file.ts +1 -7
- package/package.json +1 -1
- package/shared/utils/fetch_raw.ts +7 -8
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
type AttributeConfig,
|
|
3
3
|
CELLS_DEFAULT_COLOR,
|
|
4
4
|
CELLS_DEFAULT_VISIBILITY,
|
|
5
|
+
type ComponentColoring,
|
|
5
6
|
EDGES_DEFAULT_COLOR,
|
|
6
7
|
EDGES_DEFAULT_VISIBILITY,
|
|
7
8
|
EDGES_DEFAULT_WIDTH,
|
|
@@ -15,66 +16,61 @@ import {
|
|
|
15
16
|
POLYHEDRA_DEFAULT_VISIBILITY,
|
|
16
17
|
type RGBAColor,
|
|
17
18
|
} from "./constants";
|
|
19
|
+
import type { Size, Visibility, Width } from "@ogw_front/types/style";
|
|
18
20
|
import type { MeshApplyTexturesParams } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
19
21
|
|
|
20
22
|
function emptyAttributeConfig(): AttributeConfig {
|
|
21
23
|
return { name: undefined, storedConfigs: {} };
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
interface
|
|
25
|
-
active: string;
|
|
26
|
-
constant: RGBAColor;
|
|
27
|
-
vertex: AttributeConfig;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface MeshEdgesColoring extends MeshComponentColoring {
|
|
26
|
+
interface MeshEdgesColoring extends ComponentColoring {
|
|
31
27
|
edge: AttributeConfig;
|
|
32
28
|
}
|
|
33
29
|
|
|
34
|
-
interface MeshCellsColoring extends
|
|
30
|
+
interface MeshCellsColoring extends ComponentColoring {
|
|
35
31
|
cell: AttributeConfig;
|
|
36
32
|
textures: MeshApplyTexturesParams["textures"];
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
interface MeshPolygonsColoring extends
|
|
35
|
+
interface MeshPolygonsColoring extends ComponentColoring {
|
|
40
36
|
textures: MeshApplyTexturesParams["textures"];
|
|
41
37
|
polygon: AttributeConfig;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
|
-
interface MeshPolyhedraColoring extends
|
|
40
|
+
interface MeshPolyhedraColoring extends ComponentColoring {
|
|
45
41
|
polyhedron: AttributeConfig;
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
interface MeshPointsStyle {
|
|
49
|
-
visibility:
|
|
50
|
-
coloring:
|
|
51
|
-
size:
|
|
45
|
+
visibility: Visibility;
|
|
46
|
+
coloring: ComponentColoring;
|
|
47
|
+
size: Size;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
interface MeshEdgesStyle {
|
|
55
|
-
visibility:
|
|
51
|
+
visibility: Visibility;
|
|
56
52
|
coloring: MeshEdgesColoring;
|
|
57
|
-
width:
|
|
53
|
+
width: Width;
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
interface MeshCellsStyle {
|
|
61
|
-
visibility:
|
|
57
|
+
visibility: Visibility;
|
|
62
58
|
coloring: MeshCellsColoring;
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
interface MeshPolygonsStyle {
|
|
66
|
-
visibility:
|
|
62
|
+
visibility: Visibility;
|
|
67
63
|
coloring: MeshPolygonsColoring;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
interface MeshPolyhedraStyle {
|
|
71
|
-
visibility:
|
|
67
|
+
visibility: Visibility;
|
|
72
68
|
coloring: MeshPolyhedraColoring;
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
function meshPointsDefaultStyle(
|
|
76
|
-
visibility:
|
|
77
|
-
size:
|
|
72
|
+
visibility: Visibility = POINTS_DEFAULT_VISIBILITY,
|
|
73
|
+
size: Size = POINTS_DEFAULT_SIZE,
|
|
78
74
|
constant: RGBAColor = POINTS_DEFAULT_COLOR,
|
|
79
75
|
): MeshPointsStyle {
|
|
80
76
|
return {
|
|
@@ -89,8 +85,8 @@ function meshPointsDefaultStyle(
|
|
|
89
85
|
}
|
|
90
86
|
|
|
91
87
|
function meshEdgesDefaultStyle(
|
|
92
|
-
visibility:
|
|
93
|
-
width:
|
|
88
|
+
visibility: Visibility = EDGES_DEFAULT_VISIBILITY,
|
|
89
|
+
width: Width = EDGES_DEFAULT_WIDTH,
|
|
94
90
|
constant: RGBAColor = EDGES_DEFAULT_COLOR,
|
|
95
91
|
): MeshEdgesStyle {
|
|
96
92
|
return {
|
|
@@ -106,7 +102,7 @@ function meshEdgesDefaultStyle(
|
|
|
106
102
|
}
|
|
107
103
|
|
|
108
104
|
function meshCellsDefaultStyle(
|
|
109
|
-
visibility:
|
|
105
|
+
visibility: Visibility = CELLS_DEFAULT_VISIBILITY,
|
|
110
106
|
constant: RGBAColor = CELLS_DEFAULT_COLOR,
|
|
111
107
|
): MeshCellsStyle {
|
|
112
108
|
return {
|
|
@@ -122,7 +118,7 @@ function meshCellsDefaultStyle(
|
|
|
122
118
|
}
|
|
123
119
|
|
|
124
120
|
function meshPolygonsDefaultStyle(
|
|
125
|
-
visibility:
|
|
121
|
+
visibility: Visibility = POLYGONS_DEFAULT_VISIBILITY,
|
|
126
122
|
constant: RGBAColor = POLYGONS_DEFAULT_COLOR,
|
|
127
123
|
): MeshPolygonsStyle {
|
|
128
124
|
return {
|
|
@@ -138,7 +134,7 @@ function meshPolygonsDefaultStyle(
|
|
|
138
134
|
}
|
|
139
135
|
|
|
140
136
|
function meshPolyhedraDefaultStyle(
|
|
141
|
-
visibility:
|
|
137
|
+
visibility: Visibility = POLYHEDRA_DEFAULT_VISIBILITY,
|
|
142
138
|
constant: RGBAColor = POLYHEDRA_DEFAULT_COLOR,
|
|
143
139
|
): MeshPolyhedraStyle {
|
|
144
140
|
return {
|
|
@@ -10,45 +10,30 @@ import {
|
|
|
10
10
|
meshPolygonsDefaultStyle,
|
|
11
11
|
meshPolyhedraDefaultStyle,
|
|
12
12
|
} from "./mesh_components";
|
|
13
|
+
import type { Visibility } from "@ogw_front/types/style";
|
|
13
14
|
|
|
14
15
|
interface PointSetStyle {
|
|
15
|
-
visibility:
|
|
16
|
+
visibility: Visibility;
|
|
16
17
|
points: MeshPointsStyle;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
interface EdgedCurveStyle {
|
|
20
|
-
visibility: boolean;
|
|
21
|
-
points: MeshPointsStyle;
|
|
20
|
+
interface EdgedCurveStyle extends PointSetStyle {
|
|
22
21
|
edges: MeshEdgesStyle;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
interface Grid2dStyle {
|
|
26
|
-
visibility: boolean;
|
|
27
|
-
points: MeshPointsStyle;
|
|
28
|
-
edges: MeshEdgesStyle;
|
|
24
|
+
interface Grid2dStyle extends EdgedCurveStyle {
|
|
29
25
|
cells: MeshCellsStyle;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
interface Grid3dStyle {
|
|
33
|
-
visibility: boolean;
|
|
34
|
-
points: MeshPointsStyle;
|
|
35
|
-
edges: MeshEdgesStyle;
|
|
36
|
-
cells: MeshCellsStyle;
|
|
28
|
+
interface Grid3dStyle extends Grid2dStyle {
|
|
37
29
|
polyhedra: MeshPolyhedraStyle;
|
|
38
30
|
}
|
|
39
31
|
|
|
40
|
-
interface SurfaceStyle {
|
|
41
|
-
visibility: boolean;
|
|
42
|
-
points: MeshPointsStyle;
|
|
43
|
-
edges: MeshEdgesStyle;
|
|
32
|
+
interface SurfaceStyle extends EdgedCurveStyle {
|
|
44
33
|
polygons: MeshPolygonsStyle;
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
interface SolidStyle {
|
|
48
|
-
visibility: boolean;
|
|
49
|
-
points: MeshPointsStyle;
|
|
50
|
-
edges: MeshEdgesStyle;
|
|
51
|
-
polygons: MeshPolygonsStyle;
|
|
36
|
+
interface SolidStyle extends SurfaceStyle {
|
|
52
37
|
polyhedra: MeshPolyhedraStyle;
|
|
53
38
|
}
|
|
54
39
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CORNERS_DEFAULT_ACTIVE_COLORING,
|
|
7
7
|
CORNERS_DEFAULT_COLOR,
|
|
8
8
|
CORNERS_DEFAULT_VISIBILITY,
|
|
9
|
+
type ComponentColoring,
|
|
9
10
|
EDGES_DEFAULT_VISIBILITY,
|
|
10
11
|
EDGES_DEFAULT_WIDTH,
|
|
11
12
|
LINES_DEFAULT_ACTIVE_COLORING,
|
|
@@ -18,61 +19,56 @@ import {
|
|
|
18
19
|
SURFACES_DEFAULT_COLOR,
|
|
19
20
|
SURFACES_DEFAULT_VISIBILITY,
|
|
20
21
|
} from "./constants";
|
|
22
|
+
import type { Size, Visibility, Width } from "@ogw_front/types/style";
|
|
21
23
|
|
|
22
24
|
function emptyAttributeConfig(): AttributeConfig {
|
|
23
25
|
return { name: undefined, storedConfigs: {} };
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
interface
|
|
27
|
-
active: string;
|
|
28
|
-
constant: RGBAColor;
|
|
29
|
-
vertex: AttributeConfig;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface ModelLinesColoring extends ModelComponentColoring {
|
|
28
|
+
interface ModelLinesColoring extends ComponentColoring {
|
|
33
29
|
edge: AttributeConfig;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
interface ModelSurfacesColoring extends
|
|
32
|
+
interface ModelSurfacesColoring extends ComponentColoring {
|
|
37
33
|
polygon: AttributeConfig;
|
|
38
34
|
}
|
|
39
35
|
|
|
40
|
-
interface ModelBlocksColoring extends
|
|
36
|
+
interface ModelBlocksColoring extends ComponentColoring {
|
|
41
37
|
polyhedron: AttributeConfig;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
interface ModelCornersStyle {
|
|
45
|
-
visibility:
|
|
46
|
-
coloring:
|
|
41
|
+
visibility: Visibility;
|
|
42
|
+
coloring: ComponentColoring;
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
interface ModelLinesStyle {
|
|
50
|
-
visibility:
|
|
46
|
+
visibility: Visibility;
|
|
51
47
|
coloring: ModelLinesColoring;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
interface ModelSurfacesStyle {
|
|
55
|
-
visibility:
|
|
51
|
+
visibility: Visibility;
|
|
56
52
|
coloring: ModelSurfacesColoring;
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
interface ModelBlocksStyle {
|
|
60
|
-
visibility:
|
|
56
|
+
visibility: Visibility;
|
|
61
57
|
coloring: ModelBlocksColoring;
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
interface ModelPointsStyle {
|
|
65
|
-
visibility:
|
|
66
|
-
size:
|
|
61
|
+
visibility: Visibility;
|
|
62
|
+
size: Size;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
65
|
interface ModelEdgesStyle {
|
|
70
|
-
visibility:
|
|
71
|
-
width:
|
|
66
|
+
visibility: Visibility;
|
|
67
|
+
width: Width;
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
function modelCornersDefaultStyle(
|
|
75
|
-
visibility:
|
|
71
|
+
visibility: Visibility = CORNERS_DEFAULT_VISIBILITY,
|
|
76
72
|
constant: RGBAColor = CORNERS_DEFAULT_COLOR,
|
|
77
73
|
): ModelCornersStyle {
|
|
78
74
|
return {
|
|
@@ -86,7 +82,7 @@ function modelCornersDefaultStyle(
|
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
function modelLinesDefaultStyle(
|
|
89
|
-
visibility:
|
|
85
|
+
visibility: Visibility = LINES_DEFAULT_VISIBILITY,
|
|
90
86
|
constant: RGBAColor = LINES_DEFAULT_COLOR,
|
|
91
87
|
): ModelLinesStyle {
|
|
92
88
|
return {
|
|
@@ -101,7 +97,7 @@ function modelLinesDefaultStyle(
|
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
function modelSurfacesDefaultStyle(
|
|
104
|
-
visibility:
|
|
100
|
+
visibility: Visibility = SURFACES_DEFAULT_VISIBILITY,
|
|
105
101
|
constant: RGBAColor = SURFACES_DEFAULT_COLOR,
|
|
106
102
|
): ModelSurfacesStyle {
|
|
107
103
|
return {
|
|
@@ -116,7 +112,7 @@ function modelSurfacesDefaultStyle(
|
|
|
116
112
|
}
|
|
117
113
|
|
|
118
114
|
function modelBlocksDefaultStyle(
|
|
119
|
-
visibility:
|
|
115
|
+
visibility: Visibility = BLOCKS_DEFAULT_VISIBILITY,
|
|
120
116
|
constant: RGBAColor = BLOCKS_DEFAULT_COLOR,
|
|
121
117
|
): ModelBlocksStyle {
|
|
122
118
|
return {
|
|
@@ -131,15 +127,15 @@ function modelBlocksDefaultStyle(
|
|
|
131
127
|
}
|
|
132
128
|
|
|
133
129
|
function modelPointsDefaultStyle(
|
|
134
|
-
visibility:
|
|
135
|
-
size:
|
|
130
|
+
visibility: Visibility = POINTS_DEFAULT_VISIBILITY,
|
|
131
|
+
size: Size = POINTS_DEFAULT_SIZE,
|
|
136
132
|
): ModelPointsStyle {
|
|
137
133
|
return { visibility, size };
|
|
138
134
|
}
|
|
139
135
|
|
|
140
136
|
function modelEdgesDefaultStyle(
|
|
141
|
-
visibility:
|
|
142
|
-
width:
|
|
137
|
+
visibility: Visibility = EDGES_DEFAULT_VISIBILITY,
|
|
138
|
+
width: Width = EDGES_DEFAULT_WIDTH,
|
|
143
139
|
): ModelEdgesStyle {
|
|
144
140
|
return { visibility, width };
|
|
145
141
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ComponentColoring,
|
|
3
|
+
MODEL_DEFAULT_ACTIVE_COLORING,
|
|
4
|
+
MODEL_DEFAULT_COLOR,
|
|
5
|
+
} from "./constants";
|
|
2
6
|
import {
|
|
3
7
|
type ModelBlocksStyle,
|
|
4
8
|
type ModelCornersStyle,
|
|
@@ -13,26 +17,20 @@ import {
|
|
|
13
17
|
modelPointsDefaultStyle,
|
|
14
18
|
modelSurfacesDefaultStyle,
|
|
15
19
|
} from "./model_components";
|
|
20
|
+
import type { Visibility } from "@ogw_front/types/style";
|
|
16
21
|
|
|
17
|
-
interface
|
|
18
|
-
visibility:
|
|
19
|
-
coloring:
|
|
22
|
+
interface ModelWithoutBlocksStyle {
|
|
23
|
+
visibility: Visibility;
|
|
24
|
+
coloring: Pick<ComponentColoring, "active" | "constant">;
|
|
20
25
|
corners: ModelCornersStyle;
|
|
21
26
|
lines: ModelLinesStyle;
|
|
22
27
|
surfaces: ModelSurfacesStyle;
|
|
23
|
-
blocks: ModelBlocksStyle;
|
|
24
28
|
points: ModelPointsStyle;
|
|
25
29
|
edges: ModelEdgesStyle;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
interface ModelWithoutBlocksStyle {
|
|
29
|
-
|
|
30
|
-
coloring: { active: string; constant: RGBAColor };
|
|
31
|
-
corners: ModelCornersStyle;
|
|
32
|
-
lines: ModelLinesStyle;
|
|
33
|
-
surfaces: ModelSurfacesStyle;
|
|
34
|
-
points: ModelPointsStyle;
|
|
35
|
-
edges: ModelEdgesStyle;
|
|
32
|
+
interface ModelWithBlocksStyle extends ModelWithoutBlocksStyle {
|
|
33
|
+
blocks: ModelBlocksStyle;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
function brepDefaultStyle(): ModelWithBlocksStyle {
|
|
@@ -4,6 +4,8 @@ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schem
|
|
|
4
4
|
import { consola } from "consola";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import type { DataId, GeodeObjectType, GeodeObjectTyped } from "@ogw_front/types/identifiers";
|
|
8
|
+
import { type LegacyDataId, fromLegacyDataId } from "@ogw_front/utils/legacy_data_id";
|
|
7
9
|
import { type NewDataItem, useDataStore } from "@ogw_front/stores/data";
|
|
8
10
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
9
11
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
@@ -11,14 +13,13 @@ import { useFeedbackStore } from "@ogw_front/stores/feedback";
|
|
|
11
13
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
12
14
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
13
15
|
|
|
14
|
-
interface FileToImport {
|
|
16
|
+
interface FileToImport extends Readonly<GeodeObjectTyped> {
|
|
15
17
|
readonly filename: string;
|
|
16
|
-
readonly geode_object_type: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
// NewDataItem has mutable array fields (mesh_components, collection_components), so it can't
|
|
20
21
|
// Satisfy prefer-readonly-parameter-types deeply; left unfixed (same pattern as app/plugins/auto_store_register.ts).
|
|
21
|
-
async function
|
|
22
|
+
async function importDataItem(item: NewDataItem): Promise<string> {
|
|
22
23
|
const dataStore = useDataStore();
|
|
23
24
|
const dataStyleStore = useDataStyleStore();
|
|
24
25
|
const hybridViewerStore = useHybridViewerStore();
|
|
@@ -32,7 +33,7 @@ async function importItem(item: NewDataItem): Promise<string> {
|
|
|
32
33
|
if (!(await dataStore.isItemViewable(item))) {
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
35
|
-
return dataStore.registerObject(item.
|
|
36
|
+
return dataStore.registerObject(item.data_id, item.name ?? item.data_id);
|
|
36
37
|
});
|
|
37
38
|
let addDataComponentsTask: Promise<string | undefined> = Promise.resolve(undefined);
|
|
38
39
|
let addDataRelationsTask: Promise<string | undefined> = Promise.resolve(undefined);
|
|
@@ -42,22 +43,22 @@ async function importItem(item: NewDataItem): Promise<string> {
|
|
|
42
43
|
}
|
|
43
44
|
treeviewStore.addItem(
|
|
44
45
|
item.geode_object_type,
|
|
45
|
-
item.name ?? item.
|
|
46
|
-
item.
|
|
46
|
+
item.name ?? item.data_id,
|
|
47
|
+
item.data_id,
|
|
47
48
|
item.geode_id,
|
|
48
49
|
item.viewer_type,
|
|
49
50
|
);
|
|
50
|
-
const addDataStyleTask = dataStyleStore.addDataStyle(item.
|
|
51
|
+
const addDataStyleTask = dataStyleStore.addDataStyle(item.data_id, item.geode_object_type);
|
|
51
52
|
const addViewerTask = addDataTask.then(async () => {
|
|
52
53
|
if (!(await dataStore.isItemViewable(item))) {
|
|
53
54
|
return undefined;
|
|
54
55
|
}
|
|
55
|
-
return hybridViewerStore.addItem(item.
|
|
56
|
+
return hybridViewerStore.addItem(item.data_id);
|
|
56
57
|
});
|
|
57
58
|
const applyStyleTask = Promise.all([registerTask, addDataComponentsTask, addDataStyleTask]).then(
|
|
58
59
|
async () => {
|
|
59
60
|
if (await dataStore.isItemViewable(item)) {
|
|
60
|
-
return dataStyleStore.applyDefaultStyle(item.
|
|
61
|
+
return dataStyleStore.applyDefaultStyle(item.data_id);
|
|
61
62
|
}
|
|
62
63
|
return undefined;
|
|
63
64
|
},
|
|
@@ -70,9 +71,14 @@ async function importItem(item: NewDataItem): Promise<string> {
|
|
|
70
71
|
addViewerTask,
|
|
71
72
|
applyStyleTask,
|
|
72
73
|
]);
|
|
73
|
-
return item.
|
|
74
|
+
return item.data_id;
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
// Every item comes through here: from the back-end, which still names its data id `id`, or from a project
|
|
77
|
+
async function importItem(imported: LegacyDataId<NewDataItem> | NewDataItem): Promise<string> {
|
|
78
|
+
const dataId = await importDataItem(fromLegacyDataId(imported));
|
|
79
|
+
return dataId;
|
|
80
|
+
}
|
|
81
|
+
async function importFile(filename: string, geode_object_type: GeodeObjectType): Promise<string> {
|
|
76
82
|
const backStore = useBackStore();
|
|
77
83
|
const schema = back_schemas.opengeodeweb_back.save_viewable_file;
|
|
78
84
|
const params = {
|
|
@@ -83,8 +89,8 @@ async function importFile(filename: string, geode_object_type: string): Promise<
|
|
|
83
89
|
schema,
|
|
84
90
|
params,
|
|
85
91
|
});
|
|
86
|
-
// oxlint-disable-next-line no-unsafe-type-assertion -- this is the trusted API boundary; the back-end response shape matches NewDataItem.
|
|
87
|
-
return importItem(response as NewDataItem);
|
|
92
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- this is the trusted API boundary; the back-end response shape matches NewDataItem, except for its legacy id.
|
|
93
|
+
return importItem(response as LegacyDataId<NewDataItem>);
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
async function importWorkflow(files: readonly FileToImport[]): Promise<string[]> {
|
|
@@ -107,8 +113,8 @@ async function importWorkflow(files: readonly FileToImport[]): Promise<string[]>
|
|
|
107
113
|
// A failing file does not prevent the other files from being imported
|
|
108
114
|
const chunk_results = await Promise.allSettled(
|
|
109
115
|
chunk.map(async ({ filename, geode_object_type }) => {
|
|
110
|
-
const
|
|
111
|
-
return
|
|
116
|
+
const dataId = await importFile(filename, geode_object_type);
|
|
117
|
+
return dataId;
|
|
112
118
|
}),
|
|
113
119
|
);
|
|
114
120
|
for (const result of chunk_results) {
|
|
@@ -133,11 +139,13 @@ async function importWorkflow(files: readonly FileToImport[]): Promise<string[]>
|
|
|
133
139
|
}
|
|
134
140
|
|
|
135
141
|
// NewDataItem has mutable array fields (mesh_components, collection_components), so a readonly array of it can't satisfy prefer-readonly-parameter-types deeply; left unfixed (same pattern as app/plugins/auto_store_register.ts).
|
|
136
|
-
async function importWorkflowFromSnapshot(
|
|
142
|
+
async function importWorkflowFromSnapshot(
|
|
143
|
+
items: readonly (LegacyDataId<NewDataItem> | NewDataItem)[],
|
|
144
|
+
): Promise<string[]> {
|
|
137
145
|
consola.debug("[importWorkflowFromSnapshot] start", { count: items?.length });
|
|
138
146
|
const hybridViewerStore = useHybridViewerStore();
|
|
139
147
|
const chunk_size = 5;
|
|
140
|
-
const chunks: NewDataItem[][] = [];
|
|
148
|
+
const chunks: (LegacyDataId<NewDataItem> | NewDataItem)[][] = [];
|
|
141
149
|
for (let i = 0; i < items.length; i += chunk_size) {
|
|
142
150
|
chunks.push(items.slice(i, i + chunk_size));
|
|
143
151
|
}
|
|
@@ -149,8 +157,8 @@ async function importWorkflowFromSnapshot(items: readonly NewDataItem[]): Promis
|
|
|
149
157
|
const chunk = chunks[chunkIndex] ?? [];
|
|
150
158
|
const chunk_ids = await Promise.all(
|
|
151
159
|
chunk.map(async (item) => {
|
|
152
|
-
const
|
|
153
|
-
return
|
|
160
|
+
const dataId = await importItem(item);
|
|
161
|
+
return dataId;
|
|
154
162
|
}),
|
|
155
163
|
);
|
|
156
164
|
ids.push(...chunk_ids);
|
|
@@ -166,32 +174,32 @@ async function importWorkflowFromSnapshot(items: readonly NewDataItem[]): Promis
|
|
|
166
174
|
|
|
167
175
|
// Reloads the viewer object under the same id with its stored style, after the back rewrote its files.
|
|
168
176
|
async function reloadObject(
|
|
169
|
-
|
|
177
|
+
dataId: DataId,
|
|
170
178
|
{ rebuildActor = false }: { rebuildActor?: boolean } = {},
|
|
171
179
|
): Promise<void> {
|
|
172
180
|
const dataStore = useDataStore();
|
|
173
181
|
const dataStyleStore = useDataStyleStore();
|
|
174
182
|
const hybridViewerStore = useHybridViewerStore();
|
|
175
|
-
const item = await dataStore.item(
|
|
176
|
-
await dataStore.deregisterObject(
|
|
177
|
-
await dataStore.registerObject(
|
|
183
|
+
const item = await dataStore.item(dataId);
|
|
184
|
+
await dataStore.deregisterObject(dataId);
|
|
185
|
+
await dataStore.registerObject(dataId, item.name ?? dataId);
|
|
178
186
|
// Only when the geometry moved: the local actor is rebuilt from the stored light viewable
|
|
179
187
|
if (rebuildActor) {
|
|
180
|
-
await hybridViewerStore.addItem(
|
|
188
|
+
await hybridViewerStore.addItem(dataId);
|
|
181
189
|
}
|
|
182
|
-
await dataStyleStore.applyDefaultStyle(
|
|
190
|
+
await dataStyleStore.applyDefaultStyle(dataId);
|
|
183
191
|
await hybridViewerStore.remoteRender();
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
// The time series only adds attributes to the model, so the viewer object is reloaded.
|
|
187
|
-
async function applyTimeSeriesWorkflow(filename: string,
|
|
195
|
+
async function applyTimeSeriesWorkflow(filename: string, dataId: DataId): Promise<string> {
|
|
188
196
|
const backStore = useBackStore();
|
|
189
197
|
await backStore.request({
|
|
190
198
|
schema: back_schemas.opengeodeweb_back.apply_time_series,
|
|
191
|
-
params: { id, filename },
|
|
199
|
+
params: { id: dataId, filename },
|
|
192
200
|
});
|
|
193
|
-
await reloadObject(
|
|
194
|
-
return
|
|
201
|
+
await reloadObject(dataId);
|
|
202
|
+
return dataId;
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
export {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DataId, DataIdentified } from "@ogw_front/types/identifiers";
|
|
2
|
+
|
|
3
|
+
// Temporary: the back-end, the viewer and the projects saved before data_id existed still name the data id `id`
|
|
4
|
+
type LegacyDataId<Row extends DataIdentified> = Omit<Row, "data_id"> & { id: DataId };
|
|
5
|
+
|
|
6
|
+
function fromLegacyDataId<Row extends DataIdentified>(row: LegacyDataId<Row> | Row): Row {
|
|
7
|
+
if ("data_id" in row) {
|
|
8
|
+
return row;
|
|
9
|
+
}
|
|
10
|
+
const { id, ...rest } = row;
|
|
11
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- the other fields of a legacy row are the other fields of Row.
|
|
12
|
+
return { ...rest, data_id: id } as unknown as Row;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { LegacyDataId };
|
|
16
|
+
export { fromLegacyDataId };
|
package/app/utils/slice.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DataIdentified, GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
2
|
+
|
|
1
3
|
const GRID_TYPES = new Set([
|
|
2
4
|
"RegularGrid2D",
|
|
3
5
|
"LightRegularGrid2D",
|
|
@@ -12,8 +14,11 @@ const SLICE_AXES = [
|
|
|
12
14
|
] as const satisfies readonly { title: string; value: SliceAxis; next: SliceAxis }[];
|
|
13
15
|
const DEFAULT_SLICE_AXIS: SliceAxis = 2;
|
|
14
16
|
|
|
15
|
-
function areAllGrids(
|
|
16
|
-
|
|
17
|
+
function areAllGrids(
|
|
18
|
+
items: (DataIdentified & { geode_object_type: GeodeObjectType })[],
|
|
19
|
+
ids: string[],
|
|
20
|
+
): boolean {
|
|
21
|
+
const targetedItems = items.filter((item) => ids.includes(item.data_id));
|
|
17
22
|
return (
|
|
18
23
|
targetedItems.length > 0 &&
|
|
19
24
|
targetedItems.every((item) => GRID_TYPES.has(item.geode_object_type))
|
package/app/utils/threshold.ts
CHANGED
|
@@ -9,13 +9,6 @@ interface AttributeSource {
|
|
|
9
9
|
location: "point" | "cell";
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
interface AttributeInfo {
|
|
13
|
-
attribute_name: string;
|
|
14
|
-
nb_items: number;
|
|
15
|
-
time_steps?: number[];
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
function isValidThresholdAttribute(
|
|
20
13
|
attribute: Partial<ThresholdAttribute>,
|
|
21
14
|
): attribute is ThresholdAttribute {
|
|
@@ -30,4 +23,4 @@ function isValidThresholdAttribute(
|
|
|
30
23
|
}
|
|
31
24
|
|
|
32
25
|
export { isValidThresholdAttribute };
|
|
33
|
-
export type {
|
|
26
|
+
export type { AttributeSource };
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
MODEL_COMPONENT_KINDS,
|
|
5
5
|
} from "@ogw_front/utils/attributes";
|
|
6
6
|
import type { AttributeSource } from "@ogw_front/utils/threshold";
|
|
7
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
7
8
|
import { attributeSchemas } from "@ogw_front/composables/attribute_coloring_style";
|
|
8
9
|
import type { useDataStore } from "@ogw_front/stores/data";
|
|
9
10
|
|
|
@@ -28,21 +29,23 @@ function attributeSource(
|
|
|
28
29
|
|
|
29
30
|
async function fetchSources(
|
|
30
31
|
dataStore: ReturnType<typeof useDataStore>,
|
|
31
|
-
|
|
32
|
+
dataId: DataId,
|
|
32
33
|
): Promise<AttributeSource[]> {
|
|
33
|
-
const item = await dataStore.item(
|
|
34
|
+
const item = await dataStore.item(dataId);
|
|
34
35
|
if (item.viewer_type !== "model") {
|
|
35
36
|
return ["vertex", MESH_ELEMENT_KINDS[item.geode_object_type]]
|
|
36
37
|
.filter((kind): kind is string => kind !== undefined)
|
|
37
|
-
.map((kind) => attributeSource(kind, "", { id }));
|
|
38
|
+
.map((kind) => attributeSource(kind, "", { id: dataId }));
|
|
38
39
|
}
|
|
39
40
|
const modelSources = await Promise.all(
|
|
40
41
|
Object.entries(MODEL_COMPONENT_KINDS).map(async ([type, kinds]) => {
|
|
41
|
-
const component_ids = await dataStore.getMeshComponentGeodeIds(
|
|
42
|
+
const component_ids = await dataStore.getMeshComponentGeodeIds(dataId, type);
|
|
42
43
|
if (component_ids.length === 0) {
|
|
43
44
|
return [];
|
|
44
45
|
}
|
|
45
|
-
return kinds.map((kind) =>
|
|
46
|
+
return kinds.map((kind) =>
|
|
47
|
+
attributeSource(kind, `${type} `, { id: dataId, component_ids }, type),
|
|
48
|
+
);
|
|
46
49
|
}),
|
|
47
50
|
);
|
|
48
51
|
return modelSources.flat();
|
package/app/utils/treeview.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ModelIdentified } from "@ogw_front/types/identifiers";
|
|
2
|
+
|
|
1
3
|
function compareSelections<Item>(
|
|
2
4
|
current: readonly Item[],
|
|
3
5
|
previous: readonly Item[],
|
|
@@ -20,11 +22,10 @@ interface GeodeObjectTypeMenuPayload {
|
|
|
20
22
|
targetIds: string[];
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
interface ModelComponentMenuPayload {
|
|
25
|
+
interface ModelComponentMenuPayload extends ModelIdentified {
|
|
24
26
|
event: MouseEvent;
|
|
25
27
|
itemId: string;
|
|
26
28
|
context_type: "model_component" | "model_component_type";
|
|
27
|
-
modelId: string;
|
|
28
29
|
modelComponentType?: string;
|
|
29
30
|
targetComponentIds?: string[];
|
|
30
31
|
}
|
|
@@ -3,5 +3,5 @@ import type { TableDefinition } from "./table_definition";
|
|
|
3
3
|
export const dataTable: TableDefinition = {
|
|
4
4
|
name: "data",
|
|
5
5
|
schema:
|
|
6
|
-
"
|
|
6
|
+
"data_id, geode_id, name, viewer_type, geode_object_type, visible, created_at, binary_light_viewable",
|
|
7
7
|
};
|
|
@@ -2,5 +2,5 @@ import type { TableDefinition } from "./table_definition";
|
|
|
2
2
|
|
|
3
3
|
export const modelComponentsTable: TableDefinition = {
|
|
4
4
|
name: "model_components",
|
|
5
|
-
schema: "[
|
|
5
|
+
schema: "[data_id+geode_id], data_id, [data_id+type], viewer_id, name, is_active",
|
|
6
6
|
};
|