Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/components/Viewer/EdgedCurve/EdgesOptions.vue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A supprimer du coup non ?

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<template>
<ViewerGenericMeshEdgesOptions
<ViewerSpecificEdgesOptions
:itemProps="props.itemProps"
:btn_image="EdgedCurveEdges"
:index="props.index"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le index il sert à quoi ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C’est de la PR de Tao pour ne pas que les éléments du contexte nu ne se chevauchent de ce que j'ai compris

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C’est de la PR de Tao pour ne pas que les éléments du contexte nu ne se chevauchent de ce que j'ai compris

/>
</template>

<script setup>
import ViewerGenericMeshEdgesOptions from "@ogw_front/components/Viewer/Generic/Mesh/EdgesOptions"
import ViewerSpecificEdgesOptions from "@ogw_front/components/Viewer/EdgedCurve/SpecificEdgesOptions"
import EdgedCurveEdges from "@ogw_front/assets/viewer_svgs/edged_curve_edges.svg"
const props = defineProps({
itemProps: { type: Object, required: true },
index: { type: Number, required: true },
})
</script>
105 changes: 105 additions & 0 deletions app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<template>
<ViewerContextMenuItem
:itemProps="props.itemProps"
tooltip="Edges options"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
<template v-if="visibility">
<v-row class="pa-0" align="center">
<v-divider />
<v-col cols="auto" justify="center">
<v-icon size="30" icon="mdi-ruler" v-tooltip:left="'Width'" />
</v-col>
<v-col justify="center">
<v-slider
v-model="size"
hide-details
min="0"
max="20"
step="2"
thumb-color="black"
ticks
/>
</v-col>
</v-row>
<v-row>
<v-col>
<ViewerOptionsColoringTypeSelector
:id="id"
v-model:coloring_style_key="coloring_style_key"
v-model:color="color"
v-model:vertex_attribute="vertex_attribute"
v-model:edge_attribute="edge_attribute"
/>
</v-col>
</v-row>
</template>
</template>
</ViewerContextMenuItem>
</template>

<script setup>
import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"

import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"

const dataStyleStore = useDataStyleStore()
const hybridViewerStore = useHybridViewerStore()

const props = defineProps({
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
index: { type: Number, required: true },
})

const id = toRef(() => props.itemProps.id)

const visibility = computed({
get: () => dataStyleStore.meshEdgesVisibility(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesVisibility(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const size = computed({
get: () => dataStyleStore.meshEdgesWidth(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesWidth(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const coloring_style_key = computed({
get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesActiveColoring(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const color = computed({
get: () => dataStyleStore.meshEdgesColor(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesColor(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const vertex_attribute = computed({
get: () => dataStyleStore.meshEdgesVertexAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesVertexAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const edge_attribute = computed({
get: () => dataStyleStore.meshEdgesEdgeAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesEdgeAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
</script>
2 changes: 2 additions & 0 deletions app/components/Viewer/Generic/Mesh/CellsOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:itemProps="props.itemProps"
:tooltip="props.tooltip"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
Expand Down Expand Up @@ -34,6 +35,7 @@
const props = defineProps({
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
index: { type: Number, required: true },
tooltip: { type: String, required: false, default: "Cells options" },
})

Expand Down
44 changes: 37 additions & 7 deletions app/components/Viewer/Generic/Mesh/EdgesOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,37 @@
:itemProps="props.itemProps"
tooltip="Edges options"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
<template v-if="visibility">
<ViewerOptionsColoringTypeSelector
:id="id"
v-model:coloring_style_key="coloring_style_key"
v-model:color="color"
/>
<v-row class="pa-0" align="center">
<v-divider />
<v-col cols="auto" justify="center">
<v-icon size="30" icon="mdi-ruler" v-tooltip:left="'Width'" />
</v-col>
<v-col justify="center">
<v-slider
v-model="size"
hide-details
min="0"
max="20"
step="2"
thumb-color="black"
ticks
/>
</v-col>
</v-row>
<v-row>
<v-col>
<ViewerOptionsColoringTypeSelector
:id="id"
v-model:coloring_style_key="coloring_style_key"
v-model:color="color"
/>
</v-col>
</v-row>
</template>
</template>
</ViewerContextMenuItem>
Expand All @@ -31,6 +53,7 @@
const props = defineProps({
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
index: { type: Number, required: true },
})

const id = toRef(() => props.itemProps.id)
Expand All @@ -43,9 +66,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()
},
})
Expand All @@ -63,4 +86,11 @@
hybridViewerStore.remoteRender()
},
})
const vertex_attribute = computed({
get: () => dataStyleStore.meshEdgesVertexAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshEdgesVertexAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
</script>
10 changes: 3 additions & 7 deletions app/components/Viewer/Generic/Mesh/PointsOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:itemProps="props.itemProps"
tooltip="Points options"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
Expand Down Expand Up @@ -30,6 +31,7 @@
:id="id"
v-model:coloring_style_key="coloring_style_key"
v-model:color="color"
v-model:vertex_attribute="vertex_attribute"
/>
</v-col>
</v-row>
Expand All @@ -52,6 +54,7 @@
const props = defineProps({
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
index: { type: Number, required: true },
})

const id = toRef(() => props.itemProps.id)
Expand Down Expand Up @@ -84,11 +87,4 @@
hybridViewerStore.remoteRender()
},
})
const vertex_attribute = computed({
get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
</script>
18 changes: 2 additions & 16 deletions app/components/Viewer/Generic/Mesh/PolygonsOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:itemProps="props.itemProps"
:tooltip="props.tooltip"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
Expand All @@ -12,8 +13,6 @@
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"
/>
</template>
</template>
Expand All @@ -34,6 +33,7 @@
const props = defineProps({
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
index: { type: Number, required: true },
tooltip: { type: String, required: false, default: "Polygons options" },
})

Expand Down Expand Up @@ -67,18 +67,4 @@
hybridViewerStore.remoteRender()
},
})
const vertex_attribute = computed({
get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshPolygonsVertexAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const polygon_attribute = computed({
get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
set: (newValue) => {
dataStyleStore.setMeshPolygonsPolygonAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
</script>
19 changes: 2 additions & 17 deletions app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
:itemProps="props.itemProps"
:tooltip="props.tooltip"
:btn_image="props.btn_image"
:index="props.index"
>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />

<template v-if="visibility">
<ViewerOptionsColoringTypeSelector
: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"
/>
</template>
</template>
Expand All @@ -35,6 +33,7 @@
itemProps: { type: Object, required: true },
btn_image: { type: String, required: true },
tooltip: { type: String, required: false, default: "Polyhedra options" },
index: { type: Number, required: true },
})

const id = toRef(() => props.itemProps.id)
Expand All @@ -60,18 +59,4 @@
hybridViewerStore.remoteRender()
},
})
const vertex_attribute = computed({
get: () => dataStyleStore.polyhedraVertexAttribute(id.value),
set: (newValue) => {
dataStyleStore.setPolyhedraVertexAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
const polyhedron_attribute = computed({
get: () => dataStyleStore.polyhedraPolyhedronAttribute(id.value),
set: (newValue) => {
dataStyleStore.setPolyhedraPolyhedronAttribute(id.value, newValue)
hybridViewerStore.remoteRender()
},
})
</script>
1 change: 1 addition & 0 deletions app/components/Viewer/Generic/Model/EdgesOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:itemProps="itemProps"
tooltip="Edges options"
:btn_image="SurfaceEdges"
:index="props.index"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Y a t-il une prop index ?

>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
Expand Down
1 change: 1 addition & 0 deletions app/components/Viewer/Generic/Model/PointsOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:itemProps="props.itemProps"
tooltip="Points options"
:btn_image="SurfacePoints"
:index="props.index"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pareil ici

>
<template #options>
<ViewerOptionsVisibilitySwitch v-model="visibility" />
Expand Down
Loading