From ce85c5f3ad80e93cde2b497596ea9867439a9a6f Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 9 Jan 2026 16:42:10 +0100 Subject: [PATCH 01/12] test --- .../Viewer/Generic/Mesh/EdgesOptions.vue | 43 ++++++++++++++++--- .../Viewer/Generic/Mesh/PointsOptions.vue | 1 + app/utils/default_styles.js | 1 + internal/stores/mesh/edges.js | 36 +++++++++++++--- 4 files changed, 68 insertions(+), 13 deletions(-) diff --git a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue index a5e4b493..ae9a1cae 100644 --- a/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +++ b/app/components/Viewer/Generic/Mesh/EdgesOptions.vue @@ -7,11 +7,33 @@ @@ -43,9 +65,9 @@ }, }) const size = computed({ - get: () => dataStyleStore.edgesSize(id.value), + get: () => dataStyleStore.meshEdgesWidth(id.value), set: (newValue) => { - dataStyleStore.setEdgesSize(id.value, newValue) + dataStyleStore.setMeshEdgesWidth(id.value, newValue) hybridViewerStore.remoteRender() }, }) @@ -63,4 +85,11 @@ hybridViewerStore.remoteRender() }, }) + const vertex_attribute = computed({ + get: () => dataStyleStore.meshEdgesVertexAttribute(id.value), + set: (newValue) => { + dataStyleStore.setMeshEdgesVertexAttribute(id.value, newValue) + hybridViewerStore.remoteRender() + }, + }) diff --git a/app/components/Viewer/Generic/Mesh/PointsOptions.vue b/app/components/Viewer/Generic/Mesh/PointsOptions.vue index de8fe81a..39338789 100644 --- a/app/components/Viewer/Generic/Mesh/PointsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/PointsOptions.vue @@ -30,6 +30,7 @@ :id="id" v-model:coloring_style_key="coloring_style_key" v-model:color="color" + v-model:vertex_attribute="vertex_attribute" /> diff --git a/app/utils/default_styles.js b/app/utils/default_styles.js index 517cf33b..45915c41 100644 --- a/app/utils/default_styles.js +++ b/app/utils/default_styles.js @@ -49,6 +49,7 @@ const meshEdgesDefaultStyle = ( coloring: { active: "color", color, + vertex: null, }, size, } diff --git a/internal/stores/mesh/edges.js b/internal/stores/mesh/edges.js index 7755c093..9786bb84 100644 --- a/internal/stores/mesh/edges.js +++ b/internal/stores/mesh/edges.js @@ -49,10 +49,11 @@ export function useMeshEdgesStyle() { ) if (type === "color") { return setMeshEdgesColor(id, coloring.color) - // } else if (type == "vertex" && coloring.vertex !== null) { - // return setEdgesVertexAttribute(id, coloring.vertex) - // } else if (type == "edges" && coloring.edges !== null) { - // return setEdgesEdgeAttribute(id, coloring.edges) + } else if (type === "vertex") { + if (coloring.vertex === null) { + return + } + return setMeshEdgesVertexAttribute(id, coloring.vertex) } else { throw new Error("Unknown mesh edges coloring type: " + type) } @@ -89,19 +90,40 @@ export function useMeshEdgesStyle() { { id, width }, { response_function: () => { - edges_style.width = width + edges_style.size = width console.log(setMeshEdgesWidth.name, { id }, meshEdgesWidth(id)) }, }, ) } + function meshEdgesVertexAttribute(id) { + return meshEdgesStyle(id).coloring.vertex + } + function setMeshEdgesVertexAttribute(id, vertex_attribute) { + const coloring_style = meshEdgesStyle(id).coloring + return viewerStore.request( + mesh_edges_schemas.vertex_attribute, + { id, ...vertex_attribute }, + { + response_function: () => { + coloring_style.vertex = vertex_attribute + console.log( + setMeshEdgesVertexAttribute.name, + { id }, + meshEdgesVertexAttribute(id), + ) + }, + }, + ) + } + function applyMeshEdgesStyle(id) { const style = meshEdgesStyle(id) return Promise.all([ setMeshEdgesVisibility(id, style.visibility), setMeshEdgesActiveColoring(id, style.coloring.active), - // setMeshEdgesWidth(id, style.width); + setMeshEdgesWidth(id, style.size), ]) } @@ -111,9 +133,11 @@ export function useMeshEdgesStyle() { meshEdgesColor, meshEdgesVisibility, meshEdgesWidth, + meshEdgesVertexAttribute, setMeshEdgesActiveColoring, setMeshEdgesColor, setMeshEdgesVisibility, setMeshEdgesWidth, + setMeshEdgesVertexAttribute, } } From 3e411876ea9d9cd7b74710b316474f76da284abf Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 19 Jan 2026 16:02:52 +0100 Subject: [PATCH 02/12] fix(context-menu): Align context menu options with requirements table and fix EdgedCurve technical issues --- .../Viewer/EdgedCurve/EdgesOptions.vue | 6 +- .../EdgedCurve/SpecificEdgesOptions.vue | 105 ++++++++++++++++++ .../Viewer/Generic/Mesh/CellsOptions.vue | 2 + .../Viewer/Generic/Mesh/EdgesOptions.vue | 37 ++++-- .../Viewer/Generic/Mesh/PointsOptions.vue | 9 +- .../Viewer/Generic/Mesh/PolygonsOptions.vue | 18 +-- .../Viewer/Generic/Mesh/PolyhedraOptions.vue | 19 +--- .../Viewer/Generic/Model/EdgesOptions.vue | 1 + .../Viewer/Generic/Model/PointsOptions.vue | 1 + .../Viewer/Options/ColoringTypeSelector.vue | 21 ++-- .../Viewer/Options/EdgeAttributeSelector.vue | 46 ++++++++ .../Viewer/PointSet/PointsOptions.vue | 2 + .../Viewer/PointSet/SpecificPointsOptions.vue | 2 + .../Viewer/PolygonalSurface/PointsOptions.vue | 2 + .../PolygonalSurface/PolygonsOptions.vue | 6 +- .../SpecificPolygonsOptions.vue | 86 ++++++++++++++ app/components/Viewer/Solid/EdgesOptions.vue | 2 + app/components/Viewer/Solid/PointsOptions.vue | 2 + .../Viewer/Solid/PolygonsOptions.vue | 2 + .../Viewer/Solid/PolyhedraOptions.vue | 10 +- .../Viewer/Solid/SpecificPolyhedraOptions.vue | 78 +++++++++++++ .../TetrahedralSolid/TetrahedraOptions.vue | 3 + .../TetrahedralSolid/TrianglesOptions.vue | 2 + .../TriangulatedSurface/EdgesOptions.vue | 2 + .../TriangulatedSurface/PointsOptions.vue | 2 + .../TriangulatedSurface/TrianglesOptions.vue | 10 +- app/utils/default_styles.js | 1 + internal/stores/mesh/edges.js | 36 +++++- 28 files changed, 440 insertions(+), 73 deletions(-) create mode 100644 app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue create mode 100644 app/components/Viewer/Options/EdgeAttributeSelector.vue create mode 100644 app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue create mode 100644 app/components/Viewer/Solid/SpecificPolyhedraOptions.vue diff --git a/app/components/Viewer/EdgedCurve/EdgesOptions.vue b/app/components/Viewer/EdgedCurve/EdgesOptions.vue index 6c98546a..faa4f24f 100644 --- a/app/components/Viewer/EdgedCurve/EdgesOptions.vue +++ b/app/components/Viewer/EdgedCurve/EdgesOptions.vue @@ -1,15 +1,17 @@ diff --git a/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue new file mode 100644 index 00000000..eca0430e --- /dev/null +++ b/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue @@ -0,0 +1,105 @@ + + + diff --git a/app/components/Viewer/Generic/Mesh/CellsOptions.vue b/app/components/Viewer/Generic/Mesh/CellsOptions.vue index 7eb4ef3a..2343ebe2 100644 --- a/app/components/Viewer/Generic/Mesh/CellsOptions.vue +++ b/app/components/Viewer/Generic/Mesh/CellsOptions.vue @@ -3,6 +3,7 @@ :itemProps="props.itemProps" :tooltip="props.tooltip" :btn_image="props.btn_image" + :index="props.index" > @@ -11,5 +12,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/Solid/PolygonsOptions.vue b/app/components/Viewer/Solid/PolygonsOptions.vue index 0f4946a3..77a80120 100644 --- a/app/components/Viewer/Solid/PolygonsOptions.vue +++ b/app/components/Viewer/Solid/PolygonsOptions.vue @@ -2,6 +2,7 @@ @@ -11,5 +12,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/Solid/PolyhedraOptions.vue b/app/components/Viewer/Solid/PolyhedraOptions.vue index 3828966a..6b7fe69d 100644 --- a/app/components/Viewer/Solid/PolyhedraOptions.vue +++ b/app/components/Viewer/Solid/PolyhedraOptions.vue @@ -1,15 +1,17 @@ diff --git a/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue b/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue new file mode 100644 index 00000000..ed18cf01 --- /dev/null +++ b/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue @@ -0,0 +1,78 @@ + + + diff --git a/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue b/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue index 1e58b835..69234602 100644 --- a/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +++ b/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue @@ -3,6 +3,8 @@ :itemProps="props.itemProps" :btn_image="TetrahedralSolidTetrahedra" tooltip="Tetrahedra options" + :index="props.index" + /> @@ -12,5 +14,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue b/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue index a1cb4fde..559dfac4 100644 --- a/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +++ b/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue @@ -3,6 +3,7 @@ :itemProps="props.itemProps" :btn_image="TetrahedralSolidTriangles" tooltip="Triangles options" + :index="props.index" /> @@ -12,5 +13,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue b/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue index f17e779f..d1e16ff4 100644 --- a/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +++ b/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue @@ -2,6 +2,7 @@ @@ -11,5 +12,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/TriangulatedSurface/PointsOptions.vue b/app/components/Viewer/TriangulatedSurface/PointsOptions.vue index fb8093e9..459f445f 100644 --- a/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +++ b/app/components/Viewer/TriangulatedSurface/PointsOptions.vue @@ -2,6 +2,7 @@ @@ -11,5 +12,6 @@ const props = defineProps({ itemProps: { type: Object, required: true }, + index: { type: Number, required: true }, }) diff --git a/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue b/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue index ba5e30c3..1e55f246 100644 --- a/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +++ b/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue @@ -1,16 +1,18 @@ diff --git a/app/utils/default_styles.js b/app/utils/default_styles.js index 517cf33b..45915c41 100644 --- a/app/utils/default_styles.js +++ b/app/utils/default_styles.js @@ -49,6 +49,7 @@ const meshEdgesDefaultStyle = ( coloring: { active: "color", color, + vertex: null, }, size, } diff --git a/internal/stores/mesh/edges.js b/internal/stores/mesh/edges.js index 7755c093..9786bb84 100644 --- a/internal/stores/mesh/edges.js +++ b/internal/stores/mesh/edges.js @@ -49,10 +49,11 @@ export function useMeshEdgesStyle() { ) if (type === "color") { return setMeshEdgesColor(id, coloring.color) - // } else if (type == "vertex" && coloring.vertex !== null) { - // return setEdgesVertexAttribute(id, coloring.vertex) - // } else if (type == "edges" && coloring.edges !== null) { - // return setEdgesEdgeAttribute(id, coloring.edges) + } else if (type === "vertex") { + if (coloring.vertex === null) { + return + } + return setMeshEdgesVertexAttribute(id, coloring.vertex) } else { throw new Error("Unknown mesh edges coloring type: " + type) } @@ -89,19 +90,40 @@ export function useMeshEdgesStyle() { { id, width }, { response_function: () => { - edges_style.width = width + edges_style.size = width console.log(setMeshEdgesWidth.name, { id }, meshEdgesWidth(id)) }, }, ) } + function meshEdgesVertexAttribute(id) { + return meshEdgesStyle(id).coloring.vertex + } + function setMeshEdgesVertexAttribute(id, vertex_attribute) { + const coloring_style = meshEdgesStyle(id).coloring + return viewerStore.request( + mesh_edges_schemas.vertex_attribute, + { id, ...vertex_attribute }, + { + response_function: () => { + coloring_style.vertex = vertex_attribute + console.log( + setMeshEdgesVertexAttribute.name, + { id }, + meshEdgesVertexAttribute(id), + ) + }, + }, + ) + } + function applyMeshEdgesStyle(id) { const style = meshEdgesStyle(id) return Promise.all([ setMeshEdgesVisibility(id, style.visibility), setMeshEdgesActiveColoring(id, style.coloring.active), - // setMeshEdgesWidth(id, style.width); + setMeshEdgesWidth(id, style.size), ]) } @@ -111,9 +133,11 @@ export function useMeshEdgesStyle() { meshEdgesColor, meshEdgesVisibility, meshEdgesWidth, + meshEdgesVertexAttribute, setMeshEdgesActiveColoring, setMeshEdgesColor, setMeshEdgesVisibility, setMeshEdgesWidth, + setMeshEdgesVertexAttribute, } } From f3452827259005f80923d8997a0f760a27fe8095 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 19 Jan 2026 16:09:39 +0100 Subject: [PATCH 03/12] fix(store): Add missing edge and polyhedra attribute support to stores --- app/utils/default_styles.js | 1 + internal/stores/mesh/edges.js | 28 +++++++ internal/stores/mesh/polyhedra.js | 119 ++++++++++++++---------------- 3 files changed, 83 insertions(+), 65 deletions(-) diff --git a/app/utils/default_styles.js b/app/utils/default_styles.js index 45915c41..d1014e06 100644 --- a/app/utils/default_styles.js +++ b/app/utils/default_styles.js @@ -49,6 +49,7 @@ const meshEdgesDefaultStyle = ( coloring: { active: "color", color, + edge: null, vertex: null, }, size, diff --git a/internal/stores/mesh/edges.js b/internal/stores/mesh/edges.js index 9786bb84..c69976a2 100644 --- a/internal/stores/mesh/edges.js +++ b/internal/stores/mesh/edges.js @@ -54,6 +54,11 @@ export function useMeshEdgesStyle() { return } return setMeshEdgesVertexAttribute(id, coloring.vertex) + } else if (type === "edge") { + if (coloring.edge === null) { + return + } + return setMeshEdgesEdgeAttribute(id, coloring.edge) } else { throw new Error("Unknown mesh edges coloring type: " + type) } @@ -118,6 +123,27 @@ export function useMeshEdgesStyle() { ) } + function meshEdgesEdgeAttribute(id) { + return meshEdgesStyle(id).coloring.edge + } + function setMeshEdgesEdgeAttribute(id, edge_attribute) { + const coloring_style = meshEdgesStyle(id).coloring + return viewerStore.request( + mesh_edges_schemas.edge_attribute, + { id, ...edge_attribute }, + { + response_function: () => { + coloring_style.edge = edge_attribute + console.log( + setMeshEdgesEdgeAttribute.name, + { id }, + meshEdgesEdgeAttribute(id), + ) + }, + }, + ) + } + function applyMeshEdgesStyle(id) { const style = meshEdgesStyle(id) return Promise.all([ @@ -134,10 +160,12 @@ export function useMeshEdgesStyle() { meshEdgesVisibility, meshEdgesWidth, meshEdgesVertexAttribute, + meshEdgesEdgeAttribute, setMeshEdgesActiveColoring, setMeshEdgesColor, setMeshEdgesVisibility, setMeshEdgesWidth, setMeshEdgesVertexAttribute, + setMeshEdgesEdgeAttribute, } } diff --git a/internal/stores/mesh/polyhedra.js b/internal/stores/mesh/polyhedra.js index e44f8ee4..6e76e8c7 100644 --- a/internal/stores/mesh/polyhedra.js +++ b/internal/stores/mesh/polyhedra.js @@ -49,10 +49,16 @@ export function useMeshPolyhedraStyle() { ) if (type === "color") { return setMeshPolyhedraColor(id, coloring.color) - // } else if (type === "vertex" && coloring.vertex !== null) { - // return setPolyhedraVertexAttribute(id, coloring.vertex) - // } else if (type === "polyhedron" && coloring.polyhedron !== null) { - // return setPolyhedraPolyhedronAttribute(id, coloring.polyhedron) + } else if (type === "vertex") { + if (coloring.vertex === null) { + return + } + return setPolyhedraVertexAttribute(id, coloring.vertex) + } else if (type === "polyhedron") { + if (coloring.polyhedron === null) { + return + } + return setPolyhedraPolyhedronAttribute(id, coloring.polyhedron) } else { throw new Error("Unknown mesh polyhedra coloring type: " + type) } @@ -79,62 +85,47 @@ export function useMeshPolyhedraStyle() { ) } - // function polyhedraVertexAttribute(id) { - // return meshPolyhedraStyle(id).coloring.vertex - // } - // function setPolyhedraVertexAttribute(id, vertex_attribute) { - // const coloring_style = meshPolyhedraStyle(id).coloring - // return viewerStore.request( - // mesh_polyhedra_schemas.vertex_attribute, - // { id, ...vertex_attribute }, - // { - // response_function: () => { - // coloring_style.vertex = vertex_attribute - // console.log( - // setPolyhedraVertexAttribute.name} ${polyhedraVertexAttribute(id), - // ) - // }, - // }, - // ) - // } - - // function polyhedraPolygonAttribute(id) { - // return meshPolyhedraStyle(id).coloring.polygon - // } - // function setPolyhedraPolygonAttribute(id, polygon_attribute) { - // const coloring_style = meshPolyhedraStyle(id).coloring - // return viewerStore.request( - // mesh_polyhedra_schemas.polygon_attribute, - // { id, ...polygon_attribute }, - // { - // response_function: () => { - // coloring_style.polygon = polygon_attribute - // console.log( - // setPolyhedraPolygonAttribute.name} ${polyhedraPolygonAttribute(id), - // ) - // }, - // }, - // ) - // } + function polyhedraVertexAttribute(id) { + return meshPolyhedraStyle(id).coloring.vertex + } + function setPolyhedraVertexAttribute(id, vertex_attribute) { + const coloring_style = meshPolyhedraStyle(id).coloring + return viewerStore.request( + mesh_polyhedra_schemas.vertex_attribute, + { id, ...vertex_attribute }, + { + response_function: () => { + coloring_style.vertex = vertex_attribute + console.log( + setPolyhedraVertexAttribute.name, + { id }, + polyhedraVertexAttribute(id), + ) + }, + }, + ) + } - // function polyhedraPolyhedronAttribute(id) { - // return meshPolyhedraStyle(id).coloring.polyhedron - // } - // function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) { - // const coloring = meshPolyhedraStyle(id).coloring - // return viewerStore.request( - // mesh_polyhedra_schemas.polyhedron_attribute, - // { id, ...polyhedron_attribute }, - // { - // response_function: () => { - // coloring.polyhedron = polyhedron_attribute - // console.log( - // setPolyhedraPolyhedronAttribute.name} ${polyhedraPolyhedronAttribute(id), - // ) - // }, - // }, - // ) - // } + function polyhedraPolyhedronAttribute(id) { + return meshPolyhedraStyle(id).coloring.polyhedron + } + function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) { + const coloring = meshPolyhedraStyle(id).coloring + return viewerStore.request( + mesh_polyhedra_schemas.polyhedron_attribute, + { id, ...polyhedron_attribute }, + { + response_function: () => { + coloring.polyhedron = polyhedron_attribute + console.log( + setPolyhedraPolyhedronAttribute.name, + { id }, + polyhedraPolyhedronAttribute(id), + ) + }, + }, + ) + } function applyMeshPolyhedraStyle(id) { const style = meshPolyhedraStyle(id) @@ -148,15 +139,13 @@ export function useMeshPolyhedraStyle() { applyMeshPolyhedraStyle, meshPolyhedraActiveColoring, meshPolyhedraColor, - // polyhedraVertexAttribute, + polyhedraVertexAttribute, meshPolyhedraVisibility, - // polyhedraPolyhedronAttribute, - // polyhedraPolygonAttribute, + polyhedraPolyhedronAttribute, setMeshPolyhedraActiveColoring, setMeshPolyhedraColor, - // setPolyhedraPolyhedronAttribute, - // setPolyhedraPolygonAttribute, - // setPolyhedraVertexAttribute, + setPolyhedraPolyhedronAttribute, + setPolyhedraVertexAttribute, setMeshPolyhedraVisibility, } } From 24c9ed2aa3dc5299c0160fc848bdf717621d483e Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 19 Jan 2026 16:13:42 +0100 Subject: [PATCH 04/12] fix(store): Add missing edge and polyhedra attribute support to stores --- app/components/Viewer/Solid/PolyhedraOptions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/Viewer/Solid/PolyhedraOptions.vue b/app/components/Viewer/Solid/PolyhedraOptions.vue index 6b7fe69d..7ba7b8ff 100644 --- a/app/components/Viewer/Solid/PolyhedraOptions.vue +++ b/app/components/Viewer/Solid/PolyhedraOptions.vue @@ -1,14 +1,14 @@