@geode/opengeodeweb-front 10.2.0-rc.1 → 10.2.0

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.
Files changed (31) hide show
  1. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +103 -0
  2. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +35 -7
  3. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +1 -7
  4. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +1 -16
  5. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +0 -17
  6. package/app/components/Viewer/Options/ColoringTypeSelector.vue +13 -8
  7. package/app/components/Viewer/Options/EdgeAttributeSelector.vue +72 -0
  8. package/app/components/Viewer/Options/VertexAttributeSelector.vue +3 -0
  9. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +2 -2
  10. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +84 -0
  11. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +76 -0
  12. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +4 -4
  13. package/app/stores/geode.js +21 -23
  14. package/app/stores/menu.js +5 -5
  15. package/app/utils/default_styles.js +11 -9
  16. package/internal/stores/mesh/edges.js +58 -6
  17. package/internal/stores/mesh/points.js +5 -2
  18. package/internal/stores/mesh/polyhedra.js +54 -65
  19. package/package.json +3 -3
  20. package/tests/integration/data/uploads/test.og_edc3d +0 -0
  21. package/tests/integration/data/uploads/test.vtu +22 -0
  22. package/tests/integration/microservices/back/requirements.txt +1 -1
  23. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  24. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +46 -12
  25. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +19 -0
  26. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +15 -15
  27. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +57 -16
  28. package/app/components/Viewer/EdgedCurve/EdgesOptions.vue +0 -15
  29. package/app/components/Viewer/PointSet/PointsOptions.vue +0 -15
  30. package/app/components/Viewer/PolygonalSurface/PolygonsOptions.vue +0 -15
  31. package/app/components/Viewer/Solid/PolyhedraOptions.vue +0 -15
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <ViewerContextMenuItem
3
+ :itemProps="props.itemProps"
4
+ tooltip="Edges options"
5
+ :btn_image="EdgedCurveEdges"
6
+ >
7
+ <template #options>
8
+ <ViewerOptionsVisibilitySwitch v-model="visibility" />
9
+ <template v-if="visibility">
10
+ <v-row class="pa-0" align="center">
11
+ <v-divider />
12
+ <v-col cols="auto" justify="center">
13
+ <v-icon size="30" icon="mdi-ruler" v-tooltip:left="'Width'" />
14
+ </v-col>
15
+ <v-col justify="center">
16
+ <v-slider
17
+ v-model="size"
18
+ hide-details
19
+ min="0"
20
+ max="20"
21
+ step="2"
22
+ thumb-color="black"
23
+ ticks
24
+ />
25
+ </v-col>
26
+ </v-row>
27
+ <v-row>
28
+ <v-col>
29
+ <ViewerOptionsColoringTypeSelector
30
+ :id="id"
31
+ v-model:coloring_style_key="coloring_style_key"
32
+ v-model:color="color"
33
+ v-model:vertex_attribute="vertex_attribute"
34
+ v-model:edge_attribute="edge_attribute"
35
+ />
36
+ </v-col>
37
+ </v-row>
38
+ </template>
39
+ </template>
40
+ </ViewerContextMenuItem>
41
+ </template>
42
+
43
+ <script setup>
44
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
45
+ import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
46
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
47
+ import EdgedCurveEdges from "@ogw_front/assets/viewer_svgs/edged_curve_edges.svg"
48
+
49
+ import { useDataStyleStore } from "@ogw_front/stores/data_style"
50
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
51
+
52
+ const dataStyleStore = useDataStyleStore()
53
+ const hybridViewerStore = useHybridViewerStore()
54
+
55
+ const props = defineProps({
56
+ itemProps: { type: Object, required: true },
57
+ })
58
+
59
+ const id = toRef(() => props.itemProps.id)
60
+
61
+ const visibility = computed({
62
+ get: () => dataStyleStore.meshEdgesVisibility(id.value),
63
+ set: (newValue) => {
64
+ dataStyleStore.setMeshEdgesVisibility(id.value, newValue)
65
+ hybridViewerStore.remoteRender()
66
+ },
67
+ })
68
+ const size = computed({
69
+ get: () => dataStyleStore.meshEdgesWidth(id.value),
70
+ set: (newValue) => {
71
+ dataStyleStore.setMeshEdgesWidth(id.value, newValue)
72
+ hybridViewerStore.remoteRender()
73
+ },
74
+ })
75
+ const coloring_style_key = computed({
76
+ get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
77
+ set: (newValue) => {
78
+ dataStyleStore.setMeshEdgesActiveColoring(id.value, newValue)
79
+ hybridViewerStore.remoteRender()
80
+ },
81
+ })
82
+ const color = computed({
83
+ get: () => dataStyleStore.meshEdgesColor(id.value),
84
+ set: (newValue) => {
85
+ dataStyleStore.setMeshEdgesColor(id.value, newValue)
86
+ hybridViewerStore.remoteRender()
87
+ },
88
+ })
89
+ const vertex_attribute = computed({
90
+ get: () => dataStyleStore.meshEdgesVertexAttribute(id.value),
91
+ set: (newValue) => {
92
+ dataStyleStore.setMeshEdgesVertexAttribute(id.value, newValue)
93
+ hybridViewerStore.remoteRender()
94
+ },
95
+ })
96
+ const edge_attribute = computed({
97
+ get: () => dataStyleStore.meshEdgesEdgeAttribute(id.value),
98
+ set: (newValue) => {
99
+ dataStyleStore.setMeshEdgesEdgeAttribute(id.value, newValue)
100
+ hybridViewerStore.remoteRender()
101
+ },
102
+ })
103
+ </script>
@@ -7,11 +7,32 @@
7
7
  <template #options>
8
8
  <ViewerOptionsVisibilitySwitch v-model="visibility" />
9
9
  <template v-if="visibility">
10
- <ViewerOptionsColoringTypeSelector
11
- :id="id"
12
- v-model:coloring_style_key="coloring_style_key"
13
- v-model:color="color"
14
- />
10
+ <v-row class="pa-0" align="center">
11
+ <v-divider />
12
+ <v-col cols="auto" justify="center">
13
+ <v-icon size="30" icon="mdi-ruler" v-tooltip:left="'Width'" />
14
+ </v-col>
15
+ <v-col justify="center">
16
+ <v-slider
17
+ v-model="size"
18
+ hide-details
19
+ min="0"
20
+ max="20"
21
+ step="2"
22
+ thumb-color="black"
23
+ ticks
24
+ />
25
+ </v-col>
26
+ </v-row>
27
+ <v-row>
28
+ <v-col>
29
+ <ViewerOptionsColoringTypeSelector
30
+ :id="id"
31
+ v-model:coloring_style_key="coloring_style_key"
32
+ v-model:color="color"
33
+ />
34
+ </v-col>
35
+ </v-row>
15
36
  </template>
16
37
  </template>
17
38
  </ViewerContextMenuItem>
@@ -43,9 +64,9 @@
43
64
  },
44
65
  })
45
66
  const size = computed({
46
- get: () => dataStyleStore.edgesSize(id.value),
67
+ get: () => dataStyleStore.meshEdgesWidth(id.value),
47
68
  set: (newValue) => {
48
- dataStyleStore.setEdgesSize(id.value, newValue)
69
+ dataStyleStore.setMeshEdgesWidth(id.value, newValue)
49
70
  hybridViewerStore.remoteRender()
50
71
  },
51
72
  })
@@ -63,4 +84,11 @@
63
84
  hybridViewerStore.remoteRender()
64
85
  },
65
86
  })
87
+ const vertex_attribute = computed({
88
+ get: () => dataStyleStore.meshEdgesVertexAttribute(id.value),
89
+ set: (newValue) => {
90
+ dataStyleStore.setMeshEdgesVertexAttribute(id.value, newValue)
91
+ hybridViewerStore.remoteRender()
92
+ },
93
+ })
66
94
  </script>
@@ -30,6 +30,7 @@
30
30
  :id="id"
31
31
  v-model:coloring_style_key="coloring_style_key"
32
32
  v-model:color="color"
33
+ v-model:vertex_attribute="vertex_attribute"
33
34
  />
34
35
  </v-col>
35
36
  </v-row>
@@ -84,11 +85,4 @@
84
85
  hybridViewerStore.remoteRender()
85
86
  },
86
87
  })
87
- const vertex_attribute = computed({
88
- get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
89
- set: (newValue) => {
90
- dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue)
91
- hybridViewerStore.remoteRender()
92
- },
93
- })
94
88
  </script>
@@ -12,8 +12,6 @@
12
12
  v-model:coloring_style_key="coloring_style_key"
13
13
  v-model:color="color"
14
14
  v-model:textures="textures"
15
- v-model:vertex_attribute="vertex_attribute"
16
- v-model:polygon_attribute="polygon_attribute"
17
15
  />
18
16
  </template>
19
17
  </template>
@@ -34,6 +32,7 @@
34
32
  const props = defineProps({
35
33
  itemProps: { type: Object, required: true },
36
34
  btn_image: { type: String, required: true },
35
+
37
36
  tooltip: { type: String, required: false, default: "Polygons options" },
38
37
  })
39
38
 
@@ -67,18 +66,4 @@
67
66
  hybridViewerStore.remoteRender()
68
67
  },
69
68
  })
70
- const vertex_attribute = computed({
71
- get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
72
- set: (newValue) => {
73
- dataStyleStore.setMeshPolygonsVertexAttribute(id.value, newValue)
74
- hybridViewerStore.remoteRender()
75
- },
76
- })
77
- const polygon_attribute = computed({
78
- get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
79
- set: (newValue) => {
80
- dataStyleStore.setMeshPolygonsPolygonAttribute(id.value, newValue)
81
- hybridViewerStore.remoteRender()
82
- },
83
- })
84
69
  </script>
@@ -6,14 +6,11 @@
6
6
  >
7
7
  <template #options>
8
8
  <ViewerOptionsVisibilitySwitch v-model="visibility" />
9
-
10
9
  <template v-if="visibility">
11
10
  <ViewerOptionsColoringTypeSelector
12
11
  :id="id"
13
12
  v-model:coloring_style_key="coloring_style_key"
14
13
  v-model:color="color"
15
- v-model:vertex_attribute="vertex_attribute"
16
- v-model:polyhedron_attribute="polyhedron_attribute"
17
14
  />
18
15
  </template>
19
16
  </template>
@@ -60,18 +57,4 @@
60
57
  hybridViewerStore.remoteRender()
61
58
  },
62
59
  })
63
- const vertex_attribute = computed({
64
- get: () => dataStyleStore.polyhedraVertexAttribute(id.value),
65
- set: (newValue) => {
66
- dataStyleStore.setPolyhedraVertexAttribute(id.value, newValue)
67
- hybridViewerStore.remoteRender()
68
- },
69
- })
70
- const polyhedron_attribute = computed({
71
- get: () => dataStyleStore.polyhedraPolyhedronAttribute(id.value),
72
- set: (newValue) => {
73
- dataStyleStore.setPolyhedraPolyhedronAttribute(id.value, newValue)
74
- hybridViewerStore.remoteRender()
75
- },
76
- })
77
60
  </script>
@@ -34,9 +34,12 @@
34
34
  :id="id"
35
35
  />
36
36
  </template>
37
- <!-- <template v-if="coloring_style_key === edge_dict['value']">
38
- <ViewerOptionsEdgeAttributeSelector v-model="edge_attribute" :id="id" />
39
- </template> -->
37
+ <template v-if="coloring_style_key === edge_dict['value']">
38
+ <ViewerOptionsEdgeAttributeSelector
39
+ v-model="edge_attribute"
40
+ :id="id"
41
+ />
42
+ </template>
40
43
  <template v-if="coloring_style_key === cell_dict['value']">
41
44
  <ViewerOptionsCellAttributeSelector
42
45
  v-model="cell_attribute"
@@ -65,7 +68,7 @@
65
68
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker"
66
69
  import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector"
67
70
  import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector"
68
- // import ViewerOptionsEdgeAttributeSelector from "@ogw_front/components/Viewer/Options/EdgeAttributeSelector"
71
+ import ViewerOptionsEdgeAttributeSelector from "@ogw_front/components/Viewer/Options/EdgeAttributeSelector"
69
72
  import ViewerOptionsPolygonAttributeSelector from "@ogw_front/components/Viewer/Options/PolygonAttributeSelector"
70
73
  import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector"
71
74
  import ViewerOptionsPolyhedronAttributeSelector from "@ogw_front/components/Viewer/Options/PolyhedronAttributeSelector"
@@ -75,7 +78,7 @@
75
78
  const color = defineModel("color")
76
79
  const textures = defineModel("textures")
77
80
  const vertex_attribute = defineModel("vertex_attribute")
78
- // const edge_attribute = defineModel("edge_attribute");
81
+ const edge_attribute = defineModel("edge_attribute")
79
82
  const cell_attribute = defineModel("cell_attribute")
80
83
  const polygon_attribute = defineModel("polygon_attribute")
81
84
  const polyhedron_attribute = defineModel("polyhedron_attribute")
@@ -91,7 +94,9 @@
91
94
  const has_vertex = computed(() =>
92
95
  vertex_attribute.value !== undefined ? true : false,
93
96
  )
94
- // const has_edge = computed(() => (edge_attribute.value !== undefined ? true : false));
97
+ const has_edge = computed(() =>
98
+ edge_attribute.value !== undefined ? true : false,
99
+ )
95
100
  const has_cells = computed(() =>
96
101
  cell_attribute.value !== undefined ? true : false,
97
102
  )
@@ -105,7 +110,7 @@
105
110
  const color_dict = { name: "Color", value: "color" }
106
111
  const textures_dict = { name: "Textures", value: "textures" }
107
112
  const vertex_dict = { name: "Vertex attribute", value: "vertex" }
108
- // const edge_dict = { name: "Edge attribute", value: "edge" }
113
+ const edge_dict = { name: "Edge attribute", value: "edge" }
109
114
  const cell_dict = { name: "Cell attribute", value: "cell" }
110
115
  const polygon_dict = { name: "Polygon attribute", value: "polygon" }
111
116
  const polyhedron_dict = {
@@ -117,7 +122,7 @@
117
122
  if (has_color.value) array.push(color_dict)
118
123
  if (has_textures.value) array.push(textures_dict)
119
124
  if (has_vertex.value) array.push(vertex_dict)
120
- // if (has_edges.value) array.push(edge_dict);
125
+ if (has_edge.value) array.push(edge_dict)
121
126
  if (has_cells.value) array.push(cell_dict)
122
127
  if (has_polygons.value) array.push(polygon_dict)
123
128
  if (has_polyhedra.value) array.push(polyhedron_dict)
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <v-row justify="center" align="center">
3
+ <v-col cols="auto">
4
+ <v-icon
5
+ size="30"
6
+ icon="mdi-ray-end-arrow"
7
+ v-tooltip:left="'Edge Attribute'"
8
+ />
9
+ </v-col>
10
+ <v-col>
11
+ <v-select
12
+ v-model="edge_attribute_name"
13
+ :items="edge_attribute_names"
14
+ label="Select an edge attribute"
15
+ density="compact"
16
+ hide-details
17
+ />
18
+ </v-col>
19
+ </v-row>
20
+ </template>
21
+
22
+ <script setup>
23
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
24
+ import { useGeodeStore } from "@ogw_front/stores/geode"
25
+
26
+ const geodeStore = useGeodeStore()
27
+
28
+ const model = defineModel()
29
+
30
+ const props = defineProps({
31
+ id: { type: String, required: true },
32
+ })
33
+
34
+ const edge_attribute_name = ref("")
35
+ const edge_attribute_names = ref([])
36
+
37
+ onMounted(() => {
38
+ if (model.value != null) {
39
+ edge_attribute_name.value = model.value.name
40
+ }
41
+ })
42
+
43
+ const edge_attribute = reactive({ name: edge_attribute_name.value })
44
+
45
+ watch(edge_attribute_name, (value) => {
46
+ edge_attribute.name = value
47
+ model.value = edge_attribute
48
+ })
49
+
50
+ function get_edge_attribute_names() {
51
+ geodeStore.request(
52
+ back_schemas.opengeodeweb_back.edge_attribute_names,
53
+ { id: props.id },
54
+ {
55
+ response_function: (response) => {
56
+ edge_attribute_names.value = response.edge_attribute_names
57
+ },
58
+ },
59
+ )
60
+ }
61
+
62
+ onMounted(() => {
63
+ get_edge_attribute_names()
64
+ })
65
+
66
+ watch(
67
+ () => props.id,
68
+ () => {
69
+ get_edge_attribute_names()
70
+ },
71
+ )
72
+ </script>
@@ -9,6 +9,9 @@
9
9
 
10
10
  <script setup>
11
11
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
12
+ import { useGeodeStore } from "@ogw_front/stores/geode"
13
+
14
+ const geodeStore = useGeodeStore()
12
15
 
13
16
  const model = defineModel()
14
17
 
@@ -2,7 +2,7 @@
2
2
  <ViewerContextMenuItem
3
3
  :itemProps="props.itemProps"
4
4
  tooltip="Points options"
5
- :btn_image="props.btn_image"
5
+ :btn_image="PointSetPoints"
6
6
  >
7
7
  <template #options>
8
8
  <ViewerOptionsVisibilitySwitch v-model="visibility" />
@@ -43,6 +43,7 @@
43
43
  import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
44
44
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
45
45
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
46
+ import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg"
46
47
 
47
48
  import { useDataStyleStore } from "@ogw_front/stores/data_style"
48
49
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
@@ -52,7 +53,6 @@
52
53
 
53
54
  const props = defineProps({
54
55
  itemProps: { type: Object, required: true },
55
- btn_image: { type: String, required: true },
56
56
  })
57
57
 
58
58
  const id = toRef(() => props.itemProps.id)
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <ViewerContextMenuItem
3
+ :itemProps="props.itemProps"
4
+ :tooltip="props.tooltip"
5
+ :btn_image="PolygonalSurfacePolygons"
6
+ >
7
+ <template #options>
8
+ <ViewerOptionsVisibilitySwitch v-model="visibility" />
9
+ <template v-if="visibility">
10
+ <ViewerOptionsColoringTypeSelector
11
+ :id="id"
12
+ v-model:coloring_style_key="coloring_style_key"
13
+ v-model:color="color"
14
+ v-model:textures="textures"
15
+ v-model:vertex_attribute="vertex_attribute"
16
+ v-model:polygon_attribute="polygon_attribute"
17
+ />
18
+ </template>
19
+ </template>
20
+ </ViewerContextMenuItem>
21
+ </template>
22
+
23
+ <script setup>
24
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
25
+ import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
26
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
27
+ import PolygonalSurfacePolygons from "@ogw_front/assets/viewer_svgs/surface_triangles.svg"
28
+
29
+ import { useDataStyleStore } from "@ogw_front/stores/data_style"
30
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
31
+
32
+ const dataStyleStore = useDataStyleStore()
33
+ const hybridViewerStore = useHybridViewerStore()
34
+
35
+ const props = defineProps({
36
+ itemProps: { type: Object, required: true },
37
+ tooltip: { type: String, required: false, default: "Polygons options" },
38
+ })
39
+
40
+ const id = toRef(() => props.itemProps.id)
41
+
42
+ const visibility = computed({
43
+ get: () => dataStyleStore.meshPolygonsVisibility(id.value),
44
+ set: (newValue) => {
45
+ dataStyleStore.setMeshPolygonsVisibility(id.value, newValue)
46
+ hybridViewerStore.remoteRender()
47
+ },
48
+ })
49
+ const coloring_style_key = computed({
50
+ get: () => dataStyleStore.meshPolygonsActiveColoring(id.value),
51
+ set: (newValue) => {
52
+ dataStyleStore.setMeshPolygonsActiveColoring(id.value, newValue)
53
+ hybridViewerStore.remoteRender()
54
+ },
55
+ })
56
+ const color = computed({
57
+ get: () => dataStyleStore.meshPolygonsColor(id.value),
58
+ set: (newValue) => {
59
+ dataStyleStore.setMeshPolygonsColor(id.value, newValue)
60
+ hybridViewerStore.remoteRender()
61
+ },
62
+ })
63
+ const textures = computed({
64
+ get: () => dataStyleStore.meshPolygonsTextures(id.value),
65
+ set: (newValue) => {
66
+ dataStyleStore.setMeshPolygonsTextures(id.value, newValue)
67
+ hybridViewerStore.remoteRender()
68
+ },
69
+ })
70
+ const vertex_attribute = computed({
71
+ get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
72
+ set: (newValue) => {
73
+ dataStyleStore.setMeshPolygonsVertexAttribute(id.value, newValue)
74
+ hybridViewerStore.remoteRender()
75
+ },
76
+ })
77
+ const polygon_attribute = computed({
78
+ get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
79
+ set: (newValue) => {
80
+ dataStyleStore.setMeshPolygonsPolygonAttribute(id.value, newValue)
81
+ hybridViewerStore.remoteRender()
82
+ },
83
+ })
84
+ </script>
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <ViewerContextMenuItem
3
+ :itemProps="props.itemProps"
4
+ :tooltip="props.tooltip"
5
+ :btn_image="SolidPolyhedra"
6
+ >
7
+ <template #options>
8
+ <ViewerOptionsVisibilitySwitch v-model="visibility" />
9
+ <template v-if="visibility">
10
+ <ViewerOptionsColoringTypeSelector
11
+ :id="id"
12
+ v-model:coloring_style_key="coloring_style_key"
13
+ v-model:color="color"
14
+ v-model:vertex_attribute="vertex_attribute"
15
+ v-model:polyhedron_attribute="polyhedron_attribute"
16
+ />
17
+ </template>
18
+ </template>
19
+ </ViewerContextMenuItem>
20
+ </template>
21
+
22
+ <script setup>
23
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
24
+ import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
25
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
26
+ import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg"
27
+
28
+ import { useDataStyleStore } from "@ogw_front/stores/data_style"
29
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
30
+
31
+ const dataStyleStore = useDataStyleStore()
32
+ const hybridViewerStore = useHybridViewerStore()
33
+
34
+ const props = defineProps({
35
+ itemProps: { type: Object, required: true },
36
+ tooltip: { type: String, required: false, default: "Polyhedra options" },
37
+ })
38
+
39
+ const id = toRef(() => props.itemProps.id)
40
+
41
+ const visibility = computed({
42
+ get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
43
+ set: (newValue) => {
44
+ dataStyleStore.setMeshPolyhedraVisibility(id.value, newValue)
45
+ hybridViewerStore.remoteRender()
46
+ },
47
+ })
48
+ const coloring_style_key = computed({
49
+ get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
50
+ set: (newValue) => {
51
+ dataStyleStore.setMeshPolyhedraActiveColoring(id.value, newValue)
52
+ hybridViewerStore.remoteRender()
53
+ },
54
+ })
55
+ const color = computed({
56
+ get: () => dataStyleStore.meshPolyhedraColor(id.value),
57
+ set: (newValue) => {
58
+ dataStyleStore.setMeshPolyhedraColor(id.value, newValue)
59
+ hybridViewerStore.remoteRender()
60
+ },
61
+ })
62
+ const vertex_attribute = computed({
63
+ get: () => dataStyleStore.polyhedraVertexAttribute(id.value),
64
+ set: (newValue) => {
65
+ dataStyleStore.setPolyhedraVertexAttribute(id.value, newValue)
66
+ hybridViewerStore.remoteRender()
67
+ },
68
+ })
69
+ const polyhedron_attribute = computed({
70
+ get: () => dataStyleStore.polyhedraPolyhedronAttribute(id.value),
71
+ set: (newValue) => {
72
+ dataStyleStore.setPolyhedraPolyhedronAttribute(id.value, newValue)
73
+ hybridViewerStore.remoteRender()
74
+ },
75
+ })
76
+ </script>
@@ -1,14 +1,14 @@
1
1
  <template>
2
- <ViewerGenericMeshPolygonsOptions
2
+ <ViewerSpecificPolygonsOptions
3
3
  :itemProps="props.itemProps"
4
- :btn_image="TriangulatedSurfaceEdgesTriangles"
4
+ :btn_image="TriangulatedSurfaceTriangles"
5
5
  tooltip="Triangles options"
6
6
  />
7
7
  </template>
8
8
 
9
9
  <script setup>
10
- import ViewerGenericMeshPolygonsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PolygonsOptions"
11
- import TriangulatedSurfaceEdgesTriangles from "@ogw_front/assets/viewer_svgs/surface_triangles.svg"
10
+ import ViewerSpecificPolygonsOptions from "@ogw_front/components/Viewer/PolygonalSurface/SpecificPolygonsOptions"
11
+ import TriangulatedSurfaceTriangles from "@ogw_front/assets/viewer_svgs/surface_triangles.svg"
12
12
 
13
13
  const props = defineProps({
14
14
  itemProps: { type: Object, required: true },
@@ -44,36 +44,33 @@ export const useGeodeStore = defineStore("geode", {
44
44
  },
45
45
  },
46
46
  actions: {
47
- ping_task() {
47
+ set_ping() {
48
+ this.ping()
48
49
  setInterval(() => {
49
- this.do_ping()
50
+ this.ping()
50
51
  }, 10 * 1000)
51
52
  },
52
- do_ping() {
53
+ ping() {
53
54
  const geodeStore = this
54
55
  const feedbackStore = useFeedbackStore()
55
- return $fetch(back_schemas.opengeodeweb_back.ping.$id, {
56
- baseURL: this.base_url,
57
- method: back_schemas.opengeodeweb_back.ping.methods[0],
58
- body: {},
59
- onResponse({ response }) {
60
- if (response.ok) {
56
+ return this.request(
57
+ back_schemas.opengeodeweb_back.ping,
58
+ {},
59
+ {
60
+ request_error_function: () => {
61
+ feedbackStore.$patch({ server_error: true })
62
+ geodeStore.status = Status.NOT_CONNECTED
63
+ },
64
+ response_function: () => {
61
65
  feedbackStore.$patch({ server_error: false })
62
66
  geodeStore.status = Status.CONNECTED
63
- }
64
- },
65
- onResponseError({ response }) {
66
- feedbackStore.$patch({ server_error: true })
67
- geodeStore.status = Status.NOT_CONNECTED
68
- },
69
- onRequestError({ error }) {
70
- feedbackStore.$patch({ server_error: true })
71
- geodeStore.status = Status.NOT_CONNECTED
67
+ },
68
+ response_error_function: () => {
69
+ feedbackStore.$patch({ server_error: true })
70
+ geodeStore.status = Status.NOT_CONNECTED
71
+ },
72
72
  },
73
- })
74
- },
75
- ping() {
76
- return this.do_ping()
73
+ )
77
74
  },
78
75
  start_request() {
79
76
  this.request_counter++
@@ -87,7 +84,8 @@ export const useGeodeStore = defineStore("geode", {
87
84
  },
88
85
  connect() {
89
86
  console.log("[GEODE] Connecting to geode microservice...")
90
- return this.ping_task()
87
+ this.set_ping()
88
+ return Promise.resolve()
91
89
  },
92
90
  request(schema, params, callbacks = {}) {
93
91
  console.log("[GEODE] Request:", schema.$id)