From 28c50f2f5356545904dca4c6bf91f173bf98b648 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Tue, 27 Jan 2026 17:40:52 +0100 Subject: [PATCH 01/23] Initialize PR --- .../EdgedCurve/SpecificEdgesOptions.vue | 1 + .../Viewer/Generic/Mesh/CellsOptions.vue | 1 + .../Viewer/Generic/Mesh/EdgesOptions.vue | 2 + .../Viewer/Generic/Mesh/PointsOptions.vue | 1 + .../Viewer/Generic/Mesh/PolygonsOptions.vue | 3 + .../Viewer/Generic/Mesh/PolyhedraOptions.vue | 3 + .../Viewer/Options/AttributeColorBar.vue | 80 ++++++++ .../Viewer/Options/CellAttributeSelector.vue | 53 +++++- .../Viewer/Options/ColorMapList.vue | 175 ++++++++++++++++++ .../Viewer/Options/ColorMapPicker.vue | 160 ++++++++++++++++ .../Viewer/Options/ColoringTypeSelector.vue | 2 + .../Viewer/Options/EdgeAttributeSelector.vue | 79 ++++++-- .../Options/PolygonAttributeSelector.vue | 52 +++++- .../Options/PolyhedronAttributeSelector.vue | 65 +++++-- .../Options/VertexAttributeSelector.vue | 83 ++++++++- .../Viewer/PointSet/SpecificPointsOptions.vue | 1 + .../SpecificPolygonsOptions.vue | 1 + .../Viewer/Solid/SpecificPolyhedraOptions.vue | 1 + internal/stores/mesh/cells.js | 56 +++++- internal/stores/mesh/edges.js | 19 +- internal/stores/mesh/points.js | 19 +- internal/stores/mesh/polygons.js | 68 ++++++- internal/stores/mesh/polyhedra.js | 38 +++- 23 files changed, 901 insertions(+), 62 deletions(-) create mode 100644 app/components/Viewer/Options/AttributeColorBar.vue create mode 100644 app/components/Viewer/Options/ColorMapList.vue create mode 100644 app/components/Viewer/Options/ColorMapPicker.vue diff --git a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue index 922c8daa..239bd6e2 100644 --- a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +++ b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue @@ -32,6 +32,7 @@ v-model:color="color" v-model:vertex_attribute="vertex_attribute" v-model:edge_attribute="edge_attribute" + mesh-type="edges" /> diff --git a/app/components/Viewer/Generic/Mesh/CellsOptions.vue b/app/components/Viewer/Generic/Mesh/CellsOptions.vue index 7eb4ef3a..2800db2f 100644 --- a/app/components/Viewer/Generic/Mesh/CellsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/CellsOptions.vue @@ -14,6 +14,7 @@ v-model:textures="textures" v-model:vertex_attribute="vertex_attribute" v-model:cell_attribute="cell_attribute" + mesh-type="cells" /> diff --git a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue index cd34ce97..9c3eebbc 100644 --- a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +++ b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue @@ -30,6 +30,8 @@ :id="id" v-model:coloring_style_key="coloring_style_key" v-model:color="color" + v-model:vertex_attribute="vertex_attribute" + mesh-type="edges" /> diff --git a/app/components/Viewer/Generic/Mesh/PointsOptions.vue b/app/components/Viewer/Generic/Mesh/PointsOptions.vue index dfc5b55f..ea61d0b1 100644 --- a/app/components/Viewer/Generic/Mesh/PointsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PointsOptions.vue @@ -31,6 +31,7 @@ v-model:coloring_style_key="coloring_style_key" v-model:color="color" v-model:vertex_attribute="vertex_attribute" + mesh-type="points" /> diff --git a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue index 90a8ec10..b47aff81 100644 --- a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue @@ -12,6 +12,9 @@ v-model:coloring_style_key="coloring_style_key" v-model:color="color" v-model:textures="textures" + v-model:vertex_attribute="vertex_attribute" + v-model:polygon_attribute="polygon_attribute" + mesh-type="polygons" /> diff --git a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue index 715cd40c..a6373068 100644 --- a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue @@ -11,6 +11,9 @@ :id="id" v-model:coloring_style_key="coloring_style_key" v-model:color="color" + v-model:vertex_attribute="vertex_attribute" + v-model:polyhedron_attribute="polyhedron_attribute" + mesh-type="polyhedra" /> diff --git a/app/components/Viewer/Options/AttributeColorBar.vue b/app/components/Viewer/Options/AttributeColorBar.vue new file mode 100644 index 00000000..f0de2e5f --- /dev/null +++ b/app/components/Viewer/Options/AttributeColorBar.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/app/components/Viewer/Options/CellAttributeSelector.vue b/app/components/Viewer/Options/CellAttributeSelector.vue index cd0c3153..9276180e 100644 --- a/app/components/Viewer/Options/CellAttributeSelector.vue +++ b/app/components/Viewer/Options/CellAttributeSelector.vue @@ -1,15 +1,27 @@ + diff --git a/app/components/Viewer/Options/ColorMapList.vue b/app/components/Viewer/Options/ColorMapList.vue new file mode 100644 index 00000000..5b8c158e --- /dev/null +++ b/app/components/Viewer/Options/ColorMapList.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/app/components/Viewer/Options/ColorMapPicker.vue b/app/components/Viewer/Options/ColorMapPicker.vue new file mode 100644 index 00000000..f6006d8d --- /dev/null +++ b/app/components/Viewer/Options/ColorMapPicker.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/app/components/Viewer/Options/ColoringTypeSelector.vue b/app/components/Viewer/Options/ColoringTypeSelector.vue index cc6acfce..2971f587 100644 --- a/app/components/Viewer/Options/ColoringTypeSelector.vue +++ b/app/components/Viewer/Options/ColoringTypeSelector.vue @@ -32,6 +32,7 @@ @@ -22,6 +26,7 @@ import { useDataStyleStore } from "@ogw_front/stores/data_style" import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer" import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar" + import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap" const props = defineProps({ id: { type: String, required: true }, @@ -30,10 +35,20 @@ const model = defineModel() const polygon_attribute_name = ref("") const polygon_attribute_names = ref([]) + const polygon_attribute_metadata = ref({}) + + const selectedAttributeRange = computed(() => { + if (polygon_attribute_name.value && polygon_attribute_metadata.value[polygon_attribute_name.value]) { + return polygon_attribute_metadata.value[polygon_attribute_name.value] + } + return [0, 1] + }) + const polygon_attribute = reactive({ name: polygon_attribute_name.value, min: undefined, max: undefined, + colorMap: "Cool to Warm", }) const geodeStore = useGeodeStore() const dataStyleStore = useDataStyleStore() @@ -44,6 +59,9 @@ polygon_attribute_name.value = model.value.name polygon_attribute.min = model.value.min polygon_attribute.max = model.value.max + if (model.value.colorMap) { + polygon_attribute.colorMap = model.value.colorMap + } } }) @@ -53,7 +71,7 @@ }) watch( - () => [polygon_attribute.min, polygon_attribute.max], + () => [polygon_attribute.min, polygon_attribute.max, polygon_attribute.colorMap], () => { model.value = { ...polygon_attribute } }, @@ -70,6 +88,22 @@ } } + function onColorMapChange() { + if ( + polygon_attribute.min !== undefined && + polygon_attribute.max !== undefined && + polygon_attribute.colorMap + ) { + const points = getRGBPointsFromPreset( + polygon_attribute.colorMap, + polygon_attribute.min, + polygon_attribute.max, + ) + dataStyleStore.setMeshPolygonsPolygonColorMap(props.id, points) + hybridViewerStore.remoteRender() + } + } + onMounted(() => { getPolygonAttributes() }) @@ -83,6 +117,7 @@ { response_function: (response) => { polygon_attribute_names.value = response.polygon_attribute_names + polygon_attribute_metadata.value = response.polygon_attribute_metadata || {} }, }, ) diff --git a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue index 49faa336..ef6f1fec 100644 --- a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +++ b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue @@ -10,8 +10,12 @@ v-if="polyhedron_attribute_name" v-model:min="polyhedron_attribute.min" v-model:max="polyhedron_attribute.max" + v-model:colorMap="polyhedron_attribute.colorMap" + :auto-min="selectedAttributeRange[0]" + :auto-max="selectedAttributeRange[1]" @update:min="onScalarRangeChange" @update:max="onScalarRangeChange" + @update:colorMap="onColorMapChange" /> @@ -22,6 +26,7 @@ import { useDataStyleStore } from "@ogw_front/stores/data_style" import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer" import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar" + import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap" const model = defineModel() const geodeStore = useGeodeStore() @@ -29,11 +34,20 @@ const hybridViewerStore = useHybridViewerStore() const polyhedron_attribute_name = ref("") + const polyhedron_attribute_metadata = ref({}) + + const selectedAttributeRange = computed(() => { + if (polyhedron_attribute_name.value && polyhedron_attribute_metadata.value[polyhedron_attribute_name.value]) { + return polyhedron_attribute_metadata.value[polyhedron_attribute_name.value] + } + return [0, 1] + }) const polyhedron_attribute = reactive({ name: polyhedron_attribute_name.value, min: undefined, max: undefined, + colorMap: "Cool to Warm", }) onMounted(() => { @@ -41,6 +55,9 @@ polyhedron_attribute_name.value = model.value.name polyhedron_attribute.min = model.value.min polyhedron_attribute.max = model.value.max + if (model.value.colorMap) { + polyhedron_attribute.colorMap = model.value.colorMap + } } }) @@ -50,12 +67,11 @@ }) watch( - () => [polyhedron_attribute.min, polyhedron_attribute.max], + () => [polyhedron_attribute.min, polyhedron_attribute.max, polyhedron_attribute.colorMap], () => { model.value = { ...polyhedron_attribute } }, ) - function onScalarRangeChange() { if ( polyhedron_attribute.min !== undefined && @@ -70,6 +86,22 @@ } } + function onColorMapChange() { + if ( + polyhedron_attribute.min !== undefined && + polyhedron_attribute.max !== undefined && + polyhedron_attribute.colorMap + ) { + const points = getRGBPointsFromPreset( + polyhedron_attribute.colorMap, + polyhedron_attribute.min, + polyhedron_attribute.max, + ) + dataStyleStore.setPolyhedraPolyhedraColorMap(props.id, points) + hybridViewerStore.remoteRender() + } + } + const props = defineProps({ id: { type: String, required: true }, }) @@ -87,6 +119,7 @@ { response_function: (response) => { polyhedron_attribute_names.value = response.polyhedron_attribute_names + polyhedron_attribute_metadata.value = response.polyhedron_attribute_metadata || {} }, }, ) diff --git a/app/components/Viewer/Options/VertexAttributeSelector.vue b/app/components/Viewer/Options/VertexAttributeSelector.vue index bf96838b..4446fb5e 100644 --- a/app/components/Viewer/Options/VertexAttributeSelector.vue +++ b/app/components/Viewer/Options/VertexAttributeSelector.vue @@ -10,8 +10,12 @@ v-if="vertex_attribute_name" v-model:min="vertex_attribute.min" v-model:max="vertex_attribute.max" + v-model:colorMap="vertex_attribute.colorMap" + :auto-min="selectedAttributeRange[0]" + :auto-max="selectedAttributeRange[1]" @update:min="onScalarRangeChange" @update:max="onScalarRangeChange" + @update:colorMap="onColorMapChange" /> @@ -22,6 +26,7 @@ import { useDataStyleStore } from "@ogw_front/stores/data_style" import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer" import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar" + import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap" const geodeStore = useGeodeStore() const dataStyleStore = useDataStyleStore() @@ -36,11 +41,20 @@ const vertex_attribute_name = ref("") const vertex_attribute_names = ref([]) + const vertex_attribute_metadata = ref({}) + + const selectedAttributeRange = computed(() => { + if (vertex_attribute_name.value && vertex_attribute_metadata.value[vertex_attribute_name.value]) { + return vertex_attribute_metadata.value[vertex_attribute_name.value] + } + return [0, 1] + }) const vertex_attribute = reactive({ name: vertex_attribute_name.value, min: undefined, max: undefined, + colorMap: "Cool to Warm", }) onMounted(() => { @@ -48,6 +62,9 @@ vertex_attribute_name.value = model.value.name vertex_attribute.min = model.value.min vertex_attribute.max = model.value.max + if (model.value.colorMap) { + vertex_attribute.colorMap = model.value.colorMap + } } }) @@ -57,7 +74,7 @@ }) watch( - () => [vertex_attribute.min, vertex_attribute.max], + () => [vertex_attribute.min, vertex_attribute.max, vertex_attribute.colorMap], () => { model.value = { ...vertex_attribute } }, @@ -103,6 +120,32 @@ } } + function onColorMapChange() { + if ( + vertex_attribute.min !== undefined && + vertex_attribute.max !== undefined && + vertex_attribute.colorMap + ) { + const points = getRGBPointsFromPreset( + vertex_attribute.colorMap, + vertex_attribute.min, + vertex_attribute.max, + ) + if (props.meshType === "polygons") { + dataStyleStore.setMeshPolygonsVertexColorMap(props.id, points) + } else if (props.meshType === "cells") { + dataStyleStore.setMeshCellsVertexColorMap(props.id, points) + } else if (props.meshType === "edges") { + dataStyleStore.setMeshEdgesVertexColorMap(props.id, points) + } else if (props.meshType === "points") { + dataStyleStore.setMeshPointsVertexColorMap(props.id, points) + } else if (props.meshType === "polyhedra") { + dataStyleStore.setPolyhedraVertexColorMap(props.id, points) + } + hybridViewerStore.remoteRender() + } + } + onMounted(() => { getVertexAttributes() }) @@ -114,6 +157,7 @@ { response_function: (response) => { vertex_attribute_names.value = response.vertex_attribute_names + vertex_attribute_metadata.value = response.vertex_attribute_metadata || {} }, }, ) diff --git a/app/utils/colormap.js b/app/utils/colormap.js new file mode 100644 index 00000000..2a0f7744 --- /dev/null +++ b/app/utils/colormap.js @@ -0,0 +1,36 @@ +import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps" + +export function getRGBPointsFromPreset(presetName, min, max) { + const preset = vtkColorMaps.getPresetByName(presetName) + if (!preset || !preset.RGBPoints) { + return [ + [min, 59, 76, 192], + [(min + max) / 2, 221, 221, 221], + [max, 180, 4, 38], + ] + } + return getRGBPointsFromPresetData(preset.RGBPoints, min, max) +} + +function getRGBPointsFromPresetData(rgbPoints, min, max) { + const points = [] + const presetMin = rgbPoints[0] + const presetMax = rgbPoints[rgbPoints.length - 4] + const presetRange = presetMax - presetMin + const targetRange = max - min + + for (let i = 0; i < rgbPoints.length; i += 4) { + const originalValue = rgbPoints[i] + const normalizedValue = presetRange !== 0 + ? (originalValue - presetMin) / presetRange + : 0 + const scaledValue = min + normalizedValue * targetRange + points.push([ + scaledValue, + Math.round(rgbPoints[i + 1] * 255), + Math.round(rgbPoints[i + 2] * 255), + Math.round(rgbPoints[i + 3] * 255), + ]) + } + return points +} diff --git a/internal/stores/mesh/cells.js b/internal/stores/mesh/cells.js index 021658c1..d53f52de 100644 --- a/internal/stores/mesh/cells.js +++ b/internal/stores/mesh/cells.js @@ -142,25 +142,25 @@ export function useMeshCellsStyle() { ) } - function setMeshCellsCellScalarRange(id, minimum, maximum) { + function setMeshCellsVertexColorMap(id, points) { return viewerStore.request( - mesh_cells_schemas.cell_scalar_range, - { id, minimum, maximum }, + mesh_cells_schemas.vertex_color_map, + { id, points }, { response_function: () => { - console.log(setMeshCellsCellScalarRange.name, { id, minimum, maximum }) + console.log(setMeshCellsVertexColorMap.name, { id, points }) }, }, ) } - function setMeshCellsVertexScalarRange(id, minimum, maximum) { + function setMeshCellsCellColorMap(id, points) { return viewerStore.request( - mesh_cells_schemas.vertex_scalar_range, - { id, minimum, maximum }, + mesh_cells_schemas.cell_color_map, + { id, points }, { response_function: () => { - console.log(setMeshCellsVertexScalarRange.name, { id, minimum, maximum }) + console.log(setMeshCellsCellColorMap.name, { id, points }) }, }, ) @@ -222,6 +222,8 @@ export function useMeshCellsStyle() { setMeshCellsCellAttribute, setMeshCellsCellScalarRange, setMeshCellsVertexScalarRange, + setMeshCellsVertexColorMap, + setMeshCellsCellColorMap, applyMeshCellsStyle, } } diff --git a/internal/stores/mesh/edges.js b/internal/stores/mesh/edges.js index af1ed3ac..35f6c4bf 100644 --- a/internal/stores/mesh/edges.js +++ b/internal/stores/mesh/edges.js @@ -158,6 +158,18 @@ export function useMeshEdgesStyle() { ) } + function setMeshEdgesVertexColorMap(id, points) { + return viewerStore.request( + mesh_edges_schemas.vertex_color_map, + { id, points }, + { + response_function: () => { + console.log(setMeshEdgesVertexColorMap.name, { id, points }) + }, + }, + ) + } + function applyMeshEdgesStyle(id) { const style = meshEdgesStyle(id) return Promise.all([ @@ -182,5 +194,6 @@ export function useMeshEdgesStyle() { setMeshEdgesVertexAttribute, setMeshEdgesEdgeAttribute, setMeshEdgesVertexScalarRange, + setMeshEdgesVertexColorMap, } } diff --git a/internal/stores/mesh/points.js b/internal/stores/mesh/points.js index 584dfdb6..675907b9 100644 --- a/internal/stores/mesh/points.js +++ b/internal/stores/mesh/points.js @@ -133,6 +133,18 @@ export function useMeshPointsStyle() { ) } + function setMeshPointsVertexColorMap(id, points) { + return viewerStore.request( + mesh_points_schemas.vertex_color_map, + { id, points }, + { + response_function: () => { + console.log(setMeshPointsVertexColorMap.name, { id, points }) + }, + }, + ) + } + function applyMeshPointsStyle(id) { const style = meshPointsStyle(id) return Promise.all([ @@ -154,6 +166,7 @@ export function useMeshPointsStyle() { setMeshPointsVertexAttribute, setMeshPointsSize, setMeshPointsVertexScalarRange, + setMeshPointsVertexColorMap, applyMeshPointsStyle, } } diff --git a/internal/stores/mesh/polygons.js b/internal/stores/mesh/polygons.js index 6f6c684d..d19087e6 100644 --- a/internal/stores/mesh/polygons.js +++ b/internal/stores/mesh/polygons.js @@ -154,36 +154,31 @@ export function useMeshPolygonsStyle() { ) } - function setMeshPolygonsPolygonScalarRange(id, minimum, maximum) { + function setMeshPolygonsVertexColorMap(id, points) { return viewerStore.request( - mesh_polygons_schemas.polygon_scalar_range, - { id, minimum, maximum }, + mesh_polygons_schemas.vertex_color_map, + { id, points }, { response_function: () => { - console.log( - setMeshPolygonsPolygonScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setMeshPolygonsVertexColorMap.name, { id, points }) }, }, ) } - function setMeshPolygonsVertexScalarRange(id, minimum, maximum) { + function setMeshPolygonsPolygonColorMap(id, points) { return viewerStore.request( - mesh_polygons_schemas.vertex_scalar_range, - { id, minimum, maximum }, + mesh_polygons_schemas.polygon_color_map, + { id, points }, { response_function: () => { - console.log( - setMeshPolygonsVertexScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setMeshPolygonsPolygonColorMap.name, { id, points }) }, }, ) } + function meshPolygonsActiveColoring(id) { return meshPolygonsStyle(id).coloring.active } @@ -240,6 +235,8 @@ export function useMeshPolygonsStyle() { setMeshPolygonsPolygonAttribute, setMeshPolygonsPolygonScalarRange, setMeshPolygonsVertexScalarRange, + setMeshPolygonsVertexColorMap, + setMeshPolygonsPolygonColorMap, applyMeshPolygonsStyle, } } diff --git a/internal/stores/mesh/polyhedra.js b/internal/stores/mesh/polyhedra.js index 5c330b74..a271264c 100644 --- a/internal/stores/mesh/polyhedra.js +++ b/internal/stores/mesh/polyhedra.js @@ -159,6 +159,48 @@ export function useMeshPolyhedraStyle() { ) } + function setPolyhedraVertexColorMap(id, points) { + return viewerStore.request( + mesh_polyhedra_schemas.vertex_color_map, + { id, points }, + { + response_function: () => { + console.log(setPolyhedraVertexColorMap.name, { id, points }) + }, + }, + ) + } + + function setPolyhedraPolyhedraColorMap(id, points) { + return viewerStore.request( + mesh_polyhedra_schemas.polyhedra_color_map, + { id, points }, + { + response_function: () => { + console.log(setPolyhedraPolyhedraColorMap.name, { id, points }) + }, + }, + ) + } + + function setMeshPolyhedraVisibility(id, visibility) { + const polyhedra_style = meshPolyhedraStyle(id) + return viewerStore.request( + mesh_polyhedra_schemas.visibility, + { id, visibility }, + { + response_function: () => { + polyhedra_style.visibility = visibility + console.log( + setMeshPolyhedraVisibility.name, + { id }, + meshPolyhedraVisibility(id), + ) + }, + }, + ) + } + function applyMeshPolyhedraStyle(id) { const style = meshPolyhedraStyle(id) return Promise.all([ @@ -180,6 +222,8 @@ export function useMeshPolyhedraStyle() { setPolyhedraVertexAttribute, setPolyhedraPolyhedronScalarRange, setPolyhedraVertexScalarRange, + setPolyhedraVertexColorMap, + setPolyhedraPolyhedraColorMap, setMeshPolyhedraVisibility, } } From 17ad156a697f4ffb4fa077daa52e99ecddda8e13 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Wed, 28 Jan 2026 16:20:42 +0100 Subject: [PATCH 03/23] Centralize actions --- .../Options/VertexAttributeSelector.vue | 246 +++++++----------- internal/stores/mesh/index.js | 64 +++++ 2 files changed, 164 insertions(+), 146 deletions(-) diff --git a/app/components/Viewer/Options/VertexAttributeSelector.vue b/app/components/Viewer/Options/VertexAttributeSelector.vue index 4446fb5e..da934c14 100644 --- a/app/components/Viewer/Options/VertexAttributeSelector.vue +++ b/app/components/Viewer/Options/VertexAttributeSelector.vue @@ -1,165 +1,119 @@ - - + + diff --git a/internal/stores/mesh/index.js b/internal/stores/mesh/index.js index b38d710c..813e5512 100644 --- a/internal/stores/mesh/index.js +++ b/internal/stores/mesh/index.js @@ -64,10 +64,74 @@ export default function useMeshStyle() { return Promise.all(promise_array) } + function setVertexScalarRange(id, meshType, minimum, maximum) { + switch (meshType) { + case "points": + return meshPointsStyleStore.setMeshPointsVertexScalarRange(id, minimum, maximum) + case "edges": + return meshEdgesStyleStore.setMeshEdgesVertexScalarRange(id, minimum, maximum) + case "cells": + return meshCellsStyleStore.setMeshCellsVertexScalarRange(id, minimum, maximum) + case "polygons": + return meshPolygonsStyleStore.setMeshPolygonsVertexScalarRange(id, minimum, maximum) + case "polyhedra": + return meshPolyhedraStyleStore.setPolyhedraVertexScalarRange(id, minimum, maximum) + default: + throw new Error("Unknown meshType for vertex scalar range: " + meshType) + } + } + + function setVertexColorMap(id, meshType, points) { + switch (meshType) { + case "points": + return meshPointsStyleStore.setMeshPointsVertexColorMap(id, points) + case "edges": + return meshEdgesStyleStore.setMeshEdgesVertexColorMap(id, points) + case "cells": + return meshCellsStyleStore.setMeshCellsVertexColorMap(id, points) + case "polygons": + return meshPolygonsStyleStore.setMeshPolygonsVertexColorMap(id, points) + case "polyhedra": + return meshPolyhedraStyleStore.setPolyhedraVertexColorMap(id, points) + default: + throw new Error("Unknown meshType for vertex color map: " + meshType) + } + } + + function setElementScalarRange(id, elementType, minimum, maximum) { + switch (elementType) { + case "cell": + return meshCellsStyleStore.setMeshCellsCellScalarRange(id, minimum, maximum) + case "polygon": + return meshPolygonsStyleStore.setMeshPolygonsPolygonScalarRange(id, minimum, maximum) + case "polyhedron": + return meshPolyhedraStyleStore.setPolyhedraPolyhedronScalarRange(id, minimum, maximum) + default: + throw new Error("Unknown elementType for scalar range: " + elementType) + } + } + + function setElementColorMap(id, elementType, points) { + switch (elementType) { + case "cell": + return meshCellsStyleStore.setMeshCellsCellColorMap(id, points) + case "polygon": + return meshPolygonsStyleStore.setMeshPolygonsPolygonColorMap(id, points) + case "polyhedron": + return meshPolyhedraStyleStore.setPolyhedraPolyhedraColorMap(id, points) + default: + throw new Error("Unknown elementType for color map: " + elementType) + } + } + return { meshVisibility, setMeshVisibility, applyMeshStyle, + setVertexScalarRange, + setVertexColorMap, + setElementScalarRange, + setElementColorMap, ...useMeshPointsStyle(), ...useMeshEdgesStyle(), ...useMeshCellsStyle(), From 99983b75f1bd2571e86d362066c89c00396bc6fb Mon Sep 17 00:00:00 2001 From: SpliiT Date: Thu, 29 Jan 2026 13:16:26 +0100 Subject: [PATCH 04/23] edit colormap logic and save state of attribut --- .../Viewer/Options/AttributeColorBar.vue | 14 +- .../Viewer/Options/CellAttributeSelector.vue | 142 ++++++--- .../Viewer/Options/EdgeAttributeSelector.vue | 156 ++++++---- .../Options/PolygonAttributeSelector.vue | 166 +++++++---- .../Options/PolyhedronAttributeSelector.vue | 156 ++++++---- .../Options/VertexAttributeSelector.vue | 277 +++++++++++------- app/stores/data_style.js | 16 +- app/utils/colormap.js | 37 +-- internal/stores/data_style_state.js | 27 +- 9 files changed, 652 insertions(+), 339 deletions(-) diff --git a/app/components/Viewer/Options/AttributeColorBar.vue b/app/components/Viewer/Options/AttributeColorBar.vue index 28216478..ad84f3d6 100644 --- a/app/components/Viewer/Options/AttributeColorBar.vue +++ b/app/components/Viewer/Options/AttributeColorBar.vue @@ -8,7 +8,10 @@ const min = defineModel("min", { type: Number }) const max = defineModel("max", { type: Number }) - const colorMap = defineModel("colorMap", { type: String, default: "Cool to Warm" }) + const colorMap = defineModel("colorMap", { + type: String, + default: "Cool to Warm", + }) const minValue = computed({ get: () => min.value ?? props.autoMin, @@ -29,15 +32,6 @@ if (max.value === undefined) max.value = props.autoMax }) - // Reset min/max when autoMin/autoMax change (attribute selection changed) - watch( - () => [props.autoMin, props.autoMax], - ([newAutoMin, newAutoMax]) => { - min.value = newAutoMin - max.value = newAutoMax - }, - ) - function reset() { min.value = props.autoMin max.value = props.autoMax diff --git a/app/components/Viewer/Options/CellAttributeSelector.vue b/app/components/Viewer/Options/CellAttributeSelector.vue index 0cbef22a..99121409 100644 --- a/app/components/Viewer/Options/CellAttributeSelector.vue +++ b/app/components/Viewer/Options/CellAttributeSelector.vue @@ -1,32 +1,13 @@ - - + diff --git a/app/components/Viewer/Options/EdgeAttributeSelector.vue b/app/components/Viewer/Options/EdgeAttributeSelector.vue index 6e84d20f..106e7eca 100644 --- a/app/components/Viewer/Options/EdgeAttributeSelector.vue +++ b/app/components/Viewer/Options/EdgeAttributeSelector.vue @@ -1,44 +1,13 @@ - - + diff --git a/app/components/Viewer/Options/PolygonAttributeSelector.vue b/app/components/Viewer/Options/PolygonAttributeSelector.vue index 1559f4fc..82bc68ef 100644 --- a/app/components/Viewer/Options/PolygonAttributeSelector.vue +++ b/app/components/Viewer/Options/PolygonAttributeSelector.vue @@ -1,32 +1,13 @@ - - + + diff --git a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue index ef6f1fec..3bae5235 100644 --- a/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +++ b/app/components/Viewer/Options/PolyhedronAttributeSelector.vue @@ -1,32 +1,17 @@ - - + diff --git a/app/components/Viewer/Options/VertexAttributeSelector.vue b/app/components/Viewer/Options/VertexAttributeSelector.vue index da934c14..5eb0363f 100644 --- a/app/components/Viewer/Options/VertexAttributeSelector.vue +++ b/app/components/Viewer/Options/VertexAttributeSelector.vue @@ -1,119 +1,194 @@ diff --git a/app/stores/data_style.js b/app/stores/data_style.js index 747a59ac..41d61462 100644 --- a/app/stores/data_style.js +++ b/app/stores/data_style.js @@ -46,7 +46,10 @@ export const useDataStyleStore = defineStore("dataStyle", () => { } const exportStores = () => { - return { styles: dataStyleState.styles } + return { + styles: dataStyleState.styles, + attributeSettings: dataStyleState.attributeSettings, + } } const importStores = (snapshot) => { @@ -57,8 +60,17 @@ export const useDataStyleStore = defineStore("dataStyle", () => { for (const [id, style] of Object.entries(stylesSnapshot)) { dataStyleState.styles[id] = style } + + const attributeSettingsSnapshot = snapshot.attributeSettings || {} + for (const key of Object.keys(dataStyleState.attributeSettings)) { + delete dataStyleState.attributeSettings[key] + } + for (const [key, settings] of Object.entries(attributeSettingsSnapshot)) { + dataStyleState.attributeSettings[key] = settings + } } + const applyAllStylesFromState = () => { const ids = Object.keys(dataStyleState.styles || {}) const promises = [] @@ -80,6 +92,8 @@ export const useDataStyleStore = defineStore("dataStyle", () => { getStyle: dataStyleState.getStyle, objectVisibility: dataStyleState.objectVisibility, selectedObjects: dataStyleState.selectedObjects, + getAttributeSettings: dataStyleState.getAttributeSettings, + setAttributeSettings: dataStyleState.setAttributeSettings, ...meshStyleStore, ...modelStyleStore, addDataStyle, diff --git a/app/utils/colormap.js b/app/utils/colormap.js index 2a0f7744..daa50352 100644 --- a/app/utils/colormap.js +++ b/app/utils/colormap.js @@ -1,35 +1,20 @@ import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps" -export function getRGBPointsFromPreset(presetName, min, max) { - const preset = vtkColorMaps.getPresetByName(presetName) - if (!preset || !preset.RGBPoints) { - return [ - [min, 59, 76, 192], - [(min + max) / 2, 221, 221, 221], - [max, 180, 4, 38], - ] - } - return getRGBPointsFromPresetData(preset.RGBPoints, min, max) +export function getRGBPointsFromPreset(presetName) { + return vtkColorMaps.getPresetByName(presetName) } -function getRGBPointsFromPresetData(rgbPoints, min, max) { +export function convertRGBPointsToSchemaFormat(flatRGBPoints) { + if (!flatRGBPoints || !Array.isArray(flatRGBPoints)) { + return [] + } const points = [] - const presetMin = rgbPoints[0] - const presetMax = rgbPoints[rgbPoints.length - 4] - const presetRange = presetMax - presetMin - const targetRange = max - min - - for (let i = 0; i < rgbPoints.length; i += 4) { - const originalValue = rgbPoints[i] - const normalizedValue = presetRange !== 0 - ? (originalValue - presetMin) / presetRange - : 0 - const scaledValue = min + normalizedValue * targetRange + for (let i = 0; i < flatRGBPoints.length; i += 4) { points.push([ - scaledValue, - Math.round(rgbPoints[i + 1] * 255), - Math.round(rgbPoints[i + 2] * 255), - Math.round(rgbPoints[i + 3] * 255), + flatRGBPoints[i], + flatRGBPoints[i + 1] * 255, + flatRGBPoints[i + 2] * 255, + flatRGBPoints[i + 3] * 255, ]) } return points diff --git a/internal/stores/data_style_state.js b/internal/stores/data_style_state.js index 3b5dd49d..978d49d1 100644 --- a/internal/stores/data_style_state.js +++ b/internal/stores/data_style_state.js @@ -1,8 +1,12 @@ import { reactive, computed } from "vue" +const DEFAULT_COLOR_MAP = "Cool to Warm" + export const useDataStyleStateStore = defineStore("dataStyleState", () => { const styles = reactive({}) + const attributeSettings = reactive({}) + const objectVisibility = computed(() => (id) => { if (styles[id]) { return styles[id].visibility @@ -23,5 +27,26 @@ export const useDataStyleStateStore = defineStore("dataStyleState", () => { return styles[id] } - return { getStyle, styles, objectVisibility, selectedObjects } + function getAttributeSettings(meshId, attributeType, attributeName) { + const key = `${meshId}:${attributeType}:${attributeName}` + return attributeSettings[key] || null + } + function setAttributeSettings(meshId, attributeType, attributeName, settings) { + const key = `${meshId}:${attributeType}:${attributeName}` + attributeSettings[key] = { + min: settings.min, + max: settings.max, + colorMap: settings.colorMap || DEFAULT_COLOR_MAP, + } + } + + return { + getStyle, + styles, + objectVisibility, + selectedObjects, + attributeSettings, + getAttributeSettings, + setAttributeSettings, + } }) From b3f2127283a3a9c6f3fb28168d7b3189ba95b461 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Thu, 29 Jan 2026 14:05:30 +0100 Subject: [PATCH 05/23] rm useless imports --- .../Viewer/Options/ColorMapList.vue | 119 +++---- .../Viewer/Options/ColorMapPicker.vue | 295 +++++++++--------- 2 files changed, 212 insertions(+), 202 deletions(-) diff --git a/app/components/Viewer/Options/ColorMapList.vue b/app/components/Viewer/Options/ColorMapList.vue index 5b8c158e..e1961ed9 100644 --- a/app/components/Viewer/Options/ColorMapList.vue +++ b/app/components/Viewer/Options/ColorMapList.vue @@ -1,60 +1,4 @@ - - + From 490a35fa732ea2a7b8772b12c4f8bc92621eb11e Mon Sep 17 00:00:00 2001 From: SpliiT Date: Thu, 29 Jan 2026 14:34:02 +0100 Subject: [PATCH 06/23] edit components --- .../EdgedCurve/SpecificEdgesOptions.vue | 85 ++++++----- .../Viewer/Generic/Mesh/CellsOptions.vue | 45 +++--- .../Viewer/Generic/Mesh/EdgesOptions.vue | 83 ++++++----- .../Viewer/Generic/Mesh/PointsOptions.vue | 83 ++++++----- .../Viewer/Generic/Mesh/PolygonsOptions.vue | 45 +++--- .../Viewer/Generic/Mesh/PolyhedraOptions.vue | 43 +++--- .../Viewer/Options/ColoringTypeSelector.vue | 133 +++++++++--------- .../Viewer/PointSet/SpecificPointsOptions.vue | 83 ++++++----- .../SpecificPolygonsOptions.vue | 45 +++--- .../Viewer/Solid/SpecificPolyhedraOptions.vue | 43 +++--- 10 files changed, 339 insertions(+), 349 deletions(-) diff --git a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue index 239bd6e2..77c2fb5f 100644 --- a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +++ b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue @@ -1,46 +1,3 @@ - - + diff --git a/app/components/Viewer/Generic/Mesh/CellsOptions.vue b/app/components/Viewer/Generic/Mesh/CellsOptions.vue index 2800db2f..862e054c 100644 --- a/app/components/Viewer/Generic/Mesh/CellsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/CellsOptions.vue @@ -1,26 +1,3 @@ - - + diff --git a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue index 9c3eebbc..64cadef5 100644 --- a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +++ b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue @@ -1,45 +1,3 @@ - - + diff --git a/app/components/Viewer/Generic/Mesh/PointsOptions.vue b/app/components/Viewer/Generic/Mesh/PointsOptions.vue index ea61d0b1..8374252d 100644 --- a/app/components/Viewer/Generic/Mesh/PointsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PointsOptions.vue @@ -1,45 +1,3 @@ - - + diff --git a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue index b47aff81..6cf5f186 100644 --- a/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue @@ -1,26 +1,3 @@ - - + diff --git a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue index a6373068..4f2e4a89 100644 --- a/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue @@ -1,25 +1,3 @@ - - + diff --git a/app/components/Viewer/Options/ColoringTypeSelector.vue b/app/components/Viewer/Options/ColoringTypeSelector.vue index 2971f587..19898e3a 100644 --- a/app/components/Viewer/Options/ColoringTypeSelector.vue +++ b/app/components/Viewer/Options/ColoringTypeSelector.vue @@ -1,70 +1,3 @@ - - + diff --git a/app/components/Viewer/PointSet/SpecificPointsOptions.vue b/app/components/Viewer/PointSet/SpecificPointsOptions.vue index 5bce67e5..68237370 100644 --- a/app/components/Viewer/PointSet/SpecificPointsOptions.vue +++ b/app/components/Viewer/PointSet/SpecificPointsOptions.vue @@ -1,45 +1,3 @@ - - + diff --git a/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue b/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue index 225caa10..2292253e 100644 --- a/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +++ b/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue @@ -1,26 +1,3 @@ - - + diff --git a/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue b/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue index a8760641..bb5b54cd 100644 --- a/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +++ b/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue @@ -1,25 +1,3 @@ - - + From 4fb4d636fe980c006b0bcddad8be4e70e943c2e0 Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Thu, 29 Jan 2026 13:39:49 +0000 Subject: [PATCH 07/23] Apply prepare changes --- app/stores/data_style.js | 1 - internal/stores/data_style_state.js | 7 ++- internal/stores/mesh/cells.js | 12 ++++- internal/stores/mesh/edges.js | 6 ++- internal/stores/mesh/index.js | 48 +++++++++++++++---- internal/stores/mesh/points.js | 9 ++-- internal/stores/mesh/polygons.js | 19 ++++---- internal/stores/mesh/polyhedra.js | 18 +++---- .../microservices/back/requirements.txt | 1 - .../microservices/viewer/requirements.txt | 1 - 10 files changed, 86 insertions(+), 36 deletions(-) diff --git a/app/stores/data_style.js b/app/stores/data_style.js index 41d61462..54c55f5b 100644 --- a/app/stores/data_style.js +++ b/app/stores/data_style.js @@ -70,7 +70,6 @@ export const useDataStyleStore = defineStore("dataStyle", () => { } } - const applyAllStylesFromState = () => { const ids = Object.keys(dataStyleState.styles || {}) const promises = [] diff --git a/internal/stores/data_style_state.js b/internal/stores/data_style_state.js index 978d49d1..c0320cd0 100644 --- a/internal/stores/data_style_state.js +++ b/internal/stores/data_style_state.js @@ -31,7 +31,12 @@ export const useDataStyleStateStore = defineStore("dataStyleState", () => { const key = `${meshId}:${attributeType}:${attributeName}` return attributeSettings[key] || null } - function setAttributeSettings(meshId, attributeType, attributeName, settings) { + function setAttributeSettings( + meshId, + attributeType, + attributeName, + settings, + ) { const key = `${meshId}:${attributeType}:${attributeName}` attributeSettings[key] = { min: settings.min, diff --git a/internal/stores/mesh/cells.js b/internal/stores/mesh/cells.js index d53f52de..8d24be73 100644 --- a/internal/stores/mesh/cells.js +++ b/internal/stores/mesh/cells.js @@ -124,7 +124,11 @@ export function useMeshCellsStyle() { { id, minimum, maximum }, { response_function: () => { - console.log(setMeshCellsCellScalarRange.name, { id, minimum, maximum }) + console.log(setMeshCellsCellScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) @@ -136,7 +140,11 @@ export function useMeshCellsStyle() { { id, minimum, maximum }, { response_function: () => { - console.log(setMeshCellsVertexScalarRange.name, { id, minimum, maximum }) + console.log(setMeshCellsVertexScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) diff --git a/internal/stores/mesh/edges.js b/internal/stores/mesh/edges.js index 35f6c4bf..df379940 100644 --- a/internal/stores/mesh/edges.js +++ b/internal/stores/mesh/edges.js @@ -152,7 +152,11 @@ export function useMeshEdgesStyle() { { id, minimum, maximum }, { response_function: () => { - console.log(setMeshEdgesVertexScalarRange.name, { id, minimum, maximum }) + console.log(setMeshEdgesVertexScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) diff --git a/internal/stores/mesh/index.js b/internal/stores/mesh/index.js index 813e5512..775c4aa8 100644 --- a/internal/stores/mesh/index.js +++ b/internal/stores/mesh/index.js @@ -67,15 +67,35 @@ export default function useMeshStyle() { function setVertexScalarRange(id, meshType, minimum, maximum) { switch (meshType) { case "points": - return meshPointsStyleStore.setMeshPointsVertexScalarRange(id, minimum, maximum) + return meshPointsStyleStore.setMeshPointsVertexScalarRange( + id, + minimum, + maximum, + ) case "edges": - return meshEdgesStyleStore.setMeshEdgesVertexScalarRange(id, minimum, maximum) + return meshEdgesStyleStore.setMeshEdgesVertexScalarRange( + id, + minimum, + maximum, + ) case "cells": - return meshCellsStyleStore.setMeshCellsVertexScalarRange(id, minimum, maximum) + return meshCellsStyleStore.setMeshCellsVertexScalarRange( + id, + minimum, + maximum, + ) case "polygons": - return meshPolygonsStyleStore.setMeshPolygonsVertexScalarRange(id, minimum, maximum) + return meshPolygonsStyleStore.setMeshPolygonsVertexScalarRange( + id, + minimum, + maximum, + ) case "polyhedra": - return meshPolyhedraStyleStore.setPolyhedraVertexScalarRange(id, minimum, maximum) + return meshPolyhedraStyleStore.setPolyhedraVertexScalarRange( + id, + minimum, + maximum, + ) default: throw new Error("Unknown meshType for vertex scalar range: " + meshType) } @@ -101,11 +121,23 @@ export default function useMeshStyle() { function setElementScalarRange(id, elementType, minimum, maximum) { switch (elementType) { case "cell": - return meshCellsStyleStore.setMeshCellsCellScalarRange(id, minimum, maximum) + return meshCellsStyleStore.setMeshCellsCellScalarRange( + id, + minimum, + maximum, + ) case "polygon": - return meshPolygonsStyleStore.setMeshPolygonsPolygonScalarRange(id, minimum, maximum) + return meshPolygonsStyleStore.setMeshPolygonsPolygonScalarRange( + id, + minimum, + maximum, + ) case "polyhedron": - return meshPolyhedraStyleStore.setPolyhedraPolyhedronScalarRange(id, minimum, maximum) + return meshPolyhedraStyleStore.setPolyhedraPolyhedronScalarRange( + id, + minimum, + maximum, + ) default: throw new Error("Unknown elementType for scalar range: " + elementType) } diff --git a/internal/stores/mesh/points.js b/internal/stores/mesh/points.js index 675907b9..90ce3eba 100644 --- a/internal/stores/mesh/points.js +++ b/internal/stores/mesh/points.js @@ -124,10 +124,11 @@ export function useMeshPointsStyle() { { id, minimum, maximum }, { response_function: () => { - console.log( - setMeshPointsVertexScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setMeshPointsVertexScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) diff --git a/internal/stores/mesh/polygons.js b/internal/stores/mesh/polygons.js index d19087e6..ad92f239 100644 --- a/internal/stores/mesh/polygons.js +++ b/internal/stores/mesh/polygons.js @@ -130,10 +130,11 @@ export function useMeshPolygonsStyle() { { id, minimum, maximum }, { response_function: () => { - console.log( - setMeshPolygonsPolygonScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setMeshPolygonsPolygonScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) @@ -145,10 +146,11 @@ export function useMeshPolygonsStyle() { { id, minimum, maximum }, { response_function: () => { - console.log( - setMeshPolygonsVertexScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setMeshPolygonsVertexScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) @@ -178,7 +180,6 @@ export function useMeshPolygonsStyle() { ) } - function meshPolygonsActiveColoring(id) { return meshPolygonsStyle(id).coloring.active } diff --git a/internal/stores/mesh/polyhedra.js b/internal/stores/mesh/polyhedra.js index a271264c..260e2492 100644 --- a/internal/stores/mesh/polyhedra.js +++ b/internal/stores/mesh/polyhedra.js @@ -135,10 +135,11 @@ export function useMeshPolyhedraStyle() { { id, minimum, maximum }, { response_function: () => { - console.log( - setPolyhedraPolyhedronScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setPolyhedraPolyhedronScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) @@ -150,10 +151,11 @@ export function useMeshPolyhedraStyle() { { id, minimum, maximum }, { response_function: () => { - console.log( - setPolyhedraVertexScalarRange.name, - { id, minimum, maximum }, - ) + console.log(setPolyhedraVertexScalarRange.name, { + id, + minimum, + maximum, + }) }, }, ) diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt index ecc4fc94..bd3a3ef5 100644 --- a/tests/integration/microservices/back/requirements.txt +++ b/tests/integration/microservices/back/requirements.txt @@ -5,4 +5,3 @@ # pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in # -opengeodeweb-back==6.*,>=6.0.0 diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index 39137326..4d097394 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -5,4 +5,3 @@ # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in # -opengeodeweb-viewer==1.*,>=1.15.0 From 8f5df62dfd1a951e5d4f62ecf8f54086e38a67a8 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Mon, 2 Feb 2026 11:46:34 +0100 Subject: [PATCH 08/23] fix logic and design --- .../Viewer/Generic/Mesh/PointsOptions.vue | 7 ++ .../Viewer/Generic/Mesh/PolygonsOptions.vue | 14 +++ .../Viewer/Generic/Mesh/PolyhedraOptions.vue | 14 +++ .../Viewer/Options/CellAttributeSelector.vue | 28 ++++-- .../Viewer/Options/ColorMapList.vue | 87 +++++++++++++++---- .../Viewer/Options/ColorMapPicker.vue | 19 ++-- .../Viewer/Options/EdgeAttributeSelector.vue | 29 +++++-- .../Options/PolygonAttributeSelector.vue | 36 +++++--- .../Options/PolyhedronAttributeSelector.vue | 29 +++++-- .../Options/VertexAttributeSelector.vue | 37 +++++--- app/utils/colormap.js | 23 +++-- internal/stores/mesh/cells.js | 32 +++++-- internal/stores/mesh/edges.js | 16 +++- internal/stores/mesh/index.js | 60 ++++++++++--- internal/stores/mesh/points.js | 16 +++- internal/stores/mesh/polygons.js | 32 +++++-- internal/stores/mesh/polyhedra.js | 32 +++++-- 17 files changed, 403 insertions(+), 108 deletions(-) diff --git a/app/components/Viewer/Generic/Mesh/PointsOptions.vue b/app/components/Viewer/Generic/Mesh/PointsOptions.vue index 8374252d..fd5bc1cc 100644 --- a/app/components/Viewer/Generic/Mesh/PointsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PointsOptions.vue @@ -44,6 +44,13 @@ hybridViewerStore.remoteRender() }, }) + const vertex_attribute = computed({ + get: () => dataStyleStore.meshPointsVertexAttribute(id.value), + set: (newValue) => { + dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue) + hybridViewerStore.remoteRender() + }, + })