@geode/opengeodeweb-front 11.2.2-rc.1 → 12.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build/shared/utils/response_handlers/load.js +5 -2
- package/.build/tests/browser/helpers/object_trees/main_object_tree.js +3 -3
- package/.build/tests/browser/helpers/object_trees/model_components_object_tree.js +2 -2
- package/.build/tests/browser/suites/model/surfaces.js +1 -1
- package/app/app.config.ts +28 -0
- package/app/assets/css/main.css +11 -0
- package/app/assets/geode_objects.ts +37 -108
- package/app/assets/img/geode_objects/HorizonStack3D.svg +10 -0
- package/app/components/ActionButton.vue +9 -2
- package/app/components/CameraManager/List.vue +6 -6
- package/app/components/CameraManager.vue +0 -1
- package/app/components/CameraOrientation.vue +12 -7
- package/app/components/ChromeTheme.vue +20 -0
- package/app/components/ClippingPlaneCard.vue +2 -3
- package/app/components/ClippingPlanes.vue +2 -2
- package/app/components/CrsSelector.vue +8 -8
- package/app/components/DeleteDialog.vue +12 -16
- package/app/components/DragAndDropInternal/DragAndDropInline.vue +7 -7
- package/app/components/DragAndDropInternal/DragAndDropOverlay.vue +87 -82
- package/app/components/ExtensionSelector.vue +21 -14
- package/app/components/FactorFilterPanel.vue +0 -1
- package/app/components/FeedBack/ErrorBanner.vue +8 -9
- package/app/components/FeedBack/Snackers.vue +5 -7
- package/app/components/FileUploader.vue +13 -21
- package/app/components/GlassCard.vue +3 -1
- package/app/components/HybridRenderingView.vue +2 -0
- package/app/components/HybridViewerTooltip.vue +4 -4
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading/EcoMessages.vue +17 -11
- package/app/components/Loading/Footer.vue +2 -2
- package/app/components/Loading/Header.vue +9 -4
- package/app/components/Loading/Progress.vue +7 -3
- package/app/components/Loading.vue +54 -46
- package/app/components/MissingFilesSelector.vue +5 -5
- package/app/components/ObjectSelector.vue +8 -15
- package/app/components/PackagesVersions.vue +1 -3
- package/app/components/ProjectCrs.vue +1 -1
- package/app/components/Screenshot.vue +23 -15
- package/app/components/SearchBar.vue +1 -3
- package/app/components/SliceCard.vue +1 -2
- package/app/components/Step.vue +1 -1
- package/app/components/Stepper.vue +13 -11
- package/app/components/ThresholdCard.vue +1 -1
- package/app/components/ThresholdFilter.vue +2 -2
- package/app/components/TimeSeriesTargetSelector.vue +3 -6
- package/app/components/ToolPanel.vue +3 -9
- package/app/components/Viewer/Basemap/CropOptions.vue +1 -1
- package/app/components/Viewer/Basemap/OpacityOptions.vue +1 -1
- package/app/components/Viewer/ContextMenu/CenterButton.vue +9 -3
- package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -1
- package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +17 -6
- package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -13
- package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +12 -9
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +2 -2
- package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +12 -9
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +1 -1
- package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +12 -9
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +12 -8
- package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +12 -9
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +1 -1
- package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +12 -9
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +16 -17
- package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +11 -6
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +11 -6
- package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +7 -8
- package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +7 -8
- package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +9 -10
- package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +9 -10
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +2 -2
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +1 -1
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -4
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -17
- package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +4 -4
- package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +1 -1
- package/app/components/Viewer/ObjectTree/Base/Controls.vue +22 -18
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +11 -11
- package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +3 -3
- package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -9
- package/app/components/Viewer/ObjectTree/Box.vue +20 -21
- package/app/components/Viewer/ObjectTree/Layout.vue +28 -25
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +4 -3
- package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +1 -1
- package/app/components/Viewer/Options/AttributeRangeSelector.vue +1 -1
- package/app/components/Viewer/Options/AttributeSelector.vue +1 -1
- package/app/components/Viewer/Options/ColorMapList.vue +7 -9
- package/app/components/Viewer/Options/ColorMapPicker.vue +2 -2
- package/app/components/Viewer/Options/ColorPicker.vue +9 -9
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +9 -9
- package/app/components/Viewer/Options/NoDataColorInfo.vue +4 -4
- package/app/components/Viewer/Options/Sliders/Opacity.vue +1 -1
- package/app/components/Viewer/Options/Sliders/Slider.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +11 -8
- package/app/components/Viewer/Options/TexturesSelector.vue +3 -3
- package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
- package/app/components/Viewer/OrientationCompass.vue +223 -0
- package/app/components/Viewer/OrientationGlobe.vue +376 -0
- package/app/components/Viewer/OrientationOverlay.vue +47 -0
- package/app/components/Viewer/OverlappingObjectsPicker.vue +10 -7
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +4 -5
- package/app/components/Viewer/Scene/BackgroundOptions.vue +3 -3
- package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +1 -1
- package/app/components/Viewer/Scene/TextOptions.vue +3 -3
- package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +12 -12
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +1 -1
- package/app/components/Viewer/Surface/PolygonsColoring.vue +12 -12
- package/app/components/Viewer/Surface/PolygonsOptions.vue +1 -1
- package/app/components/Viewer/ToolActiveChip.vue +1 -1
- package/app/components/Viewer/Ui.vue +2 -2
- package/app/components/csv-preview/CsvPreviewer.vue +17 -24
- package/app/components/csv-preview/CsvSettings.vue +6 -6
- package/app/components/csv-preview/CsvTable.vue +11 -9
- package/app/composables/attribute_selector.ts +1 -1
- package/app/composables/batch_style.ts +3 -3
- package/app/composables/batch_style_model.ts +1 -1
- package/app/composables/chrome_theme.ts +23 -0
- package/app/composables/clipping_slices.ts +2 -1
- package/app/composables/hover_highlight.ts +10 -7
- package/app/composables/live_data_item.ts +1 -1
- package/app/composables/model_menu_context.ts +11 -4
- package/app/composables/orientation_overlay.ts +133 -0
- package/app/composables/project_manager_helpers/reset.ts +2 -0
- package/app/composables/project_manager_helpers/types.ts +2 -2
- package/app/composables/use_adaptive_styles.ts +42 -21
- package/app/composables/use_overlapping_picker.ts +10 -8
- package/app/composables/view_toolbar_options.ts +7 -7
- package/app/composables/view_toolbar_tool_options.ts +9 -11
- package/app/composables/viewer_context_menu.ts +4 -2
- package/app/composables/viewer_reset.ts +54 -0
- package/app/plugins/chrome_theme.ts +10 -0
- package/app/plugins/phosphor_icons.ts +13 -0
- package/app/plugins/scene_colors.ts +10 -0
- package/app/stores/basemap_helpers/builds.ts +2 -2
- package/app/stores/basemap_helpers/viewer.ts +1 -1
- package/app/stores/crs.ts +12 -12
- package/app/stores/data.ts +4 -5
- package/app/stores/data_helpers/mesh.ts +2 -1
- package/app/stores/data_style.ts +4 -3
- package/app/stores/hybrid_viewer.ts +5 -3
- package/app/stores/menu.ts +18 -12
- package/app/stores/treeview.ts +5 -4
- package/app/stores/viewer.ts +2 -0
- package/app/types/attribute.ts +5 -21
- package/app/types/identifiers.ts +5 -15
- package/app/utils/attribute_range.ts +1 -1
- package/app/utils/attributes.ts +2 -1
- package/app/utils/clipping_planes.ts +1 -1
- package/app/utils/color_picker.ts +3 -3
- package/app/utils/crs.ts +6 -6
- package/app/utils/default_styles/constants.ts +17 -22
- package/app/utils/default_styles/index.ts +24 -3
- package/app/utils/default_styles/mesh_components.ts +15 -11
- package/app/utils/default_styles/meshes.ts +1 -1
- package/app/utils/default_styles/model_components.ts +14 -10
- package/app/utils/default_styles/models.ts +1 -1
- package/app/utils/import_workflow.ts +3 -1
- package/app/utils/legacy_data_id.ts +2 -1
- package/app/utils/orientation_compass.ts +103 -0
- package/app/utils/orientation_gizmo.ts +73 -0
- package/app/utils/orientation_globe.ts +145 -0
- package/app/utils/orientation_strata.ts +119 -0
- package/app/utils/phosphor_icons.ts +105 -0
- package/app/utils/slice.ts +2 -1
- package/app/utils/threshold_sources.ts +1 -1
- package/internal/stores/data_style/attribute_types.ts +6 -6
- package/internal/stores/data_style/mesh/base_style.ts +6 -7
- package/internal/stores/data_style/mesh/cells/cell.ts +6 -6
- package/internal/stores/data_style/mesh/cells/cell_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/cells/cell_config.ts +5 -6
- package/internal/stores/data_style/mesh/cells/color.ts +6 -6
- package/internal/stores/data_style/mesh/cells/opacity.ts +3 -4
- package/internal/stores/data_style/mesh/cells/vertex.ts +6 -6
- package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/cells/vertex_config.ts +5 -6
- package/internal/stores/data_style/mesh/cells/visibility.ts +1 -1
- package/internal/stores/data_style/mesh/edges/color.ts +6 -6
- package/internal/stores/data_style/mesh/edges/edge.ts +6 -6
- package/internal/stores/data_style/mesh/edges/edge_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/edges/edge_config.ts +5 -6
- package/internal/stores/data_style/mesh/edges/opacity.ts +3 -4
- package/internal/stores/data_style/mesh/edges/vertex.ts +6 -6
- package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/edges/vertex_config.ts +5 -6
- package/internal/stores/data_style/mesh/edges/visibility.ts +1 -1
- package/internal/stores/data_style/mesh/edges/width.ts +6 -6
- package/internal/stores/data_style/mesh/index.ts +3 -4
- package/internal/stores/data_style/mesh/points/color.ts +6 -6
- package/internal/stores/data_style/mesh/points/common.ts +1 -1
- package/internal/stores/data_style/mesh/points/opacity.ts +3 -4
- package/internal/stores/data_style/mesh/points/size.ts +6 -6
- package/internal/stores/data_style/mesh/points/vertex.ts +6 -6
- package/internal/stores/data_style/mesh/points/vertex_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/points/vertex_config.ts +5 -6
- package/internal/stores/data_style/mesh/points/visibility.ts +1 -1
- package/internal/stores/data_style/mesh/polygons/color.ts +6 -6
- package/internal/stores/data_style/mesh/polygons/opacity.ts +3 -4
- package/internal/stores/data_style/mesh/polygons/polygon.ts +6 -6
- package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/polygon_config.ts +5 -6
- package/internal/stores/data_style/mesh/polygons/vertex.ts +6 -6
- package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/vertex_config.ts +5 -6
- package/internal/stores/data_style/mesh/polygons/visibility.ts +1 -1
- package/internal/stores/data_style/mesh/polyhedra/color.ts +6 -6
- package/internal/stores/data_style/mesh/polyhedra/opacity.ts +3 -4
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +6 -6
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +5 -6
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +6 -6
- package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +8 -6
- package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +5 -6
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +1 -1
- package/internal/stores/data_style/model/blocks/color.ts +6 -6
- package/internal/stores/data_style/model/blocks/coloring_groups.ts +2 -2
- package/internal/stores/data_style/model/blocks/polyhedron.ts +12 -9
- package/internal/stores/data_style/model/blocks/vertex.ts +12 -9
- package/internal/stores/data_style/model/blocks/visibility.ts +1 -1
- package/internal/stores/data_style/model/color.ts +10 -11
- package/internal/stores/data_style/model/common.ts +3 -4
- package/internal/stores/data_style/model/corners/color.ts +6 -6
- package/internal/stores/data_style/model/corners/index.ts +2 -2
- package/internal/stores/data_style/model/corners/vertex.ts +12 -9
- package/internal/stores/data_style/model/corners/visibility.ts +1 -1
- package/internal/stores/data_style/model/edges/component.ts +13 -13
- package/internal/stores/data_style/model/edges/visibility.ts +1 -1
- package/internal/stores/data_style/model/edges/width.ts +6 -6
- package/internal/stores/data_style/model/lines/color.ts +6 -6
- package/internal/stores/data_style/model/lines/coloring_groups.ts +2 -2
- package/internal/stores/data_style/model/lines/edge.ts +12 -9
- package/internal/stores/data_style/model/lines/vertex.ts +12 -9
- package/internal/stores/data_style/model/lines/visibility.ts +1 -1
- package/internal/stores/data_style/model/points/component.ts +17 -13
- package/internal/stores/data_style/model/points/index.ts +2 -2
- package/internal/stores/data_style/model/points/size.ts +6 -6
- package/internal/stores/data_style/model/points/visibility.ts +1 -1
- package/internal/stores/data_style/model/surfaces/color.ts +6 -6
- package/internal/stores/data_style/model/surfaces/coloring_groups.ts +2 -2
- package/internal/stores/data_style/model/surfaces/polygon.ts +12 -9
- package/internal/stores/data_style/model/surfaces/vertex.ts +12 -9
- package/internal/stores/data_style/model/surfaces/visibility.ts +1 -1
- package/internal/stores/data_style/model/visibility.ts +1 -1
- package/internal/stores/data_style/scene.ts +31 -19
- package/internal/stores/data_style/time_step.ts +3 -2
- package/internal/stores/data_style/types.ts +3 -4
- package/internal/stores/hybrid_viewer/brightness.ts +14 -7
- package/internal/stores/hybrid_viewer/camera.ts +1 -1
- package/internal/stores/hybrid_viewer/constants.ts +1 -12
- package/internal/stores/hybrid_viewer/filters.ts +2 -2
- package/internal/stores/hybrid_viewer/highlight.ts +2 -1
- package/internal/stores/hybrid_viewer/scene.ts +11 -4
- package/nuxt.config.ts +9 -1
- package/package.json +4 -2
- package/shared/utils/response_handlers/load.ts +19 -11
- package/tests/browser/helpers/object_trees/main_object_tree.ts +3 -3
- package/tests/browser/helpers/object_trees/model_components_object_tree.ts +2 -2
- package/tests/browser/suites/model/surfaces.ts +1 -1
- package/tests/unit/helpers/phosphor_glyphs.ts +46 -0
- package/app/assets/viewer_svgs/camera-bookmark.svg +0 -64
- package/app/types/style.ts +0 -13
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MaybeComputedElementRef } from "@vueuse/core";
|
|
2
2
|
import { consola } from "consola";
|
|
3
3
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
4
|
+
import { useTheme } from "vuetify";
|
|
4
5
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
5
6
|
|
|
6
7
|
const LUMINANCE_THRESHOLD = 0.65;
|
|
@@ -14,6 +15,8 @@ const MAX_OPACITY = 0.5;
|
|
|
14
15
|
|
|
15
16
|
const MIN_BOOST = 1;
|
|
16
17
|
const MAX_BOOST = 1.2;
|
|
18
|
+
// On a dark theme the glass carries light text: the backdrop is dimmed instead of boosted
|
|
19
|
+
const MIN_DIM = 0.8;
|
|
17
20
|
const ADAPTIVE_REFRESH_RATE = 150;
|
|
18
21
|
|
|
19
22
|
// `target` is intentionally duck-typed: callers pass either a coordinates source (a plain object, a Ref/ComputedRef of one, or a getter function returning one) or an element ref/template ref destined for vueuse's useElementBounding - see call sites in Viewer/ContextMenu and Viewer/ObjectTree components.
|
|
@@ -58,16 +61,49 @@ function getValue(val: unknown): number {
|
|
|
58
61
|
return typeof val === "number" ? val : 0;
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
// How much the glass has to cover its backdrop to keep the text readable: dark text (light theme)
|
|
65
|
+
// Needs it over a dark backdrop, light text (dark theme) over a bright one. Same curve both ways.
|
|
66
|
+
function contrastFactor(brightness: number, isDark: boolean): number {
|
|
67
|
+
const backdrop = isDark ? 1 - brightness : brightness;
|
|
68
|
+
const normalized = Math.min(1, backdrop / LUMINANCE_THRESHOLD);
|
|
69
|
+
return (1 - normalized) ** ADAPTIVE_EXPONENT;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface GlassStyles {
|
|
73
|
+
"--adaptive-blur": string;
|
|
74
|
+
"--adaptive-opacity": number;
|
|
75
|
+
"--adaptive-brightness": number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function useGlassStyles(
|
|
79
|
+
brightness: Ref<number>,
|
|
80
|
+
options: AdaptiveStylesOptions,
|
|
81
|
+
): ComputedRef<GlassStyles> {
|
|
82
|
+
const theme = useTheme();
|
|
83
|
+
return computed(() => {
|
|
84
|
+
const isDark = theme.current.value.dark;
|
|
85
|
+
const factor = contrastFactor(brightness.value, isDark);
|
|
86
|
+
const blur = MIN_BLUR + factor * (MAX_BLUR - MIN_BLUR);
|
|
87
|
+
const minOpacity = options.minOpacity ?? MIN_OPACITY;
|
|
88
|
+
const maxOpacity = options.maxOpacity ?? MAX_OPACITY;
|
|
89
|
+
const opacity = minOpacity + factor * (maxOpacity - minOpacity);
|
|
90
|
+
const brightnessBoost = isDark
|
|
91
|
+
? MIN_BOOST - factor * (MIN_BOOST - MIN_DIM)
|
|
92
|
+
: MIN_BOOST + factor * (MAX_BOOST - MIN_BOOST);
|
|
93
|
+
return {
|
|
94
|
+
"--adaptive-blur": `${blur}px`,
|
|
95
|
+
"--adaptive-opacity": opacity,
|
|
96
|
+
"--adaptive-brightness": brightnessBoost,
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
61
101
|
// oxlint-disable max-lines-per-function
|
|
62
102
|
export function useAdaptiveStyles(
|
|
63
103
|
target: AdaptiveStylesTarget,
|
|
64
104
|
options: AdaptiveStylesOptions = {},
|
|
65
105
|
): {
|
|
66
|
-
adaptiveStyles: ComputedRef<
|
|
67
|
-
"--adaptive-blur": string;
|
|
68
|
-
"--adaptive-opacity": number;
|
|
69
|
-
"--adaptive-brightness": number;
|
|
70
|
-
}>;
|
|
106
|
+
adaptiveStyles: ComputedRef<GlassStyles>;
|
|
71
107
|
brightness: Ref<number>;
|
|
72
108
|
} {
|
|
73
109
|
const hybridViewerStore = useHybridViewerStore();
|
|
@@ -164,22 +200,7 @@ export function useAdaptiveStyles(
|
|
|
164
200
|
|
|
165
201
|
watch(() => treeviewStore.opened_views, forceRefresh, { deep: true });
|
|
166
202
|
|
|
167
|
-
const adaptiveStyles =
|
|
168
|
-
const normalized = Math.min(1, brightness.value / LUMINANCE_THRESHOLD);
|
|
169
|
-
const darkFactor = (1 - normalized) ** ADAPTIVE_EXPONENT;
|
|
170
|
-
|
|
171
|
-
const blur = MIN_BLUR + darkFactor * (MAX_BLUR - MIN_BLUR);
|
|
172
|
-
const minOpacity = options.minOpacity ?? MIN_OPACITY;
|
|
173
|
-
const maxOpacity = options.maxOpacity ?? MAX_OPACITY;
|
|
174
|
-
const opacity = minOpacity + darkFactor * (maxOpacity - minOpacity);
|
|
175
|
-
const brightnessBoost = MIN_BOOST + darkFactor * (MAX_BOOST - MIN_BOOST);
|
|
176
|
-
|
|
177
|
-
return {
|
|
178
|
-
"--adaptive-blur": `${blur}px`,
|
|
179
|
-
"--adaptive-opacity": opacity,
|
|
180
|
-
"--adaptive-brightness": brightnessBoost,
|
|
181
|
-
};
|
|
182
|
-
});
|
|
203
|
+
const adaptiveStyles = useGlassStyles(brightness, options);
|
|
183
204
|
|
|
184
205
|
return {
|
|
185
206
|
adaptiveStyles,
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
3
3
|
|
|
4
|
+
import { type DataItem, useDataStore } from "@ogw_front/stores/data";
|
|
4
5
|
import type {
|
|
5
|
-
DataIdentified,
|
|
6
6
|
GeodeObjectType,
|
|
7
7
|
ViewerObjectType,
|
|
8
|
-
} from "@
|
|
9
|
-
import
|
|
8
|
+
} from "@geode/opengeodeweb-microservice/data_types";
|
|
9
|
+
import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
10
|
+
import type { DataIdentified } from "@ogw_front/types/identifiers";
|
|
11
|
+
import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
|
|
10
12
|
import { computeMenuPosition } from "@ogw_front/composables/overlapping_picker_menu";
|
|
11
13
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
12
14
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
13
15
|
|
|
14
16
|
interface PickedItem {
|
|
15
|
-
id:
|
|
16
|
-
viewer_id:
|
|
17
|
+
id: DataId;
|
|
18
|
+
viewer_id: ViewerId | undefined;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
interface ProposedItem extends DataIdentified {
|
|
20
|
-
viewer_id:
|
|
22
|
+
viewer_id: ViewerId | undefined;
|
|
21
23
|
name: string;
|
|
22
24
|
viewer_object_type: ViewerObjectType | undefined;
|
|
23
25
|
geode_object_type: GeodeObjectType | undefined;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
interface ViewerIdResult {
|
|
27
|
-
id:
|
|
28
|
-
viewer_id:
|
|
29
|
+
id: DataId | undefined;
|
|
30
|
+
viewer_id: ViewerId | undefined;
|
|
29
31
|
// True when objects were under the cursor but the user closed the picker without choosing
|
|
30
32
|
dismissed?: boolean;
|
|
31
33
|
}
|
|
@@ -20,7 +20,7 @@ function pickingOptions(
|
|
|
20
20
|
{
|
|
21
21
|
testId: "resetCameraButton",
|
|
22
22
|
tooltip: "Reset camera",
|
|
23
|
-
icon: "
|
|
23
|
+
icon: "ph-cube-focus",
|
|
24
24
|
action: (): void => {
|
|
25
25
|
hybridViewerStore.resetCamera();
|
|
26
26
|
},
|
|
@@ -28,7 +28,7 @@ function pickingOptions(
|
|
|
28
28
|
{
|
|
29
29
|
testId: "centerOnClickButton",
|
|
30
30
|
tooltip: "Center on click",
|
|
31
|
-
icon: "
|
|
31
|
+
icon: "ph-crosshair-simple",
|
|
32
32
|
color: hybridViewerStore.is_picking ? "primary" : undefined,
|
|
33
33
|
action: (): void => {
|
|
34
34
|
tools.toggleTool(tools.is_picking);
|
|
@@ -37,7 +37,7 @@ function pickingOptions(
|
|
|
37
37
|
{
|
|
38
38
|
testId: "zoomToBoxButton",
|
|
39
39
|
tooltip: "Zoom to box",
|
|
40
|
-
icon: "
|
|
40
|
+
icon: "ph-magnifying-glass-plus",
|
|
41
41
|
color: hybridViewerStore.is_zoom_box_active ? "primary" : undefined,
|
|
42
42
|
action: (): void => {
|
|
43
43
|
tools.toggleTool(tools.is_zoom_box_active);
|
|
@@ -53,14 +53,14 @@ function hoverHighlightOption(
|
|
|
53
53
|
return {
|
|
54
54
|
testId: "highlightOnHoverButton",
|
|
55
55
|
tooltip: "Highlight on hover",
|
|
56
|
-
icon: "
|
|
56
|
+
icon: "ph-cursor-click",
|
|
57
57
|
color: hybridViewerStore.is_hover_highlight ? "primary" : undefined,
|
|
58
58
|
action: hybridViewerStore.is_hover_highlight ? tools.stopHoverHighlight : undefined,
|
|
59
59
|
menu: [
|
|
60
60
|
{
|
|
61
61
|
title: "Cells",
|
|
62
62
|
testId: "highlightOnHoverCellsButton",
|
|
63
|
-
icon: "
|
|
63
|
+
icon: "ph-selection-all",
|
|
64
64
|
action: (): void => {
|
|
65
65
|
tools.toggleHoverHighlight("CELL");
|
|
66
66
|
},
|
|
@@ -68,7 +68,7 @@ function hoverHighlightOption(
|
|
|
68
68
|
{
|
|
69
69
|
title: "Points",
|
|
70
70
|
testId: "highlightOnHoverPointsButton",
|
|
71
|
-
icon: "
|
|
71
|
+
icon: "ph-selection",
|
|
72
72
|
action: (): void => {
|
|
73
73
|
tools.toggleHoverHighlight("POINT");
|
|
74
74
|
},
|
|
@@ -85,7 +85,7 @@ function gridScaleOption(
|
|
|
85
85
|
return {
|
|
86
86
|
testId: "gridScaleButton",
|
|
87
87
|
tooltip: "Toggle grid scale",
|
|
88
|
-
icon: "
|
|
88
|
+
icon: "ph-grid-four",
|
|
89
89
|
color: gridScale.value ? "primary" : undefined,
|
|
90
90
|
action: (): void => {
|
|
91
91
|
const schema = schemas.opengeodeweb_viewer.viewer.grid_scale;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import CameraBookmarkIcon from "@ogw_front/assets/viewer_svgs/camera-bookmark.svg";
|
|
2
1
|
import type { ViewToolbarTools } from "@ogw_front/composables/view_toolbar_tools";
|
|
3
2
|
|
|
4
3
|
interface CameraOptionAction {
|
|
@@ -18,7 +17,7 @@ function panelOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
18
17
|
{
|
|
19
18
|
testId: "cameraOrientationButton",
|
|
20
19
|
tooltip: "Camera orientation",
|
|
21
|
-
icon: "
|
|
20
|
+
icon: "ph-arrows-clockwise",
|
|
22
21
|
action: (): void => {
|
|
23
22
|
tools.toggleTool(tools.showCameraOrientation);
|
|
24
23
|
},
|
|
@@ -26,8 +25,7 @@ function panelOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
26
25
|
{
|
|
27
26
|
testId: "cameraManagerButton",
|
|
28
27
|
tooltip: "Manage camera positions",
|
|
29
|
-
icon:
|
|
30
|
-
iconSize: 34,
|
|
28
|
+
icon: "ph-video-camera",
|
|
31
29
|
action: (): void => {
|
|
32
30
|
tools.toggleTool(tools.showCameraManager);
|
|
33
31
|
},
|
|
@@ -35,7 +33,7 @@ function panelOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
35
33
|
{
|
|
36
34
|
testId: "screenshotButton",
|
|
37
35
|
tooltip: "Take a screenshot",
|
|
38
|
-
icon: "
|
|
36
|
+
icon: "ph-camera",
|
|
39
37
|
action: (): void => {
|
|
40
38
|
tools.toggleTool(tools.showScreenshot);
|
|
41
39
|
},
|
|
@@ -49,7 +47,7 @@ function controlOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
49
47
|
{
|
|
50
48
|
testId: "zScalingButton",
|
|
51
49
|
tooltip: "Z Scaling Control",
|
|
52
|
-
icon: "
|
|
50
|
+
icon: "ph-arrows-down-up",
|
|
53
51
|
action: (): void => {
|
|
54
52
|
tools.toggleTool(tools.showZScaling);
|
|
55
53
|
},
|
|
@@ -57,7 +55,7 @@ function controlOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
57
55
|
{
|
|
58
56
|
testId: "clippingPlanesButton",
|
|
59
57
|
tooltip: "Clipping Planes",
|
|
60
|
-
icon: "
|
|
58
|
+
icon: "ph-scissors",
|
|
61
59
|
color: tools.showClippingPlanes.value ? "primary" : undefined,
|
|
62
60
|
action: (): void => {
|
|
63
61
|
tools.toggleTool(tools.showClippingPlanes);
|
|
@@ -72,7 +70,7 @@ function filterOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
72
70
|
{
|
|
73
71
|
testId: "shrinkFilterButton",
|
|
74
72
|
tooltip: "Shrink Filter",
|
|
75
|
-
icon: "
|
|
73
|
+
icon: "ph-arrows-in",
|
|
76
74
|
color: tools.showShrinkFilter.value ? "primary" : undefined,
|
|
77
75
|
action: (): void => {
|
|
78
76
|
tools.toggleTool(tools.showShrinkFilter);
|
|
@@ -81,7 +79,7 @@ function filterOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
81
79
|
{
|
|
82
80
|
testId: "explodeFilterButton",
|
|
83
81
|
tooltip: "Exploded View",
|
|
84
|
-
icon: "
|
|
82
|
+
icon: "ph-arrows-out",
|
|
85
83
|
color: tools.showExplodeFilter.value ? "primary" : undefined,
|
|
86
84
|
action: (): void => {
|
|
87
85
|
tools.toggleTool(tools.showExplodeFilter);
|
|
@@ -90,7 +88,7 @@ function filterOptions(tools: ViewToolbarTools): CameraOptionAction[] {
|
|
|
90
88
|
{
|
|
91
89
|
testId: "thresholdFilterButton",
|
|
92
90
|
tooltip: "Threshold Filter",
|
|
93
|
-
icon: "
|
|
91
|
+
icon: "ph-funnel-simple",
|
|
94
92
|
color: tools.showThresholdFilter.value ? "primary" : undefined,
|
|
95
93
|
action: (): void => {
|
|
96
94
|
tools.toggleTool(tools.showThresholdFilter);
|
|
@@ -103,7 +101,7 @@ function rulerOption(tools: ViewToolbarTools): CameraOptionAction {
|
|
|
103
101
|
return {
|
|
104
102
|
testId: "rulerButton",
|
|
105
103
|
tooltip: "Ruler",
|
|
106
|
-
icon: "
|
|
104
|
+
icon: "ph-ruler",
|
|
107
105
|
color: tools.showRuler.value ? "primary" : undefined,
|
|
108
106
|
action: (): void => {
|
|
109
107
|
tools.toggleTool(tools.showRuler);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type MenuMetaData, useMenuStore } from "@ogw_front/stores/menu";
|
|
2
2
|
import type { Ref, ShallowRef } from "vue";
|
|
3
3
|
import { BASEMAP_GROUP_ID } from "@ogw_front/utils/basemap_tree";
|
|
4
|
+
import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
4
5
|
import type { TreeMenuPayload } from "@ogw_front/utils/treeview";
|
|
6
|
+
import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
|
|
5
7
|
import type { ViewerIdResult } from "@ogw_front/composables/use_overlapping_picker";
|
|
6
8
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
7
9
|
import { useElementSize } from "@vueuse/core";
|
|
@@ -69,8 +71,8 @@ async function treeMenuTarget(
|
|
|
69
71
|
|
|
70
72
|
async function viewerMenuTarget(
|
|
71
73
|
dataStore: ReturnType<typeof useDataStore>,
|
|
72
|
-
pickedId:
|
|
73
|
-
viewer_id:
|
|
74
|
+
pickedId: DataId,
|
|
75
|
+
viewer_id: ViewerId | undefined,
|
|
74
76
|
): Promise<MenuTarget> {
|
|
75
77
|
const item = await dataStore.item(pickedId);
|
|
76
78
|
const meta_data: MenuMetaData = { ...item };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ColorRGB, ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
|
|
2
|
+
import type { ViewerRequest } from "@ogw_front/stores/viewer_helpers/request";
|
|
3
|
+
// Third party imports
|
|
4
|
+
import { consola } from "consola";
|
|
5
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
6
|
+
|
|
7
|
+
// Local imports
|
|
8
|
+
import { getDefaultSceneStyle, getSceneColors } from "@ogw_front/utils/default_styles";
|
|
9
|
+
import {
|
|
10
|
+
hideViewerMarker,
|
|
11
|
+
resetOrientationMarkerVisibility,
|
|
12
|
+
} from "@ogw_front/composables/orientation_overlay";
|
|
13
|
+
|
|
14
|
+
// The scene colors of the viewer have no alpha (the text one takes it as its opacity)
|
|
15
|
+
function toViewerColor({ red, green, blue }: ColorRGBA): ColorRGB {
|
|
16
|
+
return { red, green, blue };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// A reset viewer draws its own scene colors: give it the app's (`ogwFront.sceneColors`), which the default
|
|
20
|
+
// Scene style shows
|
|
21
|
+
async function applyAppSceneColors(request: ViewerRequest): Promise<void> {
|
|
22
|
+
const sceneColors = getSceneColors();
|
|
23
|
+
const { background_color, text } = getDefaultSceneStyle();
|
|
24
|
+
if (sceneColors.background) {
|
|
25
|
+
await request({
|
|
26
|
+
schema: viewer_schemas.opengeodeweb_viewer.viewer.set_background_color,
|
|
27
|
+
params: { color: toViewerColor(background_color) },
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (sceneColors.text) {
|
|
31
|
+
await request({
|
|
32
|
+
schema: viewer_schemas.opengeodeweb_viewer.viewer.set_text_style,
|
|
33
|
+
params: {
|
|
34
|
+
color: toViewerColor(text.color),
|
|
35
|
+
font_family: text.font_family,
|
|
36
|
+
opacity: text.color.alpha,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// To call after each viewer reset (reset_visualization), which brings back the viewer's own scene. Neither
|
|
43
|
+
// Step fails the reset: the viewer stays usable with its own colors, and the marker is hidden either way
|
|
44
|
+
async function afterViewerReset(request: ViewerRequest): Promise<void> {
|
|
45
|
+
resetOrientationMarkerVisibility();
|
|
46
|
+
try {
|
|
47
|
+
await applyAppSceneColors(request);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
consola.warn("[SceneColors] The viewer kept its own scene colors:", error);
|
|
50
|
+
}
|
|
51
|
+
await hideViewerMarker(request);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { afterViewerReset, toViewerColor };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CHROME_THEME_KEY, DEFAULT_CHROME_THEME } from "@ogw_front/composables/chrome_theme";
|
|
2
|
+
|
|
3
|
+
// Hands `ogwFront.chromeTheme` (app.config.ts) to the whole Vue app, see composables/chrome_theme.ts
|
|
4
|
+
export default defineNuxtPlugin({
|
|
5
|
+
name: "ogw-chrome-theme",
|
|
6
|
+
setup(nuxtApp) {
|
|
7
|
+
const chromeTheme = useAppConfig().ogwFront?.chromeTheme ?? DEFAULT_CHROME_THEME;
|
|
8
|
+
nuxtApp.vueApp.provide(CHROME_THEME_KEY, chromeTheme);
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { phosphorIconOptions } from "@ogw_front/utils/phosphor_icons";
|
|
2
|
+
|
|
3
|
+
// Vuetify-nuxt-module only takes serializable icon options in nuxt.config (where its own icon sets
|
|
4
|
+
// Are disabled), so the component based Phosphor set is registered here, before Vuetify is created
|
|
5
|
+
export default defineNuxtPlugin({
|
|
6
|
+
name: "ogw-phosphor-icons",
|
|
7
|
+
enforce: "pre",
|
|
8
|
+
setup(nuxtApp) {
|
|
9
|
+
nuxtApp.hook("vuetify:before-create", ({ vuetifyOptions }) => {
|
|
10
|
+
vuetifyOptions.icons = phosphorIconOptions();
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { setSceneColors } from "@ogw_front/utils/default_styles";
|
|
2
|
+
|
|
3
|
+
// Hands `ogwFront.sceneColors` (app.config.ts) to the default scene style, before any data style store is created
|
|
4
|
+
export default defineNuxtPlugin({
|
|
5
|
+
name: "ogw-scene-colors",
|
|
6
|
+
enforce: "pre",
|
|
7
|
+
setup() {
|
|
8
|
+
setSceneColors(useAppConfig().ogwFront?.sceneColors ?? {});
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type MapStyle, sortedMaps } from "@ogw_front/utils/basemap_tree";
|
|
2
2
|
import back_schemas, {
|
|
3
3
|
type BasemapBuildResponse,
|
|
4
|
-
type CRSList,
|
|
5
4
|
} from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
6
5
|
import { ignoreError, useBasemapViewer } from "./viewer.js";
|
|
7
6
|
import type { BasemapLayers } from "./layers.js";
|
|
7
|
+
import type { CRS } from "@geode/opengeodeweb-back/schema_types";
|
|
8
8
|
import type { Extent } from "./extent.js";
|
|
9
9
|
import type { Ref } from "vue";
|
|
10
10
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
@@ -73,7 +73,7 @@ function useBasemapBuilds(
|
|
|
73
73
|
await hybridViewerStore.remoteRender();
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
async function display(build: number, extent: Extent, crs:
|
|
76
|
+
async function display(build: number, extent: Extent, crs: CRS): Promise<void> {
|
|
77
77
|
const response = await backStore.request({
|
|
78
78
|
schema: back_schemas.opengeodeweb_back.basemap.build,
|
|
79
79
|
params: { maps: [...maps.value], crs, ...extent },
|
|
@@ -2,7 +2,7 @@ import back_schemas, {
|
|
|
2
2
|
type BasemapBuildResponse,
|
|
3
3
|
} from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
4
4
|
import type { MapStyle } from "@ogw_front/utils/basemap_tree";
|
|
5
|
-
import type { Opacity } from "@
|
|
5
|
+
import type { Opacity } from "@geode/opengeodeweb-viewer/schema_types";
|
|
6
6
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
7
7
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
8
8
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
package/app/stores/crs.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { DataId, GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
2
|
-
import back_schemas, {
|
|
3
|
-
type CRSList,
|
|
4
|
-
} from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
5
1
|
import { oldestCrs, sameCrs } from "@ogw_front/utils/crs";
|
|
2
|
+
import type { CRS } from "@geode/opengeodeweb-back/schema_types";
|
|
3
|
+
import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
4
|
+
import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
|
|
5
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
6
6
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
7
7
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
8
8
|
|
|
@@ -11,12 +11,12 @@ import { useDataStore } from "@ogw_front/stores/data";
|
|
|
11
11
|
export const useCrsStore = defineStore("crs", () => {
|
|
12
12
|
const backStore = useBackStore();
|
|
13
13
|
// OpenGeode geosciences lists the same geographic CRS for 2D and 3D data: one list for all types
|
|
14
|
-
let geographicListPromise: Promise<
|
|
14
|
+
let geographicListPromise: Promise<CRS[]> | undefined = undefined;
|
|
15
15
|
const crsEditEnabled = ref(false);
|
|
16
16
|
const crsEditRequest = ref<string | undefined>(undefined);
|
|
17
17
|
const dataStore = useDataStore();
|
|
18
18
|
const crsItems = dataStore.refCrsItems();
|
|
19
|
-
const projectCrs = ref<
|
|
19
|
+
const projectCrs = ref<CRS | undefined>(undefined);
|
|
20
20
|
const projectCrsEditRequest = ref(false);
|
|
21
21
|
|
|
22
22
|
// The project follows its data: once every georeferenced data is in one CRS, it is the project
|
|
@@ -44,7 +44,7 @@ export const useCrsStore = defineStore("crs", () => {
|
|
|
44
44
|
// Data without CRS are listed too (value undefined): they could not follow the project
|
|
45
45
|
const mismatchedCrs = computed(() => {
|
|
46
46
|
const project = projectCrs.value;
|
|
47
|
-
const mismatched = new Map<string,
|
|
47
|
+
const mismatched = new Map<string, CRS | undefined>();
|
|
48
48
|
for (const item of crsItems.value) {
|
|
49
49
|
if (project !== undefined && !sameCrs(item.crs, project)) {
|
|
50
50
|
mismatched.set(item.data_id, item.crs);
|
|
@@ -53,7 +53,7 @@ export const useCrsStore = defineStore("crs", () => {
|
|
|
53
53
|
return mismatched;
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
async function fetchGeographicList(geodeObjectType: GeodeObjectType): Promise<
|
|
56
|
+
async function fetchGeographicList(geodeObjectType: GeodeObjectType): Promise<CRS[]> {
|
|
57
57
|
try {
|
|
58
58
|
const response = await backStore.request({
|
|
59
59
|
schema: back_schemas.opengeodeweb_back.crs.geographic_list,
|
|
@@ -70,7 +70,7 @@ export const useCrsStore = defineStore("crs", () => {
|
|
|
70
70
|
return [];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
async function geographicList(geodeObjectType: GeodeObjectType): Promise<
|
|
73
|
+
async function geographicList(geodeObjectType: GeodeObjectType): Promise<CRS[]> {
|
|
74
74
|
// The promise is cached, so dialogs opened together share a single request.
|
|
75
75
|
// The back still checks each CRS against the list of the data dimension
|
|
76
76
|
geographicListPromise ??= fetchGeographicList(geodeObjectType);
|
|
@@ -90,7 +90,7 @@ export const useCrsStore = defineStore("crs", () => {
|
|
|
90
90
|
crsEditRequest.value = undefined;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function setProjectCrs(crs:
|
|
93
|
+
function setProjectCrs(crs: CRS): void {
|
|
94
94
|
projectCrs.value = crs;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -107,12 +107,12 @@ export const useCrsStore = defineStore("crs", () => {
|
|
|
107
107
|
projectCrs.value = undefined;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function exportStores(): { projectCrs?:
|
|
110
|
+
function exportStores(): { projectCrs?: CRS } {
|
|
111
111
|
return { projectCrs: projectCrs.value };
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// Called once the project data is imported: a project saved without it falls back to its oldest data
|
|
115
|
-
function importStores(snapshot: { projectCrs?:
|
|
115
|
+
function importStores(snapshot: { projectCrs?: CRS } | undefined): void {
|
|
116
116
|
projectCrs.value = snapshot?.projectCrs ?? oldestCrs(crsItems.value);
|
|
117
117
|
}
|
|
118
118
|
|
package/app/stores/data.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
2
|
// Third party imports
|
|
3
|
-
import type {
|
|
3
|
+
import type { CRS } from "@geode/opengeodeweb-back/schema_types";
|
|
4
4
|
import type { Table } from "dexie";
|
|
5
5
|
import { useObservable } from "@vueuse/rxjs";
|
|
6
6
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
+
import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
9
10
|
import type {
|
|
10
|
-
DataId,
|
|
11
11
|
DataIdentified,
|
|
12
|
-
GeodeId,
|
|
13
12
|
GeodeIdentified,
|
|
14
13
|
GeodeObjectTyped,
|
|
15
14
|
ModelId,
|
|
@@ -29,7 +28,7 @@ interface DataItem extends DataIdentified, GeodeIdentified, GeodeObjectTyped, Vi
|
|
|
29
28
|
created_at: string;
|
|
30
29
|
is_viewable?: boolean;
|
|
31
30
|
binary_light_viewable?: string;
|
|
32
|
-
crs?:
|
|
31
|
+
crs?: CRS;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
// What the CRS features read of a data: light to copy on each change
|
|
@@ -49,7 +48,7 @@ interface NewDataItem extends DataIdentified, GeodeIdentified, GeodeObjectTyped,
|
|
|
49
48
|
name?: string;
|
|
50
49
|
is_viewable?: boolean;
|
|
51
50
|
binary_light_viewable?: string;
|
|
52
|
-
crs?:
|
|
51
|
+
crs?: CRS;
|
|
53
52
|
// Set on saved data: kept by the project snapshot
|
|
54
53
|
created_at?: string;
|
|
55
54
|
mesh_components?: ModelComponentInput[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataIdentified, GeodeIdentified, ModelId } from "@ogw_front/types/identifiers";
|
|
2
2
|
import type { ReadonlyTreeGroup } from "@ogw_front/types/tree";
|
|
3
3
|
import type { Table } from "dexie";
|
|
4
|
+
import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
|
|
4
5
|
import { database } from "@ogw_internal/database/database.js";
|
|
5
6
|
import { liveObservable } from "@ogw_front/utils/live_observable";
|
|
6
7
|
import { useObservable } from "@vueuse/rxjs";
|
|
@@ -16,7 +17,7 @@ interface FormattedComponent extends Readonly<GeodeIdentified> {
|
|
|
16
17
|
readonly id: string;
|
|
17
18
|
readonly title: string;
|
|
18
19
|
readonly category: string;
|
|
19
|
-
readonly viewer_id:
|
|
20
|
+
readonly viewer_id: ViewerId;
|
|
20
21
|
readonly is_active: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
package/app/stores/data_style.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DataId, GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
2
1
|
import { type LegacyDataId, fromLegacyDataId } from "@ogw_front/utils/legacy_data_id";
|
|
3
2
|
import type {
|
|
4
3
|
ModelComponentStyle,
|
|
@@ -6,8 +5,10 @@ import type {
|
|
|
6
5
|
ObjectStyle,
|
|
7
6
|
SceneStyle,
|
|
8
7
|
} from "@ogw_internal/stores/data_style/types";
|
|
8
|
+
import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
9
|
+
import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
|
|
9
10
|
import type { Table } from "dexie";
|
|
10
|
-
import type { Visibility } from "@
|
|
11
|
+
import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
|
|
11
12
|
import { database } from "@ogw_internal/database/database.js";
|
|
12
13
|
import { getDefaultStyle } from "@ogw_front/utils/default_styles";
|
|
13
14
|
import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
|
|
@@ -98,7 +99,7 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
|
|
|
98
99
|
if (viewer_object_type === "model") {
|
|
99
100
|
return modelStyleStore.applyModelStyle(dataId);
|
|
100
101
|
}
|
|
101
|
-
throw new Error(`Unknown viewer_object_type: ${viewer_object_type}`);
|
|
102
|
+
throw new Error(`Unknown viewer_object_type: ${String(viewer_object_type)}`);
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
function exportStores(): DataStyleSnapshot {
|
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
useHybridViewerViewport,
|
|
4
4
|
} from "@ogw_internal/stores/hybrid_viewer/viewport";
|
|
5
5
|
import { applySnapshot, useHybridViewerCamera } from "@ogw_internal/stores/hybrid_viewer/camera";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
localBackgroundColor,
|
|
8
|
+
useHybridViewerScene,
|
|
9
|
+
} from "@ogw_internal/stores/hybrid_viewer/scene";
|
|
7
10
|
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types";
|
|
8
11
|
import { getCameraOptions } from "@ogw_internal/stores/hybrid_viewer/camera_animation";
|
|
9
12
|
import { useHybridViewerBrightness } from "@ogw_internal/stores/hybrid_viewer/brightness";
|
|
@@ -11,7 +14,6 @@ import { useHybridViewerCore } from "@ogw_internal/stores/hybrid_viewer/core";
|
|
|
11
14
|
import { useHybridViewerFilters } from "@ogw_internal/stores/hybrid_viewer/filters";
|
|
12
15
|
import { useHybridViewerHighlight } from "@ogw_internal/stores/hybrid_viewer/highlight";
|
|
13
16
|
import { useHybridViewerRuler } from "@ogw_internal/stores/hybrid_viewer/ruler";
|
|
14
|
-
import { useHybridViewerScene } from "@ogw_internal/stores/hybrid_viewer/scene";
|
|
15
17
|
import { useHybridViewerZoomBox } from "@ogw_internal/stores/hybrid_viewer/zoom_box";
|
|
16
18
|
import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
|
|
17
19
|
|
|
@@ -58,7 +60,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
|
|
|
58
60
|
}
|
|
59
61
|
status.value = Status.CREATING;
|
|
60
62
|
genericRenderWindow.value = vtkGenericRenderWindow({
|
|
61
|
-
background:
|
|
63
|
+
background: localBackgroundColor(),
|
|
62
64
|
listenWindowResize: false,
|
|
63
65
|
});
|
|
64
66
|
const webGLRenderWindow =
|