@geode/opengeodeweb-front 10.44.0 → 10.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/ClippingPlanes.vue +7 -5
- package/app/components/CrsSelector.vue +2 -1
- package/app/components/ExtensionSelector.vue +8 -7
- package/app/components/FactorFilterPanel.vue +4 -4
- package/app/components/MissingFilesSelector.vue +2 -1
- package/app/components/ObjectSelector.vue +4 -3
- package/app/components/ThresholdCard.vue +6 -5
- package/app/components/ThresholdFilter.vue +11 -10
- package/app/components/TimeSeriesTargetSelector.vue +10 -7
- package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -10
- package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +72 -63
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +76 -71
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +72 -63
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +54 -45
- package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +76 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +72 -67
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +29 -21
- package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +15 -7
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +13 -6
- package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +19 -11
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +17 -10
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +2 -1
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +29 -21
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +2 -2
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -3
- package/app/components/Viewer/Options/AttributeSelector.vue +11 -7
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -13
- package/app/components/Viewer/Options/TextureItem.vue +5 -4
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -8
- package/app/components/Viewer/Options/TimeStepSlider.vue +3 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +6 -13
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +40 -38
- package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +69 -65
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Surface/PolygonsColoring.vue +73 -71
- package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -6
- package/app/composables/attribute_coloring_style.ts +17 -12
- package/app/composables/attribute_selector.ts +9 -15
- package/app/composables/batch_style.ts +25 -16
- package/app/composables/batch_style_model.ts +6 -5
- package/app/composables/clipping_planes_widget.ts +2 -5
- package/app/composables/clipping_slices.ts +2 -1
- package/app/composables/hover_highlight.ts +17 -16
- package/app/composables/live_data_item.ts +3 -2
- package/app/composables/model_attribute_style.ts +2 -1
- package/app/composables/model_menu_context.ts +3 -4
- package/app/composables/model_tree.ts +3 -2
- package/app/composables/project_manager_helpers/types.ts +10 -4
- package/app/composables/tree_filter.ts +3 -3
- package/app/composables/tree_keyboard_nav.ts +1 -6
- package/app/composables/tree_scroll.ts +2 -0
- package/app/composables/use_overlapping_picker.ts +9 -9
- package/app/stores/basemap_helpers/georeferenced.ts +1 -1
- package/app/stores/basemap_helpers/viewer.ts +2 -1
- package/app/stores/crs.ts +6 -5
- package/app/stores/data.ts +84 -69
- package/app/stores/data_helpers/collections.ts +13 -21
- package/app/stores/data_helpers/mesh.ts +19 -24
- package/app/stores/data_helpers/relations.ts +12 -12
- package/app/stores/data_style.ts +26 -20
- package/app/stores/menu.ts +17 -11
- package/app/stores/treeview.ts +28 -27
- package/app/types/attribute.ts +37 -0
- package/app/types/identifiers.ts +72 -0
- package/app/types/style.ts +13 -0
- package/app/types/texture.ts +6 -0
- package/app/types/tree.ts +17 -0
- package/app/utils/attribute_range.ts +2 -1
- package/app/utils/attributes.ts +13 -4
- package/app/utils/basemap_tree.ts +3 -5
- package/app/utils/clipping_planes.ts +6 -4
- package/app/utils/clipping_planes_scene.ts +4 -3
- package/app/utils/crs.ts +4 -1
- package/app/utils/default_styles/constants.ts +8 -1
- package/app/utils/default_styles/mesh_components.ts +21 -25
- package/app/utils/default_styles/meshes.ts +7 -22
- package/app/utils/default_styles/model_components.ts +22 -26
- package/app/utils/default_styles/models.ts +11 -13
- package/app/utils/import_workflow.ts +37 -29
- package/app/utils/legacy_data_id.ts +16 -0
- package/app/utils/slice.ts +7 -2
- package/app/utils/threshold.ts +1 -8
- package/app/utils/threshold_sources.ts +8 -5
- package/app/utils/treeview.ts +3 -2
- package/internal/database/tables/data.ts +1 -1
- package/internal/database/tables/data_style.ts +1 -1
- package/internal/database/tables/model_components.ts +1 -1
- package/internal/database/tables/model_components_relation.ts +1 -1
- package/internal/stores/data_style/attribute_default.ts +14 -0
- package/internal/stores/data_style/attribute_types.ts +59 -0
- package/internal/stores/data_style/attribute_valid.ts +16 -0
- package/internal/stores/data_style/mesh/base_style.ts +17 -15
- package/internal/stores/data_style/mesh/cells/cell.ts +64 -49
- package/internal/stores/data_style/mesh/cells/cell_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/cells/cell_config.ts +59 -53
- package/internal/stores/data_style/mesh/cells/color.ts +8 -7
- package/internal/stores/data_style/mesh/cells/common.ts +16 -15
- package/internal/stores/data_style/mesh/cells/index.ts +49 -47
- package/internal/stores/data_style/mesh/cells/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/cells/textures.ts +8 -7
- package/internal/stores/data_style/mesh/cells/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/cells/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/cells/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/color.ts +8 -7
- package/internal/stores/data_style/mesh/edges/common.ts +13 -12
- package/internal/stores/data_style/mesh/edges/edge.ts +64 -49
- package/internal/stores/data_style/mesh/edges/edge_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/edges/edge_config.ts +59 -53
- package/internal/stores/data_style/mesh/edges/index.ts +49 -47
- package/internal/stores/data_style/mesh/edges/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/edges/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/edges/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/edges/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/width.ts +9 -7
- package/internal/stores/data_style/mesh/index.ts +27 -24
- package/internal/stores/data_style/mesh/points/color.ts +8 -7
- package/internal/stores/data_style/mesh/points/common.ts +16 -14
- package/internal/stores/data_style/mesh/points/index.ts +39 -37
- package/internal/stores/data_style/mesh/points/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/points/size.ts +9 -7
- package/internal/stores/data_style/mesh/points/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/points/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/points/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/points/visibility.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/color.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/common.ts +19 -15
- package/internal/stores/data_style/mesh/polygons/index.ts +49 -50
- package/internal/stores/data_style/mesh/polygons/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polygons/polygon.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/polygon_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/textures.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/visibility.ts +12 -7
- package/internal/stores/data_style/mesh/polyhedra/color.ts +13 -9
- package/internal/stores/data_style/mesh/polyhedra/common.ts +13 -12
- package/internal/stores/data_style/mesh/polyhedra/index.ts +51 -51
- package/internal/stores/data_style/mesh/polyhedra/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +59 -53
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +46 -69
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +65 -55
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +12 -7
- package/internal/stores/data_style/model/blocks/apply_coloring.ts +11 -12
- package/internal/stores/data_style/model/blocks/color.ts +25 -26
- package/internal/stores/data_style/model/blocks/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/blocks/common.ts +26 -22
- package/internal/stores/data_style/model/blocks/index.ts +8 -7
- package/internal/stores/data_style/model/blocks/polyhedron.ts +114 -135
- package/internal/stores/data_style/model/blocks/vertex.ts +110 -132
- package/internal/stores/data_style/model/blocks/visibility.ts +11 -9
- package/internal/stores/data_style/model/color.ts +55 -41
- package/internal/stores/data_style/model/common.ts +16 -14
- package/internal/stores/data_style/model/component_style.ts +0 -16
- package/internal/stores/data_style/model/corners/color.ts +21 -19
- package/internal/stores/data_style/model/corners/common.ts +26 -22
- package/internal/stores/data_style/model/corners/index.ts +21 -24
- package/internal/stores/data_style/model/corners/vertex.ts +103 -122
- package/internal/stores/data_style/model/corners/visibility.ts +11 -9
- package/internal/stores/data_style/model/edges/common.ts +7 -6
- package/internal/stores/data_style/model/edges/component.ts +63 -55
- package/internal/stores/data_style/model/edges/visibility.ts +24 -16
- package/internal/stores/data_style/model/edges/width.ts +10 -8
- package/internal/stores/data_style/model/index.ts +7 -6
- package/internal/stores/data_style/model/lines/apply_coloring.ts +11 -9
- package/internal/stores/data_style/model/lines/color.ts +25 -23
- package/internal/stores/data_style/model/lines/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/lines/common.ts +29 -21
- package/internal/stores/data_style/model/lines/edge.ts +109 -128
- package/internal/stores/data_style/model/lines/index.ts +8 -7
- package/internal/stores/data_style/model/lines/vertex.ts +109 -128
- package/internal/stores/data_style/model/lines/visibility.ts +11 -9
- package/internal/stores/data_style/model/points/common.ts +7 -6
- package/internal/stores/data_style/model/points/component.ts +62 -54
- package/internal/stores/data_style/model/points/index.ts +12 -7
- package/internal/stores/data_style/model/points/size.ts +10 -8
- package/internal/stores/data_style/model/points/visibility.ts +13 -8
- package/internal/stores/data_style/model/selection.ts +6 -11
- package/internal/stores/data_style/model/surfaces/apply_coloring.ts +11 -15
- package/internal/stores/data_style/model/surfaces/color.ts +31 -23
- package/internal/stores/data_style/model/surfaces/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/surfaces/common.ts +26 -22
- package/internal/stores/data_style/model/surfaces/index.ts +8 -7
- package/internal/stores/data_style/model/surfaces/polygon.ts +113 -138
- package/internal/stores/data_style/model/surfaces/vertex.ts +117 -133
- package/internal/stores/data_style/model/surfaces/visibility.ts +11 -9
- package/internal/stores/data_style/model/visibility.ts +18 -16
- package/internal/stores/data_style/model/visibility_dispatch.ts +4 -4
- package/internal/stores/data_style/state.ts +7 -6
- package/internal/stores/data_style/state_shared.ts +11 -10
- package/internal/stores/data_style/time_step.ts +21 -15
- package/internal/stores/data_style/types.ts +4 -3
- package/internal/stores/hybrid_viewer/camera.ts +11 -6
- package/internal/stores/hybrid_viewer/filters.ts +16 -14
- package/internal/stores/hybrid_viewer/highlight.ts +6 -5
- package/internal/stores/hybrid_viewer/scene.ts +20 -18
- package/internal/stores/hybrid_viewer/vtk_types.ts +2 -2
- package/internal/utils/api_fetch.ts +1 -1
- package/internal/utils/upload_file.ts +1 -7
- package/package.json +1 -1
- package/shared/utils/fetch_raw.ts +7 -8
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
|
+
import type {
|
|
3
|
+
AttributeColorMap,
|
|
4
|
+
AttributeItem,
|
|
5
|
+
AttributeName,
|
|
6
|
+
AttributeRange,
|
|
7
|
+
AttributeRangeMaximum,
|
|
8
|
+
AttributeRangeMinimum,
|
|
9
|
+
AttributeTimeStep,
|
|
10
|
+
} from "@ogw_front/types/attribute";
|
|
11
|
+
import type {
|
|
12
|
+
AttributeInput,
|
|
13
|
+
AttributeState,
|
|
14
|
+
AttributeStoredConfig,
|
|
15
|
+
ValidAttributeInput,
|
|
16
|
+
} from "@ogw_internal/stores/data_style/attribute_types";
|
|
17
|
+
import type { CornerId, ModelId } from "@ogw_front/types/identifiers";
|
|
2
18
|
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
19
|
+
import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
|
|
20
|
+
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
3
21
|
// Third party imports
|
|
4
22
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
23
|
|
|
@@ -16,87 +34,52 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
16
34
|
// Local constants
|
|
17
35
|
const attributeSchema = viewer_schemas.opengeodeweb_viewer.model.corners.attribute.vertex.attribute;
|
|
18
36
|
|
|
19
|
-
|
|
20
|
-
minimum: number | undefined;
|
|
21
|
-
maximum: number | undefined;
|
|
22
|
-
colorMap: string | undefined;
|
|
23
|
-
no_data_color: RGBAColor;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface AttributeState {
|
|
27
|
-
name?: string;
|
|
28
|
-
item?: number;
|
|
29
|
-
storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface AttributeInput {
|
|
33
|
-
name: string | undefined;
|
|
34
|
-
item: number | undefined;
|
|
35
|
-
minimum: number | undefined;
|
|
36
|
-
maximum: number | undefined;
|
|
37
|
-
colorMap: string | undefined;
|
|
38
|
-
no_data_color?: RGBAColor;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface ValidAttributeInput {
|
|
42
|
-
name: string;
|
|
43
|
-
item: number;
|
|
44
|
-
minimum: number;
|
|
45
|
-
maximum: number;
|
|
46
|
-
colorMap: string;
|
|
47
|
-
no_data_color?: RGBAColor;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
type IdsFn<Value> = (modelId: string, cornerIds: string[], value: Value) => Promise<void>;
|
|
37
|
+
type IdsFn<Value> = (modelId: ModelId, cornerIds: CornerId[], value: Value) => Promise<void>;
|
|
51
38
|
|
|
52
39
|
interface ModelCornersVertexAttributeApi {
|
|
53
|
-
modelCornersVertexAttributeName: (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
modelCornersVertexAttributeTimeStep: (
|
|
40
|
+
modelCornersVertexAttributeName: (
|
|
41
|
+
modelId: ModelId,
|
|
42
|
+
cornerId?: CornerId,
|
|
43
|
+
) => AttributeName | undefined;
|
|
44
|
+
modelCornersVertexAttributeItem: (modelId: ModelId, cornerId?: CornerId) => AttributeItem;
|
|
45
|
+
modelCornersVertexAttributeRange: (modelId: ModelId, cornerId?: CornerId) => AttributeRange;
|
|
46
|
+
modelCornersVertexAttributeTimeStep: (
|
|
47
|
+
modelId: ModelId,
|
|
48
|
+
cornerId?: CornerId,
|
|
49
|
+
) => AttributeTimeStep | undefined;
|
|
60
50
|
setModelCornersVertexAttributeTimeStep: (
|
|
61
|
-
modelId:
|
|
62
|
-
cornerIds:
|
|
63
|
-
timeStep:
|
|
51
|
+
modelId: ModelId,
|
|
52
|
+
cornerIds: CornerId[],
|
|
53
|
+
timeStep: AttributeTimeStep,
|
|
64
54
|
) => Promise<void>;
|
|
65
|
-
modelCornersVertexAttributeColorMap: (
|
|
55
|
+
modelCornersVertexAttributeColorMap: (
|
|
56
|
+
modelId: ModelId,
|
|
57
|
+
cornerId?: CornerId,
|
|
58
|
+
) => AttributeColorMap | undefined;
|
|
66
59
|
modelCornersVertexAttributeStoredConfig: (
|
|
67
|
-
modelId:
|
|
68
|
-
cornerId:
|
|
69
|
-
name:
|
|
70
|
-
item:
|
|
60
|
+
modelId: ModelId,
|
|
61
|
+
cornerId: CornerId | undefined,
|
|
62
|
+
name: AttributeName | undefined,
|
|
63
|
+
item: AttributeItem | undefined,
|
|
71
64
|
) => AttributeStoredConfig;
|
|
72
65
|
setModelCornersVertexAttribute: (
|
|
73
|
-
modelId:
|
|
74
|
-
cornerIds:
|
|
66
|
+
modelId: ModelId,
|
|
67
|
+
cornerIds: CornerId[],
|
|
75
68
|
attribute: ValidAttributeInput,
|
|
76
69
|
) => Promise<unknown>;
|
|
77
70
|
setModelCornersVertexAttributeName: IdsFn<string>;
|
|
78
71
|
setModelCornersVertexAttributeItem: IdsFn<number>;
|
|
79
72
|
setModelCornersVertexAttributeRange: (
|
|
80
|
-
modelId:
|
|
81
|
-
cornerIds:
|
|
82
|
-
minimum:
|
|
83
|
-
maximum:
|
|
73
|
+
modelId: ModelId,
|
|
74
|
+
cornerIds: CornerId[],
|
|
75
|
+
minimum: AttributeRangeMinimum,
|
|
76
|
+
maximum: AttributeRangeMaximum,
|
|
84
77
|
) => Promise<void>;
|
|
85
78
|
setModelCornersVertexAttributeColorMap: IdsFn<string | undefined>;
|
|
86
|
-
modelCornersVertexAttributeNoDataColor: (modelId:
|
|
79
|
+
modelCornersVertexAttributeNoDataColor: (modelId: ModelId, cornerId?: CornerId) => RGBAColor;
|
|
87
80
|
setModelCornersVertexAttributeNoDataColor: IdsFn<RGBAColor>;
|
|
88
81
|
}
|
|
89
82
|
|
|
90
|
-
function isModelCornersVertexAttributeValid(input: AttributeInput): input is ValidAttributeInput {
|
|
91
|
-
return (
|
|
92
|
-
input.name !== undefined &&
|
|
93
|
-
input.item !== undefined &&
|
|
94
|
-
input.minimum !== undefined &&
|
|
95
|
-
input.maximum !== undefined &&
|
|
96
|
-
input.colorMap !== undefined
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
83
|
type ModelCornersVertexAttributeGetters = Pick<
|
|
101
84
|
ModelCornersVertexAttributeApi,
|
|
102
85
|
| "modelCornersVertexAttributeStoredConfig"
|
|
@@ -108,9 +91,9 @@ type ModelCornersVertexAttributeGetters = Pick<
|
|
|
108
91
|
| "modelCornersVertexAttributeTimeStep"
|
|
109
92
|
> & {
|
|
110
93
|
modelCornersVertexAttributeLastItem: (
|
|
111
|
-
modelId:
|
|
94
|
+
modelId: ModelId,
|
|
112
95
|
componentId: string | undefined,
|
|
113
|
-
name:
|
|
96
|
+
name: AttributeName | undefined,
|
|
114
97
|
) => number;
|
|
115
98
|
};
|
|
116
99
|
|
|
@@ -119,15 +102,15 @@ function useModelCornersVertexAttributeGetters(
|
|
|
119
102
|
modelCornersCommonStyle: ReturnType<typeof useModelCornersCommonStyle>,
|
|
120
103
|
): ModelCornersVertexAttributeGetters {
|
|
121
104
|
const { attributeTimeStep } = useAttributeTimeStepStyle();
|
|
122
|
-
function modelCornersVertexAttribute(modelId:
|
|
105
|
+
function modelCornersVertexAttribute(modelId: ModelId, cornerId?: CornerId): AttributeState {
|
|
123
106
|
// oxlint-disable-next-line no-unsafe-type-assertion -- vertex is a StyleValues sub-object stored under a StyleValues index signature.
|
|
124
107
|
return modelCornersCommonStyle.modelCornerColoring(modelId, cornerId).vertex as AttributeState;
|
|
125
108
|
}
|
|
126
109
|
function modelCornersVertexAttributeStoredConfig(
|
|
127
|
-
modelId:
|
|
128
|
-
cornerId:
|
|
129
|
-
name:
|
|
130
|
-
item:
|
|
110
|
+
modelId: ModelId,
|
|
111
|
+
cornerId: CornerId | undefined,
|
|
112
|
+
name: AttributeName | undefined,
|
|
113
|
+
item: AttributeItem | undefined,
|
|
131
114
|
): AttributeStoredConfig {
|
|
132
115
|
const storedConfig =
|
|
133
116
|
name !== undefined && item !== undefined
|
|
@@ -136,20 +119,18 @@ function useModelCornersVertexAttributeGetters(
|
|
|
136
119
|
if (storedConfig !== undefined) {
|
|
137
120
|
return storedConfig;
|
|
138
121
|
}
|
|
139
|
-
return
|
|
140
|
-
minimum: undefined,
|
|
141
|
-
maximum: undefined,
|
|
142
|
-
colorMap: undefined,
|
|
143
|
-
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
144
|
-
};
|
|
122
|
+
return defaultAttributeStoredConfig();
|
|
145
123
|
}
|
|
146
|
-
function modelCornersVertexAttributeName(
|
|
124
|
+
function modelCornersVertexAttributeName(
|
|
125
|
+
modelId: ModelId,
|
|
126
|
+
cornerId?: CornerId,
|
|
127
|
+
): AttributeName | undefined {
|
|
147
128
|
return modelCornersVertexAttribute(modelId, cornerId).name;
|
|
148
129
|
}
|
|
149
130
|
function modelCornersVertexAttributeLastItem(
|
|
150
|
-
modelId:
|
|
151
|
-
cornerId:
|
|
152
|
-
name:
|
|
131
|
+
modelId: ModelId,
|
|
132
|
+
cornerId: CornerId | undefined,
|
|
133
|
+
name: AttributeName | undefined,
|
|
153
134
|
): number {
|
|
154
135
|
if (name === undefined) {
|
|
155
136
|
return 0;
|
|
@@ -157,17 +138,14 @@ function useModelCornersVertexAttributeGetters(
|
|
|
157
138
|
const { storedConfigs } = modelCornersVertexAttribute(modelId, cornerId);
|
|
158
139
|
return storedConfigs?.[name]?.lastItem ?? 0;
|
|
159
140
|
}
|
|
160
|
-
function modelCornersVertexAttributeItem(modelId:
|
|
141
|
+
function modelCornersVertexAttributeItem(modelId: ModelId, cornerId?: CornerId): AttributeItem {
|
|
161
142
|
const vertexAttribute = modelCornersVertexAttribute(modelId, cornerId);
|
|
162
143
|
return (
|
|
163
144
|
vertexAttribute.item ??
|
|
164
145
|
modelCornersVertexAttributeLastItem(modelId, cornerId, vertexAttribute.name)
|
|
165
146
|
);
|
|
166
147
|
}
|
|
167
|
-
function modelCornersVertexAttributeRange(
|
|
168
|
-
modelId: string,
|
|
169
|
-
cornerId?: string,
|
|
170
|
-
): [number | undefined, number | undefined] {
|
|
148
|
+
function modelCornersVertexAttributeRange(modelId: ModelId, cornerId?: CornerId): AttributeRange {
|
|
171
149
|
const name = modelCornersVertexAttributeName(modelId, cornerId);
|
|
172
150
|
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
173
151
|
const { minimum, maximum } = modelCornersVertexAttributeStoredConfig(
|
|
@@ -179,22 +157,25 @@ function useModelCornersVertexAttributeGetters(
|
|
|
179
157
|
return [minimum, maximum];
|
|
180
158
|
}
|
|
181
159
|
function modelCornersVertexAttributeColorMap(
|
|
182
|
-
modelId:
|
|
183
|
-
cornerId?:
|
|
184
|
-
):
|
|
160
|
+
modelId: ModelId,
|
|
161
|
+
cornerId?: CornerId,
|
|
162
|
+
): AttributeColorMap | undefined {
|
|
185
163
|
const name = modelCornersVertexAttributeName(modelId, cornerId);
|
|
186
164
|
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
187
165
|
return modelCornersVertexAttributeStoredConfig(modelId, cornerId, name, item).colorMap;
|
|
188
166
|
}
|
|
189
|
-
function modelCornersVertexAttributeNoDataColor(
|
|
167
|
+
function modelCornersVertexAttributeNoDataColor(
|
|
168
|
+
modelId: ModelId,
|
|
169
|
+
cornerId?: CornerId,
|
|
170
|
+
): RGBAColor {
|
|
190
171
|
const name = modelCornersVertexAttributeName(modelId, cornerId);
|
|
191
172
|
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
192
173
|
return modelCornersVertexAttributeStoredConfig(modelId, cornerId, name, item).no_data_color;
|
|
193
174
|
}
|
|
194
175
|
function modelCornersVertexAttributeTimeStep(
|
|
195
|
-
modelId:
|
|
196
|
-
cornerId?:
|
|
197
|
-
):
|
|
176
|
+
modelId: ModelId,
|
|
177
|
+
cornerId?: CornerId,
|
|
178
|
+
): AttributeTimeStep | undefined {
|
|
198
179
|
return attributeTimeStep(
|
|
199
180
|
modelId,
|
|
200
181
|
attributeSchema.$id,
|
|
@@ -230,8 +211,8 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
230
211
|
} = useModelCornersVertexAttributeGetters(modelCornersCommonStyle);
|
|
231
212
|
const viewerStore = useViewerStore();
|
|
232
213
|
async function mutateModelCornersVertexStyle(
|
|
233
|
-
modelId:
|
|
234
|
-
cornerIds:
|
|
214
|
+
modelId: ModelId,
|
|
215
|
+
cornerIds: CornerId[],
|
|
235
216
|
values: Record<string, unknown>,
|
|
236
217
|
): Promise<void> {
|
|
237
218
|
const tasks: Promise<void>[] = [
|
|
@@ -250,10 +231,10 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
250
231
|
await Promise.all(tasks);
|
|
251
232
|
}
|
|
252
233
|
async function setModelCornersVertexAttributeStoredConfig(
|
|
253
|
-
modelId:
|
|
254
|
-
cornerIds:
|
|
255
|
-
name:
|
|
256
|
-
item:
|
|
234
|
+
modelId: ModelId,
|
|
235
|
+
cornerIds: CornerId[],
|
|
236
|
+
name: AttributeName | undefined,
|
|
237
|
+
item: AttributeItem | undefined,
|
|
257
238
|
config: Partial<AttributeStoredConfig>,
|
|
258
239
|
): Promise<void> {
|
|
259
240
|
if (name === undefined || item === undefined) {
|
|
@@ -264,8 +245,8 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
264
245
|
});
|
|
265
246
|
}
|
|
266
247
|
async function setModelCornersVertexAttribute(
|
|
267
|
-
modelId:
|
|
268
|
-
cornerIds:
|
|
248
|
+
modelId: ModelId,
|
|
249
|
+
cornerIds: CornerId[],
|
|
269
250
|
{
|
|
270
251
|
name,
|
|
271
252
|
item,
|
|
@@ -300,7 +281,7 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
300
281
|
});
|
|
301
282
|
return result;
|
|
302
283
|
}
|
|
303
|
-
async function applyVertexAttribute(modelId:
|
|
284
|
+
async function applyVertexAttribute(modelId: ModelId, cornerIds: CornerId[]): Promise<void> {
|
|
304
285
|
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
305
286
|
const item = modelCornersVertexAttributeItem(modelId, cornerIds[0]);
|
|
306
287
|
const storedConfig = modelCornersVertexAttributeStoredConfig(modelId, cornerIds[0], name, item);
|
|
@@ -312,31 +293,31 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
312
293
|
colorMap: storedConfig.colorMap,
|
|
313
294
|
no_data_color: storedConfig.no_data_color,
|
|
314
295
|
};
|
|
315
|
-
if (
|
|
296
|
+
if (isAttributeValid(attribute)) {
|
|
316
297
|
await setModelCornersVertexAttribute(modelId, cornerIds, attribute);
|
|
317
298
|
}
|
|
318
299
|
}
|
|
319
300
|
async function setModelCornersVertexAttributeName(
|
|
320
|
-
modelId:
|
|
321
|
-
cornerIds:
|
|
322
|
-
name:
|
|
301
|
+
modelId: ModelId,
|
|
302
|
+
cornerIds: CornerId[],
|
|
303
|
+
name: AttributeName,
|
|
323
304
|
): Promise<void> {
|
|
324
305
|
const item = modelCornersVertexAttributeLastItem(modelId, cornerIds[0], name);
|
|
325
306
|
await mutateModelCornersVertexStyle(modelId, cornerIds, { name, item });
|
|
326
307
|
await applyVertexAttribute(modelId, cornerIds);
|
|
327
308
|
}
|
|
328
309
|
async function setModelCornersVertexAttributeItem(
|
|
329
|
-
modelId:
|
|
330
|
-
cornerIds:
|
|
331
|
-
item:
|
|
310
|
+
modelId: ModelId,
|
|
311
|
+
cornerIds: CornerId[],
|
|
312
|
+
item: AttributeItem,
|
|
332
313
|
): Promise<void> {
|
|
333
314
|
await mutateModelCornersVertexStyle(modelId, cornerIds, { item });
|
|
334
315
|
await applyVertexAttribute(modelId, cornerIds);
|
|
335
316
|
}
|
|
336
317
|
async function setModelCornersVertexAttributeTimeStep(
|
|
337
|
-
modelId:
|
|
338
|
-
cornerIds:
|
|
339
|
-
timeStep:
|
|
318
|
+
modelId: ModelId,
|
|
319
|
+
cornerIds: CornerId[],
|
|
320
|
+
timeStep: AttributeTimeStep,
|
|
340
321
|
): Promise<void> {
|
|
341
322
|
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
342
323
|
if (name === undefined) {
|
|
@@ -369,10 +350,10 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
369
350
|
]);
|
|
370
351
|
}
|
|
371
352
|
async function setModelCornersVertexAttributeRange(
|
|
372
|
-
modelId:
|
|
373
|
-
cornerIds:
|
|
374
|
-
minimum:
|
|
375
|
-
maximum:
|
|
353
|
+
modelId: ModelId,
|
|
354
|
+
cornerIds: CornerId[],
|
|
355
|
+
minimum: AttributeRangeMinimum,
|
|
356
|
+
maximum: AttributeRangeMaximum,
|
|
376
357
|
): Promise<void> {
|
|
377
358
|
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
378
359
|
const item = modelCornersVertexAttributeItem(modelId, cornerIds[0]);
|
|
@@ -383,9 +364,9 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
383
364
|
await applyVertexAttribute(modelId, cornerIds);
|
|
384
365
|
}
|
|
385
366
|
async function setModelCornersVertexAttributeColorMap(
|
|
386
|
-
modelId:
|
|
387
|
-
cornerIds:
|
|
388
|
-
colorMap:
|
|
367
|
+
modelId: ModelId,
|
|
368
|
+
cornerIds: CornerId[],
|
|
369
|
+
colorMap: AttributeColorMap | undefined,
|
|
389
370
|
): Promise<void> {
|
|
390
371
|
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
391
372
|
const item = modelCornersVertexAttributeItem(modelId, cornerIds[0]);
|
|
@@ -393,8 +374,8 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
393
374
|
await applyVertexAttribute(modelId, cornerIds);
|
|
394
375
|
}
|
|
395
376
|
async function setModelCornersVertexAttributeNoDataColor(
|
|
396
|
-
modelId:
|
|
397
|
-
cornerIds:
|
|
377
|
+
modelId: ModelId,
|
|
378
|
+
cornerIds: CornerId[],
|
|
398
379
|
no_data_color: RGBAColor,
|
|
399
380
|
): Promise<void> {
|
|
400
381
|
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
@@ -423,4 +404,4 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
423
404
|
setModelCornersVertexAttributeNoDataColor,
|
|
424
405
|
};
|
|
425
406
|
}
|
|
426
|
-
export {
|
|
407
|
+
export { useModelCornersVertexAttribute };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { CornerId, ModelId } from "@ogw_front/types/identifiers";
|
|
2
|
+
import type { Visibility } from "@ogw_front/types/style";
|
|
1
3
|
import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
|
|
2
4
|
import { useModelCornersCommonStyle } from "./common";
|
|
3
5
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
@@ -6,25 +8,25 @@ const schema = viewer_schemas.opengeodeweb_viewer.model.corners.visibility;
|
|
|
6
8
|
|
|
7
9
|
interface ModelCornersVisibilityApi {
|
|
8
10
|
setModelCornersVisibility: (
|
|
9
|
-
modelId:
|
|
10
|
-
corners_ids:
|
|
11
|
-
visibility:
|
|
11
|
+
modelId: ModelId,
|
|
12
|
+
corners_ids: CornerId[],
|
|
13
|
+
visibility: Visibility,
|
|
12
14
|
) => Promise<unknown>;
|
|
13
|
-
modelCornerVisibility: (
|
|
15
|
+
modelCornerVisibility: (modelId: ModelId, corner_id?: CornerId) => unknown;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function useModelCornersVisibility(): ModelCornersVisibilityApi {
|
|
17
19
|
const modelCommonStyle = useModelCommonStyle();
|
|
18
20
|
const modelCornersCommonStyle = useModelCornersCommonStyle();
|
|
19
21
|
|
|
20
|
-
function modelCornerVisibility(
|
|
21
|
-
return modelCornersCommonStyle.modelCornerStyle(
|
|
22
|
+
function modelCornerVisibility(modelId: ModelId, corner_id?: CornerId): unknown {
|
|
23
|
+
return modelCornersCommonStyle.modelCornerStyle(modelId, corner_id).visibility;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
async function setModelCornersVisibility(
|
|
25
|
-
modelId:
|
|
26
|
-
corners_ids:
|
|
27
|
-
visibility:
|
|
27
|
+
modelId: ModelId,
|
|
28
|
+
corners_ids: CornerId[],
|
|
29
|
+
visibility: Visibility,
|
|
28
30
|
): Promise<unknown> {
|
|
29
31
|
const result = await modelCommonStyle.setModelTypeVisibility(
|
|
30
32
|
modelId,
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import type { ModelId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
2
3
|
import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
|
|
3
4
|
|
|
4
5
|
export function useModelEdgesCommonStyle(): {
|
|
5
|
-
modelEdgesStyle: (
|
|
6
|
-
mutateModelEdgesStyle: (
|
|
6
|
+
modelEdgesStyle: (modelId: ModelId) => StyleValues;
|
|
7
|
+
mutateModelEdgesStyle: (modelId: ModelId, values: StyleValues) => Promise<string>;
|
|
7
8
|
} {
|
|
8
9
|
const dataStyleState = useDataStyleState();
|
|
9
10
|
|
|
10
|
-
async function mutateModelEdgesStyle(
|
|
11
|
-
const result = await dataStyleState.mutateStyle(
|
|
11
|
+
async function mutateModelEdgesStyle(modelId: ModelId, values: StyleValues): Promise<string> {
|
|
12
|
+
const result = await dataStyleState.mutateStyle(modelId, {
|
|
12
13
|
edges: values,
|
|
13
14
|
});
|
|
14
15
|
return result;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
function modelEdgesStyle(
|
|
18
|
-
const { edges } = dataStyleState.getStyle(
|
|
18
|
+
function modelEdgesStyle(modelId: ModelId): StyleValues {
|
|
19
|
+
const { edges } = dataStyleState.getStyle(modelId);
|
|
19
20
|
if (edges === undefined) {
|
|
20
21
|
return {};
|
|
21
22
|
}
|