@geode/opengeodeweb-front 10.0.0 → 10.0.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
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
])
|
|
35
35
|
|
|
36
36
|
const props = defineProps({
|
|
37
|
-
|
|
37
|
+
geode_object_type: { type: String, required: true },
|
|
38
38
|
key_to_update: { type: String, required: true },
|
|
39
39
|
})
|
|
40
40
|
|
|
41
|
-
const {
|
|
41
|
+
const { geode_object_type, key_to_update } = props
|
|
42
42
|
|
|
43
43
|
const search = ref("")
|
|
44
44
|
const data_table_loading = ref(false)
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
async function get_crs_table() {
|
|
67
|
-
const params = {
|
|
67
|
+
const params = { geode_object_type }
|
|
68
68
|
toggle_loading()
|
|
69
69
|
await api_fetch(
|
|
70
70
|
{ schema, params },
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
])
|
|
68
68
|
|
|
69
69
|
const props = defineProps({
|
|
70
|
-
|
|
70
|
+
geode_object_type: { type: String, required: true },
|
|
71
71
|
filenames: { type: Array, required: true },
|
|
72
72
|
})
|
|
73
|
-
const {
|
|
73
|
+
const { geode_object_type, filenames } = props
|
|
74
74
|
const geode_objects_and_output_extensions = ref({})
|
|
75
75
|
const loading = ref(false)
|
|
76
76
|
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
geode_objects_and_output_extensions.value = {}
|
|
82
82
|
var promise_array = []
|
|
83
83
|
for (const filename of filenames) {
|
|
84
|
-
const params = {
|
|
84
|
+
const params = { geode_object_type, filename }
|
|
85
85
|
const promise = new Promise((resolve, reject) => {
|
|
86
86
|
api_fetch(
|
|
87
87
|
{ schema, params },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<v-btn
|
|
4
4
|
:loading="loading"
|
|
5
5
|
color="primary"
|
|
6
|
-
@click="get_inspection_results(props.
|
|
6
|
+
@click="get_inspection_results(props.geode_object_type, props.filename)"
|
|
7
7
|
>
|
|
8
8
|
Inspect
|
|
9
9
|
<template #loader>
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"decrement_step",
|
|
25
25
|
])
|
|
26
26
|
const props = defineProps({
|
|
27
|
-
|
|
27
|
+
geode_object_type: { type: String, required: true },
|
|
28
28
|
filename: { type: String, required: true },
|
|
29
29
|
})
|
|
30
30
|
const loading = ref(false)
|
|
31
31
|
const toggle_loading = useToggle(loading)
|
|
32
32
|
|
|
33
|
-
async function get_inspection_results(
|
|
33
|
+
async function get_inspection_results(geode_object_type, filename) {
|
|
34
34
|
toggle_loading()
|
|
35
|
-
const params = {
|
|
35
|
+
const params = { geode_object_type, filename }
|
|
36
36
|
|
|
37
37
|
await api_fetch(
|
|
38
38
|
{ schema, params },
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
|
|
59
59
|
const props = defineProps({
|
|
60
60
|
multiple: { type: Boolean, required: true },
|
|
61
|
-
|
|
61
|
+
geode_object_type: { type: String, required: true },
|
|
62
62
|
filenames: { type: Array, required: true },
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
const { multiple,
|
|
65
|
+
const { multiple, geode_object_type, filenames } = props
|
|
66
66
|
|
|
67
67
|
const accept = ref("")
|
|
68
68
|
const loading = ref(false)
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
var promise_array = []
|
|
85
85
|
|
|
86
86
|
for (const filename of filenames) {
|
|
87
|
-
const params = {
|
|
87
|
+
const params = { geode_object_type, filename }
|
|
88
88
|
const promise = new Promise((resolve, reject) => {
|
|
89
89
|
api_fetch(
|
|
90
90
|
{ schema, params },
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
toggle_loading()
|
|
110
110
|
allowed_objects.value = {}
|
|
111
111
|
const promise_array = filenames.map((filename) => {
|
|
112
|
-
const params = { filename
|
|
112
|
+
const params = { filename }
|
|
113
113
|
return api_fetch({ schema, params })
|
|
114
114
|
})
|
|
115
115
|
const responses = await Promise.all(promise_array)
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
toggle_loading()
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function set_geode_object(
|
|
145
|
-
if (
|
|
146
|
-
emit("update_values", {
|
|
144
|
+
function set_geode_object(geode_object_type) {
|
|
145
|
+
if (geode_object_type) {
|
|
146
|
+
emit("update_values", { geode_object_type })
|
|
147
147
|
emit("increment_step")
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
filter: opacity(0.7);
|
|
156
156
|
cursor: pointer;
|
|
157
157
|
}
|
|
158
|
+
|
|
158
159
|
.disabled div {
|
|
159
160
|
cursor: not-allowed;
|
|
160
161
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ViewerContextMenuItem
|
|
3
|
+
:itemProps="props.itemProps"
|
|
4
|
+
:tooltip="props.tooltip"
|
|
5
|
+
:btn_image="props.btn_image"
|
|
6
|
+
>
|
|
7
|
+
<template #options>
|
|
8
|
+
<ViewerOptionsVisibilitySwitch v-model="visibility" />
|
|
9
|
+
<template v-if="visibility">
|
|
10
|
+
<ViewerOptionsColoringTypeSelector
|
|
11
|
+
:id="id"
|
|
12
|
+
v-model:coloring_style_key="coloring_style_key"
|
|
13
|
+
v-model:color="color"
|
|
14
|
+
v-model:textures="textures"
|
|
15
|
+
v-model:vertex_attribute="vertex_attribute"
|
|
16
|
+
v-model:cell_attribute="cell_attribute"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
</template>
|
|
20
|
+
</ViewerContextMenuItem>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem.vue"
|
|
25
|
+
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue"
|
|
26
|
+
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue"
|
|
27
|
+
|
|
28
|
+
const dataStyleStore = useDataStyleStore()
|
|
29
|
+
const hybridViewerStore = useHybridViewerStore()
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
itemProps: { type: Object, required: true },
|
|
33
|
+
btn_image: { type: String, required: true },
|
|
34
|
+
tooltip: { type: String, required: false, default: "Cells options" },
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const id = toRef(() => props.itemProps.id)
|
|
38
|
+
|
|
39
|
+
const visibility = computed({
|
|
40
|
+
get: () => dataStyleStore.meshCellsVisibility(id.value),
|
|
41
|
+
set: (newValue) => {
|
|
42
|
+
dataStyleStore.setMeshCellsVisibility(id.value, newValue)
|
|
43
|
+
hybridViewerStore.remoteRender()
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
const coloring_style_key = computed({
|
|
47
|
+
get: () => dataStyleStore.meshCellsActiveColoring(id.value),
|
|
48
|
+
set: (newValue) => {
|
|
49
|
+
dataStyleStore.setMeshCellsActiveColoring(id.value, newValue)
|
|
50
|
+
hybridViewerStore.remoteRender()
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
const color = computed({
|
|
54
|
+
get: () => dataStyleStore.meshCellsColor(id.value),
|
|
55
|
+
set: (newValue) => {
|
|
56
|
+
dataStyleStore.setMeshCellsColor(id.value, newValue)
|
|
57
|
+
hybridViewerStore.remoteRender()
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
const textures = computed({
|
|
61
|
+
get: () => dataStyleStore.meshCellsTextures(id.value),
|
|
62
|
+
set: (newValue) => {
|
|
63
|
+
dataStyleStore.setMeshCellsTextures(id.value, newValue)
|
|
64
|
+
hybridViewerStore.remoteRender()
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
const vertex_attribute = computed({
|
|
68
|
+
get: () => dataStyleStore.meshCellsVertexAttribute(id.value),
|
|
69
|
+
set: (newValue) => {
|
|
70
|
+
dataStyleStore.setMeshCellsVertexAttribute(id.value, newValue)
|
|
71
|
+
hybridViewerStore.remoteRender()
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
const cell_attribute = computed({
|
|
75
|
+
get: () => dataStyleStore.meshCellsCellAttribute(id.value),
|
|
76
|
+
set: (newValue) => {
|
|
77
|
+
dataStyleStore.setMeshCellsCellAttribute(id.value, newValue)
|
|
78
|
+
hybridViewerStore.remoteRender()
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<ViewerGenericMeshCellsOptions
|
|
3
3
|
:itemProps="props.itemProps"
|
|
4
4
|
:btn_image="Grid2D_Cells"
|
|
5
5
|
tooltip="Cells options"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
-
import
|
|
10
|
+
import ViewerGenericMeshCellsOptions from "@ogw_front/components/Viewer/Generic/Mesh/CellsOptions.vue"
|
|
11
11
|
import Grid2D_Cells from "@ogw_front/assets/viewer_svgs/grid_2d_cells.svg"
|
|
12
12
|
|
|
13
13
|
const props = defineProps({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<ViewerGenericMeshCellsOptions
|
|
3
3
|
:itemProps="props.itemProps"
|
|
4
4
|
:btn_image="Grid3DCells"
|
|
5
5
|
tooltip="Cells options"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
-
import
|
|
10
|
+
import ViewerGenericMeshCellsOptions from "@ogw_front/components/Viewer/Generic/Mesh/CellsOptions.vue"
|
|
11
11
|
import Grid3DCells from "@ogw_front/assets/viewer_svgs/grid_3d_cells.svg"
|
|
12
12
|
|
|
13
13
|
const props = defineProps({
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-select
|
|
3
|
+
v-model="cell_attribute_name"
|
|
4
|
+
:items="cell_attribute_names"
|
|
5
|
+
label="Select an attribute"
|
|
6
|
+
density="compact"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
id: { type: String, required: true },
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const model = defineModel()
|
|
18
|
+
const cell_attribute_name = ref("")
|
|
19
|
+
const cell_attribute_names = ref([])
|
|
20
|
+
const cell_attribute = reactive({ name: cell_attribute_name.value })
|
|
21
|
+
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
if (model.value != null) {
|
|
24
|
+
cell_attribute_name.value = model.value.name
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
watch(cell_attribute_name, (value) => {
|
|
29
|
+
cell_attribute.name = value
|
|
30
|
+
model.value = cell_attribute
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
onMounted(() => {
|
|
34
|
+
getCellAttributes()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
function getCellAttributes() {
|
|
38
|
+
api_fetch(
|
|
39
|
+
{
|
|
40
|
+
schema: back_schemas.opengeodeweb_back.cell_attribute_names,
|
|
41
|
+
params: {
|
|
42
|
+
id: props.id,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
response_function: (response) => {
|
|
47
|
+
cell_attribute_names.value = response._data.cell_attribute_names
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
<!-- <template v-if="coloring_style_key === edge_dict['value']">
|
|
38
38
|
<ViewerOptionsEdgeAttributeSelector v-model="edge_attribute" :id="id" />
|
|
39
39
|
</template> -->
|
|
40
|
+
<template v-if="coloring_style_key === cell_dict['value']">
|
|
41
|
+
<ViewerOptionsCellAttributeSelector
|
|
42
|
+
v-model="cell_attribute"
|
|
43
|
+
:id="id"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
40
46
|
<template v-if="coloring_style_key === polygon_dict['value']">
|
|
41
47
|
<ViewerOptionsPolygonAttributeSelector
|
|
42
48
|
v-model="polygon_attribute"
|
|
@@ -61,6 +67,7 @@
|
|
|
61
67
|
import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector.vue"
|
|
62
68
|
// import ViewerOptionsEdgeAttributeSelector from "@ogw_front/components/Viewer/Options/EdgeAttributeSelector.vue"
|
|
63
69
|
import ViewerOptionsPolygonAttributeSelector from "@ogw_front/components/Viewer/Options/PolygonAttributeSelector.vue"
|
|
70
|
+
import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector.vue"
|
|
64
71
|
import ViewerOptionsPolyhedronAttributeSelector from "@ogw_front/components/Viewer/Options/PolyhedronAttributeSelector.vue"
|
|
65
72
|
|
|
66
73
|
const coloring_style_key = defineModel("coloring_style_key")
|
|
@@ -69,6 +76,7 @@
|
|
|
69
76
|
const textures = defineModel("textures")
|
|
70
77
|
const vertex_attribute = defineModel("vertex_attribute")
|
|
71
78
|
// const edge_attribute = defineModel("edge_attribute");
|
|
79
|
+
const cell_attribute = defineModel("cell_attribute")
|
|
72
80
|
const polygon_attribute = defineModel("polygon_attribute")
|
|
73
81
|
const polyhedron_attribute = defineModel("polyhedron_attribute")
|
|
74
82
|
|
|
@@ -83,6 +91,10 @@
|
|
|
83
91
|
const has_vertex = computed(() =>
|
|
84
92
|
vertex_attribute.value !== undefined ? true : false,
|
|
85
93
|
)
|
|
94
|
+
// const has_edge = computed(() => (edge_attribute.value !== undefined ? true : false));
|
|
95
|
+
const has_cells = computed(() =>
|
|
96
|
+
cell_attribute.value !== undefined ? true : false,
|
|
97
|
+
)
|
|
86
98
|
const has_polygons = computed(() =>
|
|
87
99
|
polygon_attribute.value !== undefined ? true : false,
|
|
88
100
|
)
|
|
@@ -93,7 +105,8 @@
|
|
|
93
105
|
const color_dict = { name: "Color", value: "color" }
|
|
94
106
|
const textures_dict = { name: "Textures", value: "textures" }
|
|
95
107
|
const vertex_dict = { name: "Vertex attribute", value: "vertex" }
|
|
96
|
-
// const edge_dict = { name: "Edge attribute", value: "edge" }
|
|
108
|
+
// const edge_dict = { name: "Edge attribute", value: "edge" }
|
|
109
|
+
const cell_dict = { name: "Cell attribute", value: "cell" }
|
|
97
110
|
const polygon_dict = { name: "Polygon attribute", value: "polygon" }
|
|
98
111
|
const polyhedron_dict = {
|
|
99
112
|
name: "Polyhedron attribute",
|
|
@@ -105,6 +118,7 @@
|
|
|
105
118
|
if (has_textures.value) array.push(textures_dict)
|
|
106
119
|
if (has_vertex.value) array.push(vertex_dict)
|
|
107
120
|
// if (has_edges.value) array.push(edge_dict);
|
|
121
|
+
if (has_cells.value) array.push(cell_dict)
|
|
108
122
|
if (has_polygons.value) array.push(polygon_dict)
|
|
109
123
|
if (has_polyhedra.value) array.push(polyhedron_dict)
|
|
110
124
|
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
})
|
|
32
32
|
|
|
33
33
|
onMounted(() => {
|
|
34
|
-
|
|
34
|
+
getPolygonAttributes()
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
-
function
|
|
37
|
+
function getPolygonAttributes() {
|
|
38
38
|
api_fetch(
|
|
39
39
|
{
|
|
40
40
|
schema: back_schemas.opengeodeweb_back.polygon_attribute_names,
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
const model = defineModel()
|
|
14
14
|
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
id: { type: String, required: true },
|
|
17
|
+
})
|
|
18
|
+
|
|
15
19
|
const vertex_attribute_name = ref("")
|
|
20
|
+
const vertex_attribute_names = ref([])
|
|
16
21
|
|
|
17
22
|
onMounted(() => {
|
|
18
23
|
if (model.value != null) {
|
|
@@ -26,14 +31,6 @@
|
|
|
26
31
|
model.value = vertex_attribute
|
|
27
32
|
})
|
|
28
33
|
|
|
29
|
-
const props = defineProps({
|
|
30
|
-
id: { type: String, required: true },
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const dataBaseStore = useDataBaseStore()
|
|
34
|
-
|
|
35
|
-
const vertex_attribute_names = ref([])
|
|
36
|
-
|
|
37
34
|
onMounted(() => {
|
|
38
35
|
getVertexAttributes()
|
|
39
36
|
})
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
dataStyleStore.setVisibility(item.id, false)
|
|
64
64
|
|
|
65
65
|
const objectMeta = dataBaseStore.itemMetaDatas(item.id)
|
|
66
|
-
if (objectMeta.
|
|
66
|
+
if (objectMeta.viewer_type === "mesh") {
|
|
67
67
|
if (dataBaseStore.db[item.id]?.mesh_components_selection) {
|
|
68
68
|
dataBaseStore.db[item.id].mesh_components_selection = []
|
|
69
69
|
}
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
function isModel(item) {
|
|
80
|
-
return item.
|
|
80
|
+
return item.viewer_type === "model"
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
onMounted(() => {
|
|
@@ -92,18 +92,9 @@ export function useProjectManager() {
|
|
|
92
92
|
const items = Object.entries(snapshotDataBase).map(function (pair) {
|
|
93
93
|
const id = pair[0]
|
|
94
94
|
const item = pair[1]
|
|
95
|
-
const binaryLightViewable =
|
|
96
|
-
item && item.vtk_js && item.vtk_js.binary_light_viewable
|
|
97
|
-
? item.vtk_js.binary_light_viewable
|
|
98
|
-
: undefined
|
|
99
95
|
return {
|
|
100
96
|
id: id,
|
|
101
|
-
|
|
102
|
-
geode_object: item.geode_object,
|
|
103
|
-
native_filename: item.native_filename,
|
|
104
|
-
viewable_filename: item.viewable_filename,
|
|
105
|
-
displayed_name: item.displayed_name,
|
|
106
|
-
vtk_js: { binary_light_viewable: binaryLightViewable },
|
|
97
|
+
...item,
|
|
107
98
|
}
|
|
108
99
|
})
|
|
109
100
|
|
package/app/stores/data_base.js
CHANGED
|
@@ -51,12 +51,12 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
51
51
|
async function addItem(
|
|
52
52
|
id,
|
|
53
53
|
value = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
viewer_type,
|
|
55
|
+
geode_object_type,
|
|
56
|
+
native_file,
|
|
57
|
+
viewable_file,
|
|
58
|
+
name,
|
|
59
|
+
binary_light_viewable,
|
|
60
60
|
},
|
|
61
61
|
) {
|
|
62
62
|
db[id] = value
|
|
@@ -125,14 +125,7 @@ export const useDataBaseStore = defineStore("dataBase", () => {
|
|
|
125
125
|
for (const [id, item] of Object.entries(db)) {
|
|
126
126
|
if (!item) continue
|
|
127
127
|
snapshotDb[id] = {
|
|
128
|
-
|
|
129
|
-
geode_object: item.geode_object,
|
|
130
|
-
native_filename: item.native_filename,
|
|
131
|
-
viewable_filename: item.viewable_filename,
|
|
132
|
-
displayed_name: item.displayed_name,
|
|
133
|
-
vtk_js: {
|
|
134
|
-
binary_light_viewable: item?.vtk_js?.binary_light_viewable,
|
|
135
|
-
},
|
|
128
|
+
...item,
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
return { db: snapshotDb }
|
package/app/stores/data_style.js
CHANGED
|
@@ -19,23 +19,23 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
|
|
|
19
19
|
"dataBaseStore.itemMetaDatas(id)",
|
|
20
20
|
dataBaseStore.itemMetaDatas(id),
|
|
21
21
|
)
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
22
|
+
const { viewer_type } = dataBaseStore.itemMetaDatas(id)
|
|
23
|
+
if (viewer_type === "mesh") {
|
|
24
24
|
return Promise.all([meshStyleStore.setMeshVisibility(id, visibility)])
|
|
25
|
-
} else if (
|
|
25
|
+
} else if (viewer_type === "model") {
|
|
26
26
|
return Promise.all([modelStyleStore.setModelVisibility(id, visibility)])
|
|
27
27
|
}
|
|
28
|
-
throw new Error("Unknown
|
|
28
|
+
throw new Error("Unknown viewer_type")
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function applyDefaultStyle(id) {
|
|
32
|
-
const {
|
|
33
|
-
if (
|
|
32
|
+
const { viewer_type } = dataBaseStore.itemMetaDatas(id)
|
|
33
|
+
if (viewer_type === "mesh") {
|
|
34
34
|
return meshStyleStore.applyMeshStyle(id)
|
|
35
|
-
} else if (
|
|
35
|
+
} else if (viewer_type === "model") {
|
|
36
36
|
return modelStyleStore.applyModelStyle(id)
|
|
37
37
|
} else {
|
|
38
|
-
throw new Error("Unknown
|
|
38
|
+
throw new Error("Unknown viewer_type: " + viewer_type)
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -58,11 +58,11 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
|
|
|
58
58
|
const promises = []
|
|
59
59
|
for (const id of ids) {
|
|
60
60
|
const meta = dataBaseStore.itemMetaDatas(id)
|
|
61
|
-
const
|
|
61
|
+
const viewerType = meta?.viewer_type
|
|
62
62
|
const style = dataStyleState.styles[id]
|
|
63
|
-
if (style &&
|
|
63
|
+
if (style && viewerType === "mesh") {
|
|
64
64
|
promises.push(meshStyleStore.applyMeshStyle(id))
|
|
65
|
-
} else if (style &&
|
|
65
|
+
} else if (style && viewerType === "model") {
|
|
66
66
|
promises.push(modelStyleStore.applyModelStyle(id))
|
|
67
67
|
}
|
|
68
68
|
}
|
package/app/stores/feedback.js
CHANGED
|
@@ -4,7 +4,7 @@ export const useFeedbackStore = defineStore("feedback", {
|
|
|
4
4
|
state: () => ({
|
|
5
5
|
feedbacks: [],
|
|
6
6
|
server_error: false,
|
|
7
|
-
feedbacks_timeout_miliseconds:
|
|
7
|
+
feedbacks_timeout_miliseconds: 10 * 1000,
|
|
8
8
|
}),
|
|
9
9
|
actions: {
|
|
10
10
|
async add_error(code, route, name, description) {
|
|
@@ -56,7 +56,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
|
|
|
56
56
|
const reader = vtkXMLPolyDataReader.newInstance()
|
|
57
57
|
const textEncoder = new TextEncoder()
|
|
58
58
|
await reader.parseAsArrayBuffer(
|
|
59
|
-
textEncoder.encode(value.
|
|
59
|
+
textEncoder.encode(value.binary_light_viewable),
|
|
60
60
|
)
|
|
61
61
|
const polydata = reader.getOutputData(0)
|
|
62
62
|
const mapper = vtkMapper.newInstance()
|
package/app/stores/menu.js
CHANGED
package/app/stores/treeview.js
CHANGED
|
@@ -11,11 +11,11 @@ export const useTreeviewStore = defineStore("treeview", () => {
|
|
|
11
11
|
const pendingSelectionIds = ref([])
|
|
12
12
|
|
|
13
13
|
// /** Functions **/
|
|
14
|
-
function addItem(
|
|
15
|
-
const child = { title:
|
|
14
|
+
function addItem(geode_object_type, name, id, viewer_type) {
|
|
15
|
+
const child = { title: name, id, viewer_type }
|
|
16
16
|
|
|
17
17
|
for (let i = 0; i < items.value.length; i++) {
|
|
18
|
-
if (items.value[i].title ===
|
|
18
|
+
if (items.value[i].title === geode_object_type) {
|
|
19
19
|
items.value[i].children.push(child)
|
|
20
20
|
items.value[i].children.sort((a, b) =>
|
|
21
21
|
a.title.localeCompare(b.title, undefined, {
|
|
@@ -27,7 +27,7 @@ export const useTreeviewStore = defineStore("treeview", () => {
|
|
|
27
27
|
return
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
items.value.push({ title:
|
|
30
|
+
items.value.push({ title: geode_object_type, children: [child] })
|
|
31
31
|
selection.value.push(child)
|
|
32
32
|
}
|
|
33
33
|
|
package/app/stores/viewer.js
CHANGED
|
@@ -105,9 +105,8 @@ export const useViewerStore = defineStore("viewer", {
|
|
|
105
105
|
})
|
|
106
106
|
|
|
107
107
|
// Connect
|
|
108
|
-
const { connectImageStream } =
|
|
109
|
-
"@kitware/vtk.js/Rendering/Misc/RemoteView"
|
|
110
|
-
)
|
|
108
|
+
const { connectImageStream } =
|
|
109
|
+
await import("@kitware/vtk.js/Rendering/Misc/RemoteView")
|
|
111
110
|
const viewer_store = this
|
|
112
111
|
return new Promise((resolve, reject) => {
|
|
113
112
|
clientToConnect
|