Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/CrsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
toggle_loading()
await geodeStore.request(schema, params, {
response_function: (response) => {
crs_list.value = response._data.crs_list
crs_list.value = response.crs_list
},
})
toggle_loading()
Expand Down
2 changes: 1 addition & 1 deletion app/components/ExtensionSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
geodeStore.request(schema, params, {
request_error_function: () => reject(),
response_function: (response) => {
resolve(response._data.geode_objects_and_output_extensions)
resolve(response.geode_objects_and_output_extensions)
},
response_error_function: () => reject(),
})
Expand Down
2 changes: 1 addition & 1 deletion app/components/FileSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
toggle_loading()
const geodeStore = useGeodeStore()
const response = await geodeStore.request(schema, {})
accept.value = response.data.value.extensions
accept.value = response.extensions
.map((extension) => "." + extension)
.join(",")
toggle_loading()
Expand Down
2 changes: 1 addition & 1 deletion app/components/Inspector/InspectionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
await geodeStore.request(schema, params, {
response_function: (response) => {
emit("update_values", {
inspection_result: [response._data.inspection_result],
inspection_result: [response.inspection_result],
})
emit("increment_step")
},
Expand Down
2 changes: 1 addition & 1 deletion app/components/MissingFilesSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
return new Promise((resolve, reject) => {
geodeStore.request(schema, params, {
request_error_function: () => reject(),
response_function: (response) => resolve(response._data),
response_function: (response) => resolve(response),
response_error_function: () => reject(),
})
})
Expand Down
4 changes: 1 addition & 3 deletions app/components/ObjectSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@
return geodeStore.request(schema, { filename })
})
const responses = await Promise.all(promise_array)
const allowed_objects_list = responses.map(
(r) => r.data.value.allowed_objects,
)
const allowed_objects_list = responses.map((r) => r.allowed_objects)
const all_keys = [...new Set(allowed_objects_list.flatMap(Object.keys))]
const common_keys = all_keys.filter((key) =>
allowed_objects_list.every((obj) => key in obj),
Expand Down
2 changes: 1 addition & 1 deletion app/components/PackagesVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{},
{
response_function: (response) => {
packages_versions.value = response._data.versions
packages_versions.value = response.versions
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion app/components/Viewer/Options/CellAttributeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
response_function: (response) => {
cell_attribute_names.value = response._data.cell_attribute_names
cell_attribute_names.value = response.cell_attribute_names
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion app/components/Viewer/Options/PolygonAttributeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
response_function: (response) => {
polygon_attribute_names.value = response._data.polygon_attribute_names
polygon_attribute_names.value = response.polygon_attribute_names
},
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
{ id: props.id },
{
response_function: (response) => {
polyhedron_attribute_names.value =
response._data.polyhedron_attribute_names
polyhedron_attribute_names.value = response.polyhedron_attribute_names
},
},
)
Expand Down
4 changes: 2 additions & 2 deletions app/components/Viewer/Options/TextureItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{ id: props.id },
{
response_function: (response) => {
texture_coordinates.value = response._data.texture_coordinates
texture_coordinates.value = response.texture_coordinates
},
},
)
Expand All @@ -86,7 +86,7 @@
},
{
response_function: async (response) => {
texture_id.value = response._data.id
texture_id.value = response.id
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion app/components/Viewer/Options/VertexAttributeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{ id: props.id },
{
response_function: (response) => {
vertex_attribute_names.value = response._data.vertex_attribute_names
vertex_attribute_names.value = response.vertex_attribute_names
},
},
)
Expand Down
86 changes: 15 additions & 71 deletions app/components/Viewer/TreeComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

const props = defineProps({ id: { type: String, required: true } })

const items = dataStore.formatedMeshComponents(props.id)
const mesh_components_selection = ref(
dataStyleStore.visibleMeshComponents(props.id),
const items = await dataStore.formatedMeshComponents(props.id)
const mesh_components_selection = dataStyleStore.visibleMeshComponents(
props.id,
)

watch(
Expand All @@ -37,79 +37,23 @@
if (!previous) previous = []
else {
const { added, removed } = compareSelections(current, previous)

const [added_corners, added_lines, added_surfaces, added_blocks] =
sortMeshComponents(added)
const [
removed_corners,
removed_lines,
removed_surfaces,
removed_blocks,
] = sortMeshComponents(removed)
if (added_corners.length > 0) {
dataStyleStore.setModelCornersVisibility(
props.id,
added_corners,
true,
)
}
if (added_lines.length > 0) {
dataStyleStore.setModelLinesVisibility(props.id, added_lines, true)
}
if (added_surfaces.length > 0) {
dataStyleStore.setModelSurfacesVisibility(
props.id,
added_surfaces,
true,
)
}
if (added_blocks.length > 0) {
dataStyleStore.setModelBlocksVisibility(props.id, added_blocks, true)
}
if (removed_corners.length > 0) {
dataStyleStore.setModelCornersVisibility(
props.id,
removed_corners,
false,
)
if (added.length > 0) {
dataStyleStore
.setModelMeshComponentVisibility(props.id, added, true)
.then(() => {
hybridViewerStore.remoteRender()
})
} else if (removed.length > 0) {
dataStyleStore
.setModelMeshComponentVisibility(props.id, removed, false)
.then(() => {
hybridViewerStore.remoteRender()
})
}
if (removed_lines.length > 0) {
dataStyleStore.setModelLinesVisibility(props.id, removed_lines, false)
}
if (removed_surfaces.length > 0) {
dataStyleStore.setModelSurfacesVisibility(
props.id,
removed_surfaces,
false,
)
}
if (removed_blocks.length > 0) {
dataStyleStore.setModelBlocksVisibility(
props.id,
removed_blocks,
false,
)
}
hybridViewerStore.remoteRender()
}
},
{ immediate: true, deep: true },
)

function sortMeshComponents(items) {
var corner_ids = [],
line_ids = [],
surface_ids = [],
block_ids = []
for (const item of items) {
const item_type = dataStore.meshComponentType(props.id, item)
if (item_type === "corner") corner_ids.push(item)
else if (item_type === "line") line_ids.push(item)
else if (item_type === "surface") surface_ids.push(item)
else if (item_type === "block") block_ids.push(item)
}
return [corner_ids, line_ids, surface_ids, block_ids]
}
</script>

<style scoped>
Expand Down
Loading