@geode/opengeodeweb-front 9.12.0 → 9.12.1-rc.2

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 (39) hide show
  1. package/components/Step.vue +10 -0
  2. package/components/Viewer/Generic/Mesh/EdgesOptions.vue +7 -6
  3. package/components/Viewer/Generic/Mesh/PointsOptions.vue +11 -10
  4. package/components/Viewer/Generic/Mesh/PolygonsOptions.vue +14 -14
  5. package/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
  6. package/components/Viewer/PointSet/SpecificPointsOptions.vue +11 -10
  7. package/components/Viewer/Tree/ObjectTree.vue +1 -1
  8. package/composables/api_fetch.js +1 -3
  9. package/composables/viewer_call.js +1 -3
  10. package/internal_stores/data_style_state.js +2 -1
  11. package/internal_stores/mesh/edges.js +39 -36
  12. package/internal_stores/mesh/index.js +13 -8
  13. package/internal_stores/mesh/points.js +66 -79
  14. package/internal_stores/mesh/polygons.js +80 -88
  15. package/internal_stores/mesh/polyhedra.js +111 -99
  16. package/internal_stores/model/blocks.js +0 -2
  17. package/internal_stores/model/corners.js +0 -2
  18. package/internal_stores/model/lines.js +0 -2
  19. package/internal_stores/model/surfaces.js +0 -2
  20. package/package.json +2 -2
  21. package/stores/data_base.js +1 -3
  22. package/stores/data_style.js +7 -5
  23. package/stores/infra.js +4 -6
  24. package/stores/treeview.js +7 -0
  25. package/tests/integration/data/uploads/test.og_psf3d +0 -0
  26. package/tests/integration/data/uploads/test.og_rgd3d +0 -0
  27. package/tests/integration/microservices/back/requirements.txt +1 -1
  28. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  29. package/tests/integration/setup.js +111 -0
  30. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +77 -0
  31. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +79 -0
  32. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +78 -0
  33. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +78 -0
  34. package/tests/integration/utils.js +35 -0
  35. package/tests/unit/utils/validate_schema.nuxt.test.js +1 -2
  36. package/tests/vitest.config.js +1 -0
  37. package/utils/local.js +42 -43
  38. package/tests/integration/data/fake_id/edged_curve.vtp +0 -20
  39. package/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +0 -215
@@ -90,4 +90,14 @@
90
90
  function decrement_step() {
91
91
  stepper_tree.current_step_index--
92
92
  }
93
+
94
+ const sortedChips = computed(() => {
95
+ const chips = steps.value[props.step_index]?.chips || []
96
+ return [...chips].sort((a, b) =>
97
+ a.localeCompare(b, undefined, {
98
+ numeric: true,
99
+ sensitivity: "base",
100
+ }),
101
+ )
102
+ })
93
103
  </script>
@@ -28,21 +28,22 @@
28
28
  const dataStyleStore = useDataStyleStore()
29
29
 
30
30
  const visibility = computed({
31
- get: () => dataStyleStore.edgesVisibility(id.value),
32
- set: (newValue) => dataStyleStore.setEdgesVisibility(id.value, newValue),
31
+ get: () => dataStyleStore.meshEdgesVisibility(id.value),
32
+ set: (newValue) =>
33
+ dataStyleStore.setMeshEdgesVisibility(id.value, newValue),
33
34
  })
34
35
  const size = computed({
35
36
  get: () => dataStyleStore.edgesSize(id.value),
36
37
  set: (newValue) => dataStyleStore.setEdgesSize(id.value, newValue),
37
38
  })
38
39
  const coloring_style_key = computed({
39
- get: () => dataStyleStore.edgesActiveColoring(id.value),
40
+ get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
40
41
  set: (newValue) => {
41
- dataStyleStore.setEdgesActiveColoring(id.value, newValue)
42
+ dataStyleStore.setMeshEdgesActiveColoring(id.value, newValue)
42
43
  },
43
44
  })
44
45
  const color = computed({
45
- get: () => dataStyleStore.edgesColor(id.value),
46
- set: (newValue) => dataStyleStore.setEdgesColor(id.value, newValue),
46
+ get: () => dataStyleStore.meshEdgesColor(id.value),
47
+ set: (newValue) => dataStyleStore.setMeshEdgesColor(id.value, newValue),
47
48
  })
48
49
  </script>
@@ -49,25 +49,26 @@
49
49
  const id = toRef(() => props.itemProps.id)
50
50
 
51
51
  const visibility = computed({
52
- get: () => dataStyleStore.pointsVisibility(id.value),
53
- set: (newValue) => dataStyleStore.setPointsVisibility(id.value, newValue),
52
+ get: () => dataStyleStore.meshPointsVisibility(id.value),
53
+ set: (newValue) =>
54
+ dataStyleStore.setMeshPointsVisibility(id.value, newValue),
54
55
  })
55
56
  const size = computed({
56
- get: () => dataStyleStore.pointsSize(id.value),
57
- set: (newValue) => dataStyleStore.setPointsSize(id.value, newValue),
57
+ get: () => dataStyleStore.meshPointsSize(id.value),
58
+ set: (newValue) => dataStyleStore.setMeshPointsSize(id.value, newValue),
58
59
  })
59
60
  const coloring_style_key = computed({
60
- get: () => dataStyleStore.pointsActiveColoring(id.value),
61
+ get: () => dataStyleStore.meshPointsActiveColoring(id.value),
61
62
  set: (newValue) =>
62
- dataStyleStore.setPointsActiveColoring(id.value, newValue),
63
+ dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
63
64
  })
64
65
  const color = computed({
65
- get: () => dataStyleStore.pointsColor(id.value),
66
- set: (newValue) => dataStyleStore.setPointsColor(id.value, newValue),
66
+ get: () => dataStyleStore.meshPointsColor(id.value),
67
+ set: (newValue) => dataStyleStore.setMeshPointsColor(id.value, newValue),
67
68
  })
68
69
  const vertex_attribute = computed({
69
- get: () => dataStyleStore.pointsVertexAttribute(id.value),
70
+ get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
70
71
  set: (newValue) =>
71
- dataStyleStore.setPointsVertexAttribute(id.value, newValue),
72
+ dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue),
72
73
  })
73
74
  </script>
@@ -32,34 +32,34 @@
32
32
  const id = toRef(() => props.itemProps.id)
33
33
 
34
34
  const visibility = computed({
35
- get: () => dataStyleStore.polygonsVisibility(id.value),
36
- set: (newValue) => dataStyleStore.setPolygonsVisibility(id.value, newValue),
35
+ get: () => dataStyleStore.meshPolygonsVisibility(id.value),
36
+ set: (newValue) =>
37
+ dataStyleStore.setMeshPolygonsVisibility(id.value, newValue),
37
38
  })
38
39
  const coloring_style_key = computed({
39
- get: () => dataStyleStore.polygonsActiveColoring(id.value),
40
+ get: () => dataStyleStore.meshPolygonsActiveColoring(id.value),
40
41
  set: (newValue) =>
41
- dataStyleStore.setPolygonsActiveColoring(id.value, newValue),
42
+ dataStyleStore.setMeshPolygonsActiveColoring(id.value, newValue),
42
43
  })
43
44
  const color = computed({
44
- get: () => dataStyleStore.polygonsColor(id.value),
45
- set: (newValue) => dataStyleStore.setPolygonsColor(id.value, newValue),
45
+ get: () => dataStyleStore.meshPolygonsColor(id.value),
46
+ set: (newValue) => dataStyleStore.setMeshPolygonsColor(id.value, newValue),
46
47
  })
47
48
  const textures = computed({
48
- get: () => dataStyleStore.polygonsTextures(id.value),
49
- set: (newValue) => dataStyleStore.setPolygonsTextures(id.value, newValue),
49
+ get: () => dataStyleStore.meshPolygonsTextures(id.value),
50
+ set: (newValue) =>
51
+ dataStyleStore.setMeshPolygonsTextures(id.value, newValue),
50
52
  })
51
53
  const vertex_attribute = computed({
52
- get: () => dataStyleStore.polygonsVertexAttribute(id.value),
54
+ get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
53
55
  set: (newValue) => {
54
- console.log("setPolygonsVertexAttribute", id.value, newValue)
55
- dataStyleStore.setPolygonsVertexAttribute(id.value, newValue)
56
+ dataStyleStore.setMeshPolygonsVertexAttribute(id.value, newValue)
56
57
  },
57
58
  })
58
59
  const polygon_attribute = computed({
59
- get: () => dataStyleStore.polygonsPolygonAttribute(id.value),
60
+ get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
60
61
  set: (newValue) => {
61
- console.log("setPolygonsPolygonAttribute", id.value, newValue)
62
- dataStyleStore.setPolygonsPolygonAttribute(id.value, newValue)
62
+ dataStyleStore.setMeshPolygonsPolygonAttribute(id.value, newValue)
63
63
  },
64
64
  })
65
65
  </script>
@@ -32,18 +32,18 @@
32
32
  const id = toRef(() => props.itemProps.id)
33
33
 
34
34
  const visibility = computed({
35
- get: () => dataStyleStore.polyhedraVisibility(id.value),
35
+ get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
36
36
  set: (newValue) =>
37
- dataStyleStore.setPolyhedraVisibility(id.value, newValue),
37
+ dataStyleStore.setMeshPolyhedraVisibility(id.value, newValue),
38
38
  })
39
39
  const coloring_style_key = computed({
40
- get: () => dataStyleStore.polyhedraActiveColoring(id.value),
40
+ get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
41
41
  set: (newValue) =>
42
- dataStyleStore.setPolyhedraActiveColoring(id.value, newValue),
42
+ dataStyleStore.setMeshPolyhedraActiveColoring(id.value, newValue),
43
43
  })
44
44
  const color = computed({
45
- get: () => dataStyleStore.polyhedraColor(id.value),
46
- set: (newValue) => dataStyleStore.setPolyhedraColor(id.value, newValue),
45
+ get: () => dataStyleStore.meshPolyhedraColor(id.value),
46
+ set: (newValue) => dataStyleStore.setMeshPolyhedraColor(id.value, newValue),
47
47
  })
48
48
  const vertex_attribute = computed({
49
49
  get: () => dataStyleStore.polyhedraVertexAttribute(id.value),
@@ -50,25 +50,26 @@
50
50
  const id = toRef(() => props.itemProps.id)
51
51
 
52
52
  const visibility = computed({
53
- get: () => dataStyleStore.pointsVisibility(id.value),
54
- set: (newValue) => dataStyleStore.setPointsVisibility(id.value, newValue),
53
+ get: () => dataStyleStore.meshPointsVisibility(id.value),
54
+ set: (newValue) =>
55
+ dataStyleStore.setMeshPointsVisibility(id.value, newValue),
55
56
  })
56
57
  const size = computed({
57
- get: () => dataStyleStore.pointsSize(id.value),
58
- set: (newValue) => dataStyleStore.setPointsSize(id.value, newValue),
58
+ get: () => dataStyleStore.meshPointsSize(id.value),
59
+ set: (newValue) => dataStyleStore.setMeshPointsSize(id.value, newValue),
59
60
  })
60
61
  const coloring_style_key = computed({
61
- get: () => dataStyleStore.pointsActiveColoring(id.value),
62
+ get: () => dataStyleStore.meshPointsActiveColoring(id.value),
62
63
  set: (newValue) =>
63
- dataStyleStore.setPointsActiveColoring(id.value, newValue),
64
+ dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
64
65
  })
65
66
  const color = computed({
66
- get: () => dataStyleStore.pointsColor(id.value),
67
- set: (newValue) => dataStyleStore.setPointsColor(id.value, newValue),
67
+ get: () => dataStyleStore.meshPointsColor(id.value),
68
+ set: (newValue) => dataStyleStore.setMeshPointsColor(id.value, newValue),
68
69
  })
69
70
  const vertex_attribute = computed({
70
- get: () => dataStyleStore.pointsVertexAttribute(id.value),
71
+ get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
71
72
  set: (newValue) =>
72
- dataStyleStore.setPointsVertexAttribute(id.value, newValue),
73
+ dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue),
73
74
  })
74
75
  </script>
@@ -9,7 +9,7 @@
9
9
  >
10
10
  <div class="scrollable-wrapper">
11
11
  <v-sheet
12
- style="max-height: calc(90vh)"
12
+ style="max-height: calc(85vh)"
13
13
  class="transparent-treeview scrollbar-hover"
14
14
  >
15
15
  <v-row v-if="treeviewStore.items.length > 0">
@@ -12,10 +12,8 @@ export function api_fetch(
12
12
  const { valid, error } = validate_schema(schema, body)
13
13
 
14
14
  if (!valid) {
15
- if (process.env.NODE_ENV === "development") {
15
+ if (process.env.NODE_ENV !== "production") {
16
16
  console.log("Bad request", error, schema, params)
17
- console.log("schema", schema)
18
- console.log("params", params)
19
17
  }
20
18
  feedback_store.add_error(400, schema.$id, "Bad request", error)
21
19
  throw new Error(schema.$id.concat(": ", error))
@@ -8,10 +8,8 @@ export function viewer_call(
8
8
  const { valid, error } = validate_schema(schema, params)
9
9
 
10
10
  if (!valid) {
11
- if (process.env.NODE_ENV === "development") {
11
+ if (process.env.NODE_ENV !== "production") {
12
12
  console.log("Bad request", error, schema, params)
13
- console.log("schema", schema)
14
- console.log("params", params)
15
13
  }
16
14
  feedback_store.add_error(400, schema.$id, "Bad request", error)
17
15
  throw new Error(schema.$id.concat(": "))
@@ -3,7 +3,7 @@ import { reactive, computed } from "vue"
3
3
  export default function useDataStyleState() {
4
4
  const styles = reactive({})
5
5
 
6
- const objectVisibility = computed(() => (id) => styles[id]?.visibility)
6
+ const objectVisibility = computed(() => (id) => styles[id].visibility)
7
7
  const selectedObjects = computed(() => {
8
8
  const selection = []
9
9
  for (const [id, value] of Object.entries(styles)) {
@@ -17,5 +17,6 @@ export default function useDataStyleState() {
17
17
  function getStyle(id) {
18
18
  return styles[id]
19
19
  }
20
+
20
21
  return { getStyle, styles, objectVisibility, selectedObjects }
21
22
  }
@@ -1,40 +1,43 @@
1
+ // Third party imports
1
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
3
  const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
3
4
 
4
5
  export function useMeshEdgesStyle() {
5
6
  const dataStyleStore = useDataStyleStore()
6
7
 
7
- function edgesStyle(id) {
8
+ function meshEdgesStyle(id) {
8
9
  return dataStyleStore.getStyle(id).edges
9
10
  }
10
11
 
11
- function edgesVisibility(id) {
12
- return edgesStyle(id).visibility
12
+ function meshEdgesVisibility(id) {
13
+ return meshEdgesStyle(id).visibility
13
14
  }
14
- function setEdgesVisibility(id, visibility) {
15
- const edges_style = edgesStyle(id)
15
+ function setMeshEdgesVisibility(id, visibility) {
16
+ const mesh_edges_style = meshEdgesStyle(id)
16
17
  return viewer_call(
17
18
  { schema: mesh_edges_schemas.visibility, params: { id, visibility } },
18
19
  {
19
20
  response_function: () => {
20
- edges_style.visibility = visibility
21
- console.log(`${setEdgesVisibility.name} ${id} ${edgesVisibility(id)}`)
21
+ mesh_edges_style.visibility = visibility
22
+ console.log(
23
+ `${setMeshEdgesVisibility.name} ${id} ${meshEdgesVisibility(id)}`,
24
+ )
22
25
  },
23
26
  },
24
27
  )
25
28
  }
26
29
 
27
- function edgesActiveColoring(id) {
28
- return edgesStyle(id).coloring.active
30
+ function meshEdgesActiveColoring(id) {
31
+ return meshEdgesStyle(id).coloring.active
29
32
  }
30
- function setEdgesActiveColoring(id, type) {
31
- const coloring = edgesStyle(id).coloring
33
+ function setMeshEdgesActiveColoring(id, type) {
34
+ const coloring = meshEdgesStyle(id).coloring
32
35
  coloring.active = type
33
36
  console.log(
34
- `${setEdgesActiveColoring.name} ${id} ${edgesActiveColoring(id)}`,
37
+ `${setMeshEdgesActiveColoring.name} ${id} ${meshEdgesActiveColoring(id)}`,
35
38
  )
36
39
  if (type === "color") {
37
- return setEdgesColor(id, coloring.color)
40
+ return setMeshEdgesColor(id, coloring.color)
38
41
  // } else if (type == "vertex" && coloring.vertex !== null) {
39
42
  // return setEdgesVertexAttribute(id, coloring.vertex)
40
43
  // } else if (type == "edges" && coloring.edges !== null) {
@@ -42,57 +45,57 @@ export function useMeshEdgesStyle() {
42
45
  } else throw new Error("Unknown edges coloring type: " + type)
43
46
  }
44
47
 
45
- function edgesColor(id) {
46
- return edgesStyle(id).coloring.color
48
+ function meshEdgesColor(id) {
49
+ return meshEdgesStyle(id).coloring.color
47
50
  }
48
- function setEdgesColor(id, color) {
49
- const coloring_style = edgesStyle(id).coloring
51
+ function setMeshEdgesColor(id, color) {
52
+ const coloring_style = meshEdgesStyle(id).coloring
50
53
  return viewer_call(
51
54
  { schema: mesh_edges_schemas.color, params: { id, color } },
52
55
  {
53
56
  response_function: () => {
54
57
  coloring_style.color = color
55
58
  console.log(
56
- `${setEdgesColor.name} ${id} ${JSON.stringify(edgesColor(id))}`,
59
+ `${setMeshEdgesColor.name} ${id} ${JSON.stringify(meshEdgesColor(id))}`,
57
60
  )
58
61
  },
59
62
  },
60
63
  )
61
64
  }
62
65
 
63
- function edgesWidth(id) {
64
- return edgesStyle(id).size
66
+ function meshEdgesWidth(id) {
67
+ return meshEdgesStyle(id).size
65
68
  }
66
- function setEdgesWidth(id, width) {
67
- const edges_style = edgesStyle(id)
69
+ function setMeshEdgesWidth(id, width) {
70
+ const edges_style = meshEdgesStyle(id)
68
71
  return viewer_call(
69
72
  { schema: mesh_edges_schemas.width, params: { id, width } },
70
73
  {
71
74
  response_function: () => {
72
75
  edges_style.width = width
73
- console.log(`${setEdgesWidth.name} ${id} ${edgesWidth(id)}`)
76
+ console.log(`${setMeshEdgesWidth.name} ${id} ${meshEdgesWidth(id)}`)
74
77
  },
75
78
  },
76
79
  )
77
80
  }
78
81
 
79
- function applyEdgesStyle(id, style) {
82
+ function applyMeshEdgesStyle(id, style) {
80
83
  return Promise.all([
81
- setEdgesVisibility(id, style.visibility),
82
- setEdgesActiveColoring(id, style.coloring.active),
83
- // setEdgesWidth(id, style.width);
84
+ setMeshEdgesVisibility(id, style.visibility),
85
+ setMeshEdgesActiveColoring(id, style.coloring.active),
86
+ // setMeshEdgesWidth(id, style.width);
84
87
  ])
85
88
  }
86
89
 
87
90
  return {
88
- applyEdgesStyle,
89
- edgesActiveColoring,
90
- edgesColor,
91
- edgesVisibility,
92
- edgesWidth,
93
- setEdgesActiveColoring,
94
- setEdgesColor,
95
- setEdgesVisibility,
96
- setEdgesWidth,
91
+ applyMeshEdgesStyle,
92
+ meshEdgesActiveColoring,
93
+ meshEdgesColor,
94
+ meshEdgesVisibility,
95
+ meshEdgesWidth,
96
+ setMeshEdgesActiveColoring,
97
+ setMeshEdgesColor,
98
+ setMeshEdgesVisibility,
99
+ setMeshEdgesWidth,
97
100
  }
98
101
  }
@@ -1,4 +1,7 @@
1
+ // Third party imports
1
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
+
4
+ // Local imports
2
5
  import { useMeshPointsStyle } from "./points.js"
3
6
  import { useMeshEdgesStyle } from "./edges.js"
4
7
  import { useMeshPolygonsStyle } from "./polygons.js"
@@ -8,8 +11,8 @@ export default function useMeshStyle() {
8
11
  const dataStyleStore = useDataStyleStore()
9
12
  const pointsStyleStore = useMeshPointsStyle()
10
13
  const edgesStyleStore = useMeshEdgesStyle()
11
- const polygonsStyleStore = useMeshPolygonsStyle()
12
- const polyhedraStyleStore = useMeshPolyhedraStyle()
14
+ const meshPolygonsStyleStore = useMeshPolygonsStyle()
15
+ const meshPolyhedraStyleStore = useMeshPolyhedraStyle()
13
16
  const hybridViewerStore = useHybridViewerStore()
14
17
 
15
18
  function meshVisibility(id) {
@@ -38,15 +41,17 @@ export default function useMeshStyle() {
38
41
  if (key == "visibility") {
39
42
  promise_array.push(setMeshVisibility(id, value))
40
43
  } else if (key == "points") {
41
- promise_array.push(pointsStyleStore.applyPointsStyle(id, value))
44
+ promise_array.push(pointsStyleStore.applyMeshPointsStyle(id, value))
42
45
  } else if (key == "edges") {
43
- promise_array.push(edgesStyleStore.applyEdgesStyle(id, value))
46
+ promise_array.push(edgesStyleStore.applyMeshEdgesStyle(id, value))
44
47
  } else if (key == "polygons") {
45
- promise_array.push(polygonsStyleStore.applyPolygonsStyle(id, value))
48
+ promise_array.push(
49
+ meshPolygonsStyleStore.applyMeshPolygonsStyle(id, value),
50
+ )
46
51
  } else if (key == "polyhedra") {
47
- promise_array.push(polyhedraStyleStore.applyPolyhedraStyle(id, value))
48
- } else {
49
- throw new Error("Unknown key: " + key)
52
+ promise_array.push(
53
+ meshPolyhedraStyleStore.applyMeshPolyhedraStyle(id, value),
54
+ )
50
55
  }
51
56
  }
52
57
  return promise_array
@@ -2,132 +2,119 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
2
2
  const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points
3
3
 
4
4
  export function useMeshPointsStyle() {
5
- /** State **/
6
5
  const dataStyleStore = useDataStyleStore()
7
6
 
8
- /** Getters **/
9
- function pointsVisibility(id) {
10
- return dataStyleStore.styles[id].points.visibility
11
- }
12
- function pointsActiveColoring(id) {
13
- return dataStyleStore.styles[id].points.coloring.active
14
- }
15
- function pointsColor(id) {
16
- return dataStyleStore.styles[id].points.coloring.color
17
- }
18
- function pointsVertexAttribute(id) {
19
- return dataStyleStore.styles[id].points.coloring.vertex
20
- }
21
- function pointsSize(id) {
22
- return dataStyleStore.styles[id].points.size
7
+ function meshPointsStyle(id) {
8
+ return dataStyleStore.getStyle(id).points
23
9
  }
24
10
 
25
- /** Actions **/
26
- function setPointsVisibility(id, visibility) {
11
+ function meshPointsVisibility(id) {
12
+ return meshPointsStyle(id).visibility
13
+ }
14
+ function setMeshPointsVisibility(id, visibility) {
15
+ const points_style = meshPointsStyle(id)
27
16
  return viewer_call(
28
- {
29
- schema: mesh_points_schemas.visibility,
30
- params: { id, visibility },
31
- },
17
+ { schema: mesh_points_schemas.visibility, params: { id, visibility } },
32
18
  {
33
19
  response_function: () => {
34
- dataStyleStore.styles[id].points.visibility = visibility
20
+ points_style.visibility = visibility
35
21
  console.log(
36
- "setPointsVisibility",
37
- dataStyleStore.styles[id].points.visibility,
22
+ `${setMeshPointsVisibility.name} ${id} ${meshPointsVisibility(id)}`,
38
23
  )
39
24
  },
40
25
  },
41
26
  )
42
27
  }
43
28
 
44
- function setPointsColor(id, color) {
29
+ function meshPointsActiveColoring(id) {
30
+ return meshPointsStyle(id).coloring.active
31
+ }
32
+ function setMeshPointsActiveColoring(id, type) {
33
+ const coloring = meshPointsStyle(id).coloring
34
+ coloring.active = type
35
+ console.log(
36
+ `${setMeshPointsActiveColoring.name} ${id} ${meshPointsActiveColoring(id)}`,
37
+ )
38
+ if (type == "color") {
39
+ return dataStyleStore.setMeshPointsColor(id, coloring.color)
40
+ } else if (type == "vertex" && coloring.vertex !== null) {
41
+ return dataStyleStore.setMeshPointsVertexAttribute(id, coloring.vertex)
42
+ } else throw new Error("Unknown points coloring type: " + type)
43
+ }
44
+
45
+ function meshPointsColor(id) {
46
+ return meshPointsStyle(id).coloring.color
47
+ }
48
+ function setMeshPointsColor(id, color) {
49
+ const coloring_style = meshPointsStyle(id).coloring
45
50
  return viewer_call(
46
- {
47
- schema: viewer_schemas.opengeodeweb_viewer.mesh.points.color,
48
- params: { id, color },
49
- },
51
+ { schema: mesh_points_schemas.color, params: { id, color } },
50
52
  {
51
53
  response_function: () => {
52
- dataStyleStore.styles[id].points.coloring.color = color
54
+ coloring_style.color = color
53
55
  console.log(
54
- "setPointsColor",
55
- dataStyleStore.styles[id].points.coloring.color,
56
+ `${setMeshPointsColor.name} ${id} ${JSON.stringify(meshPointsColor(id))}`,
56
57
  )
57
58
  },
58
59
  },
59
60
  )
60
61
  }
61
- function setPointsVertexAttribute(id, vertex_attribute) {
62
+ function meshPointsVertexAttribute(id) {
63
+ return meshPointsStyle(id).coloring.vertex
64
+ }
65
+ function setMeshPointsVertexAttribute(id, vertex_attribute) {
66
+ const coloring_style = meshPointsStyle(id).coloring
62
67
  return viewer_call(
63
68
  {
64
- schema: viewer_schemas.opengeodeweb_viewer.mesh.points.vertex_attribute,
69
+ schema: mesh_points_schemas.vertex_attribute,
65
70
  params: { id, ...vertex_attribute },
66
71
  },
67
72
  {
68
73
  response_function: () => {
69
- dataStyleStore.styles[id].points.coloring.vertex = vertex_attribute
74
+ coloring_style.vertex = vertex_attribute
70
75
  console.log(
71
- "setPointsVertexAttribute",
72
- dataStyleStore.styles[id].points.coloring.vertex,
76
+ `${setMeshPointsVertexAttribute.name} ${id} ${meshPointsVertexAttribute(id)}`,
73
77
  )
74
78
  },
75
79
  },
76
80
  )
77
81
  }
78
- function setPointsSize(id, size) {
82
+
83
+ function meshPointsSize(id) {
84
+ return meshPointsStyle(id).size
85
+ }
86
+ function setMeshPointsSize(id, size) {
87
+ const points_style = meshPointsStyle(id)
79
88
  return viewer_call(
80
- {
81
- schema: viewer_schemas.opengeodeweb_viewer.mesh.points.size,
82
- params: { id, size },
83
- },
89
+ { schema: mesh_points_schemas.size, params: { id, size } },
84
90
  {
85
91
  response_function: () => {
86
- dataStyleStore.styles[id].points.size = size
87
- console.log("setPointsSize", dataStyleStore.styles[id].points.size)
92
+ points_style.size = size
93
+ console.log(`${setMeshPointsSize.name} ${id} ${meshPointsSize(id)}`)
88
94
  },
89
95
  },
90
96
  )
91
97
  }
92
98
 
93
- function setPointsActiveColoring(id, type) {
94
- if (type == "color")
95
- dataStyleStore.setPointsColor(
96
- id,
97
- dataStyleStore.styles[id].points.coloring.color,
98
- )
99
- else if (type == "vertex") {
100
- const vertex = dataStyleStore.styles[id].points.coloring.vertex
101
- if (vertex !== null) dataStyleStore.setPointsVertexAttribute(id, vertex)
102
- } else throw new Error("Unknown edges coloring type: " + type)
103
- dataStyleStore.styles[id].points.coloring.active = type
104
- console.log(
105
- "setPointsActiveColoring",
106
- dataStyleStore.styles[id].points.coloring.active,
107
- )
108
- }
109
-
110
- function applyPointsStyle(id, style) {
99
+ function applyMeshPointsStyle(id, style) {
111
100
  return Promise.all([
112
- setPointsVisibility(id, style.visibility),
113
- setPointsActiveColoring(id, style.coloring.active),
114
- setPointsSize(id, style.size),
101
+ setMeshPointsVisibility(id, style.visibility),
102
+ setMeshPointsActiveColoring(id, style.coloring.active),
103
+ setMeshPointsSize(id, style.size),
115
104
  ])
116
105
  }
117
106
 
118
107
  return {
119
- pointsVisibility,
120
- pointsActiveColoring,
121
- pointsColor,
122
- pointsVertexAttribute,
123
- pointsSize,
124
- setPointsVisibility,
125
- setPointsActiveColoring,
126
- setPointsColor,
127
- setPointsVertexAttribute,
128
- setPointsSize,
129
- applyPointsStyle,
108
+ meshPointsVisibility,
109
+ meshPointsActiveColoring,
110
+ meshPointsColor,
111
+ meshPointsVertexAttribute,
112
+ meshPointsSize,
113
+ setMeshPointsVisibility,
114
+ setMeshPointsActiveColoring,
115
+ setMeshPointsColor,
116
+ setMeshPointsVertexAttribute,
117
+ setMeshPointsSize,
118
+ applyMeshPointsStyle,
130
119
  }
131
120
  }
132
-
133
- export default useMeshPointsStyle