@geode/opengeodeweb-front 9.9.0 → 9.10.0-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 (85) hide show
  1. package/assets/viewer_svgs/edged_curve_edges.svg +67 -0
  2. package/assets/viewer_svgs/edged_curve_points.svg +95 -0
  3. package/assets/viewer_svgs/grid_2d_cells.svg +78 -0
  4. package/assets/viewer_svgs/grid_2d_edges.svg +71 -0
  5. package/assets/viewer_svgs/grid_2d_points.svg +108 -0
  6. package/assets/viewer_svgs/grid_3d_cells.svg +76 -0
  7. package/assets/viewer_svgs/grid_3d_edges.svg +72 -0
  8. package/assets/viewer_svgs/grid_3d_facets.svg +102 -0
  9. package/assets/viewer_svgs/grid_3d_points.svg +172 -0
  10. package/assets/viewer_svgs/point_set_points.svg +86 -0
  11. package/assets/viewer_svgs/solid_edges.svg +96 -0
  12. package/assets/viewer_svgs/solid_facets.svg +119 -0
  13. package/assets/viewer_svgs/solid_points.svg +134 -0
  14. package/assets/viewer_svgs/solid_polyhedra.svg +103 -0
  15. package/assets/viewer_svgs/surface_edges.svg +73 -0
  16. package/assets/viewer_svgs/surface_points.svg +115 -0
  17. package/assets/viewer_svgs/surface_triangles.svg +92 -0
  18. package/components/ContextMenu.vue +123 -0
  19. package/components/ContextMenuItem.vue +90 -0
  20. package/components/HybridRenderingView.vue +41 -0
  21. package/components/VeaseViewToolbar.vue +107 -0
  22. package/components/Viewer/BreadCrumb.vue +61 -0
  23. package/components/Viewer/EdgedCurve/EdgesOptions.vue +14 -0
  24. package/components/Viewer/EdgedCurve/PointsOptions.vue +14 -0
  25. package/components/Viewer/Generic/Mesh/EdgesOptions.vue +48 -0
  26. package/components/Viewer/Generic/Mesh/PointsOptions.vue +73 -0
  27. package/components/Viewer/Generic/Mesh/PolygonsOptions.vue +65 -0
  28. package/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +58 -0
  29. package/components/Viewer/Generic/Model/EdgesOptions.vue +29 -0
  30. package/components/Viewer/Generic/Model/PointsOptions.vue +53 -0
  31. package/components/Viewer/Grid/2D/CellsOptions.vue +15 -0
  32. package/components/Viewer/Grid/2D/EdgesOptions.vue +14 -0
  33. package/components/Viewer/Grid/2D/PointsOptions.vue +14 -0
  34. package/components/Viewer/Grid/3D/CellsOptions.vue +15 -0
  35. package/components/Viewer/Grid/3D/EdgesOptions.vue +14 -0
  36. package/components/Viewer/Grid/3D/FacetsOptions.vue +15 -0
  37. package/components/Viewer/Grid/3D/PointsOptions.vue +14 -0
  38. package/components/Viewer/HybridSolid/EdgesOptions.vue +14 -0
  39. package/components/Viewer/HybridSolid/PointsOptions.vue +14 -0
  40. package/components/Viewer/HybridSolid/PolygonsOptions.vue +14 -0
  41. package/components/Viewer/HybridSolid/PolyhedraOptions.vue +14 -0
  42. package/components/Viewer/Options/ColorPicker.vue +25 -0
  43. package/components/Viewer/Options/ColoringTypeSelector.vue +125 -0
  44. package/components/Viewer/Options/PolygonAttributeSelector.vue +59 -0
  45. package/components/Viewer/Options/PolyhedronAttributeSelector.vue +63 -0
  46. package/components/Viewer/Options/TextureItem.vue +116 -0
  47. package/components/Viewer/Options/TexturesSelector.vue +67 -0
  48. package/components/Viewer/Options/VertexAttributeSelector.vue +60 -0
  49. package/components/Viewer/Options/VisibilitySwitch.vue +14 -0
  50. package/components/Viewer/PointSet/PointsOptions.vue +14 -0
  51. package/components/Viewer/PointSet/SpecificPointsOptions.vue +74 -0
  52. package/components/Viewer/PolygonalSurface/EdgesOptions.vue +14 -0
  53. package/components/Viewer/PolygonalSurface/PointsOptions.vue +14 -0
  54. package/components/Viewer/PolygonalSurface/PolygonsOptions.vue +14 -0
  55. package/components/Viewer/Solid/EdgesOptions.vue +14 -0
  56. package/components/Viewer/Solid/PointsOptions.vue +14 -0
  57. package/components/Viewer/Solid/PolygonsOptions.vue +14 -0
  58. package/components/Viewer/Solid/PolyhedraOptions.vue +14 -0
  59. package/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +15 -0
  60. package/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +15 -0
  61. package/components/Viewer/Tree/ObjectTree.vue +170 -0
  62. package/components/Viewer/TreeComponent.vue +93 -0
  63. package/components/Viewer/TreeObject.vue +100 -0
  64. package/components/Viewer/TriangulatedSurface/EdgesOptions.vue +14 -0
  65. package/components/Viewer/TriangulatedSurface/PointsOptions.vue +14 -0
  66. package/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +15 -0
  67. package/internal_stores/data_style_state.js +18 -0
  68. package/internal_stores/mesh/edges.js +106 -0
  69. package/internal_stores/mesh/index.js +50 -0
  70. package/internal_stores/mesh/points.js +131 -0
  71. package/internal_stores/mesh/polygons.js +159 -0
  72. package/internal_stores/mesh/polyhedra.js +136 -0
  73. package/internal_stores/model/blocks.js +60 -0
  74. package/internal_stores/model/corners.js +63 -0
  75. package/internal_stores/model/edges.js +47 -0
  76. package/internal_stores/model/index.js +154 -0
  77. package/internal_stores/model/lines.js +81 -0
  78. package/internal_stores/model/points.js +61 -0
  79. package/internal_stores/model/surfaces.js +60 -0
  80. package/package.json +1 -1
  81. package/stores/data_base.js +148 -0
  82. package/stores/data_style.js +57 -0
  83. package/stores/hybrid_viewer.js +193 -0
  84. package/stores/menu.js +182 -0
  85. package/stores/treeview.js +64 -0
@@ -0,0 +1,106 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
3
+
4
+ export function useMeshEdgesStyle() {
5
+ /** State **/
6
+ const dataStyleStore = useDataStyleStore()
7
+
8
+ /** Getters **/
9
+ function edgesVisibility(id) {
10
+ return dataStyleStore.styles[id].edges.visibility
11
+ }
12
+ function edgesActiveColoring(id) {
13
+ return dataStyleStore.styles[id].edges.coloring.active
14
+ }
15
+ function edgesColor(id) {
16
+ return dataStyleStore.styles[id].edges.coloring.color
17
+ }
18
+ function edgesSize(id) {
19
+ return dataStyleStore.styles[id].edges.size
20
+ }
21
+
22
+ /** Actions **/
23
+ function setEdgesVisibility(id, visibility) {
24
+ viewer_call(
25
+ {
26
+ schema: mesh_edges_schemas.visibility,
27
+ params: { id, visibility },
28
+ },
29
+ {
30
+ response_function: () => {
31
+ dataStyleStore.styles[id].edges.visibility = visibility
32
+ console.log(
33
+ "setEdgesVisibility",
34
+ dataStyleStore.styles[id].edges.visibility,
35
+ )
36
+ },
37
+ },
38
+ )
39
+ }
40
+ function setEdgesActiveColoring(id, type) {
41
+ if (type == "color")
42
+ setEdgesColor(id, dataStyleStore.styles[id].edges.coloring.color)
43
+ else if (type == "vertex") {
44
+ const vertex = dataStyleStore.styles[id].edges.coloring.vertex
45
+ if (vertex !== null) setEdgesVertexAttribute(id, vertex)
46
+ } else if (type == "edges") {
47
+ const edges = dataStyleStore.styles[id].edges.coloring.edges
48
+ if (edges !== null) setEdgesEdgeAttribute(id, edges)
49
+ } else throw new Error("Unknown edges coloring type: " + type)
50
+ dataStyleStore.styles[id].edges.coloring.active = type
51
+ console.log(
52
+ "setEdgesActiveColoring",
53
+ dataStyleStore.styles[id].edges.coloring.active,
54
+ )
55
+ }
56
+
57
+ function setEdgesColor(id, color) {
58
+ viewer_call(
59
+ {
60
+ schema: mesh_edges_schemas.color,
61
+ params: { id, color },
62
+ },
63
+ {
64
+ response_function: () => {
65
+ dataStyleStore.styles[id].edges.coloring.color = color
66
+ console.log(
67
+ "setEdgesColor",
68
+ dataStyleStore.styles[id].edges.coloring.color,
69
+ )
70
+ },
71
+ },
72
+ )
73
+ }
74
+ function setEdgesSize(id, size) {
75
+ viewer_call(
76
+ {
77
+ schema: mesh_edges_schemas.size,
78
+ params: { id, size },
79
+ },
80
+ {
81
+ response_function: () => {
82
+ dataStyleStore.styles[id].edges.size = size
83
+ console.log("setEdgesSize", dataStyleStore.styles[id].edges.size)
84
+ },
85
+ },
86
+ )
87
+ }
88
+
89
+ function applyEdgesStyle(id, style) {
90
+ setEdgesVisibility(id, style.visibility)
91
+ setEdgesActiveColoring(id, style.coloring.active)
92
+ // setEdgesSize(id, style.size);
93
+ }
94
+
95
+ return {
96
+ edgesVisibility,
97
+ edgesActiveColoring,
98
+ edgesColor,
99
+ edgesSize,
100
+ setEdgesVisibility,
101
+ setEdgesActiveColoring,
102
+ setEdgesColor,
103
+ setEdgesSize,
104
+ applyEdgesStyle,
105
+ }
106
+ }
@@ -0,0 +1,50 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ import { useMeshPointsStyle } from "./points.js"
3
+ import { useMeshEdgesStyle } from "./edges.js"
4
+ import { useMeshPolygonsStyle } from "./polygons.js"
5
+ import { useMeshPolyhedraStyle } from "./polyhedra.js"
6
+
7
+ export default function useMeshStyle() {
8
+ const dataStyleStore = useDataStyleStore()
9
+ const pointsStyleStore = useMeshPointsStyle()
10
+ const edgesStyleStore = useMeshEdgesStyle()
11
+ const polygonsStyleStore = useMeshPolygonsStyle()
12
+ const polyhedraStyleStore = useMeshPolyhedraStyle()
13
+
14
+ function setMeshVisibility(id, visibility) {
15
+ viewer_call(
16
+ {
17
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.visibility,
18
+ params: { id, visibility },
19
+ },
20
+ {
21
+ response_function: () => {
22
+ dataStyleStore.styles[id].visibility = visibility
23
+ console.log("setMeshVisibility", dataStyleStore.styles[id].visibility)
24
+ },
25
+ },
26
+ )
27
+ }
28
+
29
+ function applyMeshDefaultStyle(id) {
30
+ const id_style = dataStyleStore.styles[id]
31
+ for (const [key, value] of Object.entries(id_style)) {
32
+ if (key == "visibility") setMeshVisibility(id, value)
33
+ else if (key == "points") pointsStyleStore.applyPointsStyle(id, value)
34
+ else if (key == "edges") edgesStyleStore.applyEdgesStyle(id, value)
35
+ else if (key == "polygons")
36
+ polygonsStyleStore.applyPolygonsStyle(id, value)
37
+ else if (key == "polyhedra")
38
+ polyhedraStyleStore.applyPolyhedraStyle(id, value)
39
+ }
40
+ }
41
+
42
+ return {
43
+ setMeshVisibility,
44
+ applyMeshDefaultStyle,
45
+ ...useMeshPointsStyle(),
46
+ ...useMeshEdgesStyle(),
47
+ ...useMeshPolygonsStyle(),
48
+ ...useMeshPolyhedraStyle(),
49
+ }
50
+ }
@@ -0,0 +1,131 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points
3
+
4
+ export function useMeshPointsStyle() {
5
+ /** State **/
6
+ const dataStyleStore = useDataStyleStore()
7
+
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
23
+ }
24
+
25
+ /** Actions **/
26
+ function setPointsVisibility(id, visibility) {
27
+ viewer_call(
28
+ {
29
+ schema: mesh_points_schemas.visibility,
30
+ params: { id, visibility },
31
+ },
32
+ {
33
+ response_function: () => {
34
+ dataStyleStore.styles[id].points.visibility = visibility
35
+ console.log(
36
+ "setPointsVisibility",
37
+ dataStyleStore.styles[id].points.visibility,
38
+ )
39
+ },
40
+ },
41
+ )
42
+ }
43
+
44
+ function setPointsColor(id, color) {
45
+ viewer_call(
46
+ {
47
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.points.color,
48
+ params: { id, color },
49
+ },
50
+ {
51
+ response_function: () => {
52
+ dataStyleStore.styles[id].points.coloring.color = color
53
+ console.log(
54
+ "setPointsColor",
55
+ dataStyleStore.styles[id].points.coloring.color,
56
+ )
57
+ },
58
+ },
59
+ )
60
+ }
61
+ function setPointsVertexAttribute(id, vertex_attribute) {
62
+ viewer_call(
63
+ {
64
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.points.vertex_attribute,
65
+ params: { id, ...vertex_attribute },
66
+ },
67
+ {
68
+ response_function: () => {
69
+ dataStyleStore.styles[id].points.coloring.vertex = vertex_attribute
70
+ console.log(
71
+ "setPointsVertexAttribute",
72
+ dataStyleStore.styles[id].points.coloring.vertex,
73
+ )
74
+ },
75
+ },
76
+ )
77
+ }
78
+ function setPointsSize(id, size) {
79
+ viewer_call(
80
+ {
81
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.points.size,
82
+ params: { id, size },
83
+ },
84
+ {
85
+ response_function: () => {
86
+ dataStyleStore.styles[id].points.size = size
87
+ console.log("setPointsSize", dataStyleStore.styles[id].points.size)
88
+ },
89
+ },
90
+ )
91
+ }
92
+
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) {
111
+ setPointsVisibility(id, style.visibility)
112
+ setPointsActiveColoring(id, style.coloring.active)
113
+ setPointsSize(id, style.size)
114
+ }
115
+
116
+ return {
117
+ pointsVisibility,
118
+ pointsActiveColoring,
119
+ pointsColor,
120
+ pointsVertexAttribute,
121
+ pointsSize,
122
+ setPointsVisibility,
123
+ setPointsActiveColoring,
124
+ setPointsColor,
125
+ setPointsVertexAttribute,
126
+ setPointsSize,
127
+ applyPointsStyle,
128
+ }
129
+ }
130
+
131
+ export default useMeshPointsStyle
@@ -0,0 +1,159 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ const mesh_polygons_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons
3
+
4
+ export function useMeshPolygonsStyle() {
5
+ /** State **/
6
+ const dataStyleStore = useDataStyleStore()
7
+
8
+ /** Getters **/
9
+ function polygonsVisibility(id) {
10
+ return dataStyleStore.styles[id].polygons.visibility
11
+ }
12
+ function polygonsActiveColoring(id) {
13
+ return dataStyleStore.styles[id].polygons.coloring.active
14
+ }
15
+ function polygonsColor(id) {
16
+ return dataStyleStore.styles[id].polygons.coloring.color
17
+ }
18
+ function polygonsTextures(id) {
19
+ return dataStyleStore.styles[id].polygons.coloring.textures
20
+ }
21
+ function polygonsPolygonAttribute(id) {
22
+ return dataStyleStore.styles[id].polygons.coloring.polygon
23
+ }
24
+ function polygonsVertexAttribute(id) {
25
+ return dataStyleStore.styles[id].polygons.coloring.vertex
26
+ }
27
+
28
+ /** Actions **/
29
+ function setPolygonsVisibility(id, visibility) {
30
+ viewer_call(
31
+ {
32
+ schema: mesh_polygons_schemas.visibility,
33
+ params: { id, visibility },
34
+ },
35
+ {
36
+ response_function: () => {
37
+ dataStyleStore.styles[id].polygons.visibility = visibility
38
+ console.log(
39
+ "setPolygonsVisibility",
40
+ dataStyleStore.styles[id].polygons.visibility,
41
+ )
42
+ },
43
+ },
44
+ )
45
+ }
46
+ function setPolygonsActiveColoring(id, type) {
47
+ console.log("setPolygonsActiveColoring", id, type)
48
+ if (type == "color") {
49
+ setPolygonsColor(id, dataStyleStore.styles[id].polygons.coloring.color)
50
+ } else if (type == "textures") {
51
+ const textures = dataStyleStore.styles[id].polygons.coloring.textures
52
+ if (textures !== null) setPolygonsTextures(id, textures)
53
+ } else if (type == "vertex") {
54
+ const vertex = dataStyleStore.styles[id].polygons.coloring.vertex
55
+ if (vertex !== null) {
56
+ console.log("vertex", vertex)
57
+ setPolygonsVertexAttribute(id, vertex)
58
+ }
59
+ } else if (type == "polygon") {
60
+ const polygon = dataStyleStore.styles[id].polygons.coloring.polygon
61
+ if (polygon !== null) setPolygonsPolygonAttribute(id, polygon)
62
+ } else throw new Error("Unknown polygons coloring type: " + type)
63
+ dataStyleStore.styles[id].polygons.coloring.active = type
64
+ console.log(
65
+ "setPolygonsActiveColoring",
66
+ dataStyleStore.styles[id].polygons.coloring.active,
67
+ )
68
+ }
69
+ function setPolygonsColor(id, color) {
70
+ viewer_call(
71
+ {
72
+ schema: mesh_polygons_schemas.color,
73
+ params: { id, color },
74
+ },
75
+ {
76
+ response_function: () => {
77
+ dataStyleStore.styles[id].polygons.coloring.color = color
78
+ console.log(
79
+ "setPolygonsColor",
80
+ dataStyleStore.styles[id].polygons.coloring.color,
81
+ )
82
+ },
83
+ },
84
+ )
85
+ }
86
+ function setPolygonsTextures(id, textures) {
87
+ viewer_call(
88
+ {
89
+ schema: viewer_schemas.opengeodeweb_viewer.mesh.apply_textures,
90
+ params: { id, textures },
91
+ },
92
+ {
93
+ response_function: () => {
94
+ dataStyleStore.styles[id].polygons.coloring.textures = textures
95
+ console.log(
96
+ "setPolygonsTextures",
97
+ dataStyleStore.styles[id].polygons.coloring.textures,
98
+ )
99
+ },
100
+ },
101
+ )
102
+ }
103
+ function setPolygonsVertexAttribute(id, vertex_attribute) {
104
+ viewer_call(
105
+ {
106
+ schema: mesh_polygons_schemas.vertex_attribute,
107
+ params: { id, ...vertex_attribute },
108
+ },
109
+ {
110
+ response_function: () => {
111
+ dataStyleStore.styles[id].polygons.coloring.vertex = vertex_attribute
112
+ console.log(
113
+ "setPolygonsVertexAttribute",
114
+ dataStyleStore.styles[id].polygons.coloring.vertex,
115
+ )
116
+ },
117
+ },
118
+ )
119
+ }
120
+ function setPolygonsPolygonAttribute(id, polygon_attribute) {
121
+ viewer_call(
122
+ {
123
+ schema: mesh_polygons_schemas.polygon_attribute,
124
+ params: { id, ...polygon_attribute },
125
+ },
126
+ {
127
+ response_function: () => {
128
+ dataStyleStore.styles[id].polygons.coloring.polygon =
129
+ polygon_attribute
130
+ console.log(
131
+ "setPolygonsPolygonAttribute",
132
+ dataStyleStore.styles[id].polygons.coloring.polygon,
133
+ )
134
+ },
135
+ },
136
+ )
137
+ }
138
+
139
+ function applyPolygonsStyle(id, style) {
140
+ setPolygonsVisibility(id, style.visibility)
141
+ setPolygonsActiveColoring(id, style.coloring.active)
142
+ }
143
+
144
+ return {
145
+ polygonsVisibility,
146
+ polygonsActiveColoring,
147
+ polygonsColor,
148
+ polygonsTextures,
149
+ polygonsPolygonAttribute,
150
+ polygonsVertexAttribute,
151
+ setPolygonsVisibility,
152
+ setPolygonsActiveColoring,
153
+ setPolygonsColor,
154
+ setPolygonsTextures,
155
+ setPolygonsVertexAttribute,
156
+ setPolygonsPolygonAttribute,
157
+ applyPolygonsStyle,
158
+ }
159
+ }
@@ -0,0 +1,136 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ const mesh_polyhedra_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra
3
+
4
+ export function useMeshPolyhedraStyle() {
5
+ /** State **/
6
+ const dataStyleStore = useDataStyleStore()
7
+
8
+ /** Getters **/
9
+ function polyhedraVisibility(id) {
10
+ return dataStyleStore.styles[id].polyhedra.visibility
11
+ }
12
+ function polyhedraActiveColoring(id) {
13
+ return dataStyleStore.styles[id].polyhedra.coloring.active
14
+ }
15
+ function polyhedraColor(id) {
16
+ return dataStyleStore.styles[id].polyhedra.coloring.color
17
+ }
18
+ function polyhedraVertexAttribute(id) {
19
+ return dataStyleStore.styles[id].polyhedra.coloring.vertex
20
+ }
21
+ function polyhedraPolygonAttribute(id) {
22
+ return dataStyleStore.styles[id].polyhedra.coloring.polygon
23
+ }
24
+ function polyhedraPolyhedronAttribute(id) {
25
+ return dataStyleStore.styles[id].polyhedra.coloring.polyhedron
26
+ }
27
+
28
+ /** Actions **/
29
+ function setPolyhedraVisibility(id, visibility) {
30
+ viewer_call(
31
+ {
32
+ schema: mesh_polyhedra_schemas.visibility,
33
+ params: { id, visibility },
34
+ },
35
+ {
36
+ response_function: () => {
37
+ dataStyleStore.styles[id].polyhedra.visibility = visibility
38
+ console.log(
39
+ "setPolyhedraVisibility",
40
+ dataStyleStore.styles[id].polyhedra.visibility,
41
+ )
42
+ },
43
+ },
44
+ )
45
+ }
46
+ function setPolyhedraActiveColoring(id, type) {
47
+ if (type == "color")
48
+ setPolyhedraColor(id, dataStyleStore.styles[id].polyhedra.coloring.color)
49
+ else if (type == "vertex") {
50
+ const vertex = dataStyleStore.styles[id].polyhedra.coloring.vertex
51
+ if (vertex !== null) setPolyhedraVertexAttribute(id, vertex)
52
+ } else if (type == "polyhedron") {
53
+ const polyhedron = dataStyleStore.styles[id].polyhedra.coloring.polyhedron
54
+ if (polyhedron !== null) setPolyhedraPolyhedronAttribute(id, polyhedron)
55
+ } else throw new Error("Unknown polyhedra coloring type: " + type)
56
+ dataStyleStore.styles[id].polyhedra.coloring.active = type
57
+ console.log(
58
+ "setPolyhedraActiveColoring",
59
+ dataStyleStore.styles[id].polyhedra.coloring.active,
60
+ )
61
+ }
62
+ function setPolyhedraColor(id, color) {
63
+ viewer_call(
64
+ {
65
+ schema: mesh_polyhedra_schemas.color,
66
+ params: { id, color },
67
+ },
68
+ {
69
+ response_function: () => {
70
+ dataStyleStore.styles[id].polyhedra.coloring.color = color
71
+ console.log(
72
+ "setPolyhedraColor",
73
+ dataStyleStore.styles[id].polyhedra.coloring.color,
74
+ )
75
+ },
76
+ },
77
+ )
78
+ }
79
+
80
+ function setPolyhedraVertexAttribute(id, vertex_attribute) {
81
+ viewer_call(
82
+ {
83
+ schema: mesh_polyhedra_schemas.vertex_attribute,
84
+ params: { id, ...vertex_attribute },
85
+ },
86
+ {
87
+ response_function: () => {
88
+ dataStyleStore.styles[id].polyhedra.coloring.vertex = vertex_attribute
89
+ console.log(
90
+ "setPolyhedraVertexAttribute",
91
+ dataStyleStore.styles[id].polyhedra.coloring.vertex,
92
+ )
93
+ },
94
+ },
95
+ )
96
+ }
97
+
98
+ function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) {
99
+ viewer_call(
100
+ {
101
+ schema: mesh_polyhedra_schemas.polyhedron_attribute,
102
+ params: { id, ...polyhedron_attribute },
103
+ },
104
+ {
105
+ response_function: () => {
106
+ dataStyleStore.styles[id].polyhedra.coloring.polyhedron =
107
+ polyhedron_attribute
108
+ console.log(
109
+ "setPolyhedraPolyhedronAttribute",
110
+ dataStyleStore.styles[id].polyhedra.coloring.polyhedron,
111
+ )
112
+ },
113
+ },
114
+ )
115
+ }
116
+
117
+ function applyPolyhedraStyle(id, style) {
118
+ setPolyhedraVisibility(id, style.visibility)
119
+ setPolyhedraActiveColoring(id, style.coloring.active)
120
+ }
121
+
122
+ return {
123
+ polyhedraVisibility,
124
+ polyhedraActiveColoring,
125
+ polyhedraColor,
126
+ polyhedraVertexAttribute,
127
+ polyhedraPolygonAttribute,
128
+ polyhedraPolyhedronAttribute,
129
+ setPolyhedraVisibility,
130
+ setPolyhedraActiveColoring,
131
+ setPolyhedraColor,
132
+ setPolyhedraVertexAttribute,
133
+ setPolyhedraPolyhedronAttribute,
134
+ applyPolyhedraStyle,
135
+ }
136
+ }
@@ -0,0 +1,60 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ import _ from "lodash"
3
+ const blocks_schemas = viewer_schemas.opengeodeweb_viewer.model.blocks
4
+
5
+ export function useBlocksStyle() {
6
+ /** State **/
7
+ const dataStyleStore = useDataStyleStore()
8
+ const dataBaseStore = useDataBaseStore()
9
+
10
+ /** Getters **/
11
+ function blockVisibility(id, block_id) {
12
+ return dataStyleStore.styles[id].blocks[block_id].visibility
13
+ }
14
+
15
+ /** Actions **/
16
+ function setBlockVisibility(id, block_ids, visibility) {
17
+ const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids)
18
+ viewer_call(
19
+ {
20
+ schema: blocks_schemas.visibility,
21
+ params: { id, block_ids: block_flat_indexes, visibility },
22
+ },
23
+ {
24
+ response_function: () => {
25
+ for (const block_id of block_ids) {
26
+ if (!dataStyleStore.styles[id].blocks[block_id])
27
+ dataStyleStore.styles[id].blocks[block_id] = {}
28
+ dataStyleStore.styles[id].blocks[block_id].visibility = visibility
29
+ }
30
+ console.log("setBlockVisibility", block_ids, visibility)
31
+ },
32
+ },
33
+ )
34
+ }
35
+
36
+ function setBlocksDefaultStyle(id) {
37
+ const block_ids = dataBaseStore.getBlocksUuids(id)
38
+ setBlockVisibility(
39
+ id,
40
+ block_ids,
41
+ dataStyleStore.styles[id].blocks.visibility,
42
+ )
43
+ }
44
+
45
+ function applyBlocksStyle(id) {
46
+ const blocks = dataStyleStore.styles[id].blocks
47
+ for (const [block_id, style] of Object.entries(blocks)) {
48
+ setBlockVisibility(id, [block_id], style.visibility)
49
+ }
50
+ }
51
+
52
+ return {
53
+ blockVisibility,
54
+ setBlocksDefaultStyle,
55
+ setBlockVisibility,
56
+ applyBlocksStyle,
57
+ }
58
+ }
59
+
60
+ export default useBlocksStyle
@@ -0,0 +1,63 @@
1
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
2
+ const corners_schemas = viewer_schemas.opengeodeweb_viewer.model.corners
3
+
4
+ export function useCornersStyle() {
5
+ /** State **/
6
+ const dataStyleStore = useDataStyleStore()
7
+ const dataBaseStore = useDataBaseStore()
8
+
9
+ /** Getters **/
10
+ function cornerVisibility(id, corner_id) {
11
+ return dataStyleStore.styles[id].corners[corner_id].visibility
12
+ }
13
+
14
+ /** Actions **/
15
+ function setCornerVisibility(id, corner_ids, visibility) {
16
+ const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
17
+ viewer_call(
18
+ {
19
+ schema: corners_schemas.visibility,
20
+ params: { id, block_ids: corner_flat_indexes, visibility },
21
+ },
22
+ {
23
+ response_function: () => {
24
+ for (const corner_id of corner_ids) {
25
+ if (!dataStyleStore.styles[id].corners[corner_id])
26
+ dataStyleStore.styles[id].corners[corner_id] = {}
27
+ dataStyleStore.styles[id].corners[corner_id].visibility = visibility
28
+ }
29
+ console.log("setCornerVisibility", corner_ids, visibility)
30
+ },
31
+ },
32
+ )
33
+ }
34
+
35
+ function setCornersDefaultStyle(id) {
36
+ const corner_ids = dataBaseStore.getCornersUuids(id)
37
+ console.log(
38
+ "dataStyleStore.styles[id].corners.visibility",
39
+ dataStyleStore.styles[id].corners.visibility,
40
+ )
41
+ setCornerVisibility(
42
+ id,
43
+ corner_ids,
44
+ dataStyleStore.styles[id].corners.visibility,
45
+ )
46
+ }
47
+
48
+ function applyCornersStyle(id) {
49
+ const corners = dataStyleStore.styles[id].corners
50
+ for (const [corner_id, style] of Object.entries(corners)) {
51
+ setCornerVisibility(id, [corner_id], style.visibility)
52
+ }
53
+ }
54
+
55
+ return {
56
+ cornerVisibility,
57
+ setCornersDefaultStyle,
58
+ setCornerVisibility,
59
+ applyCornersStyle,
60
+ }
61
+ }
62
+
63
+ export default useCornersStyle