@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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Heading math of the compass overlay (Viewer/OrientationCompass.vue). Same convention as the VTK
|
|
2
|
+
// Compass of OpenGeodeWeb-Viewer (orientation_marker.py): north = world +Y, east = +X, up = +Z.
|
|
3
|
+
import type { CameraPose, Vec3, ViewBasis } from "@ogw_front/utils/orientation_gizmo";
|
|
4
|
+
|
|
5
|
+
const DEGREES_PER_HALF_TURN = 180;
|
|
6
|
+
const RADIANS_PER_DEGREE = Math.PI / DEGREES_PER_HALF_TURN;
|
|
7
|
+
// Under this horizontal length, the screen right is (nearly) vertical: no heading can be read
|
|
8
|
+
const MIN_HORIZONTAL_RIGHT = 1e-3;
|
|
9
|
+
// The dial is flattened with the camera elevation, down to this ratio so its letters stay readable
|
|
10
|
+
const MIN_COMPASS_TILT = 0.6;
|
|
11
|
+
// Under this heading gap in degrees, the camera already faces the direction: nothing to turn
|
|
12
|
+
const FACING_TOLERANCE = 0.5;
|
|
13
|
+
const FULL_TURN = 360;
|
|
14
|
+
|
|
15
|
+
interface DialPoint {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Clockwise angle in degrees from north to the direction the camera looks at, on the ground plane.
|
|
21
|
+
// Read from the screen right vector, which stays horizontal both for side views and for views
|
|
22
|
+
// Straight down or up (where the view direction has no horizontal part). Undefined when the camera
|
|
23
|
+
// Is rolled until its right vector is vertical.
|
|
24
|
+
function compassHeading(basis: ViewBasis): number | undefined {
|
|
25
|
+
const [rightX, rightY] = basis.right;
|
|
26
|
+
if (Math.hypot(rightX, rightY) < MIN_HORIZONTAL_RIGHT) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
// The ground direction the camera looks at is the screen right turned by a quarter turn
|
|
30
|
+
return Math.atan2(-rightY, rightX) / RADIANS_PER_DEGREE;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Vertical scale of the dial: 1 seen from straight above or below, flatter towards the horizon
|
|
34
|
+
function compassTilt(basis: ViewBasis): number {
|
|
35
|
+
return Math.max(MIN_COMPASS_TILT, Math.abs(basis.toViewer[2]));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// SVG position (y downwards) of the dial point at the given clockwise angle from north, once the
|
|
39
|
+
// Dial is turned by -heading and flattened by tilt
|
|
40
|
+
function compassDialPoint(angle: number, radius: number, heading: number, tilt: number): DialPoint {
|
|
41
|
+
const screenAngle = (angle - heading) * RADIANS_PER_DEGREE;
|
|
42
|
+
return {
|
|
43
|
+
x: radius * Math.sin(screenAngle),
|
|
44
|
+
y: -radius * Math.cos(screenAngle) * tilt,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Whether the camera already looks towards the given heading, clockwise in degrees from north
|
|
49
|
+
function isFacing(basis: ViewBasis, targetHeading: number): boolean {
|
|
50
|
+
const heading = compassHeading(basis);
|
|
51
|
+
if (heading === undefined) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const gap = (((heading - targetHeading) % FULL_TURN) + FULL_TURN) % FULL_TURN;
|
|
55
|
+
return Math.min(gap, FULL_TURN - gap) < FACING_TOLERANCE;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function rotateAroundZ(vector: Vec3, angle: number): Vec3 {
|
|
59
|
+
const cosine = Math.cos(angle);
|
|
60
|
+
const sine = Math.sin(angle);
|
|
61
|
+
return [vector[0] * cosine - vector[1] * sine, vector[0] * sine + vector[1] * cosine, vector[2]];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Same camera turned around the vertical axis through its focal point so that it looks towards the
|
|
65
|
+
// Given heading, clockwise in degrees from north (keeps the elevation and the distance). Undefined when
|
|
66
|
+
// No heading can be read.
|
|
67
|
+
function facingCameraPose(
|
|
68
|
+
pose: CameraPose,
|
|
69
|
+
basis: ViewBasis,
|
|
70
|
+
targetHeading: number,
|
|
71
|
+
): CameraPose | undefined {
|
|
72
|
+
const heading = compassHeading(basis);
|
|
73
|
+
if (heading === undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
// A counterclockwise turn by the heading difference brings the view direction to the target
|
|
77
|
+
const angle = (heading - targetHeading) * RADIANS_PER_DEGREE;
|
|
78
|
+
const [focalX, focalY, focalZ] = pose.focal_point;
|
|
79
|
+
const offset = rotateAroundZ(
|
|
80
|
+
[pose.position[0] - focalX, pose.position[1] - focalY, pose.position[2] - focalZ],
|
|
81
|
+
angle,
|
|
82
|
+
);
|
|
83
|
+
return {
|
|
84
|
+
focal_point: pose.focal_point,
|
|
85
|
+
position: [focalX + offset[0], focalY + offset[1], focalZ + offset[2]],
|
|
86
|
+
view_up: rotateAroundZ(pose.view_up, angle),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function northUpCameraPose(pose: CameraPose, basis: ViewBasis): CameraPose | undefined {
|
|
91
|
+
return facingCameraPose(pose, basis, 0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
MIN_COMPASS_TILT,
|
|
96
|
+
compassDialPoint,
|
|
97
|
+
compassHeading,
|
|
98
|
+
compassTilt,
|
|
99
|
+
facingCameraPose,
|
|
100
|
+
isFacing,
|
|
101
|
+
northUpCameraPose,
|
|
102
|
+
};
|
|
103
|
+
export type { DialPoint };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Camera frame of the orientation overlay (Viewer/OrientationGlobe.vue), drawn by the front over the
|
|
2
|
+
// Viewer image. Pure math on the camera pose (position, focal point, view up): no vtk.js nor Vue here.
|
|
3
|
+
|
|
4
|
+
type Vec3 = readonly [number, number, number];
|
|
5
|
+
|
|
6
|
+
interface CameraPose {
|
|
7
|
+
position: Vec3;
|
|
8
|
+
focal_point: Vec3;
|
|
9
|
+
view_up: Vec3;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Camera frame in world coordinates: screen right, screen up, and the direction towards the viewer
|
|
13
|
+
interface ViewBasis {
|
|
14
|
+
right: Vec3;
|
|
15
|
+
upward: Vec3;
|
|
16
|
+
toViewer: Vec3;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const EPSILON = 1e-9;
|
|
20
|
+
const VECTOR_SIZE = 3;
|
|
21
|
+
|
|
22
|
+
function subtract(first: Vec3, second: Vec3): Vec3 {
|
|
23
|
+
return [first[0] - second[0], first[1] - second[1], first[2] - second[2]];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function cross(first: Vec3, second: Vec3): Vec3 {
|
|
27
|
+
return [
|
|
28
|
+
first[1] * second[2] - first[2] * second[1],
|
|
29
|
+
first[2] * second[0] - first[0] * second[2],
|
|
30
|
+
first[0] * second[1] - first[1] * second[0],
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function normalize(vector: Vec3): Vec3 | undefined {
|
|
35
|
+
const length = Math.hypot(...vector);
|
|
36
|
+
if (length < EPSILON) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return [vector[0] / length, vector[1] / length, vector[2] / length];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isVec3(value: unknown): value is Vec3 {
|
|
43
|
+
return (
|
|
44
|
+
Array.isArray(value) &&
|
|
45
|
+
value.length === VECTOR_SIZE &&
|
|
46
|
+
value.every((item) => typeof item === "number" && Number.isFinite(item))
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Reads a pose from the loosely typed camera options of the hybrid viewer store
|
|
51
|
+
function toCameraPose(options: Record<string, unknown>): CameraPose | undefined {
|
|
52
|
+
const { position, focal_point, view_up } = options;
|
|
53
|
+
if (!isVec3(position) || !isVec3(focal_point) || !isVec3(view_up)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return { position, focal_point, view_up };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Undefined for a degenerate camera (position on the focal point, view up along the view direction)
|
|
60
|
+
function cameraViewBasis(pose: CameraPose): ViewBasis | undefined {
|
|
61
|
+
const toViewer = normalize(subtract(pose.position, pose.focal_point));
|
|
62
|
+
if (!toViewer) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const right = normalize(cross(pose.view_up, toViewer));
|
|
66
|
+
if (!right) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
return { right, upward: cross(toViewer, right), toViewer };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { cameraViewBasis, toCameraPose };
|
|
73
|
+
export type { CameraPose, Vec3, ViewBasis };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Geometry of the orientation globe (Viewer/OrientationGlobe.vue): a sphere crossed by horizontal strata
|
|
2
|
+
// (latitude rings, horizontal in the world, so the tilt reads at a glance), the world axes from its
|
|
3
|
+
// Center and the north (+Y) on its equator. Pure math on the camera view basis: no vtk.js nor Vue here.
|
|
4
|
+
// SVG coordinates: origin at the globe center, y grows downwards.
|
|
5
|
+
import type { Vec3, ViewBasis } from "@ogw_front/utils/orientation_gizmo";
|
|
6
|
+
|
|
7
|
+
type GlobeAxis = "x" | "y" | "z";
|
|
8
|
+
|
|
9
|
+
interface GlobeLabel {
|
|
10
|
+
axis: GlobeAxis;
|
|
11
|
+
// Text drawn at the end of the axis: X, Y or Z
|
|
12
|
+
text: string;
|
|
13
|
+
// Key of the camera orientation looking from this end (see camera_helpers ORIENTATIONS)
|
|
14
|
+
key: string;
|
|
15
|
+
// Projected end of the axis, on the sphere
|
|
16
|
+
tipX: number;
|
|
17
|
+
tipY: number;
|
|
18
|
+
// Label position, outside the sphere along the projected axis
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
// Component towards the viewer: 1 points at the viewer, -1 away from it
|
|
22
|
+
depth: number;
|
|
23
|
+
// The axis points (nearly) at or away from the viewer: its label sits next to the center
|
|
24
|
+
foreshortened: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface RingPaths {
|
|
28
|
+
front: string;
|
|
29
|
+
back: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const DEGREES_PER_HALF_TURN = 180;
|
|
33
|
+
const RADIANS_PER_DEGREE = Math.PI / DEGREES_PER_HALF_TURN;
|
|
34
|
+
const FULL_TURN_DEGREES = 360;
|
|
35
|
+
const RING_SEGMENTS = 96;
|
|
36
|
+
// Heights of the latitude rings (unit sphere), the equator in the middle
|
|
37
|
+
const STRATA_LINE_HEIGHT = 0.62;
|
|
38
|
+
const STRATA_LINES = [STRATA_LINE_HEIGHT, 0, -STRATA_LINE_HEIGHT] as const;
|
|
39
|
+
// Gap between the sphere and the labels, in SVG units
|
|
40
|
+
const LABEL_GAP = 11;
|
|
41
|
+
// Under this projected length (ratio of the radius), the axis points at the viewer
|
|
42
|
+
const FORESHORTENED_RATIO = 0.18;
|
|
43
|
+
const FORESHORTENED_OFFSET = 8;
|
|
44
|
+
const AXES: readonly { axis: GlobeAxis; vector: Vec3; key: string }[] = [
|
|
45
|
+
{ axis: "x", vector: [1, 0, 0], key: "xplus" },
|
|
46
|
+
{ axis: "y", vector: [0, 1, 0], key: "yplus" },
|
|
47
|
+
{ axis: "z", vector: [0, 0, 1], key: "zplus" },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
function dot(first: Vec3, second: Vec3): number {
|
|
51
|
+
return first[0] * second[0] + first[1] * second[1] + first[2] * second[2];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Screen position of a point of the unit sphere (world coordinates) for a globe of the given radius
|
|
55
|
+
function projectOnGlobe(basis: ViewBasis, radius: number, point: Vec3): [number, number, number] {
|
|
56
|
+
return [
|
|
57
|
+
radius * dot(point, basis.right),
|
|
58
|
+
-radius * dot(point, basis.upward),
|
|
59
|
+
dot(point, basis.toViewer),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function pathPoint(previous: boolean | undefined, current: boolean, x: number, y: number): string {
|
|
64
|
+
const command = previous === current ? "L" : "M";
|
|
65
|
+
return `${command}${x.toFixed(2)} ${y.toFixed(2)}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Latitude ring at the given height of the unit sphere, split into its half facing the viewer and its
|
|
69
|
+
// Hidden half (drawn fainter)
|
|
70
|
+
function latitudeRing(basis: ViewBasis, radius: number, height: number): RingPaths {
|
|
71
|
+
const ringRadius = Math.sqrt(Math.max(0, 1 - height * height));
|
|
72
|
+
let front = "";
|
|
73
|
+
let back = "";
|
|
74
|
+
let previous: boolean | undefined = undefined;
|
|
75
|
+
for (let index = 0; index <= RING_SEGMENTS; index += 1) {
|
|
76
|
+
const angle = (2 * Math.PI * index) / RING_SEGMENTS;
|
|
77
|
+
const [x, y, depth] = projectOnGlobe(basis, radius, [
|
|
78
|
+
ringRadius * Math.cos(angle),
|
|
79
|
+
ringRadius * Math.sin(angle),
|
|
80
|
+
height,
|
|
81
|
+
]);
|
|
82
|
+
const facing = depth >= 0;
|
|
83
|
+
if (facing) {
|
|
84
|
+
front += pathPoint(previous, true, x, y);
|
|
85
|
+
} else {
|
|
86
|
+
back += pathPoint(previous === false ? false : undefined, false, x, y);
|
|
87
|
+
}
|
|
88
|
+
previous = facing;
|
|
89
|
+
}
|
|
90
|
+
return { front, back };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function strataRings(basis: ViewBasis, radius: number): (RingPaths & { equator: boolean })[] {
|
|
94
|
+
return STRATA_LINES.map((height) => {
|
|
95
|
+
const { front, back } = latitudeRing(basis, radius, height);
|
|
96
|
+
return { front, back, equator: height === 0 };
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Axis labels, back to front so the nearest axis is drawn last
|
|
101
|
+
function globeLabels(basis: ViewBasis, radius: number): GlobeLabel[] {
|
|
102
|
+
const labels: GlobeLabel[] = [];
|
|
103
|
+
for (const { axis, vector, key } of AXES) {
|
|
104
|
+
const text = axis.toUpperCase();
|
|
105
|
+
const [tipX, tipY, depth] = projectOnGlobe(basis, radius, vector);
|
|
106
|
+
const length = Math.hypot(tipX, tipY);
|
|
107
|
+
const foreshortened = length < radius * FORESHORTENED_RATIO;
|
|
108
|
+
const scale = foreshortened ? 0 : (radius + LABEL_GAP) / length;
|
|
109
|
+
labels.push({
|
|
110
|
+
axis,
|
|
111
|
+
text,
|
|
112
|
+
key,
|
|
113
|
+
tipX,
|
|
114
|
+
tipY,
|
|
115
|
+
x: foreshortened ? FORESHORTENED_OFFSET : tipX * scale,
|
|
116
|
+
y: foreshortened ? -FORESHORTENED_OFFSET : tipY * scale,
|
|
117
|
+
depth,
|
|
118
|
+
foreshortened,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return labels.toSorted((first, second) => first.depth - second.depth);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// North (+Y) on the equator
|
|
125
|
+
function northPoint(basis: ViewBasis, radius: number): { x: number; y: number; depth: number } {
|
|
126
|
+
const [x, y, depth] = projectOnGlobe(basis, radius, [0, 1, 0]);
|
|
127
|
+
return { x, y, depth };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Angle of the camera above the horizon, in degrees: 90 looking straight down
|
|
131
|
+
function cameraElevation(basis: ViewBasis): number {
|
|
132
|
+
return Math.asin(Math.max(-1, Math.min(1, basis.toViewer[2]))) / RADIANS_PER_DEGREE;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Geologist's reading of the view: azimuth of the view direction, then elevation ("N 030° · 25°")
|
|
136
|
+
function orientationReadout(heading: number, elevation: number): string {
|
|
137
|
+
const azimuth = Math.round(
|
|
138
|
+
((heading % FULL_TURN_DEGREES) + FULL_TURN_DEGREES) % FULL_TURN_DEGREES,
|
|
139
|
+
);
|
|
140
|
+
const padded = String(azimuth % FULL_TURN_DEGREES).padStart(3, "0");
|
|
141
|
+
return `N ${padded}° · ${Math.round(elevation)}°`;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { cameraElevation, globeLabels, latitudeRing, northPoint, orientationReadout, strataRings };
|
|
145
|
+
export type { GlobeAxis, GlobeLabel, RingPaths };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Strata fills of the orientation globe (Viewer/OrientationGlobe.vue): the sphere is cut by horizontal
|
|
2
|
+
// Planes of the world into alternate light and clear layers, like the slices of the Geode Solutions mark.
|
|
3
|
+
// Rasterized per pixel with supersampling for smooth edges. Pure math: no vtk.js nor Vue here.
|
|
4
|
+
import type { ViewBasis } from "@ogw_front/utils/orientation_gizmo";
|
|
5
|
+
|
|
6
|
+
interface Strata {
|
|
7
|
+
// World height range of the stratum on the unit sphere
|
|
8
|
+
bottom: number;
|
|
9
|
+
top: number;
|
|
10
|
+
// Fill opacity, 0 for the strata left clear
|
|
11
|
+
opacity: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface StrataSample {
|
|
15
|
+
coverage: number;
|
|
16
|
+
shade: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Same heights as the latitude rings of the globe (orientation_globe.ts)
|
|
20
|
+
const STRATA_LINE_HEIGHT = 0.62;
|
|
21
|
+
const LIGHT_OPACITY = 0.62;
|
|
22
|
+
const SHADOW_OPACITY = 0.38;
|
|
23
|
+
const STRATA: readonly Strata[] = [
|
|
24
|
+
{ bottom: STRATA_LINE_HEIGHT, top: 1, opacity: LIGHT_OPACITY },
|
|
25
|
+
{ bottom: 0, top: STRATA_LINE_HEIGHT, opacity: 0 },
|
|
26
|
+
{ bottom: -STRATA_LINE_HEIGHT, top: 0, opacity: SHADOW_OPACITY },
|
|
27
|
+
{ bottom: -1, top: -STRATA_LINE_HEIGHT, opacity: 0 },
|
|
28
|
+
];
|
|
29
|
+
const SUPERSAMPLING = 3;
|
|
30
|
+
const SAMPLE_CENTER = 0.5;
|
|
31
|
+
const SHADE_BASE = 0.85;
|
|
32
|
+
const SHADE_RANGE = 0.15;
|
|
33
|
+
const BYTES_PER_PIXEL = 4;
|
|
34
|
+
const MAX_CHANNEL = 255;
|
|
35
|
+
const RGB_CHANNELS = 3;
|
|
36
|
+
const HEX_BASE = 16;
|
|
37
|
+
const HEX_CHANNEL_LENGTH = 2;
|
|
38
|
+
|
|
39
|
+
// World height of the visible sphere point under the given screen offset, as a ratio of the radius
|
|
40
|
+
// (x right, y down). Undefined outside the sphere.
|
|
41
|
+
function visibleHeight(basis: ViewBasis, x: number, y: number): number | undefined {
|
|
42
|
+
const squared = x * x + y * y;
|
|
43
|
+
if (squared > 1) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const towardsViewer = Math.sqrt(1 - squared);
|
|
47
|
+
return x * basis.right[2] - y * basis.upward[2] + towardsViewer * basis.toViewer[2];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Fill opacity of the stratum at this world height
|
|
51
|
+
function strataOpacity(height: number): number {
|
|
52
|
+
return STRATA.find(({ bottom, top }) => height >= bottom && height <= top)?.opacity ?? 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// "#RRGGBB" to its red, green and blue channels
|
|
56
|
+
function hexChannels(color: string): number[] {
|
|
57
|
+
return Array.from({ length: RGB_CHANNELS }, (_item, channel) => {
|
|
58
|
+
const start = 1 + channel * HEX_CHANNEL_LENGTH;
|
|
59
|
+
return Number.parseInt(color.slice(start, start + HEX_CHANNEL_LENGTH), HEX_BASE);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Coverage and lighting of one sample of the globe (x, y in radius units, y down)
|
|
64
|
+
function strataSample(basis: ViewBasis, x: number, y: number): StrataSample {
|
|
65
|
+
const height = visibleHeight(basis, x, y);
|
|
66
|
+
if (height === undefined) {
|
|
67
|
+
return { coverage: 0, shade: 0 };
|
|
68
|
+
}
|
|
69
|
+
const coverage = strataOpacity(height);
|
|
70
|
+
const towardsViewer = Math.sqrt(Math.max(0, 1 - x * x - y * y));
|
|
71
|
+
return { coverage, shade: coverage * (SHADE_BASE + SHADE_RANGE * towardsViewer) };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Supersampled coverage and lighting of one canvas pixel
|
|
75
|
+
function strataPixel(
|
|
76
|
+
basis: ViewBasis,
|
|
77
|
+
column: number,
|
|
78
|
+
row: number,
|
|
79
|
+
pixelsPerRadius: number,
|
|
80
|
+
): StrataSample {
|
|
81
|
+
const total: StrataSample = { coverage: 0, shade: 0 };
|
|
82
|
+
for (let index = 0; index < SUPERSAMPLING * SUPERSAMPLING; index += 1) {
|
|
83
|
+
const sampleColumn = index % SUPERSAMPLING;
|
|
84
|
+
const sampleRow = Math.floor(index / SUPERSAMPLING);
|
|
85
|
+
const x = (column + (sampleColumn + SAMPLE_CENTER) / SUPERSAMPLING) / pixelsPerRadius - 1;
|
|
86
|
+
const y = (row + (sampleRow + SAMPLE_CENTER) / SUPERSAMPLING) / pixelsPerRadius - 1;
|
|
87
|
+
const sample = strataSample(basis, x, y);
|
|
88
|
+
total.coverage += sample.coverage;
|
|
89
|
+
total.shade += sample.shade;
|
|
90
|
+
}
|
|
91
|
+
return total;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// RGBA pixels of the strata fills for a square canvas of the given side covering the globe:
|
|
95
|
+
// Alternate light and clear layers, like the slices of the brand mark, lit a bit more towards the viewer
|
|
96
|
+
function strataPixels(basis: ViewBasis, side: number, color: string): Uint8ClampedArray {
|
|
97
|
+
const channels = hexChannels(color);
|
|
98
|
+
const pixels = new Uint8ClampedArray(side * side * BYTES_PER_PIXEL);
|
|
99
|
+
const pixelsPerRadius = side / 2;
|
|
100
|
+
const samples = SUPERSAMPLING * SUPERSAMPLING;
|
|
101
|
+
for (let index = 0; index < side * side; index += 1) {
|
|
102
|
+
const { coverage, shade } = strataPixel(
|
|
103
|
+
basis,
|
|
104
|
+
index % side,
|
|
105
|
+
Math.floor(index / side),
|
|
106
|
+
pixelsPerRadius,
|
|
107
|
+
);
|
|
108
|
+
if (coverage > 0) {
|
|
109
|
+
const offset = index * BYTES_PER_PIXEL;
|
|
110
|
+
for (let channel = 0; channel < RGB_CHANNELS; channel += 1) {
|
|
111
|
+
pixels[offset + channel] = (channels[channel] ?? 0) * (shade / coverage);
|
|
112
|
+
}
|
|
113
|
+
pixels[offset + RGB_CHANNELS] = (MAX_CHANNEL * coverage) / samples;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return pixels;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { strataOpacity, strataPixels, visibleHeight };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Third party imports
|
|
2
|
+
import type { IconAliases, IconOptions, IconProps, IconSet } from "vuetify";
|
|
3
|
+
import { type VNode, h } from "vue";
|
|
4
|
+
|
|
5
|
+
// Icons of the apps: Phosphor (https://phosphoricons.com), the flat line icons of the Geode Solutions
|
|
6
|
+
// Brand book. An icon is written "ph-<name>" for the regular weight or "ph-fill ph-<name>" for the
|
|
7
|
+
// Fill one, optionally followed by other classes. The font CSS is registered in nuxt.config `css`.
|
|
8
|
+
const PHOSPHOR_SET_NAME = "ph";
|
|
9
|
+
const REGULAR_WEIGHT = "ph";
|
|
10
|
+
const FILL_WEIGHT = "ph-fill";
|
|
11
|
+
|
|
12
|
+
// Classes of the rendered tag: the weight class, then the icon classes as written
|
|
13
|
+
function phosphorIconClass(icon: string): string {
|
|
14
|
+
const classes = icon.trim().split(/\s+/u);
|
|
15
|
+
if (classes[0] !== FILL_WEIGHT) {
|
|
16
|
+
classes.unshift(REGULAR_WEIGHT);
|
|
17
|
+
}
|
|
18
|
+
return classes.join(" ");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Same shape as Vuetify's VClassIcon: the v-icon classes, styles and attributes fall through to the
|
|
22
|
+
// Rendered tag, so sizes and colors behave as with any font icon set
|
|
23
|
+
function PhosphorIcon(props: IconProps): VNode {
|
|
24
|
+
return h(props.tag, { class: phosphorIconClass(String(props.icon ?? "")) });
|
|
25
|
+
}
|
|
26
|
+
PhosphorIcon.props = ["icon", "tag"];
|
|
27
|
+
|
|
28
|
+
const phosphor: IconSet = { component: PhosphorIcon };
|
|
29
|
+
|
|
30
|
+
// Icons Vuetify components draw by themselves ($close, $checkboxOn, $expand...)
|
|
31
|
+
const PHOSPHOR_ALIASES: IconAliases = {
|
|
32
|
+
collapse: "ph-caret-up",
|
|
33
|
+
complete: "ph-check",
|
|
34
|
+
cancel: "ph-x-circle",
|
|
35
|
+
close: "ph-x",
|
|
36
|
+
delete: "ph-x-circle",
|
|
37
|
+
clear: "ph-x-circle",
|
|
38
|
+
success: "ph-check-circle",
|
|
39
|
+
info: "ph-info",
|
|
40
|
+
warning: "ph-warning-circle",
|
|
41
|
+
error: "ph-x-circle",
|
|
42
|
+
prev: "ph-caret-left",
|
|
43
|
+
next: "ph-caret-right",
|
|
44
|
+
checkboxOn: "ph-check-square",
|
|
45
|
+
checkboxOff: "ph-square",
|
|
46
|
+
checkboxIndeterminate: "ph-minus-square",
|
|
47
|
+
delimiter: "ph-fill ph-circle",
|
|
48
|
+
sortAsc: "ph-arrow-up",
|
|
49
|
+
sortDesc: "ph-arrow-down",
|
|
50
|
+
expand: "ph-caret-down",
|
|
51
|
+
menu: "ph-list",
|
|
52
|
+
subgroup: "ph-caret-down",
|
|
53
|
+
dropdown: "ph-caret-down",
|
|
54
|
+
radioOn: "ph-radio-button",
|
|
55
|
+
radioOff: "ph-circle",
|
|
56
|
+
edit: "ph-pencil-simple",
|
|
57
|
+
ratingEmpty: "ph-star",
|
|
58
|
+
ratingFull: "ph-fill ph-star",
|
|
59
|
+
ratingHalf: "ph-fill ph-star-half",
|
|
60
|
+
loading: "ph-arrows-clockwise",
|
|
61
|
+
first: "ph-caret-line-left",
|
|
62
|
+
last: "ph-caret-line-right",
|
|
63
|
+
unfold: "ph-caret-up-down",
|
|
64
|
+
file: "ph-paperclip",
|
|
65
|
+
plus: "ph-plus",
|
|
66
|
+
minus: "ph-minus",
|
|
67
|
+
calendar: "ph-calendar-blank",
|
|
68
|
+
treeviewCollapse: "ph-caret-down",
|
|
69
|
+
treeviewExpand: "ph-caret-right",
|
|
70
|
+
tableGroupCollapse: "ph-caret-down",
|
|
71
|
+
tableGroupExpand: "ph-caret-right",
|
|
72
|
+
eyeDropper: "ph-eyedropper",
|
|
73
|
+
upload: "ph-cloud-arrow-up",
|
|
74
|
+
color: "ph-palette",
|
|
75
|
+
command: "ph-command",
|
|
76
|
+
ctrl: "ph-control",
|
|
77
|
+
space: "ph-keyboard",
|
|
78
|
+
shift: "ph-arrow-fat-up",
|
|
79
|
+
alt: "ph-option",
|
|
80
|
+
enter: "ph-key-return",
|
|
81
|
+
arrowup: "ph-arrow-up",
|
|
82
|
+
arrowdown: "ph-arrow-down",
|
|
83
|
+
arrowleft: "ph-arrow-left",
|
|
84
|
+
arrowright: "ph-arrow-right",
|
|
85
|
+
backspace: "ph-backspace",
|
|
86
|
+
play: "ph-play",
|
|
87
|
+
pause: "ph-pause",
|
|
88
|
+
fullscreen: "ph-corners-out",
|
|
89
|
+
fullscreenExit: "ph-corners-in",
|
|
90
|
+
volumeHigh: "ph-speaker-high",
|
|
91
|
+
volumeMedium: "ph-speaker-low",
|
|
92
|
+
volumeLow: "ph-speaker-none",
|
|
93
|
+
volumeOff: "ph-speaker-x",
|
|
94
|
+
search: "ph-magnifying-glass",
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function phosphorIconOptions(): IconOptions {
|
|
98
|
+
return {
|
|
99
|
+
defaultSet: PHOSPHOR_SET_NAME,
|
|
100
|
+
aliases: PHOSPHOR_ALIASES,
|
|
101
|
+
sets: { [PHOSPHOR_SET_NAME]: phosphor },
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { PHOSPHOR_ALIASES, PHOSPHOR_SET_NAME, phosphor, phosphorIconClass, phosphorIconOptions };
|
package/app/utils/slice.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DataIdentified
|
|
1
|
+
import type { DataIdentified } from "@ogw_front/types/identifiers";
|
|
2
|
+
import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
|
|
2
3
|
|
|
3
4
|
const GRID_TYPES = new Set([
|
|
4
5
|
"RegularGrid2D",
|
|
@@ -4,7 +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 "@
|
|
7
|
+
import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
|
|
8
8
|
import { attributeSchemas } from "@ogw_front/composables/attribute_coloring_style";
|
|
9
9
|
import type { useDataStore } from "@ogw_front/stores/data";
|
|
10
10
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
AttributeColorMap,
|
|
3
2
|
AttributeItem,
|
|
4
3
|
AttributeName,
|
|
5
4
|
AttributeRangeMaximum,
|
|
6
5
|
AttributeRangeMinimum,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ColorRGBA,
|
|
7
|
+
} from "@geode/opengeodeweb-viewer/schema_types";
|
|
8
|
+
import type { AttributeColorMap } from "@ogw_front/types/attribute";
|
|
9
9
|
|
|
10
10
|
// The same fields while the user has not chosen them yet
|
|
11
11
|
type Undefinable<Fields> = { [Field in keyof Fields]: Fields[Field] | undefined };
|
|
@@ -28,7 +28,7 @@ interface AttributeColorMapped {
|
|
|
28
28
|
// What is kept of an attribute coloring when another attribute is picked
|
|
29
29
|
interface AttributeStoredConfig
|
|
30
30
|
extends Undefinable<AttributeBounds>, Undefinable<AttributeColorMapped> {
|
|
31
|
-
no_data_color:
|
|
31
|
+
no_data_color: ColorRGBA;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// The input of an attribute coloring while the user has not chosen all of it yet
|
|
@@ -37,11 +37,11 @@ interface AttributeInput
|
|
|
37
37
|
Undefinable<AttributeSelection>,
|
|
38
38
|
Undefinable<AttributeBounds>,
|
|
39
39
|
Undefinable<AttributeColorMapped> {
|
|
40
|
-
no_data_color?:
|
|
40
|
+
no_data_color?: ColorRGBA;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
interface ValidAttributeInput extends AttributeSelection, AttributeBounds, AttributeColorMapped {
|
|
44
|
-
no_data_color?:
|
|
44
|
+
no_data_color?: ColorRGBA;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
interface AttributeState extends Partial<AttributeSelection> {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import type { ColorRGBA, Visibility } from "@geode/opengeodeweb-viewer/schema_types";
|
|
1
2
|
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
2
|
-
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
3
|
-
import type { Visibility } from "@ogw_front/types/style";
|
|
4
3
|
// Third party imports
|
|
5
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
6
5
|
|
|
@@ -16,8 +15,8 @@ const meshSchemas = viewer_schemas.opengeodeweb_viewer.mesh;
|
|
|
16
15
|
interface MeshBaseStyle {
|
|
17
16
|
meshVisibility: (meshId: MeshId) => Visibility | undefined;
|
|
18
17
|
setMeshVisibility: (meshId: MeshId, visibility: Visibility) => Promise<unknown>;
|
|
19
|
-
meshColor: (meshId: MeshId) =>
|
|
20
|
-
setMeshColor: (meshId: MeshId, color:
|
|
18
|
+
meshColor: (meshId: MeshId) => ColorRGBA | undefined;
|
|
19
|
+
setMeshColor: (meshId: MeshId, color: ColorRGBA) => Promise<unknown>;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export function useMeshBaseStyle(): MeshBaseStyle {
|
|
@@ -49,12 +48,12 @@ export function useMeshBaseStyle(): MeshBaseStyle {
|
|
|
49
48
|
return result;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
function meshColor(meshId: MeshId):
|
|
51
|
+
function meshColor(meshId: MeshId): ColorRGBA | undefined {
|
|
53
52
|
// oxlint-disable-next-line no-unsafe-type-assertion -- color shape is defined by the data style schema.
|
|
54
|
-
return dataStyleState.getStyle(meshId).color as
|
|
53
|
+
return dataStyleState.getStyle(meshId).color as ColorRGBA | undefined;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
async function setMeshColor(meshId: MeshId, color:
|
|
56
|
+
async function setMeshColor(meshId: MeshId, color: ColorRGBA): Promise<unknown> {
|
|
58
57
|
const schema = meshSchemas.color;
|
|
59
58
|
const params = { id: meshId, color };
|
|
60
59
|
const result = await viewerStore.request(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { AttributeColorMap, AttributeTimeStep } from "@ogw_front/types/attribute";
|
|
1
2
|
import type {
|
|
2
|
-
AttributeColorMap,
|
|
3
3
|
AttributeItem,
|
|
4
4
|
AttributeName,
|
|
5
5
|
AttributeRangeMaximum,
|
|
6
6
|
AttributeRangeMinimum,
|
|
7
|
-
|
|
8
|
-
} from "@
|
|
9
|
-
import { DEFAULT_NO_DATA_COLOR
|
|
7
|
+
ColorRGBA,
|
|
8
|
+
} from "@geode/opengeodeweb-viewer/schema_types";
|
|
9
|
+
import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
|
|
10
10
|
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
11
11
|
import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
|
|
12
|
-
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
13
12
|
// Third party imports
|
|
14
13
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
14
|
+
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
15
15
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
16
16
|
|
|
17
17
|
// Local imports
|
|
@@ -162,7 +162,7 @@ function useMeshCellsCellAttributeStyle(): UseMeshCellsCellAttributeStyleReturn
|
|
|
162
162
|
}
|
|
163
163
|
async function setMeshCellsCellAttributeNoDataColor(
|
|
164
164
|
meshId: MeshId,
|
|
165
|
-
no_data_color:
|
|
165
|
+
no_data_color: ColorRGBA,
|
|
166
166
|
): Promise<unknown> {
|
|
167
167
|
const name = meshCellsCellAttributeName(meshId);
|
|
168
168
|
const item = meshCellsCellAttributeItem(meshId);
|