@geode/opengeodeweb-front 10.44.0 → 10.44.1-rc.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 +4 -4
- 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 { BlockId, 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
|
|
|
@@ -17,99 +35,62 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
17
35
|
const modelBlockPolyhedronAttributeSchema =
|
|
18
36
|
viewer_schemas.opengeodeweb_viewer.model.blocks.attribute.polyhedron.attribute;
|
|
19
37
|
|
|
20
|
-
interface AttributeStoredConfig {
|
|
21
|
-
minimum: number | undefined;
|
|
22
|
-
maximum: number | undefined;
|
|
23
|
-
colorMap: string | undefined;
|
|
24
|
-
no_data_color: RGBAColor;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface AttributeState {
|
|
28
|
-
name?: string;
|
|
29
|
-
item?: number;
|
|
30
|
-
storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface AttributeInput {
|
|
34
|
-
name: string | undefined;
|
|
35
|
-
item: number | undefined;
|
|
36
|
-
minimum: number | undefined;
|
|
37
|
-
maximum: number | undefined;
|
|
38
|
-
colorMap: string | undefined;
|
|
39
|
-
no_data_color?: RGBAColor;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface ValidAttributeInput {
|
|
43
|
-
name: string;
|
|
44
|
-
item: number;
|
|
45
|
-
minimum: number;
|
|
46
|
-
maximum: number;
|
|
47
|
-
colorMap: string;
|
|
48
|
-
no_data_color?: RGBAColor;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function isModelBlocksPolyhedronAttributeValid(
|
|
52
|
-
input: AttributeInput,
|
|
53
|
-
): input is ValidAttributeInput {
|
|
54
|
-
return (
|
|
55
|
-
input.name !== undefined &&
|
|
56
|
-
input.item !== undefined &&
|
|
57
|
-
input.minimum !== undefined &&
|
|
58
|
-
input.maximum !== undefined &&
|
|
59
|
-
input.colorMap !== undefined
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
38
|
interface UseModelBlocksPolyhedronAttributeReturn {
|
|
64
|
-
modelBlocksPolyhedronAttributeName: (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
modelBlocksPolyhedronAttributeTimeStep: (
|
|
39
|
+
modelBlocksPolyhedronAttributeName: (
|
|
40
|
+
modelId: ModelId,
|
|
41
|
+
blockId?: BlockId,
|
|
42
|
+
) => AttributeName | undefined;
|
|
43
|
+
modelBlocksPolyhedronAttributeItem: (modelId: ModelId, blockId?: BlockId) => AttributeItem;
|
|
44
|
+
modelBlocksPolyhedronAttributeRange: (modelId: ModelId, blockId?: BlockId) => AttributeRange;
|
|
45
|
+
modelBlocksPolyhedronAttributeTimeStep: (
|
|
46
|
+
modelId: ModelId,
|
|
47
|
+
blockId?: BlockId,
|
|
48
|
+
) => AttributeTimeStep | undefined;
|
|
71
49
|
setModelBlocksPolyhedronAttributeTimeStep: (
|
|
72
|
-
modelId:
|
|
73
|
-
blockIds:
|
|
74
|
-
timeStep:
|
|
50
|
+
modelId: ModelId,
|
|
51
|
+
blockIds: BlockId[],
|
|
52
|
+
timeStep: AttributeTimeStep,
|
|
75
53
|
) => Promise<boolean>;
|
|
76
|
-
modelBlocksPolyhedronAttributeColorMap: (
|
|
54
|
+
modelBlocksPolyhedronAttributeColorMap: (
|
|
55
|
+
modelId: ModelId,
|
|
56
|
+
blockId?: BlockId,
|
|
57
|
+
) => AttributeColorMap | undefined;
|
|
77
58
|
modelBlocksPolyhedronAttributeStoredConfig: (
|
|
78
|
-
modelId:
|
|
79
|
-
blockId:
|
|
80
|
-
name:
|
|
81
|
-
item:
|
|
59
|
+
modelId: ModelId,
|
|
60
|
+
blockId: BlockId | undefined,
|
|
61
|
+
name: AttributeName | undefined,
|
|
62
|
+
item: AttributeItem | undefined,
|
|
82
63
|
) => AttributeStoredConfig;
|
|
83
64
|
setModelBlocksPolyhedronAttribute: (
|
|
84
|
-
modelId:
|
|
85
|
-
blockIds:
|
|
65
|
+
modelId: ModelId,
|
|
66
|
+
blockIds: BlockId[],
|
|
86
67
|
input: ValidAttributeInput,
|
|
87
68
|
) => Promise<unknown>;
|
|
88
69
|
setModelBlocksPolyhedronAttributeName: (
|
|
89
|
-
modelId:
|
|
90
|
-
blockIds:
|
|
91
|
-
name:
|
|
70
|
+
modelId: ModelId,
|
|
71
|
+
blockIds: BlockId[],
|
|
72
|
+
name: AttributeName,
|
|
92
73
|
) => Promise<boolean>;
|
|
93
74
|
setModelBlocksPolyhedronAttributeItem: (
|
|
94
|
-
modelId:
|
|
95
|
-
blockIds:
|
|
96
|
-
item:
|
|
75
|
+
modelId: ModelId,
|
|
76
|
+
blockIds: BlockId[],
|
|
77
|
+
item: AttributeItem,
|
|
97
78
|
) => Promise<boolean>;
|
|
98
79
|
setModelBlocksPolyhedronAttributeRange: (
|
|
99
|
-
modelId:
|
|
100
|
-
blockIds:
|
|
101
|
-
minimum:
|
|
102
|
-
maximum:
|
|
80
|
+
modelId: ModelId,
|
|
81
|
+
blockIds: BlockId[],
|
|
82
|
+
minimum: AttributeRangeMinimum,
|
|
83
|
+
maximum: AttributeRangeMaximum,
|
|
103
84
|
) => Promise<boolean>;
|
|
104
85
|
setModelBlocksPolyhedronAttributeColorMap: (
|
|
105
|
-
modelId:
|
|
106
|
-
blockIds:
|
|
107
|
-
colorMap:
|
|
86
|
+
modelId: ModelId,
|
|
87
|
+
blockIds: BlockId[],
|
|
88
|
+
colorMap: AttributeColorMap | undefined,
|
|
108
89
|
) => Promise<boolean>;
|
|
109
|
-
modelBlocksPolyhedronAttributeNoDataColor: (modelId:
|
|
90
|
+
modelBlocksPolyhedronAttributeNoDataColor: (modelId: ModelId, blockId?: BlockId) => RGBAColor;
|
|
110
91
|
setModelBlocksPolyhedronAttributeNoDataColor: (
|
|
111
|
-
modelId:
|
|
112
|
-
blockIds:
|
|
92
|
+
modelId: ModelId,
|
|
93
|
+
blockIds: BlockId[],
|
|
113
94
|
no_data_color: RGBAColor,
|
|
114
95
|
) => Promise<boolean>;
|
|
115
96
|
}
|
|
@@ -125,9 +106,9 @@ type ModelBlocksPolyhedronAttributeGetters = Pick<
|
|
|
125
106
|
| "modelBlocksPolyhedronAttributeTimeStep"
|
|
126
107
|
> & {
|
|
127
108
|
modelBlocksPolyhedronAttributeLastItem: (
|
|
128
|
-
modelId:
|
|
109
|
+
modelId: ModelId,
|
|
129
110
|
componentId: string | undefined,
|
|
130
|
-
name:
|
|
111
|
+
name: AttributeName | undefined,
|
|
131
112
|
) => number;
|
|
132
113
|
};
|
|
133
114
|
|
|
@@ -136,15 +117,15 @@ function useModelBlocksPolyhedronAttributeGetters(
|
|
|
136
117
|
modelBlocksCommonStyle: ReturnType<typeof useModelBlocksCommonStyle>,
|
|
137
118
|
): ModelBlocksPolyhedronAttributeGetters {
|
|
138
119
|
const { attributeTimeStep } = useAttributeTimeStepStyle();
|
|
139
|
-
function modelBlocksPolyhedronAttribute(modelId:
|
|
120
|
+
function modelBlocksPolyhedronAttribute(modelId: ModelId, blockId?: BlockId): AttributeState {
|
|
140
121
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.polyhedron shape is defined by the data style schema.
|
|
141
122
|
return modelBlocksCommonStyle.modelBlockColoring(modelId, blockId).polyhedron as AttributeState;
|
|
142
123
|
}
|
|
143
124
|
function modelBlocksPolyhedronAttributeStoredConfig(
|
|
144
|
-
modelId:
|
|
145
|
-
blockId:
|
|
146
|
-
name:
|
|
147
|
-
item:
|
|
125
|
+
modelId: ModelId,
|
|
126
|
+
blockId: BlockId | undefined,
|
|
127
|
+
name: AttributeName | undefined,
|
|
128
|
+
item: AttributeItem | undefined,
|
|
148
129
|
): AttributeStoredConfig {
|
|
149
130
|
const { storedConfigs } = modelBlocksPolyhedronAttribute(modelId, blockId);
|
|
150
131
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
@@ -152,23 +133,18 @@ function useModelBlocksPolyhedronAttributeGetters(
|
|
|
152
133
|
if (itemConfig !== undefined) {
|
|
153
134
|
return itemConfig;
|
|
154
135
|
}
|
|
155
|
-
return
|
|
156
|
-
minimum: undefined,
|
|
157
|
-
maximum: undefined,
|
|
158
|
-
colorMap: undefined,
|
|
159
|
-
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
160
|
-
};
|
|
136
|
+
return defaultAttributeStoredConfig();
|
|
161
137
|
}
|
|
162
138
|
function modelBlocksPolyhedronAttributeName(
|
|
163
|
-
modelId:
|
|
164
|
-
blockId?:
|
|
165
|
-
):
|
|
139
|
+
modelId: ModelId,
|
|
140
|
+
blockId?: BlockId,
|
|
141
|
+
): AttributeName | undefined {
|
|
166
142
|
return modelBlocksPolyhedronAttribute(modelId, blockId).name;
|
|
167
143
|
}
|
|
168
144
|
function modelBlocksPolyhedronAttributeLastItem(
|
|
169
|
-
modelId:
|
|
170
|
-
blockId:
|
|
171
|
-
name:
|
|
145
|
+
modelId: ModelId,
|
|
146
|
+
blockId: BlockId | undefined,
|
|
147
|
+
name: AttributeName | undefined,
|
|
172
148
|
): number {
|
|
173
149
|
const { storedConfigs } = modelBlocksPolyhedronAttribute(modelId, blockId);
|
|
174
150
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
@@ -177,7 +153,7 @@ function useModelBlocksPolyhedronAttributeGetters(
|
|
|
177
153
|
}
|
|
178
154
|
return 0;
|
|
179
155
|
}
|
|
180
|
-
function modelBlocksPolyhedronAttributeItem(modelId:
|
|
156
|
+
function modelBlocksPolyhedronAttributeItem(modelId: ModelId, blockId?: BlockId): AttributeItem {
|
|
181
157
|
const polyhedronAttribute = modelBlocksPolyhedronAttribute(modelId, blockId);
|
|
182
158
|
return (
|
|
183
159
|
polyhedronAttribute.item ??
|
|
@@ -185,9 +161,9 @@ function useModelBlocksPolyhedronAttributeGetters(
|
|
|
185
161
|
);
|
|
186
162
|
}
|
|
187
163
|
function modelBlocksPolyhedronAttributeRange(
|
|
188
|
-
modelId:
|
|
189
|
-
blockId?:
|
|
190
|
-
):
|
|
164
|
+
modelId: ModelId,
|
|
165
|
+
blockId?: BlockId,
|
|
166
|
+
): AttributeRange {
|
|
191
167
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
|
|
192
168
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
|
|
193
169
|
const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
|
|
@@ -195,24 +171,27 @@ function useModelBlocksPolyhedronAttributeGetters(
|
|
|
195
171
|
return [minimum, maximum];
|
|
196
172
|
}
|
|
197
173
|
function modelBlocksPolyhedronAttributeColorMap(
|
|
198
|
-
modelId:
|
|
199
|
-
blockId?:
|
|
200
|
-
):
|
|
174
|
+
modelId: ModelId,
|
|
175
|
+
blockId?: BlockId,
|
|
176
|
+
): AttributeColorMap | undefined {
|
|
201
177
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
|
|
202
178
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
|
|
203
179
|
const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
|
|
204
180
|
return storedConfig.colorMap;
|
|
205
181
|
}
|
|
206
|
-
function modelBlocksPolyhedronAttributeNoDataColor(
|
|
182
|
+
function modelBlocksPolyhedronAttributeNoDataColor(
|
|
183
|
+
modelId: ModelId,
|
|
184
|
+
blockId?: BlockId,
|
|
185
|
+
): RGBAColor {
|
|
207
186
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
|
|
208
187
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
|
|
209
188
|
const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
|
|
210
189
|
return storedConfig.no_data_color;
|
|
211
190
|
}
|
|
212
191
|
function modelBlocksPolyhedronAttributeTimeStep(
|
|
213
|
-
modelId:
|
|
214
|
-
blockId?:
|
|
215
|
-
):
|
|
192
|
+
modelId: ModelId,
|
|
193
|
+
blockId?: BlockId,
|
|
194
|
+
): AttributeTimeStep | undefined {
|
|
216
195
|
return attributeTimeStep(
|
|
217
196
|
modelId,
|
|
218
197
|
modelBlockPolyhedronAttributeSchema.$id,
|
|
@@ -248,8 +227,8 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
248
227
|
} = useModelBlocksPolyhedronAttributeGetters(modelBlocksCommonStyle);
|
|
249
228
|
const viewerStore = useViewerStore();
|
|
250
229
|
async function mutateModelBlocksPolyhedronStyle(
|
|
251
|
-
modelId:
|
|
252
|
-
blockIds:
|
|
230
|
+
modelId: ModelId,
|
|
231
|
+
blockIds: BlockId[],
|
|
253
232
|
values: Record<string, unknown>,
|
|
254
233
|
): Promise<void> {
|
|
255
234
|
const tasks: Promise<void>[] = [
|
|
@@ -268,10 +247,10 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
268
247
|
await Promise.all(tasks);
|
|
269
248
|
}
|
|
270
249
|
async function setModelBlocksPolyhedronAttributeStoredConfig(
|
|
271
|
-
modelId:
|
|
272
|
-
blockIds:
|
|
273
|
-
name:
|
|
274
|
-
item:
|
|
250
|
+
modelId: ModelId,
|
|
251
|
+
blockIds: BlockId[],
|
|
252
|
+
name: AttributeName | undefined,
|
|
253
|
+
item: AttributeItem | undefined,
|
|
275
254
|
config: Partial<AttributeStoredConfig>,
|
|
276
255
|
): Promise<void> {
|
|
277
256
|
if (name === undefined || item === undefined) {
|
|
@@ -287,8 +266,8 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
287
266
|
});
|
|
288
267
|
}
|
|
289
268
|
async function setModelBlocksPolyhedronAttribute(
|
|
290
|
-
modelId:
|
|
291
|
-
blockIds:
|
|
269
|
+
modelId: ModelId,
|
|
270
|
+
blockIds: BlockId[],
|
|
292
271
|
{
|
|
293
272
|
name,
|
|
294
273
|
item,
|
|
@@ -326,7 +305,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
326
305
|
});
|
|
327
306
|
}
|
|
328
307
|
// True when the attribute was sent to the viewer, so the caller knows a render is needed
|
|
329
|
-
async function applyPolyhedronAttribute(modelId:
|
|
308
|
+
async function applyPolyhedronAttribute(modelId: ModelId, blockIds: BlockId[]): Promise<boolean> {
|
|
330
309
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
331
310
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockIds[0]);
|
|
332
311
|
const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(
|
|
@@ -343,16 +322,16 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
343
322
|
colorMap: storedConfig.colorMap,
|
|
344
323
|
no_data_color: storedConfig.no_data_color,
|
|
345
324
|
};
|
|
346
|
-
if (!
|
|
325
|
+
if (!isAttributeValid(attribute)) {
|
|
347
326
|
return false;
|
|
348
327
|
}
|
|
349
328
|
await setModelBlocksPolyhedronAttribute(modelId, blockIds, attribute);
|
|
350
329
|
return true;
|
|
351
330
|
}
|
|
352
331
|
async function setModelBlocksPolyhedronAttributeName(
|
|
353
|
-
modelId:
|
|
354
|
-
blockIds:
|
|
355
|
-
name:
|
|
332
|
+
modelId: ModelId,
|
|
333
|
+
blockIds: BlockId[],
|
|
334
|
+
name: AttributeName,
|
|
356
335
|
): Promise<boolean> {
|
|
357
336
|
const item = modelBlocksPolyhedronAttributeLastItem(modelId, blockIds[0], name);
|
|
358
337
|
await mutateModelBlocksPolyhedronStyle(modelId, blockIds, {
|
|
@@ -362,9 +341,9 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
362
341
|
return applyPolyhedronAttribute(modelId, blockIds);
|
|
363
342
|
}
|
|
364
343
|
async function setModelBlocksPolyhedronAttributeItem(
|
|
365
|
-
modelId:
|
|
366
|
-
blockIds:
|
|
367
|
-
item:
|
|
344
|
+
modelId: ModelId,
|
|
345
|
+
blockIds: BlockId[],
|
|
346
|
+
item: AttributeItem,
|
|
368
347
|
): Promise<boolean> {
|
|
369
348
|
await mutateModelBlocksPolyhedronStyle(modelId, blockIds, {
|
|
370
349
|
item,
|
|
@@ -372,9 +351,9 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
372
351
|
return applyPolyhedronAttribute(modelId, blockIds);
|
|
373
352
|
}
|
|
374
353
|
async function setModelBlocksPolyhedronAttributeTimeStep(
|
|
375
|
-
modelId:
|
|
376
|
-
blockIds:
|
|
377
|
-
timeStep:
|
|
354
|
+
modelId: ModelId,
|
|
355
|
+
blockIds: BlockId[],
|
|
356
|
+
timeStep: AttributeTimeStep,
|
|
378
357
|
): Promise<boolean> {
|
|
379
358
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
380
359
|
if (name === undefined) {
|
|
@@ -409,10 +388,10 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
409
388
|
return applied || reapplied;
|
|
410
389
|
}
|
|
411
390
|
async function setModelBlocksPolyhedronAttributeRange(
|
|
412
|
-
modelId:
|
|
413
|
-
blockIds:
|
|
414
|
-
minimum:
|
|
415
|
-
maximum:
|
|
391
|
+
modelId: ModelId,
|
|
392
|
+
blockIds: BlockId[],
|
|
393
|
+
minimum: AttributeRangeMinimum,
|
|
394
|
+
maximum: AttributeRangeMaximum,
|
|
416
395
|
): Promise<boolean> {
|
|
417
396
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
418
397
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockIds[0]);
|
|
@@ -423,9 +402,9 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
423
402
|
return applyPolyhedronAttribute(modelId, blockIds);
|
|
424
403
|
}
|
|
425
404
|
async function setModelBlocksPolyhedronAttributeColorMap(
|
|
426
|
-
modelId:
|
|
427
|
-
blockIds:
|
|
428
|
-
colorMap:
|
|
405
|
+
modelId: ModelId,
|
|
406
|
+
blockIds: BlockId[],
|
|
407
|
+
colorMap: AttributeColorMap | undefined,
|
|
429
408
|
): Promise<boolean> {
|
|
430
409
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
431
410
|
const item = modelBlocksPolyhedronAttributeItem(modelId, blockIds[0]);
|
|
@@ -435,8 +414,8 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
435
414
|
return applyPolyhedronAttribute(modelId, blockIds);
|
|
436
415
|
}
|
|
437
416
|
async function setModelBlocksPolyhedronAttributeNoDataColor(
|
|
438
|
-
modelId:
|
|
439
|
-
blockIds:
|
|
417
|
+
modelId: ModelId,
|
|
418
|
+
blockIds: BlockId[],
|
|
440
419
|
no_data_color: RGBAColor,
|
|
441
420
|
): Promise<boolean> {
|
|
442
421
|
const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
|
|
@@ -470,4 +449,4 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
|
|
|
470
449
|
setModelBlocksPolyhedronAttributeNoDataColor,
|
|
471
450
|
};
|
|
472
451
|
}
|
|
473
|
-
export {
|
|
452
|
+
export { useModelBlocksPolyhedronAttribute };
|