@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.
- package/components/Step.vue +10 -0
- package/components/Viewer/Generic/Mesh/EdgesOptions.vue +7 -6
- package/components/Viewer/Generic/Mesh/PointsOptions.vue +11 -10
- package/components/Viewer/Generic/Mesh/PolygonsOptions.vue +14 -14
- package/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
- package/components/Viewer/PointSet/SpecificPointsOptions.vue +11 -10
- package/components/Viewer/Tree/ObjectTree.vue +1 -1
- package/composables/api_fetch.js +1 -3
- package/composables/viewer_call.js +1 -3
- package/internal_stores/data_style_state.js +2 -1
- package/internal_stores/mesh/edges.js +39 -36
- package/internal_stores/mesh/index.js +13 -8
- package/internal_stores/mesh/points.js +66 -79
- package/internal_stores/mesh/polygons.js +80 -88
- package/internal_stores/mesh/polyhedra.js +111 -99
- package/internal_stores/model/blocks.js +0 -2
- package/internal_stores/model/corners.js +0 -2
- package/internal_stores/model/lines.js +0 -2
- package/internal_stores/model/surfaces.js +0 -2
- package/package.json +2 -2
- package/stores/data_base.js +1 -3
- package/stores/data_style.js +7 -5
- package/stores/infra.js +4 -6
- package/stores/treeview.js +7 -0
- package/tests/integration/data/uploads/test.og_psf3d +0 -0
- package/tests/integration/data/uploads/test.og_rgd3d +0 -0
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/setup.js +111 -0
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +77 -0
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +79 -0
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +78 -0
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +78 -0
- package/tests/integration/utils.js +35 -0
- package/tests/unit/utils/validate_schema.nuxt.test.js +1 -2
- package/tests/vitest.config.js +1 -0
- package/utils/local.js +42 -43
- package/tests/integration/data/fake_id/edged_curve.vtp +0 -20
- package/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +0 -215
package/components/Step.vue
CHANGED
|
@@ -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.
|
|
32
|
-
set: (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.
|
|
40
|
+
get: () => dataStyleStore.meshEdgesActiveColoring(id.value),
|
|
40
41
|
set: (newValue) => {
|
|
41
|
-
dataStyleStore.
|
|
42
|
+
dataStyleStore.setMeshEdgesActiveColoring(id.value, newValue)
|
|
42
43
|
},
|
|
43
44
|
})
|
|
44
45
|
const color = computed({
|
|
45
|
-
get: () => dataStyleStore.
|
|
46
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
53
|
-
set: (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.
|
|
57
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
61
|
+
get: () => dataStyleStore.meshPointsActiveColoring(id.value),
|
|
61
62
|
set: (newValue) =>
|
|
62
|
-
dataStyleStore.
|
|
63
|
+
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
|
|
63
64
|
})
|
|
64
65
|
const color = computed({
|
|
65
|
-
get: () => dataStyleStore.
|
|
66
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
70
|
+
get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
|
|
70
71
|
set: (newValue) =>
|
|
71
|
-
dataStyleStore.
|
|
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.
|
|
36
|
-
set: (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.
|
|
40
|
+
get: () => dataStyleStore.meshPolygonsActiveColoring(id.value),
|
|
40
41
|
set: (newValue) =>
|
|
41
|
-
dataStyleStore.
|
|
42
|
+
dataStyleStore.setMeshPolygonsActiveColoring(id.value, newValue),
|
|
42
43
|
})
|
|
43
44
|
const color = computed({
|
|
44
|
-
get: () => dataStyleStore.
|
|
45
|
-
set: (newValue) => dataStyleStore.
|
|
45
|
+
get: () => dataStyleStore.meshPolygonsColor(id.value),
|
|
46
|
+
set: (newValue) => dataStyleStore.setMeshPolygonsColor(id.value, newValue),
|
|
46
47
|
})
|
|
47
48
|
const textures = computed({
|
|
48
|
-
get: () => dataStyleStore.
|
|
49
|
-
set: (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.
|
|
54
|
+
get: () => dataStyleStore.meshPolygonsVertexAttribute(id.value),
|
|
53
55
|
set: (newValue) => {
|
|
54
|
-
|
|
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.
|
|
60
|
+
get: () => dataStyleStore.meshPolygonsPolygonAttribute(id.value),
|
|
60
61
|
set: (newValue) => {
|
|
61
|
-
|
|
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.
|
|
35
|
+
get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
|
|
36
36
|
set: (newValue) =>
|
|
37
|
-
dataStyleStore.
|
|
37
|
+
dataStyleStore.setMeshPolyhedraVisibility(id.value, newValue),
|
|
38
38
|
})
|
|
39
39
|
const coloring_style_key = computed({
|
|
40
|
-
get: () => dataStyleStore.
|
|
40
|
+
get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
|
|
41
41
|
set: (newValue) =>
|
|
42
|
-
dataStyleStore.
|
|
42
|
+
dataStyleStore.setMeshPolyhedraActiveColoring(id.value, newValue),
|
|
43
43
|
})
|
|
44
44
|
const color = computed({
|
|
45
|
-
get: () => dataStyleStore.
|
|
46
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
54
|
-
set: (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.
|
|
58
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
62
|
+
get: () => dataStyleStore.meshPointsActiveColoring(id.value),
|
|
62
63
|
set: (newValue) =>
|
|
63
|
-
dataStyleStore.
|
|
64
|
+
dataStyleStore.setMeshPointsActiveColoring(id.value, newValue),
|
|
64
65
|
})
|
|
65
66
|
const color = computed({
|
|
66
|
-
get: () => dataStyleStore.
|
|
67
|
-
set: (newValue) => dataStyleStore.
|
|
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.
|
|
71
|
+
get: () => dataStyleStore.meshPointsVertexAttribute(id.value),
|
|
71
72
|
set: (newValue) =>
|
|
72
|
-
dataStyleStore.
|
|
73
|
+
dataStyleStore.setMeshPointsVertexAttribute(id.value, newValue),
|
|
73
74
|
})
|
|
74
75
|
</script>
|
package/composables/api_fetch.js
CHANGED
|
@@ -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
|
|
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
|
|
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]
|
|
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
|
|
8
|
+
function meshEdgesStyle(id) {
|
|
8
9
|
return dataStyleStore.getStyle(id).edges
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
function
|
|
12
|
-
return
|
|
12
|
+
function meshEdgesVisibility(id) {
|
|
13
|
+
return meshEdgesStyle(id).visibility
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
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
|
-
|
|
21
|
-
console.log(
|
|
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
|
|
28
|
-
return
|
|
30
|
+
function meshEdgesActiveColoring(id) {
|
|
31
|
+
return meshEdgesStyle(id).coloring.active
|
|
29
32
|
}
|
|
30
|
-
function
|
|
31
|
-
const coloring =
|
|
33
|
+
function setMeshEdgesActiveColoring(id, type) {
|
|
34
|
+
const coloring = meshEdgesStyle(id).coloring
|
|
32
35
|
coloring.active = type
|
|
33
36
|
console.log(
|
|
34
|
-
`${
|
|
37
|
+
`${setMeshEdgesActiveColoring.name} ${id} ${meshEdgesActiveColoring(id)}`,
|
|
35
38
|
)
|
|
36
39
|
if (type === "color") {
|
|
37
|
-
return
|
|
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
|
|
46
|
-
return
|
|
48
|
+
function meshEdgesColor(id) {
|
|
49
|
+
return meshEdgesStyle(id).coloring.color
|
|
47
50
|
}
|
|
48
|
-
function
|
|
49
|
-
const coloring_style =
|
|
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
|
-
`${
|
|
59
|
+
`${setMeshEdgesColor.name} ${id} ${JSON.stringify(meshEdgesColor(id))}`,
|
|
57
60
|
)
|
|
58
61
|
},
|
|
59
62
|
},
|
|
60
63
|
)
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
function
|
|
64
|
-
return
|
|
66
|
+
function meshEdgesWidth(id) {
|
|
67
|
+
return meshEdgesStyle(id).size
|
|
65
68
|
}
|
|
66
|
-
function
|
|
67
|
-
const edges_style =
|
|
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(`${
|
|
76
|
+
console.log(`${setMeshEdgesWidth.name} ${id} ${meshEdgesWidth(id)}`)
|
|
74
77
|
},
|
|
75
78
|
},
|
|
76
79
|
)
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
function
|
|
82
|
+
function applyMeshEdgesStyle(id, style) {
|
|
80
83
|
return Promise.all([
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
12
|
-
const
|
|
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.
|
|
44
|
+
promise_array.push(pointsStyleStore.applyMeshPointsStyle(id, value))
|
|
42
45
|
} else if (key == "edges") {
|
|
43
|
-
promise_array.push(edgesStyleStore.
|
|
46
|
+
promise_array.push(edgesStyleStore.applyMeshEdgesStyle(id, value))
|
|
44
47
|
} else if (key == "polygons") {
|
|
45
|
-
promise_array.push(
|
|
48
|
+
promise_array.push(
|
|
49
|
+
meshPolygonsStyleStore.applyMeshPolygonsStyle(id, value),
|
|
50
|
+
)
|
|
46
51
|
} else if (key == "polyhedra") {
|
|
47
|
-
promise_array.push(
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
20
|
+
points_style.visibility = visibility
|
|
35
21
|
console.log(
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
54
|
+
coloring_style.color = color
|
|
53
55
|
console.log(
|
|
54
|
-
|
|
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
|
|
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:
|
|
69
|
+
schema: mesh_points_schemas.vertex_attribute,
|
|
65
70
|
params: { id, ...vertex_attribute },
|
|
66
71
|
},
|
|
67
72
|
{
|
|
68
73
|
response_function: () => {
|
|
69
|
-
|
|
74
|
+
coloring_style.vertex = vertex_attribute
|
|
70
75
|
console.log(
|
|
71
|
-
|
|
72
|
-
dataStyleStore.styles[id].points.coloring.vertex,
|
|
76
|
+
`${setMeshPointsVertexAttribute.name} ${id} ${meshPointsVertexAttribute(id)}`,
|
|
73
77
|
)
|
|
74
78
|
},
|
|
75
79
|
},
|
|
76
80
|
)
|
|
77
81
|
}
|
|
78
|
-
|
|
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
|
-
|
|
87
|
-
console.log(
|
|
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
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|