@geode/opengeodeweb-front 10.41.0-rc.1 → 10.41.0-rc.3
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/HybridRenderingView.vue +2 -0
- package/app/components/RemoteRenderingView.vue +2 -0
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +0 -1
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +245 -0
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +141 -0
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +7 -67
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +2 -40
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +11 -2
- package/app/composables/attribute_coloring_style.ts +182 -0
- package/app/composables/global_attribute_style.ts +55 -366
- package/app/composables/model_attribute_style.ts +79 -0
- package/app/composables/model_menu_context.ts +101 -0
- package/app/composables/use_quick_colormap.ts +4 -1
- package/app/stores/data.ts +12 -0
- package/app/utils/attribute_range.ts +15 -15
- package/internal/stores/data_style/model/blocks/index.ts +4 -0
- package/internal/stores/data_style/model/blocks/points.ts +51 -0
- package/internal/stores/data_style/model/index.ts +6 -0
- package/internal/stores/data_style/model/lines/index.ts +4 -0
- package/internal/stores/data_style/model/lines/points.ts +51 -0
- package/internal/stores/data_style/model/points/component.ts +423 -0
- package/internal/stores/data_style/model/points/size.ts +13 -1
- package/internal/stores/data_style/model/points/visibility.ts +13 -3
- package/internal/stores/data_style/model/surfaces/index.ts +4 -0
- package/internal/stores/data_style/model/surfaces/points.ts +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type AttributeColoring,
|
|
3
|
+
type AttributeColoringStyle,
|
|
4
|
+
attributeSchemas,
|
|
5
|
+
attributeType,
|
|
6
|
+
storeMethod,
|
|
7
|
+
useAttributeColoringStyle,
|
|
8
|
+
} from "@ogw_front/composables/attribute_coloring_style";
|
|
9
|
+
import { useDataStore } from "@ogw_front/stores/data";
|
|
10
|
+
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
11
|
+
|
|
12
|
+
// Components of the same type colored by the same attribute share the store methods, e.g. "modelBlocksPolyhedronAttributeName"
|
|
13
|
+
interface ComponentGroup {
|
|
14
|
+
// Component type of the store methods, e.g. "Block"
|
|
15
|
+
type: string;
|
|
16
|
+
activeColoring: string;
|
|
17
|
+
componentIds: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function modelColoring(
|
|
21
|
+
dataStyleStore: object,
|
|
22
|
+
modelId: string,
|
|
23
|
+
{ type, activeColoring, componentIds }: ComponentGroup,
|
|
24
|
+
): AttributeColoring {
|
|
25
|
+
const methodName = `${type}s${attributeType(activeColoring)}`;
|
|
26
|
+
return {
|
|
27
|
+
// Every component of the coloring shares its style: reading the first one is enough
|
|
28
|
+
read: (property): unknown =>
|
|
29
|
+
storeMethod(dataStyleStore, `model${methodName}${property}`)(modelId, componentIds[0]),
|
|
30
|
+
write: async (property, ...values): Promise<void> => {
|
|
31
|
+
await storeMethod(dataStyleStore, `setModel${methodName}${property}`)(
|
|
32
|
+
modelId,
|
|
33
|
+
componentIds,
|
|
34
|
+
...values,
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
schemas: attributeSchemas("model_component_", activeColoring),
|
|
38
|
+
params: { id: modelId, component_ids: componentIds },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Styles the model components colored by the picked scalar bar
|
|
43
|
+
export function useModelAttributeStyle(
|
|
44
|
+
modelIdRef: Ref<string>,
|
|
45
|
+
blockViewerIdsRef: Ref<number[]>,
|
|
46
|
+
): AttributeColoringStyle {
|
|
47
|
+
const dataStyleStore = useDataStyleStore();
|
|
48
|
+
const dataStore = useDataStore();
|
|
49
|
+
|
|
50
|
+
const colorings = shallowRef<AttributeColoring[]>([]);
|
|
51
|
+
const style = useAttributeColoringStyle(colorings);
|
|
52
|
+
|
|
53
|
+
async function loadColorings(): Promise<void> {
|
|
54
|
+
const modelId = modelIdRef.value;
|
|
55
|
+
const blockViewerIds = blockViewerIdsRef.value;
|
|
56
|
+
const components = await dataStore.getComponentsByViewerIds(modelId, blockViewerIds);
|
|
57
|
+
// A newer pick replaced this one while the components were read
|
|
58
|
+
if (modelId !== modelIdRef.value || blockViewerIds !== blockViewerIdsRef.value) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const groups = new Map<string, ComponentGroup>();
|
|
62
|
+
for (const { type, geode_id } of components) {
|
|
63
|
+
const activeColoring = String(
|
|
64
|
+
storeMethod(dataStyleStore, `model${type}ActiveColoring`)(modelId, geode_id),
|
|
65
|
+
);
|
|
66
|
+
const key = `${type}_${activeColoring}`;
|
|
67
|
+
const group = groups.get(key) ?? { type, activeColoring, componentIds: [] };
|
|
68
|
+
group.componentIds.push(geode_id);
|
|
69
|
+
groups.set(key, group);
|
|
70
|
+
}
|
|
71
|
+
colorings.value = [...groups.values()].map((group) =>
|
|
72
|
+
modelColoring(dataStyleStore, modelId, group),
|
|
73
|
+
);
|
|
74
|
+
await style.loadTimeSteps();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
watch([modelIdRef, blockViewerIdsRef], loadColorings, { immediate: true });
|
|
78
|
+
return style;
|
|
79
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref, computed, ref, watch } from "vue";
|
|
2
|
+
import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
|
|
3
|
+
import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
|
|
4
|
+
import { useDataStore } from "@ogw_front/stores/data";
|
|
5
|
+
|
|
6
|
+
interface ModelMenuMetaData {
|
|
7
|
+
modelId?: string;
|
|
8
|
+
pickedComponentId?: string;
|
|
9
|
+
viewer_type?: string;
|
|
10
|
+
modelComponentType?: string;
|
|
11
|
+
targetComponentIds?: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ModelMenuItemProps {
|
|
15
|
+
id: string;
|
|
16
|
+
meta_data: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ModelMenuContext {
|
|
20
|
+
modelId: ComputedRef<string>;
|
|
21
|
+
componentId: ComputedRef<string | undefined>;
|
|
22
|
+
componentType: Ref<string | undefined>;
|
|
23
|
+
collections: Ref<CollectionComponent[] | undefined>;
|
|
24
|
+
targetComponentIds: Ref<string[]>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Resolves what a model context menu targets: the whole model, a component type, a collection or one component
|
|
28
|
+
// oxlint-disable-next-line max-lines-per-function
|
|
29
|
+
function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuContext {
|
|
30
|
+
const dataStore = useDataStore();
|
|
31
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- meta_data is filled by the viewer context menu with these keys.
|
|
32
|
+
const metaData = computed(() => getItemProps().meta_data as ModelMenuMetaData);
|
|
33
|
+
|
|
34
|
+
const modelId = computed<string>(() => metaData.value.modelId ?? getItemProps().id);
|
|
35
|
+
const componentId = computed<string | undefined>(() => metaData.value.pickedComponentId);
|
|
36
|
+
const componentType = ref<string | undefined>(undefined);
|
|
37
|
+
const collections = ref<CollectionComponent[] | undefined>(undefined);
|
|
38
|
+
|
|
39
|
+
watch(
|
|
40
|
+
() => [
|
|
41
|
+
modelId.value,
|
|
42
|
+
componentId.value,
|
|
43
|
+
metaData.value.viewer_type,
|
|
44
|
+
metaData.value.modelComponentType,
|
|
45
|
+
],
|
|
46
|
+
async () => {
|
|
47
|
+
componentType.value = undefined;
|
|
48
|
+
collections.value = undefined;
|
|
49
|
+
if (metaData.value.viewer_type === "model_component_type") {
|
|
50
|
+
const { modelComponentType = "", targetComponentIds: ids = [] } = metaData.value;
|
|
51
|
+
if (MESH_COMPONENT_TYPES.includes(modelComponentType)) {
|
|
52
|
+
componentType.value = modelComponentType;
|
|
53
|
+
} else {
|
|
54
|
+
const collectionsByType = await dataStore.fetchAllCollectionComponents(modelId.value);
|
|
55
|
+
collections.value = (collectionsByType[modelComponentType] ?? []).filter((collection) =>
|
|
56
|
+
collection.children.every((child) => ids.includes(child.id)),
|
|
57
|
+
);
|
|
58
|
+
componentType.value = collections.value[0]?.children[0]?.category;
|
|
59
|
+
}
|
|
60
|
+
} else if (componentId.value !== undefined && modelId.value !== "") {
|
|
61
|
+
const currentModelId = modelId.value;
|
|
62
|
+
const currentCompId = componentId.value;
|
|
63
|
+
const type = await dataStore.meshComponentType(currentModelId, currentCompId);
|
|
64
|
+
if (
|
|
65
|
+
modelId.value === currentModelId &&
|
|
66
|
+
componentId.value === currentCompId &&
|
|
67
|
+
metaData.value.viewer_type !== "model_component_type"
|
|
68
|
+
) {
|
|
69
|
+
componentType.value = type;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{ immediate: true },
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const targetComponentIds = ref<string[]>([]);
|
|
77
|
+
watch(
|
|
78
|
+
() => [modelId.value, componentType.value, metaData.value.targetComponentIds],
|
|
79
|
+
async () => {
|
|
80
|
+
targetComponentIds.value = [];
|
|
81
|
+
if (metaData.value.targetComponentIds !== undefined) {
|
|
82
|
+
targetComponentIds.value = metaData.value.targetComponentIds;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (componentType.value !== undefined && modelId.value !== "") {
|
|
86
|
+
const currentModelId = modelId.value;
|
|
87
|
+
const currentType = componentType.value;
|
|
88
|
+
const ids = await dataStore.getMeshComponentGeodeIds(currentModelId, currentType);
|
|
89
|
+
if (modelId.value === currentModelId && componentType.value === currentType) {
|
|
90
|
+
targetComponentIds.value = ids;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{ immediate: true },
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return { modelId, componentId, componentType, collections, targetComponentIds };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { useModelMenuContext };
|
|
101
|
+
export type { ModelMenuItemProps };
|
|
@@ -9,11 +9,13 @@ export function useQuickColormap(): {
|
|
|
9
9
|
const viewerStore = useViewerStore();
|
|
10
10
|
const quickColormap = reactive<{
|
|
11
11
|
data_id: string | undefined;
|
|
12
|
+
block_ids: number[] | undefined;
|
|
12
13
|
show: boolean;
|
|
13
14
|
x: number;
|
|
14
15
|
y: number;
|
|
15
16
|
}>({
|
|
16
17
|
data_id: undefined,
|
|
18
|
+
block_ids: undefined,
|
|
17
19
|
show: false,
|
|
18
20
|
x: 0,
|
|
19
21
|
y: 0,
|
|
@@ -28,9 +30,10 @@ export function useQuickColormap(): {
|
|
|
28
30
|
try {
|
|
29
31
|
const schema = viewer_schemas.opengeodeweb_viewer.viewer.pick_colormap;
|
|
30
32
|
const params = { x: offsetX, y: offsetY };
|
|
31
|
-
const { data_id } = await viewerStore.request({ schema, params });
|
|
33
|
+
const { data_id, block_ids } = await viewerStore.request({ schema, params });
|
|
32
34
|
if (data_id !== undefined && data_id !== "") {
|
|
33
35
|
quickColormap.data_id = data_id;
|
|
36
|
+
quickColormap.block_ids = block_ids;
|
|
34
37
|
quickColormap.x = clientX;
|
|
35
38
|
quickColormap.y = clientY;
|
|
36
39
|
quickColormap.show = true;
|
package/app/stores/data.ts
CHANGED
|
@@ -285,6 +285,17 @@ export const useDataStore = defineStore("data", () => {
|
|
|
285
285
|
.first();
|
|
286
286
|
return component;
|
|
287
287
|
}
|
|
288
|
+
async function getComponentsByViewerIds(
|
|
289
|
+
modelId: string,
|
|
290
|
+
viewer_ids: number[],
|
|
291
|
+
): Promise<ModelComponentRecord[]> {
|
|
292
|
+
const components = await model_components_db
|
|
293
|
+
.where("viewer_id")
|
|
294
|
+
.anyOf(viewer_ids)
|
|
295
|
+
.and((model_component: ModelComponentRecord) => model_component.id === modelId)
|
|
296
|
+
.toArray();
|
|
297
|
+
return components;
|
|
298
|
+
}
|
|
288
299
|
async function deleteModelComponents(modelId: string): Promise<void> {
|
|
289
300
|
await model_components_db.where("id").equals(modelId).delete();
|
|
290
301
|
await model_components_relation_db.where("id").equals(modelId).delete();
|
|
@@ -365,6 +376,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
365
376
|
getAllModelComponentsViewerIds,
|
|
366
377
|
getMeshComponentsViewerIds,
|
|
367
378
|
getComponentByViewerId,
|
|
379
|
+
getComponentsByViewerIds,
|
|
368
380
|
exportStores,
|
|
369
381
|
importStores,
|
|
370
382
|
clear,
|
|
@@ -19,38 +19,38 @@ interface AttributeRangeTarget {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// A data never changes once imported: selectors showing the same attribute share one request
|
|
22
|
-
const rangeRequests = new Map<string, Promise<AttributeRangeInfo
|
|
22
|
+
const rangeRequests = new Map<string, Promise<AttributeRangeInfo>>();
|
|
23
23
|
|
|
24
24
|
async function requestAttributeRange(
|
|
25
25
|
rangeSchema: JsonRpcSchema,
|
|
26
26
|
params: Record<string, unknown>,
|
|
27
|
-
|
|
28
|
-
): Promise<AttributeRangeInfo | undefined> {
|
|
27
|
+
): Promise<AttributeRangeInfo> {
|
|
29
28
|
const backStore = useBackStore();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return range as AttributeRangeInfo;
|
|
34
|
-
} catch {
|
|
35
|
-
rangeRequests.delete(key);
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
29
|
+
const range = await backStore.request({ schema: rangeSchema, params });
|
|
30
|
+
// oxlint-disable-next-line no-unsafe-type-assertion -- every *_attribute_range schema shares this response.
|
|
31
|
+
return range as AttributeRangeInfo;
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
async function fetchAttributeRange(
|
|
41
35
|
rangeSchema: JsonRpcSchema,
|
|
42
36
|
target: AttributeRangeTarget,
|
|
43
37
|
attributeName: string,
|
|
44
|
-
): Promise<AttributeRangeInfo
|
|
38
|
+
): Promise<AttributeRangeInfo> {
|
|
45
39
|
const params = { ...target, attribute_name: attributeName };
|
|
46
40
|
const key = JSON.stringify([rangeSchema.$id, params]);
|
|
47
41
|
let request = rangeRequests.get(key);
|
|
48
42
|
if (request === undefined) {
|
|
49
|
-
request = requestAttributeRange(rangeSchema, params
|
|
43
|
+
request = requestAttributeRange(rangeSchema, params);
|
|
50
44
|
rangeRequests.set(key, request);
|
|
51
45
|
}
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
try {
|
|
47
|
+
const range = await request;
|
|
48
|
+
return range;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
// A failed request is not kept: the next call retries it
|
|
51
|
+
rangeRequests.delete(key);
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export { type AttributeRangeInfo, type AttributeSchemas, fetchAttributeRange };
|
|
@@ -7,6 +7,7 @@ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
|
7
7
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
8
8
|
import { useModelBlocksColor } from "./color";
|
|
9
9
|
import { useModelBlocksCommonStyle } from "./common";
|
|
10
|
+
import { useModelBlocksPointsStyle } from "./points";
|
|
10
11
|
import { useModelBlocksVisibility } from "./visibility";
|
|
11
12
|
|
|
12
13
|
interface ColorGroup {
|
|
@@ -34,6 +35,7 @@ type UseModelBlocksStyleReturn = {
|
|
|
34
35
|
} & ReturnType<typeof useModelBlocksCommonStyle> &
|
|
35
36
|
ReturnType<typeof useModelBlocksVisibility> &
|
|
36
37
|
ReturnType<typeof useModelBlocksColor> &
|
|
38
|
+
ReturnType<typeof useModelBlocksPointsStyle> &
|
|
37
39
|
ReturnType<typeof useModelBlocksVertexAttribute> &
|
|
38
40
|
ReturnType<typeof useModelBlocksPolyhedronAttribute>;
|
|
39
41
|
|
|
@@ -45,6 +47,7 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
|
|
|
45
47
|
const modelColorStyle = useModelBlocksColor();
|
|
46
48
|
const modelBlocksVertexAttribute = useModelBlocksVertexAttribute();
|
|
47
49
|
const modelBlocksPolyhedronAttribute = useModelBlocksPolyhedronAttribute();
|
|
50
|
+
const modelBlocksPointsStyle = useModelBlocksPointsStyle();
|
|
48
51
|
|
|
49
52
|
async function applyModelBlocksVisibilityStyle(
|
|
50
53
|
modelId: string,
|
|
@@ -245,5 +248,6 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
|
|
|
245
248
|
...modelColorStyle,
|
|
246
249
|
...modelBlocksVertexAttribute,
|
|
247
250
|
...modelBlocksPolyhedronAttribute,
|
|
251
|
+
...modelBlocksPointsStyle,
|
|
248
252
|
};
|
|
249
253
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ModelComponentPointsStyle,
|
|
3
|
+
useModelComponentPointsStyle,
|
|
4
|
+
} from "@ogw_internal/stores/data_style/model/points/component";
|
|
5
|
+
|
|
6
|
+
interface UseModelBlocksPointsStyleReturn {
|
|
7
|
+
modelBlockPointsVisibility: ModelComponentPointsStyle["visibility"];
|
|
8
|
+
modelBlockPointsSize: ModelComponentPointsStyle["size"];
|
|
9
|
+
modelBlockPointsColor: ModelComponentPointsStyle["color"];
|
|
10
|
+
modelBlockPointsActiveColoring: ModelComponentPointsStyle["activeColoring"];
|
|
11
|
+
modelBlockPointsVertexAttributeName: ModelComponentPointsStyle["vertexAttributeName"];
|
|
12
|
+
modelBlockPointsVertexAttributeItem: ModelComponentPointsStyle["vertexAttributeItem"];
|
|
13
|
+
modelBlockPointsVertexAttributeRange: ModelComponentPointsStyle["vertexAttributeRange"];
|
|
14
|
+
modelBlockPointsVertexAttributeColorMap: ModelComponentPointsStyle["vertexAttributeColorMap"];
|
|
15
|
+
modelBlockPointsVertexAttributeNoDataColor: ModelComponentPointsStyle["vertexAttributeNoDataColor"];
|
|
16
|
+
setModelBlocksPointsVisibility: ModelComponentPointsStyle["setVisibility"];
|
|
17
|
+
setModelBlocksPointsSize: ModelComponentPointsStyle["setSize"];
|
|
18
|
+
setModelBlocksPointsColor: ModelComponentPointsStyle["setColor"];
|
|
19
|
+
setModelBlocksPointsActiveColoring: ModelComponentPointsStyle["setActiveColoring"];
|
|
20
|
+
setModelBlocksPointsVertexAttributeName: ModelComponentPointsStyle["setVertexAttributeName"];
|
|
21
|
+
setModelBlocksPointsVertexAttributeItem: ModelComponentPointsStyle["setVertexAttributeItem"];
|
|
22
|
+
setModelBlocksPointsVertexAttributeRange: ModelComponentPointsStyle["setVertexAttributeRange"];
|
|
23
|
+
setModelBlocksPointsVertexAttributeColorMap: ModelComponentPointsStyle["setVertexAttributeColorMap"];
|
|
24
|
+
setModelBlocksPointsVertexAttributeNoDataColor: ModelComponentPointsStyle["setVertexAttributeNoDataColor"];
|
|
25
|
+
applyModelBlocksPointsStyle: ModelComponentPointsStyle["applyPointsStyle"];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useModelBlocksPointsStyle(): UseModelBlocksPointsStyleReturn {
|
|
29
|
+
const points = useModelComponentPointsStyle("Block");
|
|
30
|
+
return {
|
|
31
|
+
modelBlockPointsVisibility: points.visibility,
|
|
32
|
+
modelBlockPointsSize: points.size,
|
|
33
|
+
modelBlockPointsColor: points.color,
|
|
34
|
+
modelBlockPointsActiveColoring: points.activeColoring,
|
|
35
|
+
modelBlockPointsVertexAttributeName: points.vertexAttributeName,
|
|
36
|
+
modelBlockPointsVertexAttributeItem: points.vertexAttributeItem,
|
|
37
|
+
modelBlockPointsVertexAttributeRange: points.vertexAttributeRange,
|
|
38
|
+
modelBlockPointsVertexAttributeColorMap: points.vertexAttributeColorMap,
|
|
39
|
+
modelBlockPointsVertexAttributeNoDataColor: points.vertexAttributeNoDataColor,
|
|
40
|
+
setModelBlocksPointsVisibility: points.setVisibility,
|
|
41
|
+
setModelBlocksPointsSize: points.setSize,
|
|
42
|
+
setModelBlocksPointsColor: points.setColor,
|
|
43
|
+
setModelBlocksPointsActiveColoring: points.setActiveColoring,
|
|
44
|
+
setModelBlocksPointsVertexAttributeName: points.setVertexAttributeName,
|
|
45
|
+
setModelBlocksPointsVertexAttributeItem: points.setVertexAttributeItem,
|
|
46
|
+
setModelBlocksPointsVertexAttributeRange: points.setVertexAttributeRange,
|
|
47
|
+
setModelBlocksPointsVertexAttributeColorMap: points.setVertexAttributeColorMap,
|
|
48
|
+
setModelBlocksPointsVertexAttributeNoDataColor: points.setVertexAttributeNoDataColor,
|
|
49
|
+
applyModelBlocksPointsStyle: points.applyPointsStyle,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -61,6 +61,12 @@ function useModelStyle(): UseModelStyleReturn {
|
|
|
61
61
|
modelPointsStyle.applyModelPointsStyle(modelId),
|
|
62
62
|
modelEdgesStyle.applyModelEdgesStyle(modelId),
|
|
63
63
|
]);
|
|
64
|
+
// Components points come after the model points, which override every component
|
|
65
|
+
await Promise.all([
|
|
66
|
+
modelSurfacesStyle.applyModelSurfacesPointsStyle(modelId),
|
|
67
|
+
modelLinesStyle.applyModelLinesPointsStyle(modelId),
|
|
68
|
+
modelBlocksStyle.applyModelBlocksPointsStyle(modelId),
|
|
69
|
+
]);
|
|
64
70
|
return results;
|
|
65
71
|
}
|
|
66
72
|
|
|
@@ -4,6 +4,7 @@ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
|
4
4
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
5
5
|
import { useModelLinesColor } from "./color";
|
|
6
6
|
import { useModelLinesCommonStyle } from "./common";
|
|
7
|
+
import { useModelLinesPointsStyle } from "./points";
|
|
7
8
|
import { useModelLinesVisibility } from "./visibility";
|
|
8
9
|
|
|
9
10
|
interface ColorGroup {
|
|
@@ -29,6 +30,7 @@ async function setModelLinesDefaultStyle(_id: string): Promise<void> {
|
|
|
29
30
|
export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle> &
|
|
30
31
|
ReturnType<typeof useModelLinesVisibility> &
|
|
31
32
|
ReturnType<typeof useModelLinesColor> &
|
|
33
|
+
ReturnType<typeof useModelLinesPointsStyle> &
|
|
32
34
|
ReturnType<typeof useModelLinesVertexAttribute> &
|
|
33
35
|
ReturnType<typeof useModelLinesEdgeAttribute> & {
|
|
34
36
|
applyModelLinesStyle: (modelId: string) => Promise<void>;
|
|
@@ -40,6 +42,7 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
40
42
|
const modelColorStyle = useModelLinesColor();
|
|
41
43
|
const modelLinesVertexAttribute = useModelLinesVertexAttribute();
|
|
42
44
|
const modelLinesEdgeAttribute = useModelLinesEdgeAttribute();
|
|
45
|
+
const modelLinesPointsStyle = useModelLinesPointsStyle();
|
|
43
46
|
|
|
44
47
|
async function applyModelLinesVisibilityStyle(
|
|
45
48
|
modelId: string,
|
|
@@ -232,5 +235,6 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
232
235
|
...modelColorStyle,
|
|
233
236
|
...modelLinesVertexAttribute,
|
|
234
237
|
...modelLinesEdgeAttribute,
|
|
238
|
+
...modelLinesPointsStyle,
|
|
235
239
|
};
|
|
236
240
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ModelComponentPointsStyle,
|
|
3
|
+
useModelComponentPointsStyle,
|
|
4
|
+
} from "@ogw_internal/stores/data_style/model/points/component";
|
|
5
|
+
|
|
6
|
+
interface UseModelLinesPointsStyleReturn {
|
|
7
|
+
modelLinePointsVisibility: ModelComponentPointsStyle["visibility"];
|
|
8
|
+
modelLinePointsSize: ModelComponentPointsStyle["size"];
|
|
9
|
+
modelLinePointsColor: ModelComponentPointsStyle["color"];
|
|
10
|
+
modelLinePointsActiveColoring: ModelComponentPointsStyle["activeColoring"];
|
|
11
|
+
modelLinePointsVertexAttributeName: ModelComponentPointsStyle["vertexAttributeName"];
|
|
12
|
+
modelLinePointsVertexAttributeItem: ModelComponentPointsStyle["vertexAttributeItem"];
|
|
13
|
+
modelLinePointsVertexAttributeRange: ModelComponentPointsStyle["vertexAttributeRange"];
|
|
14
|
+
modelLinePointsVertexAttributeColorMap: ModelComponentPointsStyle["vertexAttributeColorMap"];
|
|
15
|
+
modelLinePointsVertexAttributeNoDataColor: ModelComponentPointsStyle["vertexAttributeNoDataColor"];
|
|
16
|
+
setModelLinesPointsVisibility: ModelComponentPointsStyle["setVisibility"];
|
|
17
|
+
setModelLinesPointsSize: ModelComponentPointsStyle["setSize"];
|
|
18
|
+
setModelLinesPointsColor: ModelComponentPointsStyle["setColor"];
|
|
19
|
+
setModelLinesPointsActiveColoring: ModelComponentPointsStyle["setActiveColoring"];
|
|
20
|
+
setModelLinesPointsVertexAttributeName: ModelComponentPointsStyle["setVertexAttributeName"];
|
|
21
|
+
setModelLinesPointsVertexAttributeItem: ModelComponentPointsStyle["setVertexAttributeItem"];
|
|
22
|
+
setModelLinesPointsVertexAttributeRange: ModelComponentPointsStyle["setVertexAttributeRange"];
|
|
23
|
+
setModelLinesPointsVertexAttributeColorMap: ModelComponentPointsStyle["setVertexAttributeColorMap"];
|
|
24
|
+
setModelLinesPointsVertexAttributeNoDataColor: ModelComponentPointsStyle["setVertexAttributeNoDataColor"];
|
|
25
|
+
applyModelLinesPointsStyle: ModelComponentPointsStyle["applyPointsStyle"];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useModelLinesPointsStyle(): UseModelLinesPointsStyleReturn {
|
|
29
|
+
const points = useModelComponentPointsStyle("Line");
|
|
30
|
+
return {
|
|
31
|
+
modelLinePointsVisibility: points.visibility,
|
|
32
|
+
modelLinePointsSize: points.size,
|
|
33
|
+
modelLinePointsColor: points.color,
|
|
34
|
+
modelLinePointsActiveColoring: points.activeColoring,
|
|
35
|
+
modelLinePointsVertexAttributeName: points.vertexAttributeName,
|
|
36
|
+
modelLinePointsVertexAttributeItem: points.vertexAttributeItem,
|
|
37
|
+
modelLinePointsVertexAttributeRange: points.vertexAttributeRange,
|
|
38
|
+
modelLinePointsVertexAttributeColorMap: points.vertexAttributeColorMap,
|
|
39
|
+
modelLinePointsVertexAttributeNoDataColor: points.vertexAttributeNoDataColor,
|
|
40
|
+
setModelLinesPointsVisibility: points.setVisibility,
|
|
41
|
+
setModelLinesPointsSize: points.setSize,
|
|
42
|
+
setModelLinesPointsColor: points.setColor,
|
|
43
|
+
setModelLinesPointsActiveColoring: points.setActiveColoring,
|
|
44
|
+
setModelLinesPointsVertexAttributeName: points.setVertexAttributeName,
|
|
45
|
+
setModelLinesPointsVertexAttributeItem: points.setVertexAttributeItem,
|
|
46
|
+
setModelLinesPointsVertexAttributeRange: points.setVertexAttributeRange,
|
|
47
|
+
setModelLinesPointsVertexAttributeColorMap: points.setVertexAttributeColorMap,
|
|
48
|
+
setModelLinesPointsVertexAttributeNoDataColor: points.setVertexAttributeNoDataColor,
|
|
49
|
+
applyModelLinesPointsStyle: points.applyPointsStyle,
|
|
50
|
+
};
|
|
51
|
+
}
|