@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
|
@@ -19,12 +19,19 @@ interface AttributeGroup {
|
|
|
19
19
|
lines_ids: string[];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async function setModelLinesDefaultStyle(_id: string) {
|
|
22
|
+
async function setModelLinesDefaultStyle(_id: string): Promise<void> {
|
|
23
23
|
// Placeholder
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// oxlint-disable-next-line max-lines-per-function
|
|
27
|
-
export function useModelLinesStyle()
|
|
27
|
+
export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle> &
|
|
28
|
+
ReturnType<typeof useModelLinesVisibility> &
|
|
29
|
+
ReturnType<typeof useModelLinesColor> &
|
|
30
|
+
ReturnType<typeof useModelLinesVertexAttribute> &
|
|
31
|
+
ReturnType<typeof useModelLinesEdgeAttribute> & {
|
|
32
|
+
applyModelLinesStyle: (modelId: string) => Promise<void>;
|
|
33
|
+
setModelLinesDefaultStyle: (id: string) => Promise<void>;
|
|
34
|
+
} {
|
|
28
35
|
const dataStore = useDataStore();
|
|
29
36
|
const modelCommonStyle = useModelLinesCommonStyle();
|
|
30
37
|
const modelVisibilityStyle = useModelLinesVisibility();
|
|
@@ -32,30 +39,37 @@ export function useModelLinesStyle() {
|
|
|
32
39
|
const modelLinesVertexAttribute = useModelLinesVertexAttribute();
|
|
33
40
|
const modelLinesEdgeAttribute = useModelLinesEdgeAttribute();
|
|
34
41
|
|
|
35
|
-
function applyModelLinesVisibilityStyle(
|
|
42
|
+
async function applyModelLinesVisibilityStyle(
|
|
43
|
+
modelId: string,
|
|
44
|
+
lines_ids: string[],
|
|
45
|
+
): Promise<void> {
|
|
36
46
|
const visibilityGroups: Record<string, string[]> = {};
|
|
37
47
|
for (const line_id of lines_ids) {
|
|
38
48
|
const style = modelCommonStyle.modelLineStyle(modelId, line_id);
|
|
39
49
|
const visibility = String(style.visibility);
|
|
40
|
-
|
|
41
|
-
visibilityGroups[visibility] = [];
|
|
42
|
-
}
|
|
50
|
+
visibilityGroups[visibility] ??= [];
|
|
43
51
|
visibilityGroups[visibility].push(line_id);
|
|
44
52
|
}
|
|
45
|
-
|
|
46
|
-
Object.entries(visibilityGroups).map(([visibility, ids]) =>
|
|
47
|
-
modelVisibilityStyle.setModelLinesVisibility(
|
|
48
|
-
|
|
53
|
+
await Promise.all(
|
|
54
|
+
Object.entries(visibilityGroups).map(async ([visibility, ids]) => {
|
|
55
|
+
const result = await modelVisibilityStyle.setModelLinesVisibility(
|
|
56
|
+
modelId,
|
|
57
|
+
ids,
|
|
58
|
+
visibility === "true",
|
|
59
|
+
);
|
|
60
|
+
return result;
|
|
61
|
+
}),
|
|
49
62
|
);
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
function applyModelLinesColoringStyle(
|
|
65
|
+
async function applyModelLinesColoringStyle(
|
|
66
|
+
modelId: string,
|
|
67
|
+
lines_ids: string[],
|
|
68
|
+
): Promise<unknown[]> {
|
|
53
69
|
const activeColoringGroups: Record<string, string[]> = {};
|
|
54
70
|
for (const line_id of lines_ids) {
|
|
55
71
|
const activeColoring = String(modelColorStyle.modelLineActiveColoring(modelId, line_id));
|
|
56
|
-
|
|
57
|
-
activeColoringGroups[activeColoring] = [];
|
|
58
|
-
}
|
|
72
|
+
activeColoringGroups[activeColoring] ??= [];
|
|
59
73
|
activeColoringGroups[activeColoring].push(line_id);
|
|
60
74
|
}
|
|
61
75
|
|
|
@@ -67,15 +81,19 @@ export function useModelLinesStyle() {
|
|
|
67
81
|
for (const line_id of type_lines_ids) {
|
|
68
82
|
const color = modelColorStyle.modelLineColor(modelId, line_id);
|
|
69
83
|
const color_key = JSON.stringify(color);
|
|
70
|
-
|
|
71
|
-
colorGroups[color_key] = { color, lines_ids: [] };
|
|
72
|
-
}
|
|
84
|
+
colorGroups[color_key] ??= { color, lines_ids: [] };
|
|
73
85
|
colorGroups[color_key].lines_ids.push(line_id);
|
|
74
86
|
}
|
|
75
87
|
coloringPromises.push(
|
|
76
|
-
...Object.values(colorGroups).map(({ color, lines_ids: ids }) =>
|
|
77
|
-
modelColorStyle.setModelLinesColor(
|
|
78
|
-
|
|
88
|
+
...Object.values(colorGroups).map(async ({ color, lines_ids: ids }) => {
|
|
89
|
+
const result = await modelColorStyle.setModelLinesColor(
|
|
90
|
+
modelId,
|
|
91
|
+
ids,
|
|
92
|
+
color,
|
|
93
|
+
"constant",
|
|
94
|
+
);
|
|
95
|
+
return result;
|
|
96
|
+
}),
|
|
79
97
|
);
|
|
80
98
|
} else if (type === "random") {
|
|
81
99
|
coloringPromises.push(
|
|
@@ -99,28 +117,32 @@ export function useModelLinesStyle() {
|
|
|
99
117
|
continue;
|
|
100
118
|
}
|
|
101
119
|
const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
111
|
-
}
|
|
120
|
+
vertexGroups[key] ??= {
|
|
121
|
+
name,
|
|
122
|
+
item,
|
|
123
|
+
minimum,
|
|
124
|
+
maximum,
|
|
125
|
+
colorMap,
|
|
126
|
+
lines_ids: [],
|
|
127
|
+
};
|
|
112
128
|
vertexGroups[key].lines_ids.push(line_id);
|
|
113
129
|
}
|
|
114
130
|
coloringPromises.push(
|
|
115
131
|
...Object.values(vertexGroups).map(
|
|
116
|
-
({ name, item, minimum, maximum, colorMap, lines_ids: ids }) =>
|
|
117
|
-
modelLinesVertexAttribute.setModelLinesVertexAttribute(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
132
|
+
async ({ name, item, minimum, maximum, colorMap, lines_ids: ids }) => {
|
|
133
|
+
const result = await modelLinesVertexAttribute.setModelLinesVertexAttribute(
|
|
134
|
+
modelId,
|
|
135
|
+
ids,
|
|
136
|
+
{
|
|
137
|
+
name,
|
|
138
|
+
item,
|
|
139
|
+
minimum,
|
|
140
|
+
maximum,
|
|
141
|
+
colorMap,
|
|
142
|
+
},
|
|
143
|
+
);
|
|
144
|
+
return result;
|
|
145
|
+
},
|
|
124
146
|
),
|
|
125
147
|
);
|
|
126
148
|
} else if (type === "edge") {
|
|
@@ -141,41 +163,46 @@ export function useModelLinesStyle() {
|
|
|
141
163
|
continue;
|
|
142
164
|
}
|
|
143
165
|
const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
153
|
-
}
|
|
166
|
+
edgeGroups[key] ??= {
|
|
167
|
+
name,
|
|
168
|
+
item,
|
|
169
|
+
minimum,
|
|
170
|
+
maximum,
|
|
171
|
+
colorMap,
|
|
172
|
+
lines_ids: [],
|
|
173
|
+
};
|
|
154
174
|
edgeGroups[key].lines_ids.push(line_id);
|
|
155
175
|
}
|
|
156
176
|
coloringPromises.push(
|
|
157
177
|
...Object.values(edgeGroups).map(
|
|
158
|
-
({ name, item, minimum, maximum, colorMap, lines_ids: ids }) =>
|
|
159
|
-
modelLinesEdgeAttribute.setModelLinesEdgeAttribute(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
178
|
+
async ({ name, item, minimum, maximum, colorMap, lines_ids: ids }) => {
|
|
179
|
+
const result = await modelLinesEdgeAttribute.setModelLinesEdgeAttribute(
|
|
180
|
+
modelId,
|
|
181
|
+
ids,
|
|
182
|
+
{
|
|
183
|
+
name,
|
|
184
|
+
item,
|
|
185
|
+
minimum,
|
|
186
|
+
maximum,
|
|
187
|
+
colorMap,
|
|
188
|
+
},
|
|
189
|
+
);
|
|
190
|
+
return result;
|
|
191
|
+
},
|
|
166
192
|
),
|
|
167
193
|
);
|
|
168
194
|
}
|
|
169
195
|
}
|
|
170
|
-
|
|
196
|
+
const results = await Promise.all(coloringPromises);
|
|
197
|
+
return results;
|
|
171
198
|
}
|
|
172
199
|
|
|
173
|
-
async function applyModelLinesStyle(modelId: string) {
|
|
200
|
+
async function applyModelLinesStyle(modelId: string): Promise<void> {
|
|
174
201
|
const lines_ids = await dataStore.getLinesGeodeIds(modelId);
|
|
175
202
|
if (lines_ids.length === 0) {
|
|
176
203
|
return;
|
|
177
204
|
}
|
|
178
|
-
|
|
205
|
+
await Promise.all([
|
|
179
206
|
applyModelLinesVisibilityStyle(modelId, lines_ids),
|
|
180
207
|
applyModelLinesColoringStyle(modelId, lines_ids),
|
|
181
208
|
]);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// oxlint-disable eslint/max-lines
|
|
1
2
|
import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
|
|
2
3
|
// Third party imports
|
|
3
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
|
|
@@ -49,12 +50,61 @@ function isModelLinesVertexAttributeValid({
|
|
|
49
50
|
);
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
interface UseModelLinesVertexAttributeReturn {
|
|
54
|
+
modelLinesVertexAttributeName: (modelId: string, lineId?: string) => string | undefined;
|
|
55
|
+
modelLinesVertexAttributeItem: (modelId: string, lineId?: string) => number;
|
|
56
|
+
modelLinesVertexAttributeRange: (
|
|
57
|
+
modelId: string,
|
|
58
|
+
lineId?: string,
|
|
59
|
+
) => [number | undefined, number | undefined];
|
|
60
|
+
modelLinesVertexAttributeColorMap: (modelId: string, lineId?: string) => string | undefined;
|
|
61
|
+
modelLinesVertexAttributeStoredConfig: (
|
|
62
|
+
modelId: string,
|
|
63
|
+
lineId: string | undefined,
|
|
64
|
+
name: string | undefined,
|
|
65
|
+
item: number | undefined,
|
|
66
|
+
) => AttributeStoredConfig;
|
|
67
|
+
setModelLinesVertexAttribute: (
|
|
68
|
+
modelId: string,
|
|
69
|
+
lineIds: string[],
|
|
70
|
+
input: AttributeInput,
|
|
71
|
+
) => Promise<unknown>;
|
|
72
|
+
setModelLinesVertexAttributeName: (
|
|
73
|
+
modelId: string,
|
|
74
|
+
lineIds: string[],
|
|
75
|
+
name: string,
|
|
76
|
+
) => Promise<unknown>;
|
|
77
|
+
setModelLinesVertexAttributeItem: (
|
|
78
|
+
modelId: string,
|
|
79
|
+
lineIds: string[],
|
|
80
|
+
item: number,
|
|
81
|
+
) => Promise<unknown>;
|
|
82
|
+
setModelLinesVertexAttributeRange: (
|
|
83
|
+
modelId: string,
|
|
84
|
+
lineIds: string[],
|
|
85
|
+
minimum: number,
|
|
86
|
+
maximum: number,
|
|
87
|
+
) => Promise<unknown>;
|
|
88
|
+
setModelLinesVertexAttributeColorMap: (
|
|
89
|
+
modelId: string,
|
|
90
|
+
lineIds: string[],
|
|
91
|
+
colorMap: string | undefined,
|
|
92
|
+
) => Promise<unknown>;
|
|
93
|
+
modelLinesVertexAttributeNoDataColor: (modelId: string, lineId?: string) => unknown;
|
|
94
|
+
setModelLinesVertexAttributeNoDataColor: (
|
|
95
|
+
modelId: string,
|
|
96
|
+
lineIds: string[],
|
|
97
|
+
no_data_color: unknown,
|
|
98
|
+
) => Promise<unknown>;
|
|
99
|
+
}
|
|
100
|
+
|
|
52
101
|
// oxlint-disable-next-line max-lines-per-function
|
|
53
|
-
function useModelLinesVertexAttribute() {
|
|
102
|
+
function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
54
103
|
const dataStore = useDataStore();
|
|
55
104
|
const modelLinesCommonStyle = useModelLinesCommonStyle();
|
|
56
105
|
const viewerStore = useViewerStore();
|
|
57
106
|
function modelLinesVertexAttribute(modelId: string, lineId?: string): AttributeState {
|
|
107
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.vertex shape is defined by the data style schema.
|
|
58
108
|
return modelLinesCommonStyle.modelLineColoring(modelId, lineId).vertex as AttributeState;
|
|
59
109
|
}
|
|
60
110
|
function modelLinesVertexAttributeStoredConfig(
|
|
@@ -64,14 +114,10 @@ function useModelLinesVertexAttribute() {
|
|
|
64
114
|
item: number | undefined,
|
|
65
115
|
): AttributeStoredConfig {
|
|
66
116
|
const { storedConfigs } = modelLinesVertexAttribute(modelId, lineId);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
item !== undefined &&
|
|
72
|
-
item in storedConfigs[name]!
|
|
73
|
-
) {
|
|
74
|
-
return storedConfigs[name]![item]!;
|
|
117
|
+
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
118
|
+
const itemConfig = item === undefined ? undefined : nameConfig?.[item];
|
|
119
|
+
if (itemConfig !== undefined) {
|
|
120
|
+
return itemConfig;
|
|
75
121
|
}
|
|
76
122
|
return {
|
|
77
123
|
minimum: undefined,
|
|
@@ -80,32 +126,41 @@ function useModelLinesVertexAttribute() {
|
|
|
80
126
|
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
81
127
|
};
|
|
82
128
|
}
|
|
83
|
-
function mutateModelLinesVertexStyle(
|
|
129
|
+
async function mutateModelLinesVertexStyle(
|
|
84
130
|
modelId: string,
|
|
85
131
|
lineIds: string[],
|
|
86
132
|
values: Record<string, unknown>,
|
|
87
|
-
) {
|
|
88
|
-
|
|
89
|
-
modelLinesCommonStyle.
|
|
133
|
+
): Promise<void> {
|
|
134
|
+
const tasks: Promise<void>[] = [
|
|
135
|
+
modelLinesCommonStyle.mutateModelLinesColoring(modelId, lineIds, {
|
|
90
136
|
vertex: values,
|
|
91
|
-
})
|
|
137
|
+
}),
|
|
138
|
+
];
|
|
139
|
+
const totalLineIds = await dataStore.getLinesGeodeIds(modelId);
|
|
140
|
+
if (lineIds.length === totalLineIds.length) {
|
|
141
|
+
tasks.push(
|
|
142
|
+
modelLinesCommonStyle.mutateModelLinesTypeColoring(modelId, {
|
|
143
|
+
vertex: values,
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
92
146
|
}
|
|
93
|
-
|
|
94
|
-
vertex: values,
|
|
95
|
-
});
|
|
147
|
+
await Promise.all(tasks);
|
|
96
148
|
}
|
|
97
|
-
function setModelLinesVertexAttributeStoredConfig(
|
|
149
|
+
async function setModelLinesVertexAttributeStoredConfig(
|
|
98
150
|
modelId: string,
|
|
99
151
|
lineIds: string[],
|
|
100
152
|
name: string | undefined,
|
|
101
153
|
item: number | undefined,
|
|
102
154
|
config: Partial<AttributeStoredConfig>,
|
|
103
|
-
) {
|
|
104
|
-
|
|
155
|
+
): Promise<void> {
|
|
156
|
+
if (name === undefined || item === undefined) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
await mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
105
160
|
storedConfigs: {
|
|
106
|
-
[name
|
|
161
|
+
[name]: {
|
|
107
162
|
lastItem: item,
|
|
108
|
-
[item
|
|
163
|
+
[item]: config,
|
|
109
164
|
},
|
|
110
165
|
},
|
|
111
166
|
});
|
|
@@ -119,8 +174,9 @@ function useModelLinesVertexAttribute() {
|
|
|
119
174
|
name: string | undefined,
|
|
120
175
|
): number {
|
|
121
176
|
const { storedConfigs } = modelLinesVertexAttribute(modelId, lineId);
|
|
122
|
-
|
|
123
|
-
|
|
177
|
+
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
178
|
+
if (nameConfig !== undefined) {
|
|
179
|
+
return nameConfig.lastItem;
|
|
124
180
|
}
|
|
125
181
|
return 0;
|
|
126
182
|
}
|
|
@@ -158,18 +214,18 @@ function useModelLinesVertexAttribute() {
|
|
|
158
214
|
colorMap,
|
|
159
215
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
160
216
|
}: AttributeInput,
|
|
161
|
-
) {
|
|
162
|
-
mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
217
|
+
): Promise<unknown> {
|
|
218
|
+
await mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
163
219
|
name,
|
|
164
220
|
item,
|
|
165
221
|
});
|
|
166
|
-
setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
222
|
+
await setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
167
223
|
minimum,
|
|
168
224
|
maximum,
|
|
169
225
|
colorMap,
|
|
170
226
|
no_data_color,
|
|
171
227
|
});
|
|
172
|
-
const points = getRGBPointsFromPreset(colorMap
|
|
228
|
+
const points = getRGBPointsFromPreset(colorMap ?? "");
|
|
173
229
|
const line_viewer_ids = await dataStore.getMeshComponentsViewerIds(modelId, lineIds);
|
|
174
230
|
const params = {
|
|
175
231
|
id: modelId,
|
|
@@ -186,7 +242,7 @@ function useModelLinesVertexAttribute() {
|
|
|
186
242
|
params,
|
|
187
243
|
});
|
|
188
244
|
}
|
|
189
|
-
function applyVertexAttribute(modelId: string, lineIds: string[]) {
|
|
245
|
+
async function applyVertexAttribute(modelId: string, lineIds: string[]): Promise<void> {
|
|
190
246
|
const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
|
|
191
247
|
const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
|
|
192
248
|
const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineIds[0], name, item);
|
|
@@ -199,46 +255,53 @@ function useModelLinesVertexAttribute() {
|
|
|
199
255
|
no_data_color: storedConfig.no_data_color,
|
|
200
256
|
};
|
|
201
257
|
if (isModelLinesVertexAttributeValid(attribute)) {
|
|
202
|
-
|
|
258
|
+
await setModelLinesVertexAttribute(modelId, lineIds, attribute);
|
|
203
259
|
}
|
|
204
|
-
return Promise.resolve();
|
|
205
260
|
}
|
|
206
|
-
function setModelLinesVertexAttributeName(
|
|
261
|
+
async function setModelLinesVertexAttributeName(
|
|
262
|
+
modelId: string,
|
|
263
|
+
lineIds: string[],
|
|
264
|
+
name: string,
|
|
265
|
+
): Promise<unknown> {
|
|
207
266
|
const item = modelLinesVertexAttributeLastItem(modelId, lineIds[0], name);
|
|
208
|
-
mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
267
|
+
await mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
209
268
|
name,
|
|
210
269
|
item,
|
|
211
270
|
});
|
|
212
271
|
return applyVertexAttribute(modelId, lineIds);
|
|
213
272
|
}
|
|
214
|
-
function setModelLinesVertexAttributeItem(
|
|
215
|
-
|
|
273
|
+
async function setModelLinesVertexAttributeItem(
|
|
274
|
+
modelId: string,
|
|
275
|
+
lineIds: string[],
|
|
276
|
+
item: number,
|
|
277
|
+
): Promise<unknown> {
|
|
278
|
+
await mutateModelLinesVertexStyle(modelId, lineIds, {
|
|
216
279
|
item,
|
|
217
280
|
});
|
|
218
281
|
return applyVertexAttribute(modelId, lineIds);
|
|
219
282
|
}
|
|
220
|
-
function setModelLinesVertexAttributeRange(
|
|
283
|
+
async function setModelLinesVertexAttributeRange(
|
|
221
284
|
modelId: string,
|
|
222
285
|
lineIds: string[],
|
|
223
286
|
minimum: number,
|
|
224
287
|
maximum: number,
|
|
225
|
-
) {
|
|
288
|
+
): Promise<unknown> {
|
|
226
289
|
const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
|
|
227
290
|
const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
|
|
228
|
-
setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
291
|
+
await setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
229
292
|
minimum,
|
|
230
293
|
maximum,
|
|
231
294
|
});
|
|
232
295
|
return applyVertexAttribute(modelId, lineIds);
|
|
233
296
|
}
|
|
234
|
-
function setModelLinesVertexAttributeColorMap(
|
|
297
|
+
async function setModelLinesVertexAttributeColorMap(
|
|
235
298
|
modelId: string,
|
|
236
299
|
lineIds: string[],
|
|
237
300
|
colorMap: string | undefined,
|
|
238
|
-
) {
|
|
301
|
+
): Promise<unknown> {
|
|
239
302
|
const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
|
|
240
303
|
const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
|
|
241
|
-
setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
304
|
+
await setModelLinesVertexAttributeStoredConfig(modelId, lineIds, name, item, {
|
|
242
305
|
colorMap,
|
|
243
306
|
});
|
|
244
307
|
return applyVertexAttribute(modelId, lineIds);
|
|
@@ -253,7 +316,7 @@ function useModelLinesVertexAttribute() {
|
|
|
253
316
|
modelId: string,
|
|
254
317
|
lineIds: string[],
|
|
255
318
|
no_data_color: unknown,
|
|
256
|
-
) {
|
|
319
|
+
): Promise<unknown> {
|
|
257
320
|
const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
|
|
258
321
|
const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
|
|
259
322
|
const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineIds[0], name, item);
|
|
@@ -4,7 +4,14 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
4
4
|
|
|
5
5
|
const schema = viewer_schemas.opengeodeweb_viewer.model.lines.visibility;
|
|
6
6
|
|
|
7
|
-
export function useModelLinesVisibility() {
|
|
7
|
+
export function useModelLinesVisibility(): {
|
|
8
|
+
setModelLinesVisibility: (
|
|
9
|
+
modelId: string,
|
|
10
|
+
lines_ids: string[],
|
|
11
|
+
visibility: boolean | undefined,
|
|
12
|
+
) => Promise<unknown>;
|
|
13
|
+
modelLineVisibility: (id: string, line_id?: string) => unknown;
|
|
14
|
+
} {
|
|
8
15
|
const modelCommonStyle = useModelCommonStyle();
|
|
9
16
|
const modelLinesCommonStyle = useModelLinesCommonStyle();
|
|
10
17
|
|
|
@@ -12,12 +19,18 @@ export function useModelLinesVisibility() {
|
|
|
12
19
|
return modelLinesCommonStyle.modelLineStyle(id, line_id).visibility;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
|
-
function setModelLinesVisibility(
|
|
22
|
+
async function setModelLinesVisibility(
|
|
16
23
|
modelId: string,
|
|
17
24
|
lines_ids: string[],
|
|
18
25
|
visibility: boolean | undefined,
|
|
19
|
-
) {
|
|
20
|
-
|
|
26
|
+
): Promise<unknown> {
|
|
27
|
+
const result = await modelCommonStyle.setModelTypeVisibility(
|
|
28
|
+
modelId,
|
|
29
|
+
lines_ids,
|
|
30
|
+
visibility,
|
|
31
|
+
schema,
|
|
32
|
+
);
|
|
33
|
+
return result;
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
return { setModelLinesVisibility, modelLineVisibility };
|
|
@@ -1,17 +1,21 @@
|
|
|
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 useModelPointsCommonStyle() {
|
|
4
|
+
export function useModelPointsCommonStyle(): {
|
|
5
|
+
modelPointsStyle: (id: string) => StyleValues;
|
|
6
|
+
mutateModelPointsStyle: (id: string, values: StyleValues) => Promise<unknown>;
|
|
7
|
+
} {
|
|
5
8
|
const dataStyleState = useDataStyleState();
|
|
6
9
|
|
|
7
|
-
function mutateModelPointsStyle(id: string, values: StyleValues) {
|
|
8
|
-
|
|
10
|
+
async function mutateModelPointsStyle(id: string, values: StyleValues): Promise<unknown> {
|
|
11
|
+
const result = await dataStyleState.mutateStyle(id, {
|
|
9
12
|
points: values,
|
|
10
13
|
});
|
|
14
|
+
return result;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
function modelPointsStyle(id: string): StyleValues {
|
|
14
|
-
return dataStyleState.getStyle(id).points
|
|
18
|
+
return dataStyleState.getStyle(id).points ?? {};
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
return {
|
|
@@ -3,20 +3,27 @@ import { useModelPointsCommonStyle } from "./common";
|
|
|
3
3
|
import { useModelPointsSizeStyle } from "./size";
|
|
4
4
|
import { useModelPointsVisibilityStyle } from "./visibility";
|
|
5
5
|
|
|
6
|
-
export function useModelPointsStyle() {
|
|
6
|
+
export function useModelPointsStyle(): {
|
|
7
|
+
applyModelPointsStyle: (id: string) => Promise<unknown[]>;
|
|
8
|
+
} & ReturnType<typeof useModelPointsCommonStyle> &
|
|
9
|
+
ReturnType<typeof useModelPointsVisibilityStyle> &
|
|
10
|
+
ReturnType<typeof useModelPointsSizeStyle> {
|
|
7
11
|
const modelPointsCommonStyle = useModelPointsCommonStyle();
|
|
8
12
|
const modelPointsVisibilityStyle = useModelPointsVisibilityStyle();
|
|
9
13
|
const modelPointsSizeStyle = useModelPointsSizeStyle();
|
|
10
14
|
|
|
11
|
-
function applyModelPointsStyle(id: string) {
|
|
15
|
+
async function applyModelPointsStyle(id: string): Promise<unknown[]> {
|
|
12
16
|
const style = modelPointsCommonStyle.modelPointsStyle(id);
|
|
13
|
-
|
|
17
|
+
const result = await Promise.all([
|
|
14
18
|
modelPointsVisibilityStyle.setModelPointsVisibility(
|
|
15
19
|
id,
|
|
20
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
|
|
16
21
|
style.visibility as boolean | undefined,
|
|
17
22
|
),
|
|
23
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
|
|
18
24
|
modelPointsSizeStyle.setModelPointsSize(id, style.size as number | undefined),
|
|
19
25
|
]);
|
|
26
|
+
return result;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
return {
|
|
@@ -8,25 +8,33 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
8
8
|
// Local constants
|
|
9
9
|
const schema = viewer_schemas.opengeodeweb_viewer.model.points.size;
|
|
10
10
|
|
|
11
|
-
export function useModelPointsSizeStyle() {
|
|
11
|
+
export function useModelPointsSizeStyle(): {
|
|
12
|
+
modelPointsSize: (id: string) => number | undefined;
|
|
13
|
+
setModelPointsSize: (id: string, size: number | undefined) => Promise<unknown>;
|
|
14
|
+
} {
|
|
12
15
|
const viewerStore = useViewerStore();
|
|
13
16
|
const modelPointsCommonStyle = useModelPointsCommonStyle();
|
|
14
17
|
|
|
15
18
|
function modelPointsSize(id: string): number | undefined {
|
|
19
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
|
|
16
20
|
return modelPointsCommonStyle.modelPointsStyle(id).size as number | undefined;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
function setModelPointsSize(id: string, size: number | undefined) {
|
|
23
|
+
async function setModelPointsSize(id: string, size: number | undefined): Promise<unknown> {
|
|
20
24
|
const params = { id, size };
|
|
21
|
-
|
|
25
|
+
const result = await viewerStore.request(
|
|
22
26
|
{
|
|
23
27
|
schema,
|
|
24
28
|
params,
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
|
-
response_function: () =>
|
|
31
|
+
response_function: async () => {
|
|
32
|
+
const mutateResult = await modelPointsCommonStyle.mutateModelPointsStyle(id, { size });
|
|
33
|
+
return mutateResult;
|
|
34
|
+
},
|
|
28
35
|
},
|
|
29
36
|
);
|
|
37
|
+
return result;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
return {
|
|
@@ -8,25 +8,35 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
8
8
|
// Local constants
|
|
9
9
|
const schema = viewer_schemas.opengeodeweb_viewer.model.points.visibility;
|
|
10
10
|
|
|
11
|
-
export function useModelPointsVisibilityStyle() {
|
|
11
|
+
export function useModelPointsVisibilityStyle(): {
|
|
12
|
+
modelPointsVisibility: (id: string) => boolean | undefined;
|
|
13
|
+
setModelPointsVisibility: (id: string, visibility: boolean | undefined) => Promise<unknown>;
|
|
14
|
+
} {
|
|
12
15
|
const viewerStore = useViewerStore();
|
|
13
16
|
const modelPointsCommonStyle = useModelPointsCommonStyle();
|
|
14
17
|
|
|
15
18
|
function modelPointsVisibility(id: string): boolean | undefined {
|
|
19
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
|
|
16
20
|
return modelPointsCommonStyle.modelPointsStyle(id).visibility as boolean | undefined;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
function setModelPointsVisibility(
|
|
23
|
+
async function setModelPointsVisibility(
|
|
24
|
+
id: string,
|
|
25
|
+
visibility: boolean | undefined,
|
|
26
|
+
): Promise<unknown> {
|
|
20
27
|
const params = { id, visibility };
|
|
21
|
-
|
|
28
|
+
const result = await viewerStore.request(
|
|
22
29
|
{ schema, params },
|
|
23
30
|
{
|
|
24
|
-
response_function: () =>
|
|
25
|
-
modelPointsCommonStyle.mutateModelPointsStyle(id, {
|
|
31
|
+
response_function: async () => {
|
|
32
|
+
const mutateResult = await modelPointsCommonStyle.mutateModelPointsStyle(id, {
|
|
26
33
|
visibility,
|
|
27
|
-
})
|
|
34
|
+
});
|
|
35
|
+
return mutateResult;
|
|
36
|
+
},
|
|
28
37
|
},
|
|
29
38
|
);
|
|
39
|
+
return result;
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
return {
|