@geode/opengeodeweb-front 10.34.0-rc.8 → 10.34.0
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/{server → .build/server}/utils/app_config.js +10 -9
- package/{server → .build/server}/utils/cleanup.js +31 -17
- package/{server → .build/server}/utils/cloud.js +1 -4
- package/{server → .build/server}/utils/microservices.js +21 -9
- package/{server → .build/server}/utils/path.js +4 -4
- package/{server → .build/server}/utils/scripts.js +9 -9
- package/.build/server/utils/server_config.js +51 -0
- package/.build/server/utils/stream.js +6 -0
- package/{server → .build/server}/utils/ws_client.js +18 -3
- package/{shared → .build/shared}/scripts.js +10 -10
- package/.build/shared/utils/call_raw.js +31 -0
- package/{shared → .build/shared}/utils/call_schema.js +2 -2
- package/.build/shared/utils/fetch_raw.js +52 -0
- package/{shared → .build/shared}/utils/fetch_schema.js +2 -2
- package/{shared → .build/shared}/utils/file.js +3 -1
- package/{shared → .build/shared}/utils/response_handlers/load.js +10 -7
- package/{shared → .build/shared}/utils/validate_schema.js +1 -1
- package/app/components/ActionButton.vue +6 -6
- package/app/components/CameraManager/List.vue +5 -5
- package/app/components/CameraManager/Saver.vue +3 -5
- package/app/components/CameraManager.vue +6 -4
- package/app/components/CameraOrientation.vue +12 -12
- package/app/components/ClippingPlaneCard.vue +4 -2
- package/app/components/ClippingPlanes.vue +8 -8
- package/app/components/CrsSelector.vue +9 -10
- package/app/components/DeleteDialog.vue +4 -2
- package/app/components/DragAndDrop.vue +10 -12
- package/app/components/DragAndDropInternal/DragAndDropInline.vue +4 -2
- package/app/components/ExtensionSelector.vue +4 -4
- package/app/components/FeedBack/ErrorBanner.vue +3 -1
- package/app/components/FeedBack/Snackers.vue +4 -3
- package/app/components/FileSelector.vue +10 -8
- package/app/components/FileUploader.vue +11 -11
- package/app/components/GlassCard.vue +1 -1
- package/app/components/HybridRenderingView.vue +7 -5
- package/app/components/HybridViewerTooltip.vue +7 -7
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading/EcoMessages.vue +9 -3
- package/app/components/Loading.vue +2 -2
- package/app/components/MissingFilesSelector.vue +12 -10
- package/app/components/ObjectSelector.vue +10 -9
- package/app/components/PackagesVersions.vue +6 -5
- package/app/components/Recaptcha.vue +3 -3
- package/app/components/RemoteRenderingView.vue +6 -7
- package/app/components/Ruler.vue +3 -3
- package/app/components/Screenshot.vue +6 -6
- package/app/components/SearchBar.vue +4 -2
- package/app/components/ShrinkFilter.vue +7 -7
- package/app/components/Step.vue +6 -5
- package/app/components/Stepper.vue +4 -3
- package/app/components/ToolPanel.vue +6 -3
- package/app/components/ViewToolbar.vue +25 -28
- package/app/components/Viewer/ContextMenu/CenterButton.vue +7 -5
- package/app/components/Viewer/ContextMenu/CircularItems.vue +3 -3
- package/app/components/Viewer/ContextMenu/ContextMenu.vue +22 -19
- package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -8
- package/app/components/Viewer/ContextMenu/InfoCard.vue +11 -12
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +13 -17
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -16
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +8 -12
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +11 -15
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +53 -23
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +1 -3
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +31 -15
- package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +2 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +69 -38
- package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +64 -46
- package/app/components/Viewer/ObjectTree/Base/Controls.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +13 -9
- package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +10 -10
- package/app/components/Viewer/ObjectTree/Box.vue +6 -4
- package/app/components/Viewer/ObjectTree/Layout.vue +23 -21
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +14 -14
- package/app/components/Viewer/ObjectTree/Views/{ModelCollections.vue → ModelTree.vue} +59 -24
- package/app/components/Viewer/Options/AttributeColorBar.vue +4 -2
- package/app/components/Viewer/Options/AttributeRangeSelector.vue +4 -2
- package/app/components/Viewer/Options/AttributeSelector.vue +7 -9
- package/app/components/Viewer/Options/ColorMapList.vue +15 -13
- package/app/components/Viewer/Options/ColorMapPicker.vue +4 -4
- package/app/components/Viewer/Options/ColorPicker.vue +223 -41
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +16 -16
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +7 -5
- package/app/components/Viewer/Options/OptionsSection.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +8 -6
- package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +8 -9
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +2 -6
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +12 -16
- package/app/components/Viewer/Surface/PolygonsOptions.vue +12 -16
- package/app/components/Viewer/Ui.vue +2 -2
- package/app/components/Wrapper.vue +1 -4
- package/app/components/ZScaling.vue +5 -3
- package/app/components/csv-preview/CsvPreviewer.vue +38 -37
- package/app/components/csv-preview/CsvSettings.vue +6 -4
- package/app/components/csv-preview/CsvTable.vue +1 -1
- package/app/composables/batch_style.ts +5 -6
- package/app/composables/clipping_planes_widget.ts +73 -181
- package/app/composables/clipping_planes_widget_entries.ts +189 -0
- package/app/composables/copy_to_clipboard.ts +7 -0
- package/app/composables/global_attribute_style.ts +163 -83
- package/app/composables/hover_highlight.ts +46 -14
- package/app/composables/model_collections.ts +26 -13
- package/app/composables/model_components.ts +26 -13
- package/app/composables/project_manager.ts +76 -19
- package/app/composables/responsive_middle_truncate.ts +13 -13
- package/app/composables/stepper_tree.ts +34 -11
- package/app/composables/tree_filter.ts +66 -44
- package/app/composables/tree_keyboard_nav.ts +25 -11
- package/app/composables/tree_scroll.ts +44 -14
- package/app/composables/use_adaptive_styles.ts +66 -23
- package/app/composables/use_overlapping_picker.ts +66 -16
- package/app/composables/use_quick_colormap.ts +16 -5
- package/app/composables/virtual_tree.ts +75 -43
- package/app/composables/vtk_implicit_plane_widget.d.ts +2 -0
- package/app/plugins/auto_store_register.ts +2 -7
- package/app/plugins/click_outside_ignore_snackbars.client.ts +39 -0
- package/app/stores/app.ts +57 -192
- package/app/stores/app_helpers/extension.ts +179 -0
- package/app/stores/back.ts +37 -21
- package/app/stores/camera_manager.ts +22 -20
- package/app/stores/cloud.ts +17 -13
- package/app/stores/data.ts +88 -47
- package/app/stores/data_helpers/collections.ts +36 -38
- package/app/stores/data_helpers/mesh.ts +45 -36
- package/app/stores/data_style.ts +50 -28
- package/app/stores/feedback.ts +6 -6
- package/app/stores/hybrid_viewer.ts +41 -52
- package/app/stores/infra.ts +39 -37
- package/app/stores/menu.ts +23 -14
- package/app/stores/treeview.ts +72 -42
- package/app/stores/viewer.ts +39 -27
- package/app/utils/attributes.ts +3 -3
- package/app/utils/clipping_planes.ts +111 -14
- package/app/utils/color_picker.ts +57 -0
- package/app/utils/colormap.ts +58 -35
- package/app/utils/default_styles/index.ts +2 -2
- package/app/utils/default_styles/meshes.ts +107 -13
- package/app/utils/default_styles/models.ts +83 -14
- package/app/utils/extension.ts +47 -20
- package/app/utils/import_workflow.ts +21 -13
- package/app/utils/name_cleaner.ts +1 -1
- package/app/utils/string.ts +1 -1
- package/app/utils/treeview.ts +2 -2
- package/internal/database/base_database.ts +7 -3
- package/internal/database/database.ts +36 -26
- package/internal/database/extended_database.ts +1 -1
- package/internal/stores/data_style/mesh/cells/cell.ts +70 -34
- package/internal/stores/data_style/mesh/cells/color.ts +12 -6
- package/internal/stores/data_style/mesh/cells/common.ts +18 -8
- package/internal/stores/data_style/mesh/cells/index.ts +122 -42
- package/internal/stores/data_style/mesh/cells/textures.ts +12 -6
- package/internal/stores/data_style/mesh/cells/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/cells/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/color.ts +12 -6
- package/internal/stores/data_style/mesh/edges/common.ts +14 -6
- package/internal/stores/data_style/mesh/edges/edge.ts +71 -39
- package/internal/stores/data_style/mesh/edges/index.ts +117 -42
- package/internal/stores/data_style/mesh/edges/vertex.ts +76 -39
- package/internal/stores/data_style/mesh/edges/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/width.ts +12 -4
- package/internal/stores/data_style/mesh/index.ts +30 -11
- package/internal/stores/data_style/mesh/points/color.ts +12 -6
- package/internal/stores/data_style/mesh/points/common.ts +21 -8
- package/internal/stores/data_style/mesh/points/index.ts +101 -50
- package/internal/stores/data_style/mesh/points/size.ts +12 -4
- package/internal/stores/data_style/mesh/points/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/points/visibility.ts +17 -7
- package/internal/stores/data_style/mesh/polygons/color.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/common.ts +23 -6
- package/internal/stores/data_style/mesh/polygons/index.ts +130 -70
- package/internal/stores/data_style/mesh/polygons/polygon.ts +77 -43
- package/internal/stores/data_style/mesh/polygons/textures.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polygons/visibility.ts +16 -6
- package/internal/stores/data_style/mesh/polyhedra/color.ts +12 -6
- package/internal/stores/data_style/mesh/polyhedra/common.ts +14 -6
- package/internal/stores/data_style/mesh/polyhedra/index.ts +115 -56
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +80 -39
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +16 -6
- package/internal/stores/data_style/model/blocks/color.ts +43 -13
- package/internal/stores/data_style/model/blocks/common.ts +21 -6
- package/internal/stores/data_style/model/blocks/index.ts +89 -59
- package/internal/stores/data_style/model/blocks/polyhedron.ts +101 -44
- package/internal/stores/data_style/model/blocks/vertex.ts +107 -42
- package/internal/stores/data_style/model/blocks/visibility.ts +17 -4
- package/internal/stores/data_style/model/color.ts +171 -83
- package/internal/stores/data_style/model/common.ts +70 -21
- package/internal/stores/data_style/model/corners/color.ts +43 -11
- package/internal/stores/data_style/model/corners/common.ts +25 -6
- package/internal/stores/data_style/model/corners/index.ts +66 -41
- package/internal/stores/data_style/model/corners/vertex.ts +105 -74
- package/internal/stores/data_style/model/corners/visibility.ts +19 -4
- package/internal/stores/data_style/model/edges/common.ts +12 -4
- package/internal/stores/data_style/model/edges/index.ts +2 -1
- package/internal/stores/data_style/model/edges/visibility.ts +24 -7
- package/internal/stores/data_style/model/index.ts +24 -11
- package/internal/stores/data_style/model/lines/color.ts +41 -11
- package/internal/stores/data_style/model/lines/common.ts +17 -6
- package/internal/stores/data_style/model/lines/edge.ts +105 -42
- package/internal/stores/data_style/model/lines/index.ts +86 -59
- package/internal/stores/data_style/model/lines/vertex.ts +105 -42
- package/internal/stores/data_style/model/lines/visibility.ts +17 -4
- package/internal/stores/data_style/model/points/common.ts +8 -4
- package/internal/stores/data_style/model/points/index.ts +10 -3
- package/internal/stores/data_style/model/points/size.ts +12 -4
- package/internal/stores/data_style/model/points/visibility.ts +16 -6
- package/internal/stores/data_style/model/selection.ts +80 -58
- package/internal/stores/data_style/model/surfaces/color.ts +41 -11
- package/internal/stores/data_style/model/surfaces/common.ts +23 -6
- package/internal/stores/data_style/model/surfaces/index.ts +89 -59
- package/internal/stores/data_style/model/surfaces/polygon.ts +107 -67
- package/internal/stores/data_style/model/surfaces/vertex.ts +111 -67
- package/internal/stores/data_style/model/surfaces/visibility.ts +18 -5
- package/internal/stores/data_style/model/visibility.ts +82 -20
- package/internal/stores/data_style/state.ts +77 -65
- package/internal/stores/hybrid_viewer/brightness.ts +49 -31
- package/internal/stores/hybrid_viewer/camera.ts +191 -177
- package/internal/stores/hybrid_viewer/camera_animation.ts +11 -10
- package/internal/stores/hybrid_viewer/core.ts +64 -0
- package/internal/stores/hybrid_viewer/filters.ts +10 -16
- package/internal/stores/hybrid_viewer/highlight.ts +91 -130
- package/internal/stores/hybrid_viewer/ruler.ts +24 -15
- package/internal/stores/hybrid_viewer/scene.ts +96 -117
- package/internal/stores/hybrid_viewer/viewport.ts +74 -65
- package/internal/stores/hybrid_viewer/vtk_types.ts +13 -29
- package/internal/utils/api_fetch.ts +54 -23
- package/internal/utils/upload_file.ts +74 -53
- package/internal/utils/viewer_call.ts +22 -13
- package/internal/utils/ws_client.ts +24 -13
- package/nuxt.config.ts +58 -1
- package/package.json +20 -8
- package/server/api/cloud/extensions/run.post.ts +6 -10
- package/server/api/local/app/project_folder_path.post.ts +4 -4
- package/server/api/local/app/run_back.post.ts +5 -7
- package/server/api/local/app/run_viewer.post.ts +5 -7
- package/server/api/local/extensions/kill.post.ts +4 -3
- package/server/api/local/extensions/run.post.ts +7 -10
- package/server/api/local/extensions/upload.put.ts +44 -54
- package/server/api/microservice/app/get_is_app_ready.get.ts +4 -5
- package/server/api/microservice/app/set_app_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_back_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_is_app_ready.post.ts +5 -6
- package/server/api/microservice/app/set_viewer_base_url.post.ts +5 -6
- package/server/api/microservice/extensions/download.post.ts +5 -4
- package/server/api/serverless/run_cloud.post.ts +53 -11
- package/server/utils/app_config.ts +29 -22
- package/server/utils/cleanup.ts +60 -30
- package/server/utils/cloud.ts +9 -8
- package/server/utils/extension.ts +23 -9
- package/server/utils/microservices.ts +33 -24
- package/server/utils/path.ts +4 -4
- package/server/utils/scripts.ts +26 -23
- package/server/utils/server.ts +2 -2
- package/server/utils/server_config.ts +41 -27
- package/server/utils/stream.ts +6 -0
- package/server/utils/ws_client.ts +42 -8
- package/shared/scripts.ts +15 -10
- package/shared/utils/call_raw.ts +23 -16
- package/shared/utils/call_schema.ts +5 -8
- package/shared/utils/fetch_raw.ts +87 -47
- package/shared/utils/fetch_schema.ts +6 -9
- package/shared/utils/file.ts +8 -2
- package/shared/utils/response_handlers/load.ts +26 -11
- package/shared/utils/types.ts +9 -9
- package/shared/utils/validate_schema.ts +1 -1
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +0 -276
- package/server/types/vendor.d.ts +0 -64
- package/server/utils/server_config.js +0 -43
- package/shared/utils/call_raw.js +0 -30
- package/shared/utils/fetch_raw.js +0 -40
- /package/{opengeodeweb_front_schemas.js → .build/opengeodeweb_front_schemas.js} +0 -0
- /package/{server → .build/server}/utils/server.js +0 -0
- /package/{shared → .build/shared}/app_mode.js +0 -0
- /package/{shared → .build/shared}/utils/parse_boolean.js +0 -0
- /package/{shared → .build/shared}/utils/types.js +0 -0
|
@@ -7,24 +7,35 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
7
7
|
// Local constants
|
|
8
8
|
const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.visibility;
|
|
9
9
|
|
|
10
|
-
export function useMeshEdgesVisibilityStyle() {
|
|
10
|
+
export function useMeshEdgesVisibilityStyle(): {
|
|
11
|
+
meshEdgesVisibility: (id: string) => boolean | undefined;
|
|
12
|
+
setMeshEdgesVisibility: (id: string, visibility: boolean | undefined) => Promise<unknown>;
|
|
13
|
+
} {
|
|
11
14
|
const viewerStore = useViewerStore();
|
|
12
15
|
const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
|
|
13
16
|
|
|
14
17
|
function meshEdgesVisibility(id: string): boolean | undefined {
|
|
18
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- visibility is defined as boolean in the data style schema.
|
|
15
19
|
return meshEdgesCommonStyle.meshEdgesStyle(id).visibility as boolean | undefined;
|
|
16
20
|
}
|
|
17
|
-
function setMeshEdgesVisibility(
|
|
21
|
+
async function setMeshEdgesVisibility(
|
|
22
|
+
id: string,
|
|
23
|
+
visibility: boolean | undefined,
|
|
24
|
+
): Promise<unknown> {
|
|
18
25
|
const params = { id, visibility };
|
|
19
|
-
|
|
26
|
+
const result = await viewerStore.request(
|
|
20
27
|
{
|
|
21
28
|
schema,
|
|
22
29
|
params,
|
|
23
30
|
},
|
|
24
31
|
{
|
|
25
|
-
response_function: () =>
|
|
32
|
+
response_function: async () => {
|
|
33
|
+
const mutateResult = await meshEdgesCommonStyle.mutateMeshEdgesStyle(id, { visibility });
|
|
34
|
+
return mutateResult;
|
|
35
|
+
},
|
|
26
36
|
},
|
|
27
37
|
);
|
|
38
|
+
return result;
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
return {
|
|
@@ -7,24 +7,32 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
7
7
|
// Local constants
|
|
8
8
|
const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.width;
|
|
9
9
|
|
|
10
|
-
export function useMeshEdgesWidthStyle() {
|
|
10
|
+
export function useMeshEdgesWidthStyle(): {
|
|
11
|
+
meshEdgesWidth: (id: string) => number | undefined;
|
|
12
|
+
setMeshEdgesWidth: (id: string, width: number | undefined) => Promise<unknown>;
|
|
13
|
+
} {
|
|
11
14
|
const viewerStore = useViewerStore();
|
|
12
15
|
const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
|
|
13
16
|
|
|
14
17
|
function meshEdgesWidth(id: string): number | undefined {
|
|
18
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- width is defined as number in the data style schema.
|
|
15
19
|
return meshEdgesCommonStyle.meshEdgesStyle(id).width as number | undefined;
|
|
16
20
|
}
|
|
17
|
-
function setMeshEdgesWidth(id: string, width: number | undefined) {
|
|
21
|
+
async function setMeshEdgesWidth(id: string, width: number | undefined): Promise<unknown> {
|
|
18
22
|
const params = { id, width };
|
|
19
|
-
|
|
23
|
+
const result = await viewerStore.request(
|
|
20
24
|
{
|
|
21
25
|
schema,
|
|
22
26
|
params,
|
|
23
27
|
},
|
|
24
28
|
{
|
|
25
|
-
response_function: () =>
|
|
29
|
+
response_function: async () => {
|
|
30
|
+
const mutateResult = await meshEdgesCommonStyle.mutateMeshEdgesStyle(id, { width });
|
|
31
|
+
return mutateResult;
|
|
32
|
+
},
|
|
26
33
|
},
|
|
27
34
|
);
|
|
35
|
+
return result;
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
return {
|
|
@@ -16,7 +16,17 @@ import { useMeshPolyhedraStyle } from "./polyhedra";
|
|
|
16
16
|
const meshSchemas = viewer_schemas.opengeodeweb_viewer.mesh;
|
|
17
17
|
|
|
18
18
|
// oxlint-disable-next-line max-lines-per-function
|
|
19
|
-
export function useMeshStyle() {
|
|
19
|
+
export function useMeshStyle(): {
|
|
20
|
+
meshVisibility: (id: string) => boolean | undefined;
|
|
21
|
+
setMeshVisibility: (id: string, visibility: boolean | undefined) => Promise<unknown>;
|
|
22
|
+
meshColor: (id: string) => unknown;
|
|
23
|
+
setMeshColor: (id: string, color: unknown) => Promise<unknown>;
|
|
24
|
+
applyMeshStyle: (id: string) => Promise<unknown[]>;
|
|
25
|
+
} & ReturnType<typeof useMeshPointsStyle> &
|
|
26
|
+
ReturnType<typeof useMeshEdgesStyle> &
|
|
27
|
+
ReturnType<typeof useMeshCellsStyle> &
|
|
28
|
+
ReturnType<typeof useMeshPolygonsStyle> &
|
|
29
|
+
ReturnType<typeof useMeshPolyhedraStyle> {
|
|
20
30
|
const hybridViewerStore = useHybridViewerStore();
|
|
21
31
|
const viewerStore = useViewerStore();
|
|
22
32
|
const dataStyleState = useDataStyleState();
|
|
@@ -29,47 +39,55 @@ export function useMeshStyle() {
|
|
|
29
39
|
function meshVisibility(id: string): boolean | undefined {
|
|
30
40
|
return dataStyleState.getStyle(id).visibility;
|
|
31
41
|
}
|
|
32
|
-
function setMeshVisibility(id: string, visibility: boolean | undefined) {
|
|
42
|
+
async function setMeshVisibility(id: string, visibility: boolean | undefined): Promise<unknown> {
|
|
33
43
|
const schema = meshSchemas.visibility;
|
|
34
44
|
const params = { id, visibility };
|
|
35
|
-
|
|
45
|
+
const result = await viewerStore.request(
|
|
36
46
|
{
|
|
37
47
|
schema,
|
|
38
48
|
params,
|
|
39
49
|
},
|
|
40
50
|
{
|
|
41
51
|
response_function: async () => {
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
if (visibility !== undefined) {
|
|
53
|
+
hybridViewerStore.setVisibility(id, visibility);
|
|
54
|
+
}
|
|
55
|
+
const mutatedId = await dataStyleState.mutateStyle(id, { visibility });
|
|
56
|
+
return mutatedId;
|
|
44
57
|
},
|
|
45
58
|
},
|
|
46
59
|
);
|
|
60
|
+
return result;
|
|
47
61
|
}
|
|
48
62
|
|
|
49
63
|
function meshColor(id: string): unknown {
|
|
50
64
|
return dataStyleState.getStyle(id).color;
|
|
51
65
|
}
|
|
52
66
|
|
|
53
|
-
function setMeshColor(id: string, color: unknown) {
|
|
67
|
+
async function setMeshColor(id: string, color: unknown): Promise<unknown> {
|
|
54
68
|
const schema = meshSchemas.color;
|
|
55
69
|
const params = { id, color };
|
|
56
|
-
|
|
70
|
+
const result = await viewerStore.request(
|
|
57
71
|
{
|
|
58
72
|
schema,
|
|
59
73
|
params,
|
|
60
74
|
},
|
|
61
75
|
{
|
|
62
|
-
response_function: () =>
|
|
76
|
+
response_function: async () => {
|
|
77
|
+
const mutatedId = await dataStyleState.mutateStyle(id, { color });
|
|
78
|
+
return mutatedId;
|
|
79
|
+
},
|
|
63
80
|
},
|
|
64
81
|
);
|
|
82
|
+
return result;
|
|
65
83
|
}
|
|
66
84
|
|
|
67
|
-
function applyMeshStyle(id: string) {
|
|
85
|
+
async function applyMeshStyle(id: string): Promise<unknown[]> {
|
|
68
86
|
const style = dataStyleState.getStyle(id);
|
|
69
87
|
const promise_array: unknown[] = [];
|
|
70
88
|
for (const [key, value] of Object.entries(style)) {
|
|
71
89
|
if (key === "visibility") {
|
|
72
|
-
promise_array.push(setMeshVisibility(id,
|
|
90
|
+
promise_array.push(setMeshVisibility(id, style.visibility));
|
|
73
91
|
} else if (key === "color") {
|
|
74
92
|
promise_array.push(setMeshColor(id, value));
|
|
75
93
|
} else if (key === "points") {
|
|
@@ -96,7 +114,8 @@ export function useMeshStyle() {
|
|
|
96
114
|
throw new Error(`Unknown mesh key: ${key}`);
|
|
97
115
|
}
|
|
98
116
|
}
|
|
99
|
-
|
|
117
|
+
const results = await Promise.all(promise_array);
|
|
118
|
+
return results;
|
|
100
119
|
}
|
|
101
120
|
|
|
102
121
|
return {
|
|
@@ -8,27 +8,33 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
8
8
|
// Local constants
|
|
9
9
|
const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.color;
|
|
10
10
|
|
|
11
|
-
export function useMeshPointsColorStyle() {
|
|
11
|
+
export function useMeshPointsColorStyle(): {
|
|
12
|
+
meshPointsColor: (id: string) => unknown;
|
|
13
|
+
setMeshPointsColor: (id: string, color: unknown) => Promise<unknown>;
|
|
14
|
+
} {
|
|
12
15
|
const viewerStore = useViewerStore();
|
|
13
16
|
const meshPointsCommonStyle = useMeshPointsCommonStyle();
|
|
14
17
|
|
|
15
18
|
function meshPointsColor(id: string): unknown {
|
|
16
19
|
return meshPointsCommonStyle.meshPointsColoring(id).constant;
|
|
17
20
|
}
|
|
18
|
-
function setMeshPointsColor(id: string, color: unknown) {
|
|
21
|
+
async function setMeshPointsColor(id: string, color: unknown): Promise<unknown> {
|
|
19
22
|
const params = { id, color };
|
|
20
|
-
|
|
23
|
+
const result = await viewerStore.request(
|
|
21
24
|
{
|
|
22
25
|
schema,
|
|
23
26
|
params,
|
|
24
27
|
},
|
|
25
28
|
{
|
|
26
|
-
response_function: () =>
|
|
27
|
-
meshPointsCommonStyle.mutateMeshPointsColoring(id, {
|
|
29
|
+
response_function: async () => {
|
|
30
|
+
const mutateResult = await meshPointsCommonStyle.mutateMeshPointsColoring(id, {
|
|
28
31
|
constant: color,
|
|
29
|
-
})
|
|
32
|
+
});
|
|
33
|
+
return mutateResult;
|
|
34
|
+
},
|
|
30
35
|
},
|
|
31
36
|
);
|
|
37
|
+
return result;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
return {
|
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
2
2
|
import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
|
|
3
3
|
|
|
4
|
-
export function useMeshPointsCommonStyle() {
|
|
4
|
+
export function useMeshPointsCommonStyle(): {
|
|
5
|
+
meshPointsStyle: (id: string) => StyleValues;
|
|
6
|
+
meshPointsColoring: (id: string) => StyleValues;
|
|
7
|
+
mutateMeshPointsColoring: (id: string, values: StyleValues) => Promise<string>;
|
|
8
|
+
mutateMeshPointsStyle: (id: string, values: StyleValues) => Promise<string>;
|
|
9
|
+
mutateMeshPointsVisibility: (response: { id: string; visibility: boolean }) => Promise<string>;
|
|
10
|
+
} {
|
|
5
11
|
const dataStyleState = useDataStyleState();
|
|
6
12
|
|
|
7
|
-
function mutateMeshPointsStyle(id: string, values: StyleValues) {
|
|
8
|
-
|
|
13
|
+
async function mutateMeshPointsStyle(id: string, values: StyleValues): Promise<string> {
|
|
14
|
+
const result = await dataStyleState.mutateStyle(id, {
|
|
9
15
|
points: values,
|
|
10
16
|
});
|
|
17
|
+
return result;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
|
-
function mutateMeshPointsVisibility(response: {
|
|
14
|
-
|
|
20
|
+
async function mutateMeshPointsVisibility(response: {
|
|
21
|
+
id: string;
|
|
22
|
+
visibility: boolean;
|
|
23
|
+
}): Promise<string> {
|
|
24
|
+
const result = await mutateMeshPointsStyle(response.id, { visibility: response.visibility });
|
|
25
|
+
return result;
|
|
15
26
|
}
|
|
16
27
|
|
|
17
28
|
function meshPointsStyle(id: string): StyleValues {
|
|
18
|
-
return dataStyleState.getStyle(id).points
|
|
29
|
+
return dataStyleState.getStyle(id).points ?? {};
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
function meshPointsColoring(id: string): StyleValues {
|
|
33
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
|
|
22
34
|
return meshPointsStyle(id).coloring as StyleValues;
|
|
23
35
|
}
|
|
24
36
|
|
|
25
|
-
function mutateMeshPointsColoring(id: string, values: StyleValues) {
|
|
26
|
-
|
|
37
|
+
async function mutateMeshPointsColoring(id: string, values: StyleValues): Promise<string> {
|
|
38
|
+
const result = await mutateMeshPointsStyle(id, {
|
|
27
39
|
coloring: values,
|
|
28
40
|
});
|
|
41
|
+
return result;
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
return {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Local imports
|
|
4
4
|
import { isMeshPointsVertexAttributeValid, useMeshPointsVertexAttributeStyle } from "./vertex";
|
|
5
|
+
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
5
6
|
import { useMeshPointsColorStyle } from "./color";
|
|
6
7
|
import { useMeshPointsCommonStyle } from "./common";
|
|
7
8
|
import { useMeshPointsSizeStyle } from "./size";
|
|
@@ -9,74 +10,124 @@ import { useMeshPointsVisibilityStyle } from "./visibility";
|
|
|
9
10
|
|
|
10
11
|
// Local constants
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface MeshPointsActiveColoringDeps {
|
|
14
|
+
readonly commonStyle: ReturnType<typeof useMeshPointsCommonStyle>;
|
|
15
|
+
readonly colorStyle: ReturnType<typeof useMeshPointsColorStyle>;
|
|
16
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshPointsVertexAttributeStyle>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function handleMeshPointsVertexColoring(
|
|
20
|
+
id: string,
|
|
21
|
+
vertexAttributeStyle: ReturnType<typeof useMeshPointsVertexAttributeStyle>,
|
|
22
|
+
): Promise<unknown> | undefined {
|
|
23
|
+
const name = vertexAttributeStyle.meshPointsVertexAttributeName(id);
|
|
24
|
+
const item = vertexAttributeStyle.meshPointsVertexAttributeItem(id);
|
|
25
|
+
const [minimum, maximum] = vertexAttributeStyle.meshPointsVertexAttributeRange(id);
|
|
26
|
+
const colorMap = vertexAttributeStyle.meshPointsVertexAttributeColorMap(id);
|
|
27
|
+
const vertex_attribute = { name, item, minimum, maximum, colorMap };
|
|
28
|
+
if (!isMeshPointsVertexAttributeValid(vertex_attribute)) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return vertexAttributeStyle.setMeshPointsVertexAttribute(id, vertex_attribute);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function setMeshPointsActiveColoring(
|
|
35
|
+
id: string,
|
|
36
|
+
type: string | undefined,
|
|
37
|
+
deps: MeshPointsActiveColoringDeps,
|
|
38
|
+
): Promise<unknown> {
|
|
39
|
+
await deps.commonStyle.mutateMeshPointsStyle(id, {
|
|
40
|
+
coloring: { active: type },
|
|
41
|
+
});
|
|
42
|
+
if (type === "constant") {
|
|
43
|
+
const result = await deps.colorStyle.setMeshPointsColor(
|
|
44
|
+
id,
|
|
45
|
+
deps.colorStyle.meshPointsColor(id),
|
|
46
|
+
);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
if (type === "vertex") {
|
|
50
|
+
const result = await handleMeshPointsVertexColoring(id, deps.vertexAttributeStyle);
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Unknown mesh points coloring type: ${type}`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function applyMeshPointsStyle(
|
|
57
|
+
id: string,
|
|
58
|
+
visibilityStyle: ReturnType<typeof useMeshPointsVisibilityStyle>,
|
|
59
|
+
sizeStyle: ReturnType<typeof useMeshPointsSizeStyle>,
|
|
60
|
+
activeColoringType: string | undefined,
|
|
61
|
+
deps: MeshPointsActiveColoringDeps,
|
|
62
|
+
): Promise<unknown[]> {
|
|
63
|
+
const result = await Promise.all([
|
|
64
|
+
visibilityStyle.setMeshPointsVisibility(id, visibilityStyle.meshPointsVisibility(id)),
|
|
65
|
+
sizeStyle.setMeshPointsSize(id, sizeStyle.meshPointsSize(id)),
|
|
66
|
+
setMeshPointsActiveColoring(id, activeColoringType, deps),
|
|
67
|
+
]);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type UseMeshPointsStyleReturn = ReturnType<typeof useMeshPointsCommonStyle> & {
|
|
72
|
+
meshPointsColoring: (id: string) => StyleValues;
|
|
73
|
+
meshPointsActiveColoring: (id: string) => string | undefined;
|
|
74
|
+
setMeshPointsActiveColoring: (id: string, type: string | undefined) => Promise<unknown>;
|
|
75
|
+
applyMeshPointsStyle: (id: string) => Promise<unknown[]>;
|
|
76
|
+
} & ReturnType<typeof useMeshPointsVisibilityStyle> &
|
|
77
|
+
ReturnType<typeof useMeshPointsColorStyle> &
|
|
78
|
+
ReturnType<typeof useMeshPointsSizeStyle> &
|
|
79
|
+
ReturnType<typeof useMeshPointsVertexAttributeStyle>;
|
|
80
|
+
|
|
81
|
+
export function useMeshPointsStyle(): UseMeshPointsStyleReturn {
|
|
13
82
|
const meshPointsCommonStyle = useMeshPointsCommonStyle();
|
|
83
|
+
const meshPointsVisibility = useMeshPointsVisibilityStyle();
|
|
14
84
|
const meshPointsColorStyle = useMeshPointsColorStyle();
|
|
85
|
+
const meshPointsSizeStyle = useMeshPointsSizeStyle();
|
|
15
86
|
const meshPointsVertexAttributeStyle = useMeshPointsVertexAttributeStyle();
|
|
16
87
|
|
|
17
|
-
|
|
88
|
+
const activeColoringDeps: MeshPointsActiveColoringDeps = {
|
|
89
|
+
commonStyle: meshPointsCommonStyle,
|
|
90
|
+
colorStyle: meshPointsColorStyle,
|
|
91
|
+
vertexAttributeStyle: meshPointsVertexAttributeStyle,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
function meshPointsColoring(id: string): StyleValues {
|
|
18
95
|
return meshPointsCommonStyle.meshPointsColoring(id);
|
|
19
96
|
}
|
|
20
97
|
|
|
21
98
|
function meshPointsActiveColoring(id: string): string | undefined {
|
|
99
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.active is defined as string in the data style schema.
|
|
22
100
|
return meshPointsColoring(id).active as string | undefined;
|
|
23
101
|
}
|
|
24
102
|
|
|
25
|
-
async function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
if (type === "vertex") {
|
|
33
|
-
const name = meshPointsVertexAttributeStyle.meshPointsVertexAttributeName(id);
|
|
34
|
-
const item = meshPointsVertexAttributeStyle.meshPointsVertexAttributeItem(id);
|
|
35
|
-
const [minimum, maximum] = meshPointsVertexAttributeStyle.meshPointsVertexAttributeRange(id);
|
|
36
|
-
const colorMap = meshPointsVertexAttributeStyle.meshPointsVertexAttributeColorMap(id);
|
|
37
|
-
const vertex_attribute = { name, item, minimum, maximum, colorMap };
|
|
38
|
-
if (!isMeshPointsVertexAttributeValid(vertex_attribute)) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
return meshPointsVertexAttributeStyle.setMeshPointsVertexAttribute(id, vertex_attribute);
|
|
42
|
-
}
|
|
43
|
-
throw new Error(`Unknown mesh points coloring type: ${type}`);
|
|
103
|
+
async function boundSetMeshPointsActiveColoring(
|
|
104
|
+
id: string,
|
|
105
|
+
type: string | undefined,
|
|
106
|
+
): Promise<unknown> {
|
|
107
|
+
const result = await setMeshPointsActiveColoring(id, type, activeColoringDeps);
|
|
108
|
+
return result;
|
|
44
109
|
}
|
|
45
110
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export function useMeshPointsStyle() {
|
|
56
|
-
const meshPointsCommonStyle = useMeshPointsCommonStyle();
|
|
57
|
-
const meshPointsVisibility = useMeshPointsVisibilityStyle();
|
|
58
|
-
const meshPointsSizeStyle = useMeshPointsSizeStyle();
|
|
59
|
-
const meshPointsColoringStyle = useMeshPointsColoringStyle();
|
|
60
|
-
|
|
61
|
-
function applyMeshPointsStyle(id: string) {
|
|
62
|
-
return Promise.all([
|
|
63
|
-
meshPointsVisibility.setMeshPointsVisibility(
|
|
64
|
-
id,
|
|
65
|
-
meshPointsVisibility.meshPointsVisibility(id),
|
|
66
|
-
),
|
|
67
|
-
meshPointsSizeStyle.setMeshPointsSize(id, meshPointsSizeStyle.meshPointsSize(id)),
|
|
68
|
-
meshPointsColoringStyle.setMeshPointsActiveColoring(
|
|
69
|
-
id,
|
|
70
|
-
meshPointsColoringStyle.meshPointsActiveColoring(id),
|
|
71
|
-
),
|
|
72
|
-
]);
|
|
111
|
+
async function boundApplyMeshPointsStyle(id: string): Promise<unknown[]> {
|
|
112
|
+
const result = await applyMeshPointsStyle(
|
|
113
|
+
id,
|
|
114
|
+
meshPointsVisibility,
|
|
115
|
+
meshPointsSizeStyle,
|
|
116
|
+
meshPointsActiveColoring(id),
|
|
117
|
+
activeColoringDeps,
|
|
118
|
+
);
|
|
119
|
+
return result;
|
|
73
120
|
}
|
|
74
121
|
|
|
75
122
|
return {
|
|
76
123
|
...meshPointsCommonStyle,
|
|
77
|
-
|
|
78
|
-
|
|
124
|
+
meshPointsColoring,
|
|
125
|
+
meshPointsActiveColoring,
|
|
126
|
+
setMeshPointsActiveColoring: boundSetMeshPointsActiveColoring,
|
|
127
|
+
applyMeshPointsStyle: boundApplyMeshPointsStyle,
|
|
79
128
|
...meshPointsVisibility,
|
|
129
|
+
...meshPointsColorStyle,
|
|
80
130
|
...meshPointsSizeStyle,
|
|
131
|
+
...meshPointsVertexAttributeStyle,
|
|
81
132
|
};
|
|
82
133
|
}
|
|
@@ -8,24 +8,32 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
8
8
|
// Local constants
|
|
9
9
|
const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.size;
|
|
10
10
|
|
|
11
|
-
export function useMeshPointsSizeStyle() {
|
|
11
|
+
export function useMeshPointsSizeStyle(): {
|
|
12
|
+
meshPointsSize: (id: string) => number | undefined;
|
|
13
|
+
setMeshPointsSize: (id: string, size: number | undefined) => Promise<unknown>;
|
|
14
|
+
} {
|
|
12
15
|
const viewerStore = useViewerStore();
|
|
13
16
|
const meshPointsCommonStyle = useMeshPointsCommonStyle();
|
|
14
17
|
|
|
15
18
|
function meshPointsSize(id: string): number | undefined {
|
|
19
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- size is defined as number in the data style schema.
|
|
16
20
|
return meshPointsCommonStyle.meshPointsStyle(id).size as number | undefined;
|
|
17
21
|
}
|
|
18
|
-
function setMeshPointsSize(id: string, size: number | undefined) {
|
|
22
|
+
async function setMeshPointsSize(id: string, size: number | undefined): Promise<unknown> {
|
|
19
23
|
const params = { id, size };
|
|
20
|
-
|
|
24
|
+
const result = await viewerStore.request(
|
|
21
25
|
{
|
|
22
26
|
schema,
|
|
23
27
|
params,
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
|
-
response_function: () =>
|
|
30
|
+
response_function: async () => {
|
|
31
|
+
const mutateResult = await meshPointsCommonStyle.mutateMeshPointsStyle(id, { size });
|
|
32
|
+
return mutateResult;
|
|
33
|
+
},
|
|
27
34
|
},
|
|
28
35
|
);
|
|
36
|
+
return result;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
return {
|