@geode/opengeodeweb-front 10.0.0-rc.1 → 10.0.1-rc.1
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/app/components/CrsSelector.vue +3 -3
- package/app/components/ExtensionSelector.vue +3 -3
- package/app/components/FileSelector.vue +1 -2
- package/app/components/Inspector/InspectionButton.vue +4 -4
- package/app/components/MissingFilesSelector.vue +3 -3
- package/app/components/ObjectSelector.vue +5 -4
- package/app/components/Viewer/BreadCrumb.vue +1 -1
- package/app/components/Viewer/ContextMenu.vue +2 -2
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +81 -0
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +2 -2
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +2 -2
- package/app/components/Viewer/Options/CellAttributeSelector.vue +52 -0
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +15 -1
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +2 -2
- package/app/components/Viewer/Options/TextureItem.vue +1 -1
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +5 -8
- package/app/components/Viewer/TreeObject.vue +2 -2
- package/app/composables/project_manager.js +1 -10
- package/app/stores/data_base.js +7 -14
- package/app/stores/data_style.js +11 -11
- package/app/stores/feedback.js +1 -1
- package/app/stores/hybrid_viewer.js +1 -1
- package/app/stores/menu.js +1 -1
- package/app/stores/treeview.js +4 -4
- package/app/stores/viewer.js +2 -3
- package/app/utils/default_styles.js +43 -7
- package/app/utils/file_import_workflow.js +16 -20
- package/app/utils/local.js +4 -0
- package/internal_stores/mesh/cells.js +176 -0
- package/internal_stores/mesh/index.js +9 -4
- package/internal_stores/mesh/polygons.js +12 -3
- package/package.json +1 -1
- package/tests/integration/data/uploads/test.og_psf3d +0 -0
- package/tests/integration/data/uploads/test.og_rgd2d +0 -0
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +142 -0
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +16 -14
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +15 -14
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +65 -14
- package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +2 -2
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/components/ObjectSelector.nuxt.test.js +3 -3
- package/tests/unit/components/Step.nuxt.test.js +4 -4
- package/tests/unit/components/Stepper.nuxt.test.js +4 -4
- package/tests/unit/components/Wrapper.nuxt.test.js +4 -4
- package/tests/unit/composables/ProjectManager.nuxt.test.js +15 -18
- package/tests/unit/plugins/project_load.nuxt.test.js +6 -6
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
const points_defaultVisibility = true
|
|
4
4
|
const edges_defaultVisibility = true
|
|
5
|
+
const cells_defaultVisibility = true
|
|
5
6
|
const polygons_defaultVisibility = true
|
|
6
7
|
const polyhedra_defaultVisibility = true
|
|
7
8
|
const points_defaultSize = 10
|
|
8
9
|
const points_defaultColor = { r: 20, g: 20, b: 20 }
|
|
9
10
|
const edges_defaultSize = 5
|
|
10
11
|
const edges_defaultColor = { r: 20, g: 20, b: 20 }
|
|
12
|
+
const cells_defaultColor = { r: 255, g: 255, b: 255 }
|
|
11
13
|
const polygons_defaultColor = { r: 255, g: 255, b: 255 }
|
|
12
14
|
const polyhedra_defaultColor = { r: 255, g: 255, b: 255 }
|
|
13
15
|
|
|
@@ -52,6 +54,22 @@ const meshEdgesDefaultStyle = (
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
const meshCellsDefaultStyle = (
|
|
58
|
+
visibility = cells_defaultVisibility,
|
|
59
|
+
color = cells_defaultColor,
|
|
60
|
+
) => {
|
|
61
|
+
return {
|
|
62
|
+
visibility,
|
|
63
|
+
coloring: {
|
|
64
|
+
active: "color",
|
|
65
|
+
cell: null,
|
|
66
|
+
color,
|
|
67
|
+
textures: null,
|
|
68
|
+
vertex: null,
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
const meshPolygonsDefaultStyle = (
|
|
56
74
|
visibility = polygons_defaultVisibility,
|
|
57
75
|
color = polygons_defaultColor,
|
|
@@ -93,14 +111,32 @@ const pointSet_defaultStyle = () => {
|
|
|
93
111
|
const edgedCurve_defaultStyle = () => {
|
|
94
112
|
return {
|
|
95
113
|
visibility: true,
|
|
96
|
-
points: meshPointsDefaultStyle(
|
|
114
|
+
points: meshPointsDefaultStyle(),
|
|
97
115
|
edges: meshEdgesDefaultStyle(),
|
|
98
116
|
}
|
|
99
117
|
}
|
|
100
118
|
|
|
101
|
-
const
|
|
119
|
+
const grid2d_defaultStyle = () => {
|
|
102
120
|
return {
|
|
103
|
-
visibility,
|
|
121
|
+
visibility: true,
|
|
122
|
+
points: meshPointsDefaultStyle(false),
|
|
123
|
+
edges: meshEdgesDefaultStyle(false),
|
|
124
|
+
cells: meshCellsDefaultStyle(),
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const grid3d_defaultStyle = () => {
|
|
129
|
+
return {
|
|
130
|
+
visibility: true,
|
|
131
|
+
points: meshPointsDefaultStyle(false),
|
|
132
|
+
edges: meshEdgesDefaultStyle(false),
|
|
133
|
+
cells: meshCellsDefaultStyle(),
|
|
134
|
+
polyhedra: meshPolyhedraDefaultStyle(),
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const surface_defaultStyle = () => {
|
|
138
|
+
return {
|
|
139
|
+
visibility: true,
|
|
104
140
|
points: meshPointsDefaultStyle(false),
|
|
105
141
|
edges: meshEdgesDefaultStyle(false),
|
|
106
142
|
polygons: meshPolygonsDefaultStyle(),
|
|
@@ -231,8 +267,8 @@ const default_styles = () => {
|
|
|
231
267
|
HybridSolid3D: solid_defaultStyle(),
|
|
232
268
|
ImplicitCrossSection: implicitCrossSection_defaultStyle(),
|
|
233
269
|
ImplicitStructuralModel: implicitStructuralModel_defaultStyle(),
|
|
234
|
-
LightRegularGrid2D:
|
|
235
|
-
LightRegularGrid3D:
|
|
270
|
+
LightRegularGrid2D: grid2d_defaultStyle(),
|
|
271
|
+
LightRegularGrid3D: grid3d_defaultStyle(),
|
|
236
272
|
PointSet2D: pointSet_defaultStyle(),
|
|
237
273
|
PointSet3D: pointSet_defaultStyle(),
|
|
238
274
|
PolygonalSurface2D: surface_defaultStyle(),
|
|
@@ -240,8 +276,8 @@ const default_styles = () => {
|
|
|
240
276
|
PolyhedralSolid3D: solid_defaultStyle(),
|
|
241
277
|
RasterImage2D: {},
|
|
242
278
|
RasterImage3D: {},
|
|
243
|
-
RegularGrid2D:
|
|
244
|
-
RegularGrid3D:
|
|
279
|
+
RegularGrid2D: grid2d_defaultStyle(),
|
|
280
|
+
RegularGrid3D: grid3d_defaultStyle(),
|
|
245
281
|
Section: section_defaultStyle(),
|
|
246
282
|
StructuralModel: structuralModel_defaultStyle(),
|
|
247
283
|
TetrahedralSolid3D: solid_defaultStyle(),
|
|
@@ -8,9 +8,9 @@ async function importWorkflow(files) {
|
|
|
8
8
|
console.log("importWorkflow", { files })
|
|
9
9
|
const promise_array = []
|
|
10
10
|
for (const file of files) {
|
|
11
|
-
const { filename,
|
|
12
|
-
console.log({ filename }, {
|
|
13
|
-
promise_array.push(importFile(filename,
|
|
11
|
+
const { filename, geode_object_type } = file
|
|
12
|
+
console.log({ filename }, { geode_object_type })
|
|
13
|
+
promise_array.push(importFile(filename, geode_object_type))
|
|
14
14
|
}
|
|
15
15
|
const results = await Promise.all(promise_array)
|
|
16
16
|
const hybridViewerStore = useHybridViewerStore()
|
|
@@ -18,15 +18,10 @@ async function importWorkflow(files) {
|
|
|
18
18
|
return results
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function buildImportItemFromPayloadApi(value,
|
|
21
|
+
function buildImportItemFromPayloadApi(value, geode_object_type) {
|
|
22
|
+
console.log("buildImportItemFromPayloadApi", { value, geode_object_type })
|
|
22
23
|
return {
|
|
23
|
-
|
|
24
|
-
object_type: value.object_type,
|
|
25
|
-
geode_object,
|
|
26
|
-
native_filename: value.native_file_name,
|
|
27
|
-
viewable_filename: value.viewable_file_name,
|
|
28
|
-
displayed_name: value.name,
|
|
29
|
-
vtk_js: { binary_light_viewable: value.binary_light_viewable },
|
|
24
|
+
...value,
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
|
|
@@ -41,16 +36,16 @@ async function importItem(item) {
|
|
|
41
36
|
})
|
|
42
37
|
|
|
43
38
|
await treeviewStore.addItem(
|
|
44
|
-
item.
|
|
45
|
-
item.
|
|
39
|
+
item.geode_object_type,
|
|
40
|
+
item.name,
|
|
46
41
|
item.id,
|
|
47
|
-
item.
|
|
42
|
+
item.viewer_type,
|
|
48
43
|
)
|
|
49
44
|
|
|
50
45
|
await hybridViewerStore.addItem(item.id)
|
|
51
|
-
await dataStyleStore.addDataStyle(item.id, item.
|
|
46
|
+
await dataStyleStore.addDataStyle(item.id, item.geode_object_type)
|
|
52
47
|
|
|
53
|
-
if (item.
|
|
48
|
+
if (item.viewer_type === "model") {
|
|
54
49
|
await Promise.all([
|
|
55
50
|
dataBaseStore.fetchMeshComponents(item.id),
|
|
56
51
|
dataBaseStore.fetchUuidToFlatIndexDict(item.id),
|
|
@@ -61,18 +56,19 @@ async function importItem(item) {
|
|
|
61
56
|
return item.id
|
|
62
57
|
}
|
|
63
58
|
|
|
64
|
-
async function importFile(filename,
|
|
59
|
+
async function importFile(filename, geode_object_type) {
|
|
65
60
|
const { data } = await api_fetch({
|
|
66
61
|
schema: back_schemas.opengeodeweb_back.save_viewable_file,
|
|
67
62
|
params: {
|
|
68
|
-
|
|
69
|
-
filename
|
|
63
|
+
geode_object_type,
|
|
64
|
+
filename,
|
|
70
65
|
},
|
|
71
66
|
})
|
|
72
67
|
|
|
73
68
|
console.log("data.value", data.value)
|
|
69
|
+
console.log("data.value", data._value)
|
|
74
70
|
|
|
75
|
-
const item = buildImportItemFromPayloadApi(data.
|
|
71
|
+
const item = buildImportItemFromPayloadApi(data.value, geode_object_type)
|
|
76
72
|
return importItem(item)
|
|
77
73
|
}
|
|
78
74
|
|
package/app/utils/local.js
CHANGED
|
@@ -142,6 +142,9 @@ async function run_back(
|
|
|
142
142
|
"--allowed_origin http://localhost:*",
|
|
143
143
|
"--timeout " + 0,
|
|
144
144
|
]
|
|
145
|
+
if (process.env.NODE_ENV === "development") {
|
|
146
|
+
back_args.push("--debug")
|
|
147
|
+
}
|
|
145
148
|
console.log("run_back", executable_name, executable_path, back_args)
|
|
146
149
|
await run_script(
|
|
147
150
|
executable_name,
|
|
@@ -294,6 +297,7 @@ async function run_browser(
|
|
|
294
297
|
|
|
295
298
|
const nuxt_process = child_process.spawn("npm", ["run", script_name], {
|
|
296
299
|
shell: true,
|
|
300
|
+
FORCE_COLOR: true,
|
|
297
301
|
})
|
|
298
302
|
|
|
299
303
|
return new Promise((resolve) => {
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// Third party imports
|
|
2
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
|
|
3
|
+
|
|
4
|
+
// Local constants
|
|
5
|
+
const mesh_cells_schemas = viewer_schemas.opengeodeweb_viewer.mesh.cells
|
|
6
|
+
|
|
7
|
+
export function useMeshCellsStyle() {
|
|
8
|
+
const dataStyleStore = useDataStyleStore()
|
|
9
|
+
|
|
10
|
+
function meshCellsStyle(id) {
|
|
11
|
+
return dataStyleStore.getStyle(id).cells
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function meshCellsVisibility(id) {
|
|
15
|
+
return meshCellsStyle(id).visibility
|
|
16
|
+
}
|
|
17
|
+
function setMeshCellsVisibility(id, visibility) {
|
|
18
|
+
const cells_style = meshCellsStyle(id)
|
|
19
|
+
return viewer_call(
|
|
20
|
+
{ schema: mesh_cells_schemas.visibility, params: { id, visibility } },
|
|
21
|
+
{
|
|
22
|
+
response_function: () => {
|
|
23
|
+
cells_style.visibility = visibility
|
|
24
|
+
console.log(
|
|
25
|
+
setMeshCellsVisibility.name,
|
|
26
|
+
{ id },
|
|
27
|
+
meshCellsVisibility(id),
|
|
28
|
+
)
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function meshCellsColor(id) {
|
|
35
|
+
return meshCellsStyle(id).coloring.color
|
|
36
|
+
}
|
|
37
|
+
function setMeshCellsColor(id, color) {
|
|
38
|
+
const coloring_style = meshCellsStyle(id).coloring
|
|
39
|
+
return viewer_call(
|
|
40
|
+
{ schema: mesh_cells_schemas.color, params: { id, color } },
|
|
41
|
+
{
|
|
42
|
+
response_function: () => {
|
|
43
|
+
coloring_style.color = color
|
|
44
|
+
console.log(
|
|
45
|
+
setMeshCellsColor.name,
|
|
46
|
+
{ id },
|
|
47
|
+
JSON.stringify(meshCellsColor(id)),
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function meshCellsTextures(id) {
|
|
55
|
+
return meshCellsStyle(id).coloring.textures
|
|
56
|
+
}
|
|
57
|
+
function setMeshCellsTextures(id, textures) {
|
|
58
|
+
const coloring_style = meshCellsStyle(id).coloring
|
|
59
|
+
return viewer_call(
|
|
60
|
+
{
|
|
61
|
+
schema: mesh_cells_schemas.apply_textures,
|
|
62
|
+
params: { id, textures },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
response_function: () => {
|
|
66
|
+
coloring_style.textures = textures
|
|
67
|
+
console.log(setMeshCellsTextures.name, { id }, meshCellsTextures(id))
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function meshCellsVertexAttribute(id) {
|
|
74
|
+
return meshCellsStyle(id).coloring.vertex
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function setMeshCellsVertexAttribute(id, vertex_attribute) {
|
|
78
|
+
const coloring_style = meshCellsStyle(id).coloring
|
|
79
|
+
return viewer_call(
|
|
80
|
+
{
|
|
81
|
+
schema: mesh_cells_schemas.vertex_attribute,
|
|
82
|
+
params: { id, ...vertex_attribute },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
response_function: () => {
|
|
86
|
+
coloring_style.vertex = vertex_attribute
|
|
87
|
+
console.log(
|
|
88
|
+
setMeshCellsVertexAttribute.name,
|
|
89
|
+
{ id },
|
|
90
|
+
meshCellsVertexAttribute(id),
|
|
91
|
+
)
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function meshCellsCellAttribute(id) {
|
|
98
|
+
return meshCellsStyle(id).coloring.cell
|
|
99
|
+
}
|
|
100
|
+
function setMeshCellsCellAttribute(id, cell_attribute) {
|
|
101
|
+
const coloring_style = meshCellsStyle(id).coloring
|
|
102
|
+
return viewer_call(
|
|
103
|
+
{
|
|
104
|
+
schema: mesh_cells_schemas.cell_attribute,
|
|
105
|
+
params: { id, ...cell_attribute },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
response_function: () => {
|
|
109
|
+
coloring_style.cell = cell_attribute
|
|
110
|
+
console.log(
|
|
111
|
+
setMeshCellsCellAttribute.name,
|
|
112
|
+
{ id },
|
|
113
|
+
meshCellsCellAttribute(id),
|
|
114
|
+
)
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function meshCellsActiveColoring(id) {
|
|
121
|
+
return meshCellsStyle(id).coloring.active
|
|
122
|
+
}
|
|
123
|
+
function setMeshCellsActiveColoring(id, type) {
|
|
124
|
+
const coloring = meshCellsStyle(id).coloring
|
|
125
|
+
coloring.active = type
|
|
126
|
+
console.log(
|
|
127
|
+
setMeshCellsActiveColoring.name,
|
|
128
|
+
{ id },
|
|
129
|
+
meshCellsActiveColoring(id),
|
|
130
|
+
)
|
|
131
|
+
if (type === "color") {
|
|
132
|
+
return setMeshCellsColor(id, coloring.color)
|
|
133
|
+
} else if (type === "textures") {
|
|
134
|
+
if (coloring.textures === null) {
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
return setMeshCellsTextures(id, coloring.textures)
|
|
138
|
+
} else if (type === "vertex") {
|
|
139
|
+
if (coloring.vertex === null) {
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
return setMeshCellsVertexAttribute(id, coloring.vertex)
|
|
143
|
+
} else if (type === "cell") {
|
|
144
|
+
if (coloring.cell === null) {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
return setMeshCellsCellAttribute(id, coloring.cell)
|
|
148
|
+
} else {
|
|
149
|
+
throw new Error("Unknown mesh cells coloring type: " + type)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function applyMeshCellsStyle(id) {
|
|
154
|
+
const style = meshCellsStyle(id)
|
|
155
|
+
return Promise.all([
|
|
156
|
+
setMeshCellsVisibility(id, style.visibility),
|
|
157
|
+
setMeshCellsActiveColoring(id, style.coloring.active),
|
|
158
|
+
])
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
meshCellsVisibility,
|
|
163
|
+
meshCellsActiveColoring,
|
|
164
|
+
meshCellsColor,
|
|
165
|
+
meshCellsTextures,
|
|
166
|
+
meshCellsCellAttribute,
|
|
167
|
+
meshCellsVertexAttribute,
|
|
168
|
+
setMeshCellsVisibility,
|
|
169
|
+
setMeshCellsActiveColoring,
|
|
170
|
+
setMeshCellsColor,
|
|
171
|
+
setMeshCellsTextures,
|
|
172
|
+
setMeshCellsVertexAttribute,
|
|
173
|
+
setMeshCellsCellAttribute,
|
|
174
|
+
applyMeshCellsStyle,
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -4,6 +4,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
4
4
|
// Local imports
|
|
5
5
|
import { useMeshPointsStyle } from "./points.js"
|
|
6
6
|
import { useMeshEdgesStyle } from "./edges.js"
|
|
7
|
+
import { useMeshCellsStyle } from "./cells.js"
|
|
7
8
|
import { useMeshPolygonsStyle } from "./polygons.js"
|
|
8
9
|
import { useMeshPolyhedraStyle } from "./polyhedra.js"
|
|
9
10
|
|
|
@@ -12,8 +13,9 @@ const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh
|
|
|
12
13
|
|
|
13
14
|
export default function useMeshStyle() {
|
|
14
15
|
const dataStyleStore = useDataStyleStore()
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
const meshPointsStyleStore = useMeshPointsStyle()
|
|
17
|
+
const meshEdgesStyleStore = useMeshEdgesStyle()
|
|
18
|
+
const meshCellsStyleStore = useMeshCellsStyle()
|
|
17
19
|
const meshPolygonsStyleStore = useMeshPolygonsStyle()
|
|
18
20
|
const meshPolyhedraStyleStore = useMeshPolyhedraStyle()
|
|
19
21
|
const hybridViewerStore = useHybridViewerStore()
|
|
@@ -44,9 +46,11 @@ export default function useMeshStyle() {
|
|
|
44
46
|
if (key === "visibility") {
|
|
45
47
|
promise_array.push(setMeshVisibility(id, value))
|
|
46
48
|
} else if (key === "points") {
|
|
47
|
-
promise_array.push(
|
|
49
|
+
promise_array.push(meshPointsStyleStore.applyMeshPointsStyle(id))
|
|
48
50
|
} else if (key === "edges") {
|
|
49
|
-
promise_array.push(
|
|
51
|
+
promise_array.push(meshEdgesStyleStore.applyMeshEdgesStyle(id))
|
|
52
|
+
} else if (key === "cells") {
|
|
53
|
+
promise_array.push(meshCellsStyleStore.applyMeshCellsStyle(id))
|
|
50
54
|
} else if (key === "polygons") {
|
|
51
55
|
promise_array.push(meshPolygonsStyleStore.applyMeshPolygonsStyle(id))
|
|
52
56
|
} else if (key === "polyhedra") {
|
|
@@ -64,6 +68,7 @@ export default function useMeshStyle() {
|
|
|
64
68
|
applyMeshStyle,
|
|
65
69
|
...useMeshPointsStyle(),
|
|
66
70
|
...useMeshEdgesStyle(),
|
|
71
|
+
...useMeshCellsStyle(),
|
|
67
72
|
...useMeshPolygonsStyle(),
|
|
68
73
|
...useMeshPolyhedraStyle(),
|
|
69
74
|
}
|
|
@@ -134,11 +134,20 @@ export function useMeshPolygonsStyle() {
|
|
|
134
134
|
)
|
|
135
135
|
if (type === "color") {
|
|
136
136
|
return setMeshPolygonsColor(id, coloring.color)
|
|
137
|
-
} else if (type === "textures"
|
|
137
|
+
} else if (type === "textures") {
|
|
138
|
+
if (coloring.textures === null) {
|
|
139
|
+
return
|
|
140
|
+
}
|
|
138
141
|
return setMeshPolygonsTextures(id, coloring.textures)
|
|
139
|
-
} else if (type === "vertex"
|
|
142
|
+
} else if (type === "vertex") {
|
|
143
|
+
if (coloring.vertex === null) {
|
|
144
|
+
return
|
|
145
|
+
}
|
|
140
146
|
return setMeshPolygonsVertexAttribute(id, coloring.vertex)
|
|
141
|
-
} else if (type === "polygon"
|
|
147
|
+
} else if (type === "polygon") {
|
|
148
|
+
if (coloring.polygon === null) {
|
|
149
|
+
return
|
|
150
|
+
}
|
|
142
151
|
return setMeshPolygonsPolygonAttribute(id, coloring.polygon)
|
|
143
152
|
} else {
|
|
144
153
|
throw new Error("Unknown mesh polygons coloring type: " + type)
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
41
41
|
"type": "module",
|
|
42
|
-
"version": "10.0.
|
|
42
|
+
"version": "10.0.1-rc.1",
|
|
43
43
|
"main": "./nuxt.config.js",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@geode/opengeodeweb-back": "next",
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Third party imports
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
4
|
+
|
|
5
|
+
// Local imports
|
|
6
|
+
import Status from "@ogw_front/utils/status"
|
|
7
|
+
import {
|
|
8
|
+
delete_folder_recursive,
|
|
9
|
+
kill_back,
|
|
10
|
+
kill_viewer,
|
|
11
|
+
} from "@ogw_front/utils/local"
|
|
12
|
+
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
|
+
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
|
+
|
|
15
|
+
// Local constants
|
|
16
|
+
const mesh_cells_schemas = viewer_schemas.opengeodeweb_viewer.mesh.cells
|
|
17
|
+
const file_name = "test.og_rgd2d"
|
|
18
|
+
const geode_object = "RegularGrid2D"
|
|
19
|
+
|
|
20
|
+
let id, back_port, viewer_port, project_folder_path
|
|
21
|
+
|
|
22
|
+
beforeEach(async () => {
|
|
23
|
+
;({ id, back_port, viewer_port, project_folder_path } =
|
|
24
|
+
await setupIntegrationTests(file_name, geode_object))
|
|
25
|
+
}, 20000)
|
|
26
|
+
|
|
27
|
+
afterEach(async () => {
|
|
28
|
+
console.log(
|
|
29
|
+
"afterEach mesh cells kill",
|
|
30
|
+
back_port,
|
|
31
|
+
viewer_port,
|
|
32
|
+
project_folder_path,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
|
|
36
|
+
delete_folder_recursive(project_folder_path)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
describe("Mesh cells", () => {
|
|
40
|
+
describe("Cells visibility", () => {
|
|
41
|
+
test("Visibility true", async () => {
|
|
42
|
+
const dataStyleStore = useDataStyleStore()
|
|
43
|
+
const viewerStore = useViewerStore()
|
|
44
|
+
const visibility = true
|
|
45
|
+
const spy = vi.spyOn(composables, "viewer_call")
|
|
46
|
+
await dataStyleStore.setMeshCellsVisibility(id, visibility)
|
|
47
|
+
expect(spy).toHaveBeenCalledWith(
|
|
48
|
+
{
|
|
49
|
+
schema: mesh_cells_schemas.visibility,
|
|
50
|
+
params: { id, visibility },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
response_function: expect.any(Function),
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
expect(dataStyleStore.meshCellsVisibility(id)).toBe(visibility)
|
|
57
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
describe("Cells color", () => {
|
|
62
|
+
test("Color red", async () => {
|
|
63
|
+
const dataStyleStore = useDataStyleStore()
|
|
64
|
+
const viewerStore = useViewerStore()
|
|
65
|
+
const color = { r: 255, g: 0, b: 0 }
|
|
66
|
+
const spy = vi.spyOn(composables, "viewer_call")
|
|
67
|
+
await dataStyleStore.setMeshCellsColor(id, color)
|
|
68
|
+
expect(spy).toHaveBeenCalledWith(
|
|
69
|
+
{
|
|
70
|
+
schema: mesh_cells_schemas.color,
|
|
71
|
+
params: { id, color },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
response_function: expect.any(Function),
|
|
75
|
+
},
|
|
76
|
+
)
|
|
77
|
+
expect(dataStyleStore.meshCellsColor(id)).toStrictEqual(color)
|
|
78
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe("Cells vertex attribute", () => {
|
|
83
|
+
test("Coloring vertex attribute", async () => {
|
|
84
|
+
const dataStyleStore = useDataStyleStore()
|
|
85
|
+
const viewerStore = useViewerStore()
|
|
86
|
+
const vertex_attribute = { name: "points" }
|
|
87
|
+
const spy = vi.spyOn(composables, "viewer_call")
|
|
88
|
+
await dataStyleStore.setMeshCellsVertexAttribute(id, vertex_attribute)
|
|
89
|
+
expect(spy).toHaveBeenCalledWith(
|
|
90
|
+
{
|
|
91
|
+
schema: mesh_cells_schemas.vertex_attribute,
|
|
92
|
+
params: { id, ...vertex_attribute },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
response_function: expect.any(Function),
|
|
96
|
+
},
|
|
97
|
+
)
|
|
98
|
+
expect(dataStyleStore.meshCellsVertexAttribute(id)).toStrictEqual(
|
|
99
|
+
vertex_attribute,
|
|
100
|
+
)
|
|
101
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
describe("Cells cell attribute", () => {
|
|
106
|
+
test("Coloring cell attribute", async () => {
|
|
107
|
+
const dataStyleStore = useDataStyleStore()
|
|
108
|
+
const viewerStore = useViewerStore()
|
|
109
|
+
const cell_attribute = { name: "RGB_data" }
|
|
110
|
+
const spy = vi.spyOn(composables, "viewer_call")
|
|
111
|
+
await dataStyleStore.setMeshCellsCellAttribute(id, cell_attribute)
|
|
112
|
+
expect(spy).toHaveBeenCalledWith(
|
|
113
|
+
{
|
|
114
|
+
schema: mesh_cells_schemas.cell_attribute,
|
|
115
|
+
params: { id, ...cell_attribute },
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
response_function: expect.any(Function),
|
|
119
|
+
},
|
|
120
|
+
)
|
|
121
|
+
expect(dataStyleStore.meshCellsCellAttribute(id)).toStrictEqual(
|
|
122
|
+
cell_attribute,
|
|
123
|
+
)
|
|
124
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
describe("Cells active coloring", () => {
|
|
129
|
+
test("test coloring", async () => {
|
|
130
|
+
const dataStyleStore = useDataStyleStore()
|
|
131
|
+
const viewerStore = useViewerStore()
|
|
132
|
+
const coloringTypes = ["color", "vertex", "cell"]
|
|
133
|
+
for (let i = 0; i < coloringTypes.length; i++) {
|
|
134
|
+
dataStyleStore.setMeshCellsActiveColoring(id, coloringTypes[i])
|
|
135
|
+
expect(dataStyleStore.meshCellsActiveColoring(id)).toBe(
|
|
136
|
+
coloringTypes[i],
|
|
137
|
+
)
|
|
138
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
})
|
|
@@ -56,20 +56,7 @@ describe("Mesh edges", () => {
|
|
|
56
56
|
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
|
-
|
|
60
|
-
test("test coloring", async () => {
|
|
61
|
-
const dataStyleStore = useDataStyleStore()
|
|
62
|
-
const viewerStore = useViewerStore()
|
|
63
|
-
const coloringTypes = ["color"]
|
|
64
|
-
for (let i = 0; i < coloringTypes.length; i++) {
|
|
65
|
-
dataStyleStore.setMeshEdgesActiveColoring(id, coloringTypes[i])
|
|
66
|
-
expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(
|
|
67
|
-
coloringTypes[i],
|
|
68
|
-
)
|
|
69
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
})
|
|
59
|
+
|
|
73
60
|
describe("Edges color", () => {
|
|
74
61
|
test("Color red", async () => {
|
|
75
62
|
const dataStyleStore = useDataStyleStore()
|
|
@@ -90,4 +77,19 @@ describe("Mesh edges", () => {
|
|
|
90
77
|
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
91
78
|
})
|
|
92
79
|
})
|
|
80
|
+
|
|
81
|
+
describe("Edges active coloring", () => {
|
|
82
|
+
test("test coloring", async () => {
|
|
83
|
+
const dataStyleStore = useDataStyleStore()
|
|
84
|
+
const viewerStore = useViewerStore()
|
|
85
|
+
const coloringTypes = ["color"]
|
|
86
|
+
for (let i = 0; i < coloringTypes.length; i++) {
|
|
87
|
+
dataStyleStore.setMeshEdgesActiveColoring(id, coloringTypes[i])
|
|
88
|
+
expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(
|
|
89
|
+
coloringTypes[i],
|
|
90
|
+
)
|
|
91
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
})
|
|
93
95
|
})
|
|
@@ -57,20 +57,6 @@ describe("Mesh points", () => {
|
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
describe("Points active coloring", () => {
|
|
61
|
-
test("test coloring", async () => {
|
|
62
|
-
const dataStyleStore = useDataStyleStore()
|
|
63
|
-
const viewerStore = useViewerStore()
|
|
64
|
-
const coloringTypes = ["color"]
|
|
65
|
-
for (let i = 0; i < coloringTypes.length; i++) {
|
|
66
|
-
dataStyleStore.setMeshPointsActiveColoring(id, coloringTypes[i])
|
|
67
|
-
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(
|
|
68
|
-
coloringTypes[i],
|
|
69
|
-
)
|
|
70
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
60
|
describe("Points color", () => {
|
|
75
61
|
test("Color red", async () => {
|
|
76
62
|
const dataStyleStore = useDataStyleStore()
|
|
@@ -92,6 +78,21 @@ describe("Mesh points", () => {
|
|
|
92
78
|
})
|
|
93
79
|
})
|
|
94
80
|
|
|
81
|
+
describe("Points active coloring", () => {
|
|
82
|
+
test("test coloring", async () => {
|
|
83
|
+
const dataStyleStore = useDataStyleStore()
|
|
84
|
+
const viewerStore = useViewerStore()
|
|
85
|
+
const coloringTypes = ["color"]
|
|
86
|
+
for (let i = 0; i < coloringTypes.length; i++) {
|
|
87
|
+
dataStyleStore.setMeshPointsActiveColoring(id, coloringTypes[i])
|
|
88
|
+
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(
|
|
89
|
+
coloringTypes[i],
|
|
90
|
+
)
|
|
91
|
+
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
|
|
95
96
|
describe("Points size", () => {
|
|
96
97
|
test("Size 20", async () => {
|
|
97
98
|
const dataStyleStore = useDataStyleStore()
|