@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
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
SceneStyle,
|
|
6
6
|
StyleValues,
|
|
7
7
|
} from "./types";
|
|
8
|
+
import type { ModelId } from "@ogw_front/types/identifiers";
|
|
8
9
|
import type { Observable as RxObservable } from "rxjs";
|
|
9
10
|
import { getDefaultSceneStyle } from "@ogw_front/utils/default_styles";
|
|
10
11
|
import { getTable } from "@ogw_internal/database/database";
|
|
@@ -19,24 +20,24 @@ interface SharedState {
|
|
|
19
20
|
sceneStyle: Ref<SceneStyle>;
|
|
20
21
|
loadFromDatabase: () => Promise<void>;
|
|
21
22
|
updateComponentStyleCache: (
|
|
22
|
-
modelId:
|
|
23
|
+
modelId: ModelId,
|
|
23
24
|
componentId: string,
|
|
24
25
|
styleValues: StyleValues,
|
|
25
26
|
) => void;
|
|
26
27
|
bulkUpdateComponentStyleCache: (
|
|
27
|
-
modelId:
|
|
28
|
+
modelId: ModelId,
|
|
28
29
|
componentStyleUpdates: readonly {
|
|
29
30
|
readonly id_component: string;
|
|
30
31
|
readonly values: StyleValues;
|
|
31
32
|
}[],
|
|
32
33
|
) => void;
|
|
33
34
|
bulkUpdateComponentStylesCache: (
|
|
34
|
-
modelId:
|
|
35
|
+
modelId: ModelId,
|
|
35
36
|
componentIds: readonly string[],
|
|
36
37
|
styleValues: StyleValues,
|
|
37
38
|
) => void;
|
|
38
39
|
updateModelComponentTypeStyleCache: (
|
|
39
|
-
modelId:
|
|
40
|
+
modelId: ModelId,
|
|
40
41
|
componentType: string,
|
|
41
42
|
styleValues: StyleValues,
|
|
42
43
|
) => void;
|
|
@@ -64,7 +65,7 @@ function getSharedState(): SharedState {
|
|
|
64
65
|
const objectStyles = await dataStyleTable.toArray();
|
|
65
66
|
const stylesByObjectId: Record<string, ObjectStyle> = {};
|
|
66
67
|
for (const objectStyle of objectStyles) {
|
|
67
|
-
stylesByObjectId[objectStyle.
|
|
68
|
+
stylesByObjectId[objectStyle.data_id] = objectStyle;
|
|
68
69
|
}
|
|
69
70
|
return stylesByObjectId;
|
|
70
71
|
});
|
|
@@ -105,7 +106,7 @@ function getSharedState(): SharedState {
|
|
|
105
106
|
void loadFromDatabase();
|
|
106
107
|
|
|
107
108
|
function updateComponentStyleCache(
|
|
108
|
-
modelId:
|
|
109
|
+
modelId: ModelId,
|
|
109
110
|
componentId: string,
|
|
110
111
|
styleValues: StyleValues,
|
|
111
112
|
): void {
|
|
@@ -122,7 +123,7 @@ function getSharedState(): SharedState {
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
function bulkUpdateComponentStyleCache(
|
|
125
|
-
modelId:
|
|
126
|
+
modelId: ModelId,
|
|
126
127
|
componentStyleUpdates: readonly {
|
|
127
128
|
readonly id_component: string;
|
|
128
129
|
readonly values: StyleValues;
|
|
@@ -145,7 +146,7 @@ function getSharedState(): SharedState {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
function bulkUpdateComponentStylesCache(
|
|
148
|
-
modelId:
|
|
149
|
+
modelId: ModelId,
|
|
149
150
|
componentIds: readonly string[],
|
|
150
151
|
styleValues: StyleValues,
|
|
151
152
|
): void {
|
|
@@ -166,7 +167,7 @@ function getSharedState(): SharedState {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
function updateModelComponentTypeStyleCache(
|
|
169
|
-
modelId:
|
|
170
|
+
modelId: ModelId,
|
|
170
171
|
componentType: string,
|
|
171
172
|
styleValues: StyleValues,
|
|
172
173
|
): void {
|
|
@@ -176,7 +177,7 @@ function getSharedState(): SharedState {
|
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
function updateStyleCache(objectId: string, styleValues: StyleValues): void {
|
|
179
|
-
styles.value[objectId] ??= {
|
|
180
|
+
styles.value[objectId] ??= { data_id: objectId };
|
|
180
181
|
merge(styles.value[objectId], styleValues);
|
|
181
182
|
}
|
|
182
183
|
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import type { AttributeName, AttributeTimeStep } from "@ogw_front/types/attribute";
|
|
2
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
1
3
|
import { attributeArrayName } from "@ogw_front/utils/attributes";
|
|
2
4
|
import { useDataStyleState } from "./state";
|
|
3
5
|
|
|
4
6
|
interface UseAttributeTimeStepStyleReturn {
|
|
5
|
-
attributeTimeStep: (
|
|
7
|
+
attributeTimeStep: (
|
|
8
|
+
dataId: DataId,
|
|
9
|
+
key: string,
|
|
10
|
+
name: AttributeName | undefined,
|
|
11
|
+
) => AttributeTimeStep | undefined;
|
|
6
12
|
setAttributeTimeStep: (
|
|
7
|
-
|
|
13
|
+
dataId: DataId,
|
|
8
14
|
key: string,
|
|
9
|
-
name:
|
|
10
|
-
timeStep:
|
|
15
|
+
name: AttributeName,
|
|
16
|
+
timeStep: AttributeTimeStep,
|
|
11
17
|
) => Promise<unknown>;
|
|
12
|
-
seriesArrayName: (
|
|
18
|
+
seriesArrayName: (dataId: DataId, key: string, name: AttributeName) => string;
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
// Re-render the other components showing the same series, one request per group.
|
|
@@ -42,31 +48,31 @@ function useAttributeTimeStepStyle(): UseAttributeTimeStepStyleReturn {
|
|
|
42
48
|
const dataStyleState = useDataStyleState();
|
|
43
49
|
|
|
44
50
|
function attributeTimeStep(
|
|
45
|
-
|
|
51
|
+
dataId: DataId,
|
|
46
52
|
key: string,
|
|
47
|
-
name:
|
|
48
|
-
):
|
|
53
|
+
name: AttributeName | undefined,
|
|
54
|
+
): AttributeTimeStep | undefined {
|
|
49
55
|
if (name === undefined) {
|
|
50
56
|
return undefined;
|
|
51
57
|
}
|
|
52
|
-
return dataStyleState.getStyle(
|
|
58
|
+
return dataStyleState.getStyle(dataId).timeSteps?.[key]?.[name];
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
async function setAttributeTimeStep(
|
|
56
|
-
|
|
62
|
+
dataId: DataId,
|
|
57
63
|
key: string,
|
|
58
|
-
name:
|
|
59
|
-
timeStep:
|
|
64
|
+
name: AttributeName,
|
|
65
|
+
timeStep: AttributeTimeStep,
|
|
60
66
|
): Promise<unknown> {
|
|
61
|
-
const result = await dataStyleState.mutateStyle(
|
|
67
|
+
const result = await dataStyleState.mutateStyle(dataId, {
|
|
62
68
|
timeSteps: { [key]: { [name]: timeStep } },
|
|
63
69
|
});
|
|
64
70
|
return result;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
// VTK array name of the series at its current time step
|
|
68
|
-
function seriesArrayName(
|
|
69
|
-
return attributeArrayName(name, attributeTimeStep(
|
|
74
|
+
function seriesArrayName(dataId: DataId, key: string, name: AttributeName): string {
|
|
75
|
+
return attributeArrayName(name, attributeTimeStep(dataId, key, name));
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
return { attributeTimeStep, setAttributeTimeStep, seriesArrayName };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { DataIdentified } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
3
|
+
import type { Visibility } from "@ogw_front/types/style";
|
|
2
4
|
|
|
3
5
|
type StyleValues = Record<string, unknown>;
|
|
4
6
|
|
|
5
|
-
interface ObjectStyle {
|
|
6
|
-
|
|
7
|
-
visibility?: boolean;
|
|
7
|
+
interface ObjectStyle extends DataIdentified {
|
|
8
|
+
visibility?: Visibility;
|
|
8
9
|
color?: unknown;
|
|
9
10
|
points?: StyleValues;
|
|
10
11
|
edges?: StyleValues;
|
|
@@ -2,6 +2,7 @@ import { EASE_EXPONENT, applyCameraOptions, getImageStyle, toBounds } from "./ca
|
|
|
2
2
|
import { animateCamera, computeAnimationDuration, getCameraOptions } from "./camera_animation";
|
|
3
3
|
import { requireRenderWindow, useHybridViewerCore } from "./core";
|
|
4
4
|
import type { CameraOptions } from "./vtk_types";
|
|
5
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
5
6
|
import { animateCameraOrientation } from "./camera_orientation";
|
|
6
7
|
import { useHybridViewerScene } from "./scene";
|
|
7
8
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
@@ -89,19 +90,23 @@ const useHybridViewerCamera = createSharedComposable(() => {
|
|
|
89
90
|
syncRemoteCamera();
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
async function performFocusCameraOnObject(
|
|
93
|
+
async function performFocusCameraOnObject(
|
|
94
|
+
dataId: DataId,
|
|
95
|
+
block_ids: number[] = [],
|
|
96
|
+
): Promise<void> {
|
|
93
97
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
94
98
|
const { hybridDb } = useHybridViewerScene();
|
|
95
|
-
if (!hybridDb[
|
|
99
|
+
if (!hybridDb[dataId]) {
|
|
96
100
|
return;
|
|
97
101
|
}
|
|
98
102
|
const viewerStore = useViewerStore();
|
|
99
|
-
let bounds: [number, number, number, number, number, number] =
|
|
103
|
+
let bounds: [number, number, number, number, number, number] =
|
|
104
|
+
hybridDb[dataId].actor.getBounds();
|
|
100
105
|
if (block_ids.length > 0) {
|
|
101
106
|
const response = await viewerStore.request({
|
|
102
107
|
schema: viewer_schemas.opengeodeweb_viewer.model.get_blocks_bounds,
|
|
103
108
|
params: {
|
|
104
|
-
id,
|
|
109
|
+
id: dataId,
|
|
105
110
|
block_ids,
|
|
106
111
|
},
|
|
107
112
|
});
|
|
@@ -116,8 +121,8 @@ const useHybridViewerCamera = createSharedComposable(() => {
|
|
|
116
121
|
performSetCamera(targetOptions);
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
async function focusCameraOnObject(
|
|
120
|
-
await performFocusCameraOnObject(
|
|
124
|
+
async function focusCameraOnObject(dataId: DataId, block_ids: number[] = []): Promise<void> {
|
|
125
|
+
await performFocusCameraOnObject(dataId, block_ids);
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
function setCameraOrientation(orientation: string): void {
|
|
@@ -2,6 +2,8 @@ import type { JsonRpcSchema, ParamsOf, ResponseOf } from "@ogw_shared/utils/type
|
|
|
2
2
|
import viewer_schemas, {
|
|
3
3
|
type ViewerClippingPlanesParams,
|
|
4
4
|
} from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
|
+
import type { AttributeName } from "@ogw_front/types/attribute";
|
|
6
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
5
7
|
import type { SliceAxis } from "@ogw_front/utils/slice";
|
|
6
8
|
import { useHybridViewerCore } from "./core";
|
|
7
9
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
@@ -63,7 +65,7 @@ interface ThresholdAttribute {
|
|
|
63
65
|
interface Threshold {
|
|
64
66
|
id: number;
|
|
65
67
|
sourceIndex: number | undefined;
|
|
66
|
-
attributeName:
|
|
68
|
+
attributeName: AttributeName | undefined;
|
|
67
69
|
item: number;
|
|
68
70
|
minimum: number | undefined;
|
|
69
71
|
maximum: number | undefined;
|
|
@@ -81,22 +83,22 @@ function useHybridViewerFilters(): {
|
|
|
81
83
|
setExplode: typeof setExplode;
|
|
82
84
|
setSlice: typeof setSlice;
|
|
83
85
|
setThreshold: typeof setThreshold;
|
|
84
|
-
getThresholds: (
|
|
85
|
-
addThreshold: (
|
|
86
|
-
removeThreshold: (
|
|
87
|
-
removeThresholds: (
|
|
86
|
+
getThresholds: (dataId: DataId) => Threshold[];
|
|
87
|
+
addThreshold: (dataId: DataId) => void;
|
|
88
|
+
removeThreshold: (dataId: DataId, index: number) => void;
|
|
89
|
+
removeThresholds: (dataId: DataId) => void;
|
|
88
90
|
} {
|
|
89
91
|
const thresholds = reactive<Record<string, Threshold[]>>({});
|
|
90
92
|
let lastThresholdId = 0;
|
|
91
93
|
|
|
92
|
-
function getThresholds(
|
|
93
|
-
return thresholds[
|
|
94
|
+
function getThresholds(dataId: DataId): Threshold[] {
|
|
95
|
+
return thresholds[dataId] ?? [];
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
function addThreshold(
|
|
98
|
+
function addThreshold(dataId: DataId): void {
|
|
97
99
|
lastThresholdId += 1;
|
|
98
|
-
thresholds[
|
|
99
|
-
thresholds[
|
|
100
|
+
thresholds[dataId] ??= [];
|
|
101
|
+
thresholds[dataId].push({
|
|
100
102
|
id: lastThresholdId,
|
|
101
103
|
sourceIndex: undefined,
|
|
102
104
|
attributeName: undefined,
|
|
@@ -107,12 +109,12 @@ function useHybridViewerFilters(): {
|
|
|
107
109
|
});
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
function removeThreshold(
|
|
111
|
-
thresholds[
|
|
112
|
+
function removeThreshold(dataId: DataId, index: number): void {
|
|
113
|
+
thresholds[dataId]?.splice(index, 1);
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
function removeThresholds(
|
|
115
|
-
thresholds[
|
|
116
|
+
function removeThresholds(dataId: DataId): void {
|
|
117
|
+
thresholds[dataId] = [];
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GeodeId, GeodeIdentified, ModelId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import { HOVER_DEBOUNCE_MS, HOVER_TIMEOUT_MS } from "./constants";
|
|
2
3
|
import type { HoverComponentInfo, HoverData } from "./vtk_types";
|
|
3
4
|
import viewer_schemas, {
|
|
@@ -10,23 +11,23 @@ import { useHybridViewerCore } from "./core";
|
|
|
10
11
|
import { useHybridViewerScene } from "./scene";
|
|
11
12
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
12
13
|
|
|
13
|
-
async function lookupModelName(modelId:
|
|
14
|
+
async function lookupModelName(modelId: ModelId): Promise<string | undefined> {
|
|
14
15
|
const modelRecord = (await database.data?.get(modelId)) as { name?: string } | undefined;
|
|
15
16
|
return modelRecord?.name;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
async function lookupComponentInfo(
|
|
19
|
-
modelId:
|
|
20
|
-
geodeId:
|
|
20
|
+
modelId: ModelId,
|
|
21
|
+
geodeId: GeodeId | undefined,
|
|
21
22
|
): Promise<HoverComponentInfo | undefined> {
|
|
22
23
|
const modelComponentsTable = database.model_components;
|
|
23
24
|
if (geodeId === undefined || !modelComponentsTable) {
|
|
24
25
|
return undefined;
|
|
25
26
|
}
|
|
26
|
-
const components = modelComponentsTable.where("[
|
|
27
|
+
const components = modelComponentsTable.where("[data_id+geode_id]");
|
|
27
28
|
const query = components.equals([modelId, geodeId] as IndexableType);
|
|
28
29
|
const component = (await query.first()) as
|
|
29
|
-
| { name?: string;
|
|
30
|
+
| (Partial<GeodeIdentified> & { name?: string; type?: string })
|
|
30
31
|
| undefined;
|
|
31
32
|
if (!component) {
|
|
32
33
|
return undefined;
|
|
@@ -4,6 +4,8 @@ import { requireRenderWindow, useHybridViewerCore } from "./core";
|
|
|
4
4
|
import viewer_schemas, {
|
|
5
5
|
type ViewerSetBackgroundColorParams,
|
|
6
6
|
} from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
7
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
8
|
+
import type { Visibility } from "@ogw_front/types/style";
|
|
7
9
|
import { base64ToArrayBuffer } from "./base64";
|
|
8
10
|
import { getCameraOptions } from "./camera_animation";
|
|
9
11
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
@@ -40,13 +42,13 @@ function followZScaling(camera: vtkCamera, ratio: number): void {
|
|
|
40
42
|
camera.setPosition(positionX, positionY, positionZ + offset);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
async function fetchBinaryLightViewable(
|
|
45
|
+
async function fetchBinaryLightViewable(dataId: DataId): Promise<string | undefined> {
|
|
44
46
|
const dataStore = useDataStore();
|
|
45
|
-
const isViewable = await dataStore.isItemViewable(
|
|
47
|
+
const isViewable = await dataStore.isItemViewable(dataId);
|
|
46
48
|
if (!isViewable) {
|
|
47
49
|
return undefined;
|
|
48
50
|
}
|
|
49
|
-
const value = await dataStore.item(
|
|
51
|
+
const value = await dataStore.item(dataId);
|
|
50
52
|
return value.binary_light_viewable;
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -70,12 +72,12 @@ const useHybridViewerScene = createSharedComposable(() => {
|
|
|
70
72
|
const hybridDb = reactive<HybridDb>({});
|
|
71
73
|
const zScale = ref(1);
|
|
72
74
|
|
|
73
|
-
async function addItem(
|
|
75
|
+
async function addItem(dataId: DataId): Promise<void> {
|
|
74
76
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
75
77
|
if (!genericRenderWindow.value) {
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
const binaryLightViewable = await fetchBinaryLightViewable(
|
|
80
|
+
const binaryLightViewable = await fetchBinaryLightViewable(dataId);
|
|
79
81
|
if (binaryLightViewable === undefined) {
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
@@ -83,35 +85,35 @@ const useHybridViewerScene = createSharedComposable(() => {
|
|
|
83
85
|
const entry = createHybridDbEntry(binaryLightViewable, zScale.value);
|
|
84
86
|
const renderer = genericRenderWindow.value.getRenderer();
|
|
85
87
|
// Replacing an actor keeps the camera where the user left it
|
|
86
|
-
const isFirst = !hybridDb[
|
|
87
|
-
if (hybridDb[
|
|
88
|
-
renderer.removeActor(hybridDb[
|
|
88
|
+
const isFirst = !hybridDb[dataId] && renderer.getActors().length === 0;
|
|
89
|
+
if (hybridDb[dataId]) {
|
|
90
|
+
renderer.removeActor(hybridDb[dataId].actor);
|
|
89
91
|
}
|
|
90
92
|
renderer.addActor(entry.actor);
|
|
91
93
|
if (isFirst) {
|
|
92
94
|
renderer.resetCamera();
|
|
93
95
|
}
|
|
94
|
-
hybridDb[
|
|
96
|
+
hybridDb[dataId] = entry;
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
function removeItem(
|
|
99
|
+
function removeItem(dataId: DataId): void {
|
|
98
100
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
99
|
-
if (!hybridDb[
|
|
101
|
+
if (!hybridDb[dataId]) {
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
104
|
const renderer = requireRenderWindow(genericRenderWindow).getRenderer();
|
|
103
|
-
renderer.removeActor(hybridDb[
|
|
105
|
+
renderer.removeActor(hybridDb[dataId].actor);
|
|
104
106
|
const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
|
|
105
107
|
renderWindow.render();
|
|
106
|
-
Reflect.deleteProperty(hybridDb,
|
|
108
|
+
Reflect.deleteProperty(hybridDb, dataId);
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
function setVisibility(
|
|
111
|
+
function setVisibility(dataId: DataId, visibility: Visibility): void {
|
|
110
112
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
111
|
-
if (!hybridDb[
|
|
113
|
+
if (!hybridDb[dataId]) {
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
|
-
hybridDb[
|
|
116
|
+
hybridDb[dataId].actor.setVisibility(visibility);
|
|
115
117
|
const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
|
|
116
118
|
renderWindow.render();
|
|
117
119
|
}
|
|
@@ -155,8 +157,8 @@ const useHybridViewerScene = createSharedComposable(() => {
|
|
|
155
157
|
}
|
|
156
158
|
const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
|
|
157
159
|
renderWindow.render();
|
|
158
|
-
for (const
|
|
159
|
-
Reflect.deleteProperty(hybridDb,
|
|
160
|
+
for (const dataId of Object.keys(hybridDb)) {
|
|
161
|
+
Reflect.deleteProperty(hybridDb, dataId);
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelIdentified } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { Vector3 } from "@kitware/vtk.js/types";
|
|
2
3
|
import type vtkActor from "@kitware/vtk.js/Rendering/Core/Actor";
|
|
3
4
|
import type vtkPolyData from "@kitware/vtk.js/Common/DataModel/PolyData";
|
|
@@ -26,8 +27,7 @@ interface HoverComponentInfo {
|
|
|
26
27
|
type: string;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
interface HoverData {
|
|
30
|
-
modelId: string;
|
|
30
|
+
interface HoverData extends ModelIdentified {
|
|
31
31
|
modelName: string | undefined;
|
|
32
32
|
blockName: string | undefined;
|
|
33
33
|
pickedId: unknown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { FetchErrorLike, Microservice } from "./api_fetch.js";
|
|
1
2
|
import type { JsonRpcSchema, RequestHandlers } from "@ogw_shared/utils/types.js";
|
|
2
3
|
import { CHUNK_SIZE_BYTES } from "@ogw_shared/utils/file.js";
|
|
3
|
-
import type { Microservice } from "./api_fetch.js";
|
|
4
4
|
import { consola } from "consola";
|
|
5
5
|
import { fetchRaw } from "@ogw_shared/utils/fetch_raw.js";
|
|
6
6
|
import { uploadPath } from "@ogw_front/utils/upload_path";
|
|
@@ -15,12 +15,6 @@ interface UploadFileParams {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Loosely-typed shapes for the dynamic error/response values reported by fetchRaw.
|
|
18
|
-
interface FetchErrorLike {
|
|
19
|
-
code?: number;
|
|
20
|
-
message?: string;
|
|
21
|
-
stack?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
18
|
interface FetchErrorResponseLike {
|
|
25
19
|
status?: number;
|
|
26
20
|
name?: string;
|
package/package.json
CHANGED
|
@@ -7,13 +7,17 @@ import pTimeout from "p-timeout";
|
|
|
7
7
|
import type { RequestHandlers } from "./types.js";
|
|
8
8
|
import { hasBody } from "./file.js";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// What a fetch sends and where
|
|
11
|
+
interface FetchRequest {
|
|
11
12
|
route: string;
|
|
12
13
|
method?: string;
|
|
13
14
|
params?: unknown;
|
|
14
15
|
baseURL?: string;
|
|
15
|
-
headers?: Record<string, string>;
|
|
16
16
|
max_retry?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface FetchRawOptions extends FetchRequest {
|
|
20
|
+
headers?: Record<string, string>;
|
|
17
21
|
timeout?: number;
|
|
18
22
|
expectEvent?: boolean;
|
|
19
23
|
}
|
|
@@ -34,13 +38,8 @@ function resolveHeaders(
|
|
|
34
38
|
return resolvedHeaders;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
interface PerformFetchOptions extends RequestHandlers {
|
|
38
|
-
route: string;
|
|
39
|
-
method?: string;
|
|
40
|
-
params?: unknown;
|
|
41
|
-
baseURL?: string;
|
|
41
|
+
interface PerformFetchOptions extends FetchRequest, RequestHandlers {
|
|
42
42
|
headers: Record<string, string>;
|
|
43
|
-
max_retry?: number;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
async function performFetch({
|