From 107eb4aed49d298e04d5680ecd9dbb085a11f9f3 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Fri, 1 Aug 2025 10:50:36 +0200 Subject: [PATCH 1/7] feat(Refacto): Refactorisation of Vease components & stores --- components/HybridRenderingView.vue | 41 ++++++ components/VeaseViewToolbar.vue | 107 ++++++++++++++ components/Viewer/BreadCrumb.vue | 61 ++++++++ components/Viewer/Tree/ObjectTree.vue | 170 +++++++++++++++++++++++ components/Viewer/TreeComponent.vue | 89 ++++++++++++ components/Viewer/TreeObject.vue | 100 +++++++++++++ stores/data_base.js | 148 ++++++++++++++++++++ stores/data_style.js | 57 ++++++++ stores/hybrid_viewer.js | 193 ++++++++++++++++++++++++++ stores/treeview.js | 64 +++++++++ 10 files changed, 1030 insertions(+) create mode 100644 components/HybridRenderingView.vue create mode 100644 components/VeaseViewToolbar.vue create mode 100644 components/Viewer/BreadCrumb.vue create mode 100644 components/Viewer/Tree/ObjectTree.vue create mode 100644 components/Viewer/TreeComponent.vue create mode 100644 components/Viewer/TreeObject.vue create mode 100644 stores/data_base.js create mode 100644 stores/data_style.js create mode 100644 stores/hybrid_viewer.js create mode 100644 stores/treeview.js diff --git a/components/HybridRenderingView.vue b/components/HybridRenderingView.vue new file mode 100644 index 00000000..e1ad3607 --- /dev/null +++ b/components/HybridRenderingView.vue @@ -0,0 +1,41 @@ + + + diff --git a/components/VeaseViewToolbar.vue b/components/VeaseViewToolbar.vue new file mode 100644 index 00000000..b353528a --- /dev/null +++ b/components/VeaseViewToolbar.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/components/Viewer/BreadCrumb.vue b/components/Viewer/BreadCrumb.vue new file mode 100644 index 00000000..f10223bf --- /dev/null +++ b/components/Viewer/BreadCrumb.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/components/Viewer/Tree/ObjectTree.vue b/components/Viewer/Tree/ObjectTree.vue new file mode 100644 index 00000000..c3d6ece7 --- /dev/null +++ b/components/Viewer/Tree/ObjectTree.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/components/Viewer/TreeComponent.vue b/components/Viewer/TreeComponent.vue new file mode 100644 index 00000000..d7b006e8 --- /dev/null +++ b/components/Viewer/TreeComponent.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/components/Viewer/TreeObject.vue b/components/Viewer/TreeObject.vue new file mode 100644 index 00000000..67f121e8 --- /dev/null +++ b/components/Viewer/TreeObject.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/stores/data_base.js b/stores/data_base.js new file mode 100644 index 00000000..a8fee69e --- /dev/null +++ b/stores/data_base.js @@ -0,0 +1,148 @@ +import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"; + +export const useDataBaseStore = defineStore("dataBase", () => { + const treeview_store = use_treeview_store(); + const hybridViewerStore = useHybridViewerStore(); + + /** State **/ + const db = reactive({}); + + /** Getters **/ + function itemMetaDatas(id) { + return db[id]; + } + + function formatedMeshComponents(id) { + const { mesh_components } = itemMetaDatas(id); + const formated_mesh_components = ref([]); + + for (const [category, uuids] of Object.entries(mesh_components)) { + formated_mesh_components.value.push({ + id: category, + title: category, + children: uuids.map((uuid) => ({ + id: uuid, + title: uuid, + category, + })), + }); + } + return formated_mesh_components.value; + } + + function meshComponentType(id, uuid) { + const { mesh_components } = itemMetaDatas(id); + + if (mesh_components["Corner"]?.includes(uuid)) return "corner"; + else if (mesh_components["Line"]?.includes(uuid)) return "line"; + else if (mesh_components["Surface"]?.includes(uuid)) return "surface"; + else if (mesh_components["Block"]?.includes(uuid)) return "block"; + return null; + } + + /** Actions **/ + async function addItem( + id, + value = { + object_type, + geode_object, + native_filename, + viewable_filename, + displayed_name, + vtk_js: { binary_light_viewable }, + } + ) { + db[id] = value; + + if (value.object_type === "model") { + await fetchMeshComponents(id); + await fetchUuidToFlatIndexDict(id); + } + treeview_store.addItem( + value.geode_object, + value.displayed_name, + id, + value.object_type + ); + + hybridViewerStore.addItem(id, value.vtk_js); + } + + async function fetchMeshComponents(id) { + const { native_filename, geode_object } = itemMetaDatas(id); + await api_fetch( + { + schema: back_schemas.opengeodeweb_back.models.mesh_components, + params: { + filename: native_filename, + geode_object, + }, + }, + { + response_function: async (response) => { + if (response._data?.uuid_dict) { + db[id].mesh_components = response._data.uuid_dict; + } + }, + } + ); + } + + async function fetchUuidToFlatIndexDict(id) { + await api_fetch( + { + schema: back_schemas.opengeodeweb_back.models.vtm_component_indices, + params: { id }, + }, + { + response_function: async (response) => { + if (response._data?.uuid_to_flat_index) { + db[id]["uuid_to_flat_index"] = response._data.uuid_to_flat_index; + } + }, + } + ); + } + + function getCornersUuids(id) { + const { mesh_components } = itemMetaDatas(id); + return Object.values(mesh_components["Corner"]); + } + + function getLinesUuids(id) { + const { mesh_components } = itemMetaDatas(id); + return Object.values(mesh_components["Line"]); + } + function getSurfacesUuids(id) { + const { mesh_components } = itemMetaDatas(id); + return Object.values(mesh_components["Surface"]); + } + function getBlocksUuids(id) { + const { mesh_components } = itemMetaDatas(id); + return Object.values(mesh_components["Block"]); + } + + function getFlatIndexes(id, mesh_component_ids) { + const { uuid_to_flat_index } = itemMetaDatas(id); + + const flat_indexes = mesh_component_ids.map( + (mesh_component_id) => uuid_to_flat_index[mesh_component_id] || null + ); + return flat_indexes.filter((index) => index !== null); + } + + return { + db, + itemMetaDatas, + meshComponentType, + formatedMeshComponents, + addItem, + fetchUuidToFlatIndexDict, + fetchMeshComponents, + getCornersUuids, + getLinesUuids, + getSurfacesUuids, + getBlocksUuids, + getFlatIndexes, + }; +}); diff --git a/stores/data_style.js b/stores/data_style.js new file mode 100644 index 00000000..a19f4e01 --- /dev/null +++ b/stores/data_style.js @@ -0,0 +1,57 @@ +import useDataStyleState from "../internal_stores/data_style_state.js"; +import useMeshStyle from "../internal_stores/mesh/index.js"; +import useModelStyle from "../internal_stores/model/index.js"; + +export const useDataStyleStore = defineStore("dataStyle", () => { + /** States **/ + const dataStyleState = useDataStyleState(); + const meshStyleStore = useMeshStyle(); + const modelStyleStore = useModelStyle(); + const dataBaseStore = useDataBaseStore(); + + /** Actions **/ + function addDataStyle(id, geode_object, object_type) { + dataStyleState.styles[id] = getDefaultStyle(geode_object); + + if (object_type === "mesh") { + meshStyleStore.applyMeshDefaultStyle(id); + } else if (object_type === "model") { + modelStyleStore.setMeshComponentsDefaultStyle(id); + modelStyleStore.applyModelDefaultStyle(id); + } + } + + function setVisibility(id, visibility) { + const object_type = dataBaseStore.itemMetaDatas(id).object_type; + if (object_type === "mesh") { + meshStyleStore.setMeshVisibility(id, visibility); + } else if (object_type === "model") { + modelStyleStore.setModelVisibility(id, visibility); + } + } + + function setModelEdgesVisibility(id, visibility) { + modelStyleStore.setModelMeshComponentVisibility( + id, + "Edge", + null, + visibility + ); + } + + function modelEdgesVisibility(id) { + return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null); + } + + return { + ...dataStyleState, + addDataStyle, + setVisibility, + setModelEdgesVisibility, + modelEdgesVisibility, + ...meshStyleStore, + ...modelStyleStore, + }; +}); + +export default useDataStyleStore; diff --git a/stores/hybrid_viewer.js b/stores/hybrid_viewer.js new file mode 100644 index 00000000..547128fb --- /dev/null +++ b/stores/hybrid_viewer.js @@ -0,0 +1,193 @@ +import "@kitware/vtk.js/Rendering/Profiles/Geometry"; +import vtkGenericRenderWindow from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow"; +import vtkXMLPolyDataReader from "@kitware/vtk.js/IO/XML/XMLPolyDataReader"; +import vtkMapper from "@kitware/vtk.js/Rendering/Core/Mapper"; +import vtkActor from "@kitware/vtk.js/Rendering/Core/Actor"; + +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +import Status from "@ogw_f/utils/status.js"; + +export const useHybridViewerStore = defineStore("hybridViewer", () => { + const viewer_store = use_viewer_store(); + const db = reactive({}); + const status = ref(Status.NOT_CREATED); + const camera_options = reactive({}); + const genericRenderWindow = reactive({}); + const is_moving = ref(false); + const zScale = ref(1.0); + let viewStream; + let gridActor = null; + + async function initHybridViewer() { + if (status.value !== Status.NOT_CREATED) return; + status.value = Status.CREATING; + genericRenderWindow.value = vtkGenericRenderWindow.newInstance({ + background: [180 / 255, 180 / 255, 180 / 255], + listenWindowResize: false, + }); + + const webGLRenderWindow = + genericRenderWindow.value.getApiSpecificRenderWindow(); + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; + imageStyle.transition = "opacity 0.1s ease-in"; + imageStyle.zIndex = 1; + + await viewer_store.ws_connect(); + viewStream = viewer_store.client.getImageStream().createViewStream("-1"); + viewStream.onImageReady((e) => { + if (is_moving.value) return; + const webGLRenderWindow = + genericRenderWindow.value.getApiSpecificRenderWindow(); + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; + webGLRenderWindow.setBackgroundImage(e.image); + imageStyle.opacity = 1; + }); + + status.value = Status.CREATED; + } + + async function addItem(id, value) { + const reader = vtkXMLPolyDataReader.newInstance(); + const textEncoder = new TextEncoder(); + await reader.parseAsArrayBuffer( + textEncoder.encode(value.binary_light_viewable) + ); + const polydata = reader.getOutputData(0); + const mapper = vtkMapper.newInstance(); + mapper.setInputData(polydata); + const actor = vtkActor.newInstance(); + actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255); + actor.setMapper(mapper); + const renderer = genericRenderWindow.value.getRenderer(); + const renderWindow = genericRenderWindow.value.getRenderWindow(); + renderer.addActor(actor); + renderer.resetCamera(); + renderWindow.render(); + db[id] = { actor, polydata, mapper }; + } + + async function setZScaling(z_scale) { + zScale.value = z_scale; + const renderer = genericRenderWindow.value.getRenderer(); + const actors = renderer.getActors(); + actors.forEach((actor) => { + if (actor !== gridActor) { + const scale = actor.getScale(); + actor.setScale(scale[0], scale[1], z_scale); + } + }); + renderer.resetCamera(); + genericRenderWindow.value.getRenderWindow().render(); + const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling; + if (!schema) return; + await viewer_call({ + schema, + params: { + z_scale: z_scale, + }, + }); + } + + function syncRemoteCamera() { + const renderer = genericRenderWindow.value.getRenderer(); + const camera = renderer.getActiveCamera(); + const params = { + camera_options: { + focal_point: camera.getFocalPoint(), + view_up: camera.getViewUp(), + position: camera.getPosition(), + view_angle: camera.getViewAngle(), + clipping_range: camera.getClippingRange(), + distance: camera.getDistance(), + }, + }; + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.viewer.update_camera, + params, + }, + { + response_fonction: () => { + for (const key in params.camera_options) { + camera_options[key] = params.camera_options[key]; + } + }, + } + ); + } + + function remoteRender() { + viewer_call({ + schema: viewer_schemas.opengeodeweb_viewer.viewer.render_now, + }); + } + + function setContainer(container) { + genericRenderWindow.value.setContainer(container.value.$el); + const webGLRenderWindow = + genericRenderWindow.value.getApiSpecificRenderWindow(); + webGLRenderWindow.setUseBackgroundImage(true); + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; + imageStyle.transition = "opacity 0.1s ease-in"; + imageStyle.zIndex = 1; + resize(container.value.$el.offsetWidth, container.value.$el.offsetHeight); + + useMousePressed({ + target: container, + onPressed: (event) => { + if (event.button == 0) { + is_moving.value = true; + event.stopPropagation(); + imageStyle.opacity = 0; + } + }, + onReleased: () => { + is_moving.value = false; + syncRemoteCamera(); + }, + }); + + let wheelEventEndTimeout = null; + useEventListener(container, "wheel", () => { + is_moving.value = true; + imageStyle.opacity = 0; + clearTimeout(wheelEventEndTimeout); + wheelEventEndTimeout = setTimeout(() => { + is_moving.value = false; + syncRemoteCamera(); + }, 600); + }); + } + + async function resize(width, height) { + if ( + viewer_store.status !== Status.CONNECTED || + status.value !== Status.CREATED + ) { + return; + } + const webGLRenderWindow = + genericRenderWindow.value.getApiSpecificRenderWindow(); + const canvas = webGLRenderWindow.getCanvas(); + canvas.width = width; + canvas.height = height; + await nextTick(); + webGLRenderWindow.setSize(width, height); + viewStream.setSize(width, height); + const renderWindow = genericRenderWindow.value.getRenderWindow(); + renderWindow.render(); + remoteRender(); + } + + return { + db, + genericRenderWindow, + addItem, + setZScaling, + syncRemoteCamera, + initHybridViewer, + resize, + setContainer, + zScale, + }; +}); diff --git a/stores/treeview.js b/stores/treeview.js new file mode 100644 index 00000000..8b16ad65 --- /dev/null +++ b/stores/treeview.js @@ -0,0 +1,64 @@ +export const use_treeview_store = defineStore("treeview", () => { + const dataStyleStore = useDataStyleStore(); + + /** State **/ + const items = ref([]); + const selection = ref([]); + const components_selection = ref([]); + const isAdditionnalTreeDisplayed = ref(false); + const panelWidth = ref(300); + const model_id = ref(""); + const isTreeCollection = ref(false); + const selectedTree = ref(null); + + /** Functions **/ + function addItem(geodeObject, displayed_name, id, object_type) { + dataStyleStore.addDataStyle(id, geodeObject, object_type); + const child = { title: displayed_name, id, object_type }; + for (let i = 0; i < items.value.length; i++) { + if (items.value[i].title === geodeObject) { + items.value[i].children.push(child); + selection.value.push(child); + return; + } + } + items.value.push({ title: geodeObject, children: [child] }); + selection.value.push(child); + } + + function displayAdditionalTree(id) { + isAdditionnalTreeDisplayed.value = true; + model_id.value = id; + } + + function displayFileTree() { + isAdditionnalTreeDisplayed.value = false; + } + + function toggleTreeView() { + isTreeCollection.value = !isTreeCollection.value; + console.log( + "Switched to", + isTreeCollection.value ? "TreeCollection" : "TreeComponent" + ); + } + + function setPanelWidth(width) { + panelWidth.value = width; + } + + return { + items, + selection, + components_selection, + isAdditionnalTreeDisplayed, + panelWidth, + model_id, + selectedTree, + addItem, + displayAdditionalTree, + displayFileTree, + toggleTreeView, + setPanelWidth, + }; +}); From 85f319afc42fba86785d1cdd027410cd2bddab73 Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:51:25 +0000 Subject: [PATCH 2/7] Apply prepare changes --- components/HybridRenderingView.vue | 28 +-- components/VeaseViewToolbar.vue | 128 +++++++------- components/Viewer/BreadCrumb.vue | 28 +-- components/Viewer/Tree/ObjectTree.vue | 244 +++++++++++++------------- components/Viewer/TreeComponent.vue | 126 ++++++------- components/Viewer/TreeObject.vue | 98 +++++------ stores/data_base.js | 86 ++++----- stores/data_style.js | 40 ++--- stores/hybrid_viewer.js | 200 ++++++++++----------- stores/treeview.js | 50 +++--- 10 files changed, 516 insertions(+), 512 deletions(-) diff --git a/components/HybridRenderingView.vue b/components/HybridRenderingView.vue index e1ad3607..1ba0af3a 100644 --- a/components/HybridRenderingView.vue +++ b/components/HybridRenderingView.vue @@ -21,21 +21,21 @@ diff --git a/components/VeaseViewToolbar.vue b/components/VeaseViewToolbar.vue index b353528a..0636e8b6 100644 --- a/components/VeaseViewToolbar.vue +++ b/components/VeaseViewToolbar.vue @@ -27,81 +27,81 @@ diff --git a/components/Viewer/BreadCrumb.vue b/components/Viewer/BreadCrumb.vue index f10223bf..54c4b9c2 100644 --- a/components/Viewer/BreadCrumb.vue +++ b/components/Viewer/BreadCrumb.vue @@ -37,25 +37,25 @@ diff --git a/components/Viewer/Tree/ObjectTree.vue b/components/Viewer/Tree/ObjectTree.vue index c3d6ece7..f7bfa2f1 100644 --- a/components/Viewer/Tree/ObjectTree.vue +++ b/components/Viewer/Tree/ObjectTree.vue @@ -42,129 +42,129 @@ diff --git a/components/Viewer/TreeComponent.vue b/components/Viewer/TreeComponent.vue index d7b006e8..782e346c 100644 --- a/components/Viewer/TreeComponent.vue +++ b/components/Viewer/TreeComponent.vue @@ -14,76 +14,80 @@ diff --git a/components/Viewer/TreeObject.vue b/components/Viewer/TreeObject.vue index 67f121e8..6b71d438 100644 --- a/components/Viewer/TreeObject.vue +++ b/components/Viewer/TreeObject.vue @@ -36,65 +36,65 @@ diff --git a/stores/data_base.js b/stores/data_base.js index a8fee69e..4e836046 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -1,20 +1,20 @@ -import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"; +import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" export const useDataBaseStore = defineStore("dataBase", () => { - const treeview_store = use_treeview_store(); - const hybridViewerStore = useHybridViewerStore(); + const treeview_store = use_treeview_store() + const hybridViewerStore = useHybridViewerStore() /** State **/ - const db = reactive({}); + const db = reactive({}) /** Getters **/ function itemMetaDatas(id) { - return db[id]; + return db[id] } function formatedMeshComponents(id) { - const { mesh_components } = itemMetaDatas(id); - const formated_mesh_components = ref([]); + const { mesh_components } = itemMetaDatas(id) + const formated_mesh_components = ref([]) for (const [category, uuids] of Object.entries(mesh_components)) { formated_mesh_components.value.push({ @@ -25,19 +25,19 @@ export const useDataBaseStore = defineStore("dataBase", () => { title: uuid, category, })), - }); + }) } - return formated_mesh_components.value; + return formated_mesh_components.value } function meshComponentType(id, uuid) { - const { mesh_components } = itemMetaDatas(id); + const { mesh_components } = itemMetaDatas(id) - if (mesh_components["Corner"]?.includes(uuid)) return "corner"; - else if (mesh_components["Line"]?.includes(uuid)) return "line"; - else if (mesh_components["Surface"]?.includes(uuid)) return "surface"; - else if (mesh_components["Block"]?.includes(uuid)) return "block"; - return null; + if (mesh_components["Corner"]?.includes(uuid)) return "corner" + else if (mesh_components["Line"]?.includes(uuid)) return "line" + else if (mesh_components["Surface"]?.includes(uuid)) return "surface" + else if (mesh_components["Block"]?.includes(uuid)) return "block" + return null } /** Actions **/ @@ -50,26 +50,26 @@ export const useDataBaseStore = defineStore("dataBase", () => { viewable_filename, displayed_name, vtk_js: { binary_light_viewable }, - } + }, ) { - db[id] = value; + db[id] = value if (value.object_type === "model") { - await fetchMeshComponents(id); - await fetchUuidToFlatIndexDict(id); + await fetchMeshComponents(id) + await fetchUuidToFlatIndexDict(id) } treeview_store.addItem( value.geode_object, value.displayed_name, id, - value.object_type - ); + value.object_type, + ) - hybridViewerStore.addItem(id, value.vtk_js); + hybridViewerStore.addItem(id, value.vtk_js) } async function fetchMeshComponents(id) { - const { native_filename, geode_object } = itemMetaDatas(id); + const { native_filename, geode_object } = itemMetaDatas(id) await api_fetch( { schema: back_schemas.opengeodeweb_back.models.mesh_components, @@ -81,11 +81,11 @@ export const useDataBaseStore = defineStore("dataBase", () => { { response_function: async (response) => { if (response._data?.uuid_dict) { - db[id].mesh_components = response._data.uuid_dict; + db[id].mesh_components = response._data.uuid_dict } }, - } - ); + }, + ) } async function fetchUuidToFlatIndexDict(id) { @@ -97,38 +97,38 @@ export const useDataBaseStore = defineStore("dataBase", () => { { response_function: async (response) => { if (response._data?.uuid_to_flat_index) { - db[id]["uuid_to_flat_index"] = response._data.uuid_to_flat_index; + db[id]["uuid_to_flat_index"] = response._data.uuid_to_flat_index } }, - } - ); + }, + ) } function getCornersUuids(id) { - const { mesh_components } = itemMetaDatas(id); - return Object.values(mesh_components["Corner"]); + const { mesh_components } = itemMetaDatas(id) + return Object.values(mesh_components["Corner"]) } function getLinesUuids(id) { - const { mesh_components } = itemMetaDatas(id); - return Object.values(mesh_components["Line"]); + const { mesh_components } = itemMetaDatas(id) + return Object.values(mesh_components["Line"]) } function getSurfacesUuids(id) { - const { mesh_components } = itemMetaDatas(id); - return Object.values(mesh_components["Surface"]); + const { mesh_components } = itemMetaDatas(id) + return Object.values(mesh_components["Surface"]) } function getBlocksUuids(id) { - const { mesh_components } = itemMetaDatas(id); - return Object.values(mesh_components["Block"]); + const { mesh_components } = itemMetaDatas(id) + return Object.values(mesh_components["Block"]) } function getFlatIndexes(id, mesh_component_ids) { - const { uuid_to_flat_index } = itemMetaDatas(id); + const { uuid_to_flat_index } = itemMetaDatas(id) const flat_indexes = mesh_component_ids.map( - (mesh_component_id) => uuid_to_flat_index[mesh_component_id] || null - ); - return flat_indexes.filter((index) => index !== null); + (mesh_component_id) => uuid_to_flat_index[mesh_component_id] || null, + ) + return flat_indexes.filter((index) => index !== null) } return { @@ -144,5 +144,5 @@ export const useDataBaseStore = defineStore("dataBase", () => { getSurfacesUuids, getBlocksUuids, getFlatIndexes, - }; -}); + } +}) diff --git a/stores/data_style.js b/stores/data_style.js index a19f4e01..9f84fd6d 100644 --- a/stores/data_style.js +++ b/stores/data_style.js @@ -1,32 +1,32 @@ -import useDataStyleState from "../internal_stores/data_style_state.js"; -import useMeshStyle from "../internal_stores/mesh/index.js"; -import useModelStyle from "../internal_stores/model/index.js"; +import useDataStyleState from "../internal_stores/data_style_state.js" +import useMeshStyle from "../internal_stores/mesh/index.js" +import useModelStyle from "../internal_stores/model/index.js" export const useDataStyleStore = defineStore("dataStyle", () => { /** States **/ - const dataStyleState = useDataStyleState(); - const meshStyleStore = useMeshStyle(); - const modelStyleStore = useModelStyle(); - const dataBaseStore = useDataBaseStore(); + const dataStyleState = useDataStyleState() + const meshStyleStore = useMeshStyle() + const modelStyleStore = useModelStyle() + const dataBaseStore = useDataBaseStore() /** Actions **/ function addDataStyle(id, geode_object, object_type) { - dataStyleState.styles[id] = getDefaultStyle(geode_object); + dataStyleState.styles[id] = getDefaultStyle(geode_object) if (object_type === "mesh") { - meshStyleStore.applyMeshDefaultStyle(id); + meshStyleStore.applyMeshDefaultStyle(id) } else if (object_type === "model") { - modelStyleStore.setMeshComponentsDefaultStyle(id); - modelStyleStore.applyModelDefaultStyle(id); + modelStyleStore.setMeshComponentsDefaultStyle(id) + modelStyleStore.applyModelDefaultStyle(id) } } function setVisibility(id, visibility) { - const object_type = dataBaseStore.itemMetaDatas(id).object_type; + const object_type = dataBaseStore.itemMetaDatas(id).object_type if (object_type === "mesh") { - meshStyleStore.setMeshVisibility(id, visibility); + meshStyleStore.setMeshVisibility(id, visibility) } else if (object_type === "model") { - modelStyleStore.setModelVisibility(id, visibility); + modelStyleStore.setModelVisibility(id, visibility) } } @@ -35,12 +35,12 @@ export const useDataStyleStore = defineStore("dataStyle", () => { id, "Edge", null, - visibility - ); + visibility, + ) } function modelEdgesVisibility(id) { - return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null); + return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null) } return { @@ -51,7 +51,7 @@ export const useDataStyleStore = defineStore("dataStyle", () => { modelEdgesVisibility, ...meshStyleStore, ...modelStyleStore, - }; -}); + } +}) -export default useDataStyleStore; +export default useDataStyleStore diff --git a/stores/hybrid_viewer.js b/stores/hybrid_viewer.js index 547128fb..75a2e017 100644 --- a/stores/hybrid_viewer.js +++ b/stores/hybrid_viewer.js @@ -1,96 +1,96 @@ -import "@kitware/vtk.js/Rendering/Profiles/Geometry"; -import vtkGenericRenderWindow from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow"; -import vtkXMLPolyDataReader from "@kitware/vtk.js/IO/XML/XMLPolyDataReader"; -import vtkMapper from "@kitware/vtk.js/Rendering/Core/Mapper"; -import vtkActor from "@kitware/vtk.js/Rendering/Core/Actor"; +import "@kitware/vtk.js/Rendering/Profiles/Geometry" +import vtkGenericRenderWindow from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow" +import vtkXMLPolyDataReader from "@kitware/vtk.js/IO/XML/XMLPolyDataReader" +import vtkMapper from "@kitware/vtk.js/Rendering/Core/Mapper" +import vtkActor from "@kitware/vtk.js/Rendering/Core/Actor" -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -import Status from "@ogw_f/utils/status.js"; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +import Status from "@ogw_f/utils/status.js" export const useHybridViewerStore = defineStore("hybridViewer", () => { - const viewer_store = use_viewer_store(); - const db = reactive({}); - const status = ref(Status.NOT_CREATED); - const camera_options = reactive({}); - const genericRenderWindow = reactive({}); - const is_moving = ref(false); - const zScale = ref(1.0); - let viewStream; - let gridActor = null; + const viewer_store = use_viewer_store() + const db = reactive({}) + const status = ref(Status.NOT_CREATED) + const camera_options = reactive({}) + const genericRenderWindow = reactive({}) + const is_moving = ref(false) + const zScale = ref(1.0) + let viewStream + let gridActor = null async function initHybridViewer() { - if (status.value !== Status.NOT_CREATED) return; - status.value = Status.CREATING; + if (status.value !== Status.NOT_CREATED) return + status.value = Status.CREATING genericRenderWindow.value = vtkGenericRenderWindow.newInstance({ background: [180 / 255, 180 / 255, 180 / 255], listenWindowResize: false, - }); + }) const webGLRenderWindow = - genericRenderWindow.value.getApiSpecificRenderWindow(); - const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; - imageStyle.transition = "opacity 0.1s ease-in"; - imageStyle.zIndex = 1; + genericRenderWindow.value.getApiSpecificRenderWindow() + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style + imageStyle.transition = "opacity 0.1s ease-in" + imageStyle.zIndex = 1 - await viewer_store.ws_connect(); - viewStream = viewer_store.client.getImageStream().createViewStream("-1"); + await viewer_store.ws_connect() + viewStream = viewer_store.client.getImageStream().createViewStream("-1") viewStream.onImageReady((e) => { - if (is_moving.value) return; + if (is_moving.value) return const webGLRenderWindow = - genericRenderWindow.value.getApiSpecificRenderWindow(); - const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; - webGLRenderWindow.setBackgroundImage(e.image); - imageStyle.opacity = 1; - }); + genericRenderWindow.value.getApiSpecificRenderWindow() + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style + webGLRenderWindow.setBackgroundImage(e.image) + imageStyle.opacity = 1 + }) - status.value = Status.CREATED; + status.value = Status.CREATED } async function addItem(id, value) { - const reader = vtkXMLPolyDataReader.newInstance(); - const textEncoder = new TextEncoder(); + const reader = vtkXMLPolyDataReader.newInstance() + const textEncoder = new TextEncoder() await reader.parseAsArrayBuffer( - textEncoder.encode(value.binary_light_viewable) - ); - const polydata = reader.getOutputData(0); - const mapper = vtkMapper.newInstance(); - mapper.setInputData(polydata); - const actor = vtkActor.newInstance(); - actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255); - actor.setMapper(mapper); - const renderer = genericRenderWindow.value.getRenderer(); - const renderWindow = genericRenderWindow.value.getRenderWindow(); - renderer.addActor(actor); - renderer.resetCamera(); - renderWindow.render(); - db[id] = { actor, polydata, mapper }; + textEncoder.encode(value.binary_light_viewable), + ) + const polydata = reader.getOutputData(0) + const mapper = vtkMapper.newInstance() + mapper.setInputData(polydata) + const actor = vtkActor.newInstance() + actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) + actor.setMapper(mapper) + const renderer = genericRenderWindow.value.getRenderer() + const renderWindow = genericRenderWindow.value.getRenderWindow() + renderer.addActor(actor) + renderer.resetCamera() + renderWindow.render() + db[id] = { actor, polydata, mapper } } async function setZScaling(z_scale) { - zScale.value = z_scale; - const renderer = genericRenderWindow.value.getRenderer(); - const actors = renderer.getActors(); + zScale.value = z_scale + const renderer = genericRenderWindow.value.getRenderer() + const actors = renderer.getActors() actors.forEach((actor) => { if (actor !== gridActor) { - const scale = actor.getScale(); - actor.setScale(scale[0], scale[1], z_scale); + const scale = actor.getScale() + actor.setScale(scale[0], scale[1], z_scale) } - }); - renderer.resetCamera(); - genericRenderWindow.value.getRenderWindow().render(); - const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling; - if (!schema) return; + }) + renderer.resetCamera() + genericRenderWindow.value.getRenderWindow().render() + const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling + if (!schema) return await viewer_call({ schema, params: { z_scale: z_scale, }, - }); + }) } function syncRemoteCamera() { - const renderer = genericRenderWindow.value.getRenderer(); - const camera = renderer.getActiveCamera(); + const renderer = genericRenderWindow.value.getRenderer() + const camera = renderer.getActiveCamera() const params = { camera_options: { focal_point: camera.getFocalPoint(), @@ -100,7 +100,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => { clipping_range: camera.getClippingRange(), distance: camera.getDistance(), }, - }; + } viewer_call( { schema: viewer_schemas.opengeodeweb_viewer.viewer.update_camera, @@ -109,54 +109,54 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => { { response_fonction: () => { for (const key in params.camera_options) { - camera_options[key] = params.camera_options[key]; + camera_options[key] = params.camera_options[key] } }, - } - ); + }, + ) } function remoteRender() { viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.viewer.render_now, - }); + }) } function setContainer(container) { - genericRenderWindow.value.setContainer(container.value.$el); + genericRenderWindow.value.setContainer(container.value.$el) const webGLRenderWindow = - genericRenderWindow.value.getApiSpecificRenderWindow(); - webGLRenderWindow.setUseBackgroundImage(true); - const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style; - imageStyle.transition = "opacity 0.1s ease-in"; - imageStyle.zIndex = 1; - resize(container.value.$el.offsetWidth, container.value.$el.offsetHeight); + genericRenderWindow.value.getApiSpecificRenderWindow() + webGLRenderWindow.setUseBackgroundImage(true) + const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style + imageStyle.transition = "opacity 0.1s ease-in" + imageStyle.zIndex = 1 + resize(container.value.$el.offsetWidth, container.value.$el.offsetHeight) useMousePressed({ target: container, onPressed: (event) => { if (event.button == 0) { - is_moving.value = true; - event.stopPropagation(); - imageStyle.opacity = 0; + is_moving.value = true + event.stopPropagation() + imageStyle.opacity = 0 } }, onReleased: () => { - is_moving.value = false; - syncRemoteCamera(); + is_moving.value = false + syncRemoteCamera() }, - }); + }) - let wheelEventEndTimeout = null; + let wheelEventEndTimeout = null useEventListener(container, "wheel", () => { - is_moving.value = true; - imageStyle.opacity = 0; - clearTimeout(wheelEventEndTimeout); + is_moving.value = true + imageStyle.opacity = 0 + clearTimeout(wheelEventEndTimeout) wheelEventEndTimeout = setTimeout(() => { - is_moving.value = false; - syncRemoteCamera(); - }, 600); - }); + is_moving.value = false + syncRemoteCamera() + }, 600) + }) } async function resize(width, height) { @@ -164,19 +164,19 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => { viewer_store.status !== Status.CONNECTED || status.value !== Status.CREATED ) { - return; + return } const webGLRenderWindow = - genericRenderWindow.value.getApiSpecificRenderWindow(); - const canvas = webGLRenderWindow.getCanvas(); - canvas.width = width; - canvas.height = height; - await nextTick(); - webGLRenderWindow.setSize(width, height); - viewStream.setSize(width, height); - const renderWindow = genericRenderWindow.value.getRenderWindow(); - renderWindow.render(); - remoteRender(); + genericRenderWindow.value.getApiSpecificRenderWindow() + const canvas = webGLRenderWindow.getCanvas() + canvas.width = width + canvas.height = height + await nextTick() + webGLRenderWindow.setSize(width, height) + viewStream.setSize(width, height) + const renderWindow = genericRenderWindow.value.getRenderWindow() + renderWindow.render() + remoteRender() } return { @@ -189,5 +189,5 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => { resize, setContainer, zScale, - }; -}); + } +}) diff --git a/stores/treeview.js b/stores/treeview.js index 8b16ad65..0d1afa06 100644 --- a/stores/treeview.js +++ b/stores/treeview.js @@ -1,50 +1,50 @@ export const use_treeview_store = defineStore("treeview", () => { - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() /** State **/ - const items = ref([]); - const selection = ref([]); - const components_selection = ref([]); - const isAdditionnalTreeDisplayed = ref(false); - const panelWidth = ref(300); - const model_id = ref(""); - const isTreeCollection = ref(false); - const selectedTree = ref(null); + const items = ref([]) + const selection = ref([]) + const components_selection = ref([]) + const isAdditionnalTreeDisplayed = ref(false) + const panelWidth = ref(300) + const model_id = ref("") + const isTreeCollection = ref(false) + const selectedTree = ref(null) /** Functions **/ function addItem(geodeObject, displayed_name, id, object_type) { - dataStyleStore.addDataStyle(id, geodeObject, object_type); - const child = { title: displayed_name, id, object_type }; + dataStyleStore.addDataStyle(id, geodeObject, object_type) + const child = { title: displayed_name, id, object_type } for (let i = 0; i < items.value.length; i++) { if (items.value[i].title === geodeObject) { - items.value[i].children.push(child); - selection.value.push(child); - return; + items.value[i].children.push(child) + selection.value.push(child) + return } } - items.value.push({ title: geodeObject, children: [child] }); - selection.value.push(child); + items.value.push({ title: geodeObject, children: [child] }) + selection.value.push(child) } function displayAdditionalTree(id) { - isAdditionnalTreeDisplayed.value = true; - model_id.value = id; + isAdditionnalTreeDisplayed.value = true + model_id.value = id } function displayFileTree() { - isAdditionnalTreeDisplayed.value = false; + isAdditionnalTreeDisplayed.value = false } function toggleTreeView() { - isTreeCollection.value = !isTreeCollection.value; + isTreeCollection.value = !isTreeCollection.value console.log( "Switched to", - isTreeCollection.value ? "TreeCollection" : "TreeComponent" - ); + isTreeCollection.value ? "TreeCollection" : "TreeComponent", + ) } function setPanelWidth(width) { - panelWidth.value = width; + panelWidth.value = width } return { @@ -60,5 +60,5 @@ export const use_treeview_store = defineStore("treeview", () => { displayFileTree, toggleTreeView, setPanelWidth, - }; -}); + } +}) From 847c28b2edc9be091dfe392d75149927c4952777 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Fri, 1 Aug 2025 12:10:29 +0200 Subject: [PATCH 3/7] new refacto and update imports --- assets/viewer_svgs/edged_curve_edges.svg | 67 +++++++ assets/viewer_svgs/edged_curve_points.svg | 95 +++++++++ assets/viewer_svgs/grid_2d_cells.svg | 78 ++++++++ assets/viewer_svgs/grid_2d_edges.svg | 71 +++++++ assets/viewer_svgs/grid_2d_points.svg | 108 +++++++++++ assets/viewer_svgs/grid_3d_cells.svg | 76 ++++++++ assets/viewer_svgs/grid_3d_edges.svg | 72 +++++++ assets/viewer_svgs/grid_3d_facets.svg | 102 ++++++++++ assets/viewer_svgs/grid_3d_points.svg | 172 +++++++++++++++++ assets/viewer_svgs/point_set_points.svg | 86 +++++++++ assets/viewer_svgs/solid_edges.svg | 96 +++++++++ assets/viewer_svgs/solid_facets.svg | 119 ++++++++++++ assets/viewer_svgs/solid_points.svg | 134 +++++++++++++ assets/viewer_svgs/solid_polyhedra.svg | 103 ++++++++++ assets/viewer_svgs/surface_edges.svg | 73 +++++++ assets/viewer_svgs/surface_points.svg | 115 +++++++++++ assets/viewer_svgs/surface_triangles.svg | 92 +++++++++ components/ContextMenu.vue | 123 ++++++++++++ components/ContextMenuItem.vue | 88 +++++++++ components/EdgedCurve/EdgesOptions.vue | 14 ++ components/EdgedCurve/PointsOptions.vue | 14 ++ components/Generic/Mesh/EdgesOptions.vue | 48 +++++ components/Generic/Mesh/PointsOptions.vue | 72 +++++++ components/Generic/Mesh/PolygonsOptions.vue | 65 +++++++ components/Generic/Mesh/PolyhedraOptions.vue | 57 ++++++ components/Generic/Model/EdgesOptions.vue | 28 +++ components/Generic/Model/PointsOptions.vue | 53 +++++ components/Grid/2D/CellsOptions.vue | 15 ++ components/Grid/2D/EdgesOptions.vue | 14 ++ components/Grid/2D/PointsOptions.vue | 14 ++ components/Grid/3D/CellsOptions.vue | 15 ++ components/Grid/3D/EdgesOptions.vue | 14 ++ components/Grid/3D/FacetsOptions.vue | 15 ++ components/Grid/3D/PointsOptions.vue | 14 ++ components/HybridSolid/EdgesOptions.vue | 14 ++ components/HybridSolid/PointsOptions.vue | 14 ++ components/HybridSolid/PolygonsOptions.vue | 14 ++ components/HybridSolid/PolyhedraOptions.vue | 14 ++ components/Options/ColorPicker.vue | 25 +++ components/Options/ColoringTypeSelector.vue | 125 ++++++++++++ .../Options/PolygonAttributeSelector.vue | 59 ++++++ .../Options/PolyhedronAttributeSelector.vue | 63 ++++++ components/Options/TextureItem.vue | 116 +++++++++++ components/Options/TexturesSelector.vue | 67 +++++++ .../Options/VertexAttributeSelector.vue | 60 ++++++ components/Options/VisibilitySwitch.vue | 14 ++ components/PointSet/PointsOptions.vue | 14 ++ components/PointSet/SpecificPointsOptions.vue | 73 +++++++ components/PolygonalSurface/EdgesOptions.vue | 14 ++ components/PolygonalSurface/PointsOptions.vue | 14 ++ .../PolygonalSurface/PolygonsOptions.vue | 14 ++ components/Solid/EdgesOptions.vue | 14 ++ components/Solid/PointsOptions.vue | 14 ++ components/Solid/PolygonsOptions.vue | 14 ++ components/Solid/PolyhedraOptions.vue | 14 ++ .../TetrahedralSolid/TetrahedraOptions.vue | 15 ++ .../TetrahedralSolid/TrianglesOptions.vue | 15 ++ .../TriangulatedSurface/EdgesOptions.vue | 14 ++ .../TriangulatedSurface/PointsOptions.vue | 14 ++ .../TriangulatedSurface/TrianglesOptions.vue | 15 ++ internal_stores/data_style_state.js | 18 ++ internal_stores/mesh/edges.js | 106 ++++++++++ internal_stores/mesh/index.js | 53 +++++ internal_stores/mesh/points.js | 131 +++++++++++++ internal_stores/mesh/polygons.js | 159 +++++++++++++++ internal_stores/mesh/polyhedra.js | 139 +++++++++++++ internal_stores/model/blocks.js | 60 ++++++ internal_stores/model/corners.js | 64 ++++++ internal_stores/model/edges.js | 47 +++++ internal_stores/model/index.js | 154 +++++++++++++++ internal_stores/model/lines.js | 81 ++++++++ internal_stores/model/points.js | 61 ++++++ internal_stores/model/surfaces.js | 60 ++++++ stores/menu.js | 182 ++++++++++++++++++ 74 files changed, 4480 insertions(+) create mode 100644 assets/viewer_svgs/edged_curve_edges.svg create mode 100644 assets/viewer_svgs/edged_curve_points.svg create mode 100644 assets/viewer_svgs/grid_2d_cells.svg create mode 100644 assets/viewer_svgs/grid_2d_edges.svg create mode 100644 assets/viewer_svgs/grid_2d_points.svg create mode 100644 assets/viewer_svgs/grid_3d_cells.svg create mode 100644 assets/viewer_svgs/grid_3d_edges.svg create mode 100644 assets/viewer_svgs/grid_3d_facets.svg create mode 100644 assets/viewer_svgs/grid_3d_points.svg create mode 100644 assets/viewer_svgs/point_set_points.svg create mode 100644 assets/viewer_svgs/solid_edges.svg create mode 100644 assets/viewer_svgs/solid_facets.svg create mode 100644 assets/viewer_svgs/solid_points.svg create mode 100644 assets/viewer_svgs/solid_polyhedra.svg create mode 100644 assets/viewer_svgs/surface_edges.svg create mode 100644 assets/viewer_svgs/surface_points.svg create mode 100644 assets/viewer_svgs/surface_triangles.svg create mode 100644 components/ContextMenu.vue create mode 100644 components/ContextMenuItem.vue create mode 100644 components/EdgedCurve/EdgesOptions.vue create mode 100644 components/EdgedCurve/PointsOptions.vue create mode 100644 components/Generic/Mesh/EdgesOptions.vue create mode 100644 components/Generic/Mesh/PointsOptions.vue create mode 100644 components/Generic/Mesh/PolygonsOptions.vue create mode 100644 components/Generic/Mesh/PolyhedraOptions.vue create mode 100644 components/Generic/Model/EdgesOptions.vue create mode 100644 components/Generic/Model/PointsOptions.vue create mode 100644 components/Grid/2D/CellsOptions.vue create mode 100644 components/Grid/2D/EdgesOptions.vue create mode 100644 components/Grid/2D/PointsOptions.vue create mode 100644 components/Grid/3D/CellsOptions.vue create mode 100644 components/Grid/3D/EdgesOptions.vue create mode 100644 components/Grid/3D/FacetsOptions.vue create mode 100644 components/Grid/3D/PointsOptions.vue create mode 100644 components/HybridSolid/EdgesOptions.vue create mode 100644 components/HybridSolid/PointsOptions.vue create mode 100644 components/HybridSolid/PolygonsOptions.vue create mode 100644 components/HybridSolid/PolyhedraOptions.vue create mode 100644 components/Options/ColorPicker.vue create mode 100644 components/Options/ColoringTypeSelector.vue create mode 100644 components/Options/PolygonAttributeSelector.vue create mode 100644 components/Options/PolyhedronAttributeSelector.vue create mode 100644 components/Options/TextureItem.vue create mode 100644 components/Options/TexturesSelector.vue create mode 100644 components/Options/VertexAttributeSelector.vue create mode 100644 components/Options/VisibilitySwitch.vue create mode 100644 components/PointSet/PointsOptions.vue create mode 100644 components/PointSet/SpecificPointsOptions.vue create mode 100644 components/PolygonalSurface/EdgesOptions.vue create mode 100644 components/PolygonalSurface/PointsOptions.vue create mode 100644 components/PolygonalSurface/PolygonsOptions.vue create mode 100644 components/Solid/EdgesOptions.vue create mode 100644 components/Solid/PointsOptions.vue create mode 100644 components/Solid/PolygonsOptions.vue create mode 100644 components/Solid/PolyhedraOptions.vue create mode 100644 components/TetrahedralSolid/TetrahedraOptions.vue create mode 100644 components/TetrahedralSolid/TrianglesOptions.vue create mode 100644 components/TriangulatedSurface/EdgesOptions.vue create mode 100644 components/TriangulatedSurface/PointsOptions.vue create mode 100644 components/TriangulatedSurface/TrianglesOptions.vue create mode 100644 internal_stores/data_style_state.js create mode 100644 internal_stores/mesh/edges.js create mode 100644 internal_stores/mesh/index.js create mode 100644 internal_stores/mesh/points.js create mode 100644 internal_stores/mesh/polygons.js create mode 100644 internal_stores/mesh/polyhedra.js create mode 100644 internal_stores/model/blocks.js create mode 100644 internal_stores/model/corners.js create mode 100644 internal_stores/model/edges.js create mode 100644 internal_stores/model/index.js create mode 100644 internal_stores/model/lines.js create mode 100644 internal_stores/model/points.js create mode 100644 internal_stores/model/surfaces.js create mode 100644 stores/menu.js diff --git a/assets/viewer_svgs/edged_curve_edges.svg b/assets/viewer_svgs/edged_curve_edges.svg new file mode 100644 index 00000000..750587ef --- /dev/null +++ b/assets/viewer_svgs/edged_curve_edges.svg @@ -0,0 +1,67 @@ + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/assets/viewer_svgs/edged_curve_points.svg b/assets/viewer_svgs/edged_curve_points.svg new file mode 100644 index 00000000..c1c113cb --- /dev/null +++ b/assets/viewer_svgs/edged_curve_points.svg @@ -0,0 +1,95 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/assets/viewer_svgs/grid_2d_cells.svg b/assets/viewer_svgs/grid_2d_cells.svg new file mode 100644 index 00000000..b50c26aa --- /dev/null +++ b/assets/viewer_svgs/grid_2d_cells.svg @@ -0,0 +1,78 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/viewer_svgs/grid_2d_edges.svg b/assets/viewer_svgs/grid_2d_edges.svg new file mode 100644 index 00000000..eb9757d9 --- /dev/null +++ b/assets/viewer_svgs/grid_2d_edges.svg @@ -0,0 +1,71 @@ + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/assets/viewer_svgs/grid_2d_points.svg b/assets/viewer_svgs/grid_2d_points.svg new file mode 100644 index 00000000..835f3b9e --- /dev/null +++ b/assets/viewer_svgs/grid_2d_points.svg @@ -0,0 +1,108 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/assets/viewer_svgs/grid_3d_cells.svg b/assets/viewer_svgs/grid_3d_cells.svg new file mode 100644 index 00000000..c2b5e118 --- /dev/null +++ b/assets/viewer_svgs/grid_3d_cells.svg @@ -0,0 +1,76 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/assets/viewer_svgs/grid_3d_edges.svg b/assets/viewer_svgs/grid_3d_edges.svg new file mode 100644 index 00000000..470a2135 --- /dev/null +++ b/assets/viewer_svgs/grid_3d_edges.svg @@ -0,0 +1,72 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/viewer_svgs/grid_3d_facets.svg b/assets/viewer_svgs/grid_3d_facets.svg new file mode 100644 index 00000000..ae1c511f --- /dev/null +++ b/assets/viewer_svgs/grid_3d_facets.svg @@ -0,0 +1,102 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/assets/viewer_svgs/grid_3d_points.svg b/assets/viewer_svgs/grid_3d_points.svg new file mode 100644 index 00000000..5a25cf31 --- /dev/null +++ b/assets/viewer_svgs/grid_3d_points.svg @@ -0,0 +1,172 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/viewer_svgs/point_set_points.svg b/assets/viewer_svgs/point_set_points.svg new file mode 100644 index 00000000..6b6014f3 --- /dev/null +++ b/assets/viewer_svgs/point_set_points.svg @@ -0,0 +1,86 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/assets/viewer_svgs/solid_edges.svg b/assets/viewer_svgs/solid_edges.svg new file mode 100644 index 00000000..e2ca7198 --- /dev/null +++ b/assets/viewer_svgs/solid_edges.svg @@ -0,0 +1,96 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + +   + + diff --git a/assets/viewer_svgs/solid_facets.svg b/assets/viewer_svgs/solid_facets.svg new file mode 100644 index 00000000..dcb276b4 --- /dev/null +++ b/assets/viewer_svgs/solid_facets.svg @@ -0,0 +1,119 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + +   + + diff --git a/assets/viewer_svgs/solid_points.svg b/assets/viewer_svgs/solid_points.svg new file mode 100644 index 00000000..f1ace08b --- /dev/null +++ b/assets/viewer_svgs/solid_points.svg @@ -0,0 +1,134 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + +   + + diff --git a/assets/viewer_svgs/solid_polyhedra.svg b/assets/viewer_svgs/solid_polyhedra.svg new file mode 100644 index 00000000..4adef1db --- /dev/null +++ b/assets/viewer_svgs/solid_polyhedra.svg @@ -0,0 +1,103 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + +   + + diff --git a/assets/viewer_svgs/surface_edges.svg b/assets/viewer_svgs/surface_edges.svg new file mode 100644 index 00000000..9848875d --- /dev/null +++ b/assets/viewer_svgs/surface_edges.svg @@ -0,0 +1,73 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/viewer_svgs/surface_points.svg b/assets/viewer_svgs/surface_points.svg new file mode 100644 index 00000000..f8701ff4 --- /dev/null +++ b/assets/viewer_svgs/surface_points.svg @@ -0,0 +1,115 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/assets/viewer_svgs/surface_triangles.svg b/assets/viewer_svgs/surface_triangles.svg new file mode 100644 index 00000000..17c9eb08 --- /dev/null +++ b/assets/viewer_svgs/surface_triangles.svg @@ -0,0 +1,92 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/components/ContextMenu.vue b/components/ContextMenu.vue new file mode 100644 index 00000000..f95df7f4 --- /dev/null +++ b/components/ContextMenu.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/components/ContextMenuItem.vue b/components/ContextMenuItem.vue new file mode 100644 index 00000000..4c58d664 --- /dev/null +++ b/components/ContextMenuItem.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/components/EdgedCurve/EdgesOptions.vue b/components/EdgedCurve/EdgesOptions.vue new file mode 100644 index 00000000..304e728a --- /dev/null +++ b/components/EdgedCurve/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/EdgedCurve/PointsOptions.vue b/components/EdgedCurve/PointsOptions.vue new file mode 100644 index 00000000..94e68c10 --- /dev/null +++ b/components/EdgedCurve/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Generic/Mesh/EdgesOptions.vue b/components/Generic/Mesh/EdgesOptions.vue new file mode 100644 index 00000000..b82d7352 --- /dev/null +++ b/components/Generic/Mesh/EdgesOptions.vue @@ -0,0 +1,48 @@ + + + diff --git a/components/Generic/Mesh/PointsOptions.vue b/components/Generic/Mesh/PointsOptions.vue new file mode 100644 index 00000000..62ec6b74 --- /dev/null +++ b/components/Generic/Mesh/PointsOptions.vue @@ -0,0 +1,72 @@ + + + diff --git a/components/Generic/Mesh/PolygonsOptions.vue b/components/Generic/Mesh/PolygonsOptions.vue new file mode 100644 index 00000000..3affb16c --- /dev/null +++ b/components/Generic/Mesh/PolygonsOptions.vue @@ -0,0 +1,65 @@ + + + diff --git a/components/Generic/Mesh/PolyhedraOptions.vue b/components/Generic/Mesh/PolyhedraOptions.vue new file mode 100644 index 00000000..53d180ea --- /dev/null +++ b/components/Generic/Mesh/PolyhedraOptions.vue @@ -0,0 +1,57 @@ + + + diff --git a/components/Generic/Model/EdgesOptions.vue b/components/Generic/Model/EdgesOptions.vue new file mode 100644 index 00000000..341470a6 --- /dev/null +++ b/components/Generic/Model/EdgesOptions.vue @@ -0,0 +1,28 @@ + + + diff --git a/components/Generic/Model/PointsOptions.vue b/components/Generic/Model/PointsOptions.vue new file mode 100644 index 00000000..fa47cd8d --- /dev/null +++ b/components/Generic/Model/PointsOptions.vue @@ -0,0 +1,53 @@ + + + diff --git a/components/Grid/2D/CellsOptions.vue b/components/Grid/2D/CellsOptions.vue new file mode 100644 index 00000000..8077d894 --- /dev/null +++ b/components/Grid/2D/CellsOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/Grid/2D/EdgesOptions.vue b/components/Grid/2D/EdgesOptions.vue new file mode 100644 index 00000000..33f38008 --- /dev/null +++ b/components/Grid/2D/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Grid/2D/PointsOptions.vue b/components/Grid/2D/PointsOptions.vue new file mode 100644 index 00000000..88a88e03 --- /dev/null +++ b/components/Grid/2D/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Grid/3D/CellsOptions.vue b/components/Grid/3D/CellsOptions.vue new file mode 100644 index 00000000..1ec1e623 --- /dev/null +++ b/components/Grid/3D/CellsOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/Grid/3D/EdgesOptions.vue b/components/Grid/3D/EdgesOptions.vue new file mode 100644 index 00000000..0e2401fd --- /dev/null +++ b/components/Grid/3D/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Grid/3D/FacetsOptions.vue b/components/Grid/3D/FacetsOptions.vue new file mode 100644 index 00000000..70e6a3e3 --- /dev/null +++ b/components/Grid/3D/FacetsOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/Grid/3D/PointsOptions.vue b/components/Grid/3D/PointsOptions.vue new file mode 100644 index 00000000..6240c3c6 --- /dev/null +++ b/components/Grid/3D/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/HybridSolid/EdgesOptions.vue b/components/HybridSolid/EdgesOptions.vue new file mode 100644 index 00000000..96532d56 --- /dev/null +++ b/components/HybridSolid/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/HybridSolid/PointsOptions.vue b/components/HybridSolid/PointsOptions.vue new file mode 100644 index 00000000..5cc591d5 --- /dev/null +++ b/components/HybridSolid/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/HybridSolid/PolygonsOptions.vue b/components/HybridSolid/PolygonsOptions.vue new file mode 100644 index 00000000..e5068a50 --- /dev/null +++ b/components/HybridSolid/PolygonsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/HybridSolid/PolyhedraOptions.vue b/components/HybridSolid/PolyhedraOptions.vue new file mode 100644 index 00000000..7a49f939 --- /dev/null +++ b/components/HybridSolid/PolyhedraOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Options/ColorPicker.vue b/components/Options/ColorPicker.vue new file mode 100644 index 00000000..06f1a871 --- /dev/null +++ b/components/Options/ColorPicker.vue @@ -0,0 +1,25 @@ + + + diff --git a/components/Options/ColoringTypeSelector.vue b/components/Options/ColoringTypeSelector.vue new file mode 100644 index 00000000..c92b29d0 --- /dev/null +++ b/components/Options/ColoringTypeSelector.vue @@ -0,0 +1,125 @@ + + + diff --git a/components/Options/PolygonAttributeSelector.vue b/components/Options/PolygonAttributeSelector.vue new file mode 100644 index 00000000..8eebac04 --- /dev/null +++ b/components/Options/PolygonAttributeSelector.vue @@ -0,0 +1,59 @@ + + + diff --git a/components/Options/PolyhedronAttributeSelector.vue b/components/Options/PolyhedronAttributeSelector.vue new file mode 100644 index 00000000..562f029f --- /dev/null +++ b/components/Options/PolyhedronAttributeSelector.vue @@ -0,0 +1,63 @@ + + + diff --git a/components/Options/TextureItem.vue b/components/Options/TextureItem.vue new file mode 100644 index 00000000..3f5af816 --- /dev/null +++ b/components/Options/TextureItem.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/components/Options/TexturesSelector.vue b/components/Options/TexturesSelector.vue new file mode 100644 index 00000000..a381f1de --- /dev/null +++ b/components/Options/TexturesSelector.vue @@ -0,0 +1,67 @@ + + + diff --git a/components/Options/VertexAttributeSelector.vue b/components/Options/VertexAttributeSelector.vue new file mode 100644 index 00000000..5761040b --- /dev/null +++ b/components/Options/VertexAttributeSelector.vue @@ -0,0 +1,60 @@ + + + diff --git a/components/Options/VisibilitySwitch.vue b/components/Options/VisibilitySwitch.vue new file mode 100644 index 00000000..9c1fed68 --- /dev/null +++ b/components/Options/VisibilitySwitch.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/PointSet/PointsOptions.vue b/components/PointSet/PointsOptions.vue new file mode 100644 index 00000000..792bd9fa --- /dev/null +++ b/components/PointSet/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/PointSet/SpecificPointsOptions.vue b/components/PointSet/SpecificPointsOptions.vue new file mode 100644 index 00000000..f2f1cb42 --- /dev/null +++ b/components/PointSet/SpecificPointsOptions.vue @@ -0,0 +1,73 @@ + + + diff --git a/components/PolygonalSurface/EdgesOptions.vue b/components/PolygonalSurface/EdgesOptions.vue new file mode 100644 index 00000000..82de81b2 --- /dev/null +++ b/components/PolygonalSurface/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/PolygonalSurface/PointsOptions.vue b/components/PolygonalSurface/PointsOptions.vue new file mode 100644 index 00000000..c75df1a9 --- /dev/null +++ b/components/PolygonalSurface/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/PolygonalSurface/PolygonsOptions.vue b/components/PolygonalSurface/PolygonsOptions.vue new file mode 100644 index 00000000..65e86356 --- /dev/null +++ b/components/PolygonalSurface/PolygonsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Solid/EdgesOptions.vue b/components/Solid/EdgesOptions.vue new file mode 100644 index 00000000..e0e3909c --- /dev/null +++ b/components/Solid/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Solid/PointsOptions.vue b/components/Solid/PointsOptions.vue new file mode 100644 index 00000000..5e818f2d --- /dev/null +++ b/components/Solid/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Solid/PolygonsOptions.vue b/components/Solid/PolygonsOptions.vue new file mode 100644 index 00000000..b741df2e --- /dev/null +++ b/components/Solid/PolygonsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/Solid/PolyhedraOptions.vue b/components/Solid/PolyhedraOptions.vue new file mode 100644 index 00000000..c2e21e28 --- /dev/null +++ b/components/Solid/PolyhedraOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/TetrahedralSolid/TetrahedraOptions.vue b/components/TetrahedralSolid/TetrahedraOptions.vue new file mode 100644 index 00000000..93b8d8b4 --- /dev/null +++ b/components/TetrahedralSolid/TetrahedraOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/TetrahedralSolid/TrianglesOptions.vue b/components/TetrahedralSolid/TrianglesOptions.vue new file mode 100644 index 00000000..d675dd0f --- /dev/null +++ b/components/TetrahedralSolid/TrianglesOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/TriangulatedSurface/EdgesOptions.vue b/components/TriangulatedSurface/EdgesOptions.vue new file mode 100644 index 00000000..a8ca0abd --- /dev/null +++ b/components/TriangulatedSurface/EdgesOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/TriangulatedSurface/PointsOptions.vue b/components/TriangulatedSurface/PointsOptions.vue new file mode 100644 index 00000000..66d12641 --- /dev/null +++ b/components/TriangulatedSurface/PointsOptions.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/TriangulatedSurface/TrianglesOptions.vue b/components/TriangulatedSurface/TrianglesOptions.vue new file mode 100644 index 00000000..2519ee04 --- /dev/null +++ b/components/TriangulatedSurface/TrianglesOptions.vue @@ -0,0 +1,15 @@ + + + diff --git a/internal_stores/data_style_state.js b/internal_stores/data_style_state.js new file mode 100644 index 00000000..41517acf --- /dev/null +++ b/internal_stores/data_style_state.js @@ -0,0 +1,18 @@ +import { reactive, computed } from "vue"; + +export default function useDataStyleState() { + const styles = reactive({}); + + const objectVisibility = computed(() => (id) => styles[id]?.visibility); + const selectedObjects = computed(() => { + const selection = []; + for (const [id, value] of Object.entries(styles)) { + if (value.visibility === true) { + selection.push(id); + } + } + return selection; + }); + + return { styles, objectVisibility, selectedObjects }; +} diff --git a/internal_stores/mesh/edges.js b/internal_stores/mesh/edges.js new file mode 100644 index 00000000..180550aa --- /dev/null +++ b/internal_stores/mesh/edges.js @@ -0,0 +1,106 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges; + +export function useMeshEdgesStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + + /** Getters **/ + function edgesVisibility(id) { + return dataStyleStore.styles[id].edges.visibility; + } + function edgesActiveColoring(id) { + return dataStyleStore.styles[id].edges.coloring.active; + } + function edgesColor(id) { + return dataStyleStore.styles[id].edges.coloring.color; + } + function edgesSize(id) { + return dataStyleStore.styles[id].edges.size; + } + + /** Actions **/ + function setEdgesVisibility(id, visibility) { + viewer_call( + { + schema: mesh_edges_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].edges.visibility = visibility; + console.log( + "setEdgesVisibility", + dataStyleStore.styles[id].edges.visibility + ); + }, + } + ); + } + function setEdgesActiveColoring(id, type) { + if (type == "color") + setEdgesColor(id, dataStyleStore.styles[id].edges.coloring.color); + else if (type == "vertex") { + const vertex = dataStyleStore.styles[id].edges.coloring.vertex; + if (vertex !== null) setEdgesVertexAttribute(id, vertex); + } else if (type == "edges") { + const edges = dataStyleStore.styles[id].edges.coloring.edges; + if (edges !== null) setEdgesEdgeAttribute(id, edges); + } else throw new Error("Unknown edges coloring type: " + type); + dataStyleStore.styles[id].edges.coloring.active = type; + console.log( + "setEdgesActiveColoring", + dataStyleStore.styles[id].edges.coloring.active + ); + } + + function setEdgesColor(id, color) { + viewer_call( + { + schema: mesh_edges_schemas.color, + params: { id, color }, + }, + { + response_function: () => { + dataStyleStore.styles[id].edges.coloring.color = color; + console.log( + "setEdgesColor", + dataStyleStore.styles[id].edges.coloring.color + ); + }, + } + ); + } + function setEdgesSize(id, size) { + viewer_call( + { + schema: mesh_edges_schemas.size, + params: { id, size }, + }, + { + response_function: () => { + dataStyleStore.styles[id].edges.size = size; + console.log("setEdgesSize", dataStyleStore.styles[id].edges.size); + }, + } + ); + } + + function applyEdgesStyle(id, style) { + setEdgesVisibility(id, style.visibility); + setEdgesActiveColoring(id, style.coloring.active); + // setEdgesSize(id, style.size); + } + + return { + edgesVisibility, + edgesActiveColoring, + edgesColor, + edgesSize, + setEdgesVisibility, + setEdgesActiveColoring, + setEdgesColor, + setEdgesSize, + applyEdgesStyle, + }; +} diff --git a/internal_stores/mesh/index.js b/internal_stores/mesh/index.js new file mode 100644 index 00000000..3527151e --- /dev/null +++ b/internal_stores/mesh/index.js @@ -0,0 +1,53 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +import { useMeshPointsStyle } from "./points.js"; +import { useMeshEdgesStyle } from "./edges.js"; +import { useMeshPolygonsStyle } from "./polygons.js"; +import { useMeshPolyhedraStyle } from "./polyhedra.js"; + +export default function useMeshStyle() { + const dataStyleStore = useDataStyleStore(); + const pointsStyleStore = useMeshPointsStyle(); + const edgesStyleStore = useMeshEdgesStyle(); + const polygonsStyleStore = useMeshPolygonsStyle(); + const polyhedraStyleStore = useMeshPolyhedraStyle(); + + function setMeshVisibility(id, visibility) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.mesh.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].visibility = visibility; + console.log( + "setMeshVisibility", + dataStyleStore.styles[id].visibility + ); + }, + } + ); + } + + function applyMeshDefaultStyle(id) { + const id_style = dataStyleStore.styles[id]; + for (const [key, value] of Object.entries(id_style)) { + if (key == "visibility") setMeshVisibility(id, value); + else if (key == "points") pointsStyleStore.applyPointsStyle(id, value); + else if (key == "edges") edgesStyleStore.applyEdgesStyle(id, value); + else if (key == "polygons") + polygonsStyleStore.applyPolygonsStyle(id, value); + else if (key == "polyhedra") + polyhedraStyleStore.applyPolyhedraStyle(id, value); + } + } + + return { + setMeshVisibility, + applyMeshDefaultStyle, + ...useMeshPointsStyle(), + ...useMeshEdgesStyle(), + ...useMeshPolygonsStyle(), + ...useMeshPolyhedraStyle(), + }; +} diff --git a/internal_stores/mesh/points.js b/internal_stores/mesh/points.js new file mode 100644 index 00000000..285e73f5 --- /dev/null +++ b/internal_stores/mesh/points.js @@ -0,0 +1,131 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points; + +export function useMeshPointsStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + + /** Getters **/ + function pointsVisibility(id) { + return dataStyleStore.styles[id].points.visibility; + } + function pointsActiveColoring(id) { + return dataStyleStore.styles[id].points.coloring.active; + } + function pointsColor(id) { + return dataStyleStore.styles[id].points.coloring.color; + } + function pointsVertexAttribute(id) { + return dataStyleStore.styles[id].points.coloring.vertex; + } + function pointsSize(id) { + return dataStyleStore.styles[id].points.size; + } + + /** Actions **/ + function setPointsVisibility(id, visibility) { + viewer_call( + { + schema: mesh_points_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.visibility = visibility; + console.log( + "setPointsVisibility", + dataStyleStore.styles[id].points.visibility + ); + }, + } + ); + } + + function setPointsColor(id, color) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.mesh.points.color, + params: { id, color }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.coloring.color = color; + console.log( + "setPointsColor", + dataStyleStore.styles[id].points.coloring.color + ); + }, + } + ); + } + function setPointsVertexAttribute(id, vertex_attribute) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.mesh.points.vertex_attribute, + params: { id, ...vertex_attribute }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.coloring.vertex = vertex_attribute; + console.log( + "setPointsVertexAttribute", + dataStyleStore.styles[id].points.coloring.vertex + ); + }, + } + ); + } + function setPointsSize(id, size) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.mesh.points.size, + params: { id, size }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.size = size; + console.log("setPointsSize", dataStyleStore.styles[id].points.size); + }, + } + ); + } + + function setPointsActiveColoring(id, type) { + if (type == "color") + dataStyleStore.setPointsColor( + id, + dataStyleStore.styles[id].points.coloring.color + ); + else if (type == "vertex") { + const vertex = dataStyleStore.styles[id].points.coloring.vertex; + if (vertex !== null) dataStyleStore.setPointsVertexAttribute(id, vertex); + } else throw new Error("Unknown edges coloring type: " + type); + dataStyleStore.styles[id].points.coloring.active = type; + console.log( + "setPointsActiveColoring", + dataStyleStore.styles[id].points.coloring.active + ); + } + + function applyPointsStyle(id, style) { + setPointsVisibility(id, style.visibility); + setPointsActiveColoring(id, style.coloring.active); + setPointsSize(id, style.size); + } + + return { + pointsVisibility, + pointsActiveColoring, + pointsColor, + pointsVertexAttribute, + pointsSize, + setPointsVisibility, + setPointsActiveColoring, + setPointsColor, + setPointsVertexAttribute, + setPointsSize, + applyPointsStyle, + }; +} + +export default useMeshPointsStyle; diff --git a/internal_stores/mesh/polygons.js b/internal_stores/mesh/polygons.js new file mode 100644 index 00000000..bbfe8f93 --- /dev/null +++ b/internal_stores/mesh/polygons.js @@ -0,0 +1,159 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const mesh_polygons_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons; + +export function useMeshPolygonsStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + + /** Getters **/ + function polygonsVisibility(id) { + return dataStyleStore.styles[id].polygons.visibility; + } + function polygonsActiveColoring(id) { + return dataStyleStore.styles[id].polygons.coloring.active; + } + function polygonsColor(id) { + return dataStyleStore.styles[id].polygons.coloring.color; + } + function polygonsTextures(id) { + return dataStyleStore.styles[id].polygons.coloring.textures; + } + function polygonsPolygonAttribute(id) { + return dataStyleStore.styles[id].polygons.coloring.polygon; + } + function polygonsVertexAttribute(id) { + return dataStyleStore.styles[id].polygons.coloring.vertex; + } + + /** Actions **/ + function setPolygonsVisibility(id, visibility) { + viewer_call( + { + schema: mesh_polygons_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polygons.visibility = visibility; + console.log( + "setPolygonsVisibility", + dataStyleStore.styles[id].polygons.visibility + ); + }, + } + ); + } + function setPolygonsActiveColoring(id, type) { + console.log("setPolygonsActiveColoring", id, type); + if (type == "color") { + setPolygonsColor(id, dataStyleStore.styles[id].polygons.coloring.color); + } else if (type == "textures") { + const textures = dataStyleStore.styles[id].polygons.coloring.textures; + if (textures !== null) setPolygonsTextures(id, textures); + } else if (type == "vertex") { + const vertex = dataStyleStore.styles[id].polygons.coloring.vertex; + if (vertex !== null) { + console.log("vertex", vertex); + setPolygonsVertexAttribute(id, vertex); + } + } else if (type == "polygon") { + const polygon = dataStyleStore.styles[id].polygons.coloring.polygon; + if (polygon !== null) setPolygonsPolygonAttribute(id, polygon); + } else throw new Error("Unknown polygons coloring type: " + type); + dataStyleStore.styles[id].polygons.coloring.active = type; + console.log( + "setPolygonsActiveColoring", + dataStyleStore.styles[id].polygons.coloring.active + ); + } + function setPolygonsColor(id, color) { + viewer_call( + { + schema: mesh_polygons_schemas.color, + params: { id, color }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polygons.coloring.color = color; + console.log( + "setPolygonsColor", + dataStyleStore.styles[id].polygons.coloring.color + ); + }, + } + ); + } + function setPolygonsTextures(id, textures) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.mesh.apply_textures, + params: { id, textures }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polygons.coloring.textures = textures; + console.log( + "setPolygonsTextures", + dataStyleStore.styles[id].polygons.coloring.textures + ); + }, + } + ); + } + function setPolygonsVertexAttribute(id, vertex_attribute) { + viewer_call( + { + schema: mesh_polygons_schemas.vertex_attribute, + params: { id, ...vertex_attribute }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polygons.coloring.vertex = vertex_attribute; + console.log( + "setPolygonsVertexAttribute", + dataStyleStore.styles[id].polygons.coloring.vertex + ); + }, + } + ); + } + function setPolygonsPolygonAttribute(id, polygon_attribute) { + viewer_call( + { + schema: mesh_polygons_schemas.polygon_attribute, + params: { id, ...polygon_attribute }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polygons.coloring.polygon = + polygon_attribute; + console.log( + "setPolygonsPolygonAttribute", + dataStyleStore.styles[id].polygons.coloring.polygon + ); + }, + } + ); + } + + function applyPolygonsStyle(id, style) { + setPolygonsVisibility(id, style.visibility); + setPolygonsActiveColoring(id, style.coloring.active); + } + + return { + polygonsVisibility, + polygonsActiveColoring, + polygonsColor, + polygonsTextures, + polygonsPolygonAttribute, + polygonsVertexAttribute, + setPolygonsVisibility, + setPolygonsActiveColoring, + setPolygonsColor, + setPolygonsTextures, + setPolygonsVertexAttribute, + setPolygonsPolygonAttribute, + applyPolygonsStyle, + }; +} diff --git a/internal_stores/mesh/polyhedra.js b/internal_stores/mesh/polyhedra.js new file mode 100644 index 00000000..9e98b07a --- /dev/null +++ b/internal_stores/mesh/polyhedra.js @@ -0,0 +1,139 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const mesh_polyhedra_schemas = + viewer_schemas.opengeodeweb_viewer.mesh.polyhedra; + +export function useMeshPolyhedraStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + + /** Getters **/ + function polyhedraVisibility(id) { + return dataStyleStore.styles[id].polyhedra.visibility; + } + function polyhedraActiveColoring(id) { + return dataStyleStore.styles[id].polyhedra.coloring.active; + } + function polyhedraColor(id) { + return dataStyleStore.styles[id].polyhedra.coloring.color; + } + function polyhedraVertexAttribute(id) { + return dataStyleStore.styles[id].polyhedra.coloring.vertex; + } + function polyhedraPolygonAttribute(id) { + return dataStyleStore.styles[id].polyhedra.coloring.polygon; + } + function polyhedraPolyhedronAttribute(id) { + return dataStyleStore.styles[id].polyhedra.coloring.polyhedron; + } + + /** Actions **/ + function setPolyhedraVisibility(id, visibility) { + viewer_call( + { + schema: mesh_polyhedra_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polyhedra.visibility = visibility; + console.log( + "setPolyhedraVisibility", + dataStyleStore.styles[id].polyhedra.visibility + ); + }, + } + ); + } + function setPolyhedraActiveColoring(id, type) { + if (type == "color") + setPolyhedraColor(id, dataStyleStore.styles[id].polyhedra.coloring.color); + else if (type == "vertex") { + const vertex = dataStyleStore.styles[id].polyhedra.coloring.vertex; + if (vertex !== null) setPolyhedraVertexAttribute(id, vertex); + } else if (type == "polyhedron") { + const polyhedron = + dataStyleStore.styles[id].polyhedra.coloring.polyhedron; + if (polyhedron !== null) setPolyhedraPolyhedronAttribute(id, polyhedron); + } else throw new Error("Unknown polyhedra coloring type: " + type); + dataStyleStore.styles[id].polyhedra.coloring.active = type; + console.log( + "setPolyhedraActiveColoring", + dataStyleStore.styles[id].polyhedra.coloring.active + ); + } + function setPolyhedraColor(id, color) { + viewer_call( + { + schema: mesh_polyhedra_schemas.color, + params: { id, color }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polyhedra.coloring.color = color; + console.log( + "setPolyhedraColor", + dataStyleStore.styles[id].polyhedra.coloring.color + ); + }, + } + ); + } + + function setPolyhedraVertexAttribute(id, vertex_attribute) { + viewer_call( + { + schema: mesh_polyhedra_schemas.vertex_attribute, + params: { id, ...vertex_attribute }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polyhedra.coloring.vertex = + vertex_attribute; + console.log( + "setPolyhedraVertexAttribute", + dataStyleStore.styles[id].polyhedra.coloring.vertex + ); + }, + } + ); + } + + function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) { + viewer_call( + { + schema: mesh_polyhedra_schemas.polyhedron_attribute, + params: { id, ...polyhedron_attribute }, + }, + { + response_function: () => { + dataStyleStore.styles[id].polyhedra.coloring.polyhedron = + polyhedron_attribute; + console.log( + "setPolyhedraPolyhedronAttribute", + dataStyleStore.styles[id].polyhedra.coloring.polyhedron + ); + }, + } + ); + } + + function applyPolyhedraStyle(id, style) { + setPolyhedraVisibility(id, style.visibility); + setPolyhedraActiveColoring(id, style.coloring.active); + } + + return { + polyhedraVisibility, + polyhedraActiveColoring, + polyhedraColor, + polyhedraVertexAttribute, + polyhedraPolygonAttribute, + polyhedraPolyhedronAttribute, + setPolyhedraVisibility, + setPolyhedraActiveColoring, + setPolyhedraColor, + setPolyhedraVertexAttribute, + setPolyhedraPolyhedronAttribute, + applyPolyhedraStyle, + }; +} diff --git a/internal_stores/model/blocks.js b/internal_stores/model/blocks.js new file mode 100644 index 00000000..92eca583 --- /dev/null +++ b/internal_stores/model/blocks.js @@ -0,0 +1,60 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +import _ from "lodash"; +const blocks_schemas = viewer_schemas.opengeodeweb_viewer.model.blocks; + +export function useBlocksStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + const dataBaseStore = useDataBaseStore(); + + /** Getters **/ + function blockVisibility(id, block_id) { + return dataStyleStore.styles[id].blocks[block_id].visibility; + } + + /** Actions **/ + function setBlockVisibility(id, block_ids, visibility) { + const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids); + viewer_call( + { + schema: blocks_schemas.visibility, + params: { id, block_ids: block_flat_indexes, visibility }, + }, + { + response_function: () => { + for (const block_id of block_ids) { + if (!dataStyleStore.styles[id].blocks[block_id]) + dataStyleStore.styles[id].blocks[block_id] = {}; + dataStyleStore.styles[id].blocks[block_id].visibility = visibility; + } + console.log("setBlockVisibility", block_ids, visibility); + }, + } + ); + } + + function setBlocksDefaultStyle(id) { + const block_ids = dataBaseStore.getBlocksUuids(id); + setBlockVisibility( + id, + block_ids, + dataStyleStore.styles[id].blocks.visibility + ); + } + + function applyBlocksStyle(id) { + const blocks = dataStyleStore.styles[id].blocks; + for (const [block_id, style] of Object.entries(blocks)) { + setBlockVisibility(id, [block_id], style.visibility); + } + } + + return { + blockVisibility, + setBlocksDefaultStyle, + setBlockVisibility, + applyBlocksStyle, + }; +} + +export default useBlocksStyle; diff --git a/internal_stores/model/corners.js b/internal_stores/model/corners.js new file mode 100644 index 00000000..e7a3758f --- /dev/null +++ b/internal_stores/model/corners.js @@ -0,0 +1,64 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const corners_schemas = viewer_schemas.opengeodeweb_viewer.model.corners; + +export function useCornersStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + const dataBaseStore = useDataBaseStore(); + + /** Getters **/ + function cornerVisibility(id, corner_id) { + return dataStyleStore.styles[id].corners[corner_id].visibility; + } + + /** Actions **/ + function setCornerVisibility(id, corner_ids, visibility) { + const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids); + viewer_call( + { + schema: corners_schemas.visibility, + params: { id, block_ids: corner_flat_indexes, visibility }, + }, + { + response_function: () => { + for (const corner_id of corner_ids) { + if (!dataStyleStore.styles[id].corners[corner_id]) + dataStyleStore.styles[id].corners[corner_id] = {}; + dataStyleStore.styles[id].corners[corner_id].visibility = + visibility; + } + console.log("setCornerVisibility", corner_ids, visibility); + }, + } + ); + } + + function setCornersDefaultStyle(id) { + const corner_ids = dataBaseStore.getCornersUuids(id); + console.log( + "dataStyleStore.styles[id].corners.visibility", + dataStyleStore.styles[id].corners.visibility + ); + setCornerVisibility( + id, + corner_ids, + dataStyleStore.styles[id].corners.visibility + ); + } + + function applyCornersStyle(id) { + const corners = dataStyleStore.styles[id].corners; + for (const [corner_id, style] of Object.entries(corners)) { + setCornerVisibility(id, [corner_id], style.visibility); + } + } + + return { + cornerVisibility, + setCornersDefaultStyle, + setCornerVisibility, + applyCornersStyle, + }; +} + +export default useCornersStyle; diff --git a/internal_stores/model/edges.js b/internal_stores/model/edges.js new file mode 100644 index 00000000..8ff334a5 --- /dev/null +++ b/internal_stores/model/edges.js @@ -0,0 +1,47 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const model_edges_schemas = viewer_schemas.opengeodeweb_viewer.model.edges; + +export function useModelEdgesStyle() { + const dataStyleStore = useDataStyleStore(); + + function modelEdgesVisibility(id) { + return dataStyleStore.styles[id].edges.visibility; + } + + function setModelEdgesVisibility(id, visibility) { + if (!dataStyleStore.styles[id]) { + dataStyleStore.styles[id] = {}; + } + if (!dataStyleStore.styles[id].edges) { + dataStyleStore.styles[id].edges = {}; + } + + viewer_call( + { + schema: model_edges_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].edges.visibility = visibility; + console.log("setModelEdgesVisibility", visibility); + }, + } + ); + } + + function applyModelEdgesStyle(id, style) { + setModelEdgesVisibility(id, style.visibility); + } + + function setModelEdgesDefaultStyle(id) { + setModelEdgesVisibility(id, false); + } + + return { + modelEdgesVisibility, + setModelEdgesVisibility, + applyModelEdgesStyle, + setModelEdgesDefaultStyle, + }; +} diff --git a/internal_stores/model/index.js b/internal_stores/model/index.js new file mode 100644 index 00000000..a615167a --- /dev/null +++ b/internal_stores/model/index.js @@ -0,0 +1,154 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +import { useSurfacesStyle } from "./surfaces.js"; +import { useCornersStyle } from "./corners.js"; +import { useBlocksStyle } from "./blocks.js"; +import { useLinesStyle } from "./lines.js"; +import { useModelEdgesStyle } from "./edges.js"; +import { useModelPointsStyle } from "./points.js"; + +export default function useModelStyle() { + /** States **/ + const dataBaseStore = useDataBaseStore(); + const dataStyleStore = useDataStyleStore(); + const cornersStyleStore = useCornersStyle(); + const linesStyleStore = useLinesStyle(); + const surfacesStyleStore = useSurfacesStyle(); + const blocksStyleStore = useBlocksStyle(); + const modelEdgesStore = useModelEdgesStyle(); + const modelPointsStore = useModelPointsStyle(); + + /** Getters **/ + function modelVisibility(id) { + return dataStyleStore.styles[id]?.visibility; + } + + function visibleMeshComponents(id) { + const visible_mesh_components = ref([]); + const styles = dataStyleStore.styles[id]; + if (!styles) return visible_mesh_components; + + Object.entries(styles.corners || {}).forEach(([corner_id, style]) => { + if (style.visibility) visible_mesh_components.value.push(corner_id); + }); + + Object.entries(styles.lines || {}).forEach(([line_id, style]) => { + if (style.visibility) visible_mesh_components.value.push(line_id); + }); + + Object.entries(styles.surfaces || {}).forEach(([surface_id, style]) => { + if (style.visibility) visible_mesh_components.value.push(surface_id); + }); + + Object.entries(styles.blocks || {}).forEach(([block_id, style]) => { + if (style.visibility) visible_mesh_components.value.push(block_id); + }); + + return visible_mesh_components; + } + + function modelMeshComponentVisibility(id, component_type, component_id) { + switch (component_type) { + case "Corner": + return cornersStyleStore.cornerVisibility(id, component_id); + case "Line": + return linesStyleStore.lineVisibility(id, component_id); + case "Surface": + return surfacesStyleStore.surfaceVisibility(id, component_id); + case "Block": + return blocksStyleStore.blockVisibility(id, component_id); + default: + return false; + } + } + + function setModelVisibility(id, visibility) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.model.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].visibility = visibility; + console.log("setModelVisibility", visibility); + }, + } + ); + } + + function setModelColor(id, color) { + viewer_call( + { + schema: viewer_schemas.opengeodeweb_viewer.model.color, + params: { id, color }, + }, + { + response_function: () => { + dataStyleStore.styles[id].color = color; + console.log("setModelColor", color); + }, + } + ); + } + + function setModelMeshComponentVisibility( + id, + component_type, + component_id, + visibility + ) { + switch (component_type) { + case "Corner": + cornersStyleStore.setCornerVisibility(id, [component_id], visibility); + break; + case "Line": + linesStyleStore.setLineVisibility(id, [component_id], visibility); + break; + case "Surface": + surfacesStyleStore.setSurfaceVisibility(id, [component_id], visibility); + break; + case "Block": + blocksStyleStore.setBlockVisibility(id, [component_id], visibility); + break; + } + } + + function applyModelDefaultStyle(id) { + const id_style = dataStyleStore.styles[id]; + for (const [key, value] of Object.entries(id_style)) { + if (key === "visibility") setModelVisibility(id, value); + else if (key === "edges") modelEdgesStore.applyModelEdgesStyle(id, value); + else if (key === "points") + modelPointsStore.applyModelPointsStyle(id, value); + } + } + + function setMeshComponentsDefaultStyle(id) { + const { mesh_components } = dataBaseStore.itemMetaDatas(id); + if ("Corner" in mesh_components) + cornersStyleStore.setCornersDefaultStyle(id); + if ("Line" in mesh_components) linesStyleStore.setLinesDefaultStyle(id); + if ("Surface" in mesh_components) + surfacesStyleStore.setSurfacesDefaultStyle(id); + if ("Block" in mesh_components) blocksStyleStore.setBlocksDefaultStyle(id); + modelEdgesStore.setModelEdgesDefaultStyle(id); + modelPointsStore.setModelPointsDefaultStyle(id); + } + + return { + modelVisibility, + visibleMeshComponents, + modelMeshComponentVisibility, + setModelVisibility, + setModelColor, + setModelMeshComponentVisibility, + applyModelDefaultStyle, + setMeshComponentsDefaultStyle, + ...useSurfacesStyle(), + ...useCornersStyle(), + ...useBlocksStyle(), + ...useLinesStyle(), + ...useModelEdgesStyle(), + ...useModelPointsStyle(), + }; +} diff --git a/internal_stores/model/lines.js b/internal_stores/model/lines.js new file mode 100644 index 00000000..24acd417 --- /dev/null +++ b/internal_stores/model/lines.js @@ -0,0 +1,81 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines; + +export function useLinesStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + const dataBaseStore = useDataBaseStore(); + + /** Getters **/ + function lineVisibility(id, line_id) { + return dataStyleStore.styles[id].lines[line_id].visibility; + } + + function linesColor(id) { + return dataStyleStore.styles[id].lines.color; + } + + /** Actions **/ + function setLineVisibility(id, line_ids, visibility) { + const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids); + viewer_call( + { + schema: lines_schemas.visibility, + params: { id, block_ids: line_flat_indexes, visibility }, + }, + { + response_function: () => { + for (const line_id of line_ids) { + if (!dataStyleStore.styles[id].lines[line_id]) + dataStyleStore.styles[id].lines[line_id] = {}; + dataStyleStore.styles[id].lines[line_id].visibility = visibility; + } + console.log("setLineVisibility", line_ids, visibility); + }, + } + ); + } + + function setLineColor(id, line_ids, color) { + const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids); + viewer_call( + { + schema: lines_schemas.color, + params: { id, block_ids: line_flat_indexes, color }, + }, + { + response_function: () => { + for (const line_id of line_ids) { + if (!dataStyleStore.styles[id].lines[line_id]) + dataStyleStore.styles[id].lines[line_id] = {}; + dataStyleStore.styles[id].lines[line_id].color = color; + } + console.log("setLineColor", line_ids, color); + }, + } + ); + } + + function setLinesDefaultStyle(id) { + const line_ids = dataBaseStore.getLinesUuids(id); + setLineVisibility(id, line_ids, dataStyleStore.styles[id].lines.visibility); + setLineColor(id, line_ids, dataStyleStore.styles[id].lines.color); + } + + function applyLinesStyle(id) { + const lines = dataStyleStore.styles[id].lines; + for (const [line_id, style] of Object.entries(lines)) { + setLineVisibility(id, [line_id], style.visibility); + } + } + + return { + lineVisibility, + linesColor, + setLinesDefaultStyle, + setLineVisibility, + applyLinesStyle, + }; +} + +export default useLinesStyle; diff --git a/internal_stores/model/points.js b/internal_stores/model/points.js new file mode 100644 index 00000000..d10bb390 --- /dev/null +++ b/internal_stores/model/points.js @@ -0,0 +1,61 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points; + +export function useModelPointsStyle() { + const dataStyleStore = useDataStyleStore(); + + function modelPointsVisibility(id) { + return dataStyleStore.styles[id].points.visibility; + } + function modelPointsSize(id) { + return dataStyleStore.styles[id].points.size; + } + + function setModelPointsVisibility(id, visibility) { + viewer_call( + { + schema: model_points_schemas.visibility, + params: { id, visibility }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.visibility = visibility; + console.log("setModelPointsVisibility", visibility); + }, + } + ); + } + + function setModelPointsSize(id, size) { + viewer_call( + { + schema: model_points_schemas.size, + params: { id, size }, + }, + { + response_function: () => { + dataStyleStore.styles[id].points.size = size; + console.log("setModelPointsSize", size); + }, + } + ); + } + + function applyModelPointsStyle(id, style) { + setModelPointsVisibility(id, style.visibility); + setModelPointsSize(id, style.size); + } + + function setModelPointsDefaultStyle(id) { + setModelPointsVisibility(id, false); + } + + return { + modelPointsVisibility, + modelPointsSize, + setModelPointsVisibility, + setModelPointsSize, + applyModelPointsStyle, + setModelPointsDefaultStyle, + }; +} diff --git a/internal_stores/model/surfaces.js b/internal_stores/model/surfaces.js new file mode 100644 index 00000000..273d5c27 --- /dev/null +++ b/internal_stores/model/surfaces.js @@ -0,0 +1,60 @@ +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; +const surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces; + +export function useSurfacesStyle() { + /** State **/ + const dataStyleStore = useDataStyleStore(); + const dataBaseStore = useDataBaseStore(); + + /** Getters **/ + function surfaceVisibility(id, surface_id) { + return dataStyleStore.styles[id].surfaces[surface_id].visibility; + } + + /** Actions **/ + function setSurfaceVisibility(id, surface_ids, visibility) { + const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids); + viewer_call( + { + schema: surfaces_schemas.visibility, + params: { id, block_ids: surface_flat_indexes, visibility }, + }, + { + response_function: () => { + for (const surface_id of surface_ids) { + if (!dataStyleStore.styles[id].surfaces[surface_id]) + dataStyleStore.styles[id].surfaces[surface_id] = {}; + dataStyleStore.styles[id].surfaces[surface_id].visibility = + visibility; + } + console.log("setSurfaceVisibility", surface_ids, visibility); + }, + } + ); + } + + function setSurfacesDefaultStyle(id) { + const surface_ids = dataBaseStore.getSurfacesUuids(id); + setSurfaceVisibility( + id, + surface_ids, + dataStyleStore.styles[id].surfaces.visibility + ); + } + + function applySurfacesStyle(id) { + const surfaces = dataStyleStore.styles[id].surfaces; + for (const [surface_id, style] of Object.entries(surfaces)) { + setSurfaceVisibility(id, [surface_id], style.visibility); + } + } + + return { + surfaceVisibility, + setSurfacesDefaultStyle, + setSurfaceVisibility, + applySurfacesStyle, + }; +} + +export default useSurfacesStyle; diff --git a/stores/menu.js b/stores/menu.js new file mode 100644 index 00000000..0de55a04 --- /dev/null +++ b/stores/menu.js @@ -0,0 +1,182 @@ +// PointSet components +import PointSetPointsOptions from "@ogw_f/components/Viewer/PointSet/PointsOptions.vue"; + +// EdgedCurve components +import EdgedCurvePointsOptions from "@ogw_f/components/Viewer/EdgedCurve/PointsOptions.vue"; +import EdgedCurveEdgesOptions from "@ogw_f/components/Viewer/EdgedCurve/EdgesOptions.vue"; + +// PolygonalSurface components +import PolygonalSurfacePointsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PointsOptions.vue"; +import PolygonalSurfaceEdgesOptions from "@ogw_f/components/Viewer/PolygonalSurface/EdgesOptions.vue"; +import PolygonalSurfacePolygonsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PolygonsOptions.vue"; + +// TriangulatedSurface components +import TriangulatedSurfacePointsOptions from "@ogw_f/components/Viewer/TriangulatedSurface/PointsOptions.vue"; +import TriangulatedSurfaceEdgesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/EdgesOptions.vue"; +import TriangulatedSurfaceTrianglesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/TrianglesOptions.vue"; + +// Grid 2D components +import Grid2DPointsOptions from "@ogw_f/components/Viewer/Grid/2D/PointsOptions.vue"; +import Grid2DEdgesOptions from "@ogw_f/components/Viewer/Grid/2D/EdgesOptions.vue"; +import Grid2DCellsOptions from "@ogw_f/components/Viewer/Grid/2D/CellsOptions.vue"; + +// Grid 3D components +import Grid3DPointsOptions from "@ogw_f/components/Viewer/Grid/3D/PointsOptions.vue"; +import Grid3DEdgesOptions from "@ogw_f/components/Viewer/Grid/3D/EdgesOptions.vue"; +import Grid3DFacetsOptions from "@ogw_f/components/Viewer/Grid/3D/FacetsOptions.vue"; +import Grid3DCellsOptions from "@ogw_f/components/Viewer/Grid/3D/CellsOptions.vue"; + +// Solid components +import SolidPointsOptions from "@ogw_f/components/Viewer/Solid/PointsOptions.vue"; +import SolidEdgesOptions from "@ogw_f/components/Viewer/Solid/EdgesOptions.vue"; +import SolidPolygonsOptions from "@ogw_f/components/Viewer/Solid/PolygonsOptions.vue"; +import SolidPolyhedraOptions from "@ogw_f/components/Viewer/Solid/PolyhedraOptions.vue"; + +// TetrahedralSolid components +import TetrahedralSolidTrianglesOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TrianglesOptions.vue"; +import TetrahedralSolidTetrahedraOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue"; + +// Model components +import ModelEdgesOptions from "@ogw_f/components/Viewer/Generic/Model/EdgesOptions.vue"; +import ModelPointsOptions from "@ogw_f/components/Viewer/Generic/Model/PointsOptions.vue"; + +const PointSet_menu = [PointSetPointsOptions]; + +const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions]; + +const PolygonalSurface_menu = [ + PolygonalSurfacePointsOptions, + PolygonalSurfaceEdgesOptions, + PolygonalSurfacePolygonsOptions, +]; + +const TriangulatedSurface_menu = [ + TriangulatedSurfacePointsOptions, + TriangulatedSurfaceEdgesOptions, + TriangulatedSurfaceTrianglesOptions, +]; + +const Grid2D_menu = [ + Grid2DPointsOptions, + Grid2DEdgesOptions, + Grid2DCellsOptions, +]; +const Grid3D_menu = [ + Grid3DPointsOptions, + Grid3DEdgesOptions, + Grid3DFacetsOptions, + Grid3DCellsOptions, +]; + +const Solid_menu = [ + SolidPointsOptions, + SolidEdgesOptions, + SolidPolygonsOptions, + SolidPolyhedraOptions, +]; + +const TetrahedralSolid_menu = [ + SolidPointsOptions, + SolidEdgesOptions, + TetrahedralSolidTrianglesOptions, + TetrahedralSolidTetrahedraOptions, +]; + +const BRep_menu = [ModelEdgesOptions, ModelPointsOptions]; + +const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]; + +const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]; +const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]; + +const Section_menu = [ModelEdgesOptions, ModelPointsOptions]; + +const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]; + +const menusData = { + mesh: { + EdgedCurve2D: EdgedCurve_menu, + EdgedCurve3D: EdgedCurve_menu, + HybridSolid3D: Solid_menu, + LightRegularGrid2D: Grid2D_menu, + LightRegularGrid3D: Grid3D_menu, + PointSet2D: PointSet_menu, + PointSet3D: PointSet_menu, + PolygonalSurface2D: PolygonalSurface_menu, + PolygonalSurface3D: PolygonalSurface_menu, + PolyhedralSolid3D: Solid_menu, + RegularGrid2D: Grid2D_menu, + RegularGrid3D: Grid3D_menu, + TetrahedralSolid3D: TetrahedralSolid_menu, + TriangulatedSurface2D: TriangulatedSurface_menu, + TriangulatedSurface3D: TriangulatedSurface_menu, + }, + model: { + BRep: BRep_menu, + CrossSection: CrossSection_menu, + ImplicitCrossSection: ImplicitCrossSection_menu, + ImplicitStructuralModel: ImplicitStructuralModel_menu, + Section: Section_menu, + StructuralModel: StructuralModel_menu, + }, +}; + +export const useMenuStore = defineStore("menu", () => { + const menus = ref(menusData); + const display_menu = ref(false); + const current_id = ref(null); + const menuX = ref(0); + const menuY = ref(0); + const containerWidth = ref(window.innerWidth); + const containerHeight = ref(window.innerHeight); + + function getMenuItems(objectType, geodeObject) { + if (!objectType || !geodeObject || !menus.value[objectType]) { + return []; + } + return menus.value[objectType][geodeObject] || []; + }; + + function closeMenu() { + display_menu.value = false; + current_id.value = null; + } + + async function openMenu(id, x, y, containerWidth, containerHeight) { + await closeMenu(); + current_id.value = id; + + if (x !== undefined && y !== undefined) { + menuX.value = x; + menuY.value = y; + } + + if (containerWidth) containerWidth.value = containerWidth; + if (containerHeight) containerHeight.value = containerHeight; + + display_menu.value = true; + } + + function showItemsWithDelay() { + const DELAY = 50; + const items = getMenuItems(); + items.forEach((item, index) => { + setTimeout(() => { + item.visible = true; + }, index * DELAY); + }); + } + + return { + display_menu, + current_id, + menuX, + menuY, + containerWidth, + containerHeight, + getMenuItems, + closeMenu, + openMenu, + showItemsWithDelay, + }; +}); From e1c74cb570b3add0d93a6afe1e9b9532233fd2c6 Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:10:53 +0000 Subject: [PATCH 4/7] Apply prepare changes --- components/ContextMenu.vue | 156 +++++++++--------- components/ContextMenuItem.vue | 88 +++++----- components/EdgedCurve/EdgesOptions.vue | 8 +- components/EdgedCurve/PointsOptions.vue | 8 +- components/Generic/Mesh/EdgesOptions.vue | 48 +++--- components/Generic/Mesh/PointsOptions.vue | 55 +++--- components/Generic/Mesh/PolygonsOptions.vue | 76 ++++----- components/Generic/Mesh/PolyhedraOptions.vue | 61 +++---- components/Generic/Model/EdgesOptions.vue | 23 +-- components/Generic/Model/PointsOptions.vue | 32 ++-- components/Grid/2D/CellsOptions.vue | 8 +- components/Grid/2D/EdgesOptions.vue | 8 +- components/Grid/2D/PointsOptions.vue | 8 +- components/Grid/3D/CellsOptions.vue | 8 +- components/Grid/3D/EdgesOptions.vue | 8 +- components/Grid/3D/FacetsOptions.vue | 8 +- components/Grid/3D/PointsOptions.vue | 8 +- components/HybridSolid/EdgesOptions.vue | 8 +- components/HybridSolid/PointsOptions.vue | 8 +- components/HybridSolid/PolygonsOptions.vue | 8 +- components/HybridSolid/PolyhedraOptions.vue | 8 +- components/Options/ColorPicker.vue | 18 +- components/Options/ColoringTypeSelector.vue | 114 ++++++------- .../Options/PolygonAttributeSelector.vue | 82 ++++----- .../Options/PolyhedronAttributeSelector.vue | 94 +++++------ components/Options/TextureItem.vue | 112 ++++++------- components/Options/TexturesSelector.vue | 40 ++--- .../Options/VertexAttributeSelector.vue | 88 +++++----- components/Options/VisibilitySwitch.vue | 2 +- components/PointSet/PointsOptions.vue | 8 +- components/PointSet/SpecificPointsOptions.vue | 55 +++--- components/PolygonalSurface/EdgesOptions.vue | 8 +- components/PolygonalSurface/PointsOptions.vue | 8 +- .../PolygonalSurface/PolygonsOptions.vue | 8 +- components/Solid/EdgesOptions.vue | 8 +- components/Solid/PointsOptions.vue | 8 +- components/Solid/PolygonsOptions.vue | 8 +- components/Solid/PolyhedraOptions.vue | 8 +- .../TetrahedralSolid/TetrahedraOptions.vue | 8 +- .../TetrahedralSolid/TrianglesOptions.vue | 8 +- .../TriangulatedSurface/EdgesOptions.vue | 8 +- .../TriangulatedSurface/PointsOptions.vue | 8 +- .../TriangulatedSurface/TrianglesOptions.vue | 8 +- internal_stores/data_style_state.js | 16 +- internal_stores/mesh/edges.js | 66 ++++---- internal_stores/mesh/index.js | 45 +++-- internal_stores/mesh/points.js | 80 ++++----- internal_stores/mesh/polygons.js | 100 +++++------ internal_stores/mesh/polyhedra.js | 85 +++++----- internal_stores/model/blocks.js | 38 ++--- internal_stores/model/corners.js | 41 +++-- internal_stores/model/edges.js | 26 +-- internal_stores/model/index.js | 124 +++++++------- internal_stores/model/lines.js | 50 +++--- internal_stores/model/points.js | 34 ++-- internal_stores/model/surfaces.js | 36 ++-- stores/menu.js | 130 +++++++-------- 57 files changed, 1111 insertions(+), 1112 deletions(-) diff --git a/components/ContextMenu.vue b/components/ContextMenu.vue index f95df7f4..dbcfd11f 100644 --- a/components/ContextMenu.vue +++ b/components/ContextMenu.vue @@ -25,99 +25,99 @@ diff --git a/components/ContextMenuItem.vue b/components/ContextMenuItem.vue index 4c58d664..e6ac0d39 100644 --- a/components/ContextMenuItem.vue +++ b/components/ContextMenuItem.vue @@ -34,55 +34,57 @@ diff --git a/components/EdgedCurve/EdgesOptions.vue b/components/EdgedCurve/EdgesOptions.vue index 304e728a..9eef6804 100644 --- a/components/EdgedCurve/EdgesOptions.vue +++ b/components/EdgedCurve/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/EdgedCurve/PointsOptions.vue b/components/EdgedCurve/PointsOptions.vue index 94e68c10..b623a7bf 100644 --- a/components/EdgedCurve/PointsOptions.vue +++ b/components/EdgedCurve/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Generic/Mesh/EdgesOptions.vue b/components/Generic/Mesh/EdgesOptions.vue index b82d7352..7efcff08 100644 --- a/components/Generic/Mesh/EdgesOptions.vue +++ b/components/Generic/Mesh/EdgesOptions.vue @@ -18,31 +18,31 @@ diff --git a/components/Generic/Mesh/PointsOptions.vue b/components/Generic/Mesh/PointsOptions.vue index 62ec6b74..5c4ad9fc 100644 --- a/components/Generic/Mesh/PointsOptions.vue +++ b/components/Generic/Mesh/PointsOptions.vue @@ -39,34 +39,35 @@ diff --git a/components/Generic/Mesh/PolygonsOptions.vue b/components/Generic/Mesh/PolygonsOptions.vue index 3affb16c..1d24c64f 100644 --- a/components/Generic/Mesh/PolygonsOptions.vue +++ b/components/Generic/Mesh/PolygonsOptions.vue @@ -21,45 +21,45 @@ diff --git a/components/Generic/Mesh/PolyhedraOptions.vue b/components/Generic/Mesh/PolyhedraOptions.vue index 53d180ea..03fe2c3e 100644 --- a/components/Generic/Mesh/PolyhedraOptions.vue +++ b/components/Generic/Mesh/PolyhedraOptions.vue @@ -21,37 +21,38 @@ diff --git a/components/Generic/Model/EdgesOptions.vue b/components/Generic/Model/EdgesOptions.vue index 341470a6..939947ad 100644 --- a/components/Generic/Model/EdgesOptions.vue +++ b/components/Generic/Model/EdgesOptions.vue @@ -11,18 +11,19 @@ diff --git a/components/Generic/Model/PointsOptions.vue b/components/Generic/Model/PointsOptions.vue index fa47cd8d..2ac49621 100644 --- a/components/Generic/Model/PointsOptions.vue +++ b/components/Generic/Model/PointsOptions.vue @@ -30,24 +30,24 @@ diff --git a/components/Grid/2D/CellsOptions.vue b/components/Grid/2D/CellsOptions.vue index 8077d894..25b00af8 100644 --- a/components/Grid/2D/CellsOptions.vue +++ b/components/Grid/2D/CellsOptions.vue @@ -7,9 +7,9 @@ diff --git a/components/Grid/2D/EdgesOptions.vue b/components/Grid/2D/EdgesOptions.vue index 33f38008..19c975ad 100644 --- a/components/Grid/2D/EdgesOptions.vue +++ b/components/Grid/2D/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Grid/2D/PointsOptions.vue b/components/Grid/2D/PointsOptions.vue index 88a88e03..42139a52 100644 --- a/components/Grid/2D/PointsOptions.vue +++ b/components/Grid/2D/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Grid/3D/CellsOptions.vue b/components/Grid/3D/CellsOptions.vue index 1ec1e623..4d9d8e29 100644 --- a/components/Grid/3D/CellsOptions.vue +++ b/components/Grid/3D/CellsOptions.vue @@ -7,9 +7,9 @@ diff --git a/components/Grid/3D/EdgesOptions.vue b/components/Grid/3D/EdgesOptions.vue index 0e2401fd..e8040fcc 100644 --- a/components/Grid/3D/EdgesOptions.vue +++ b/components/Grid/3D/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Grid/3D/FacetsOptions.vue b/components/Grid/3D/FacetsOptions.vue index 70e6a3e3..5dec27f7 100644 --- a/components/Grid/3D/FacetsOptions.vue +++ b/components/Grid/3D/FacetsOptions.vue @@ -7,9 +7,9 @@ diff --git a/components/Grid/3D/PointsOptions.vue b/components/Grid/3D/PointsOptions.vue index 6240c3c6..383c9ac7 100644 --- a/components/Grid/3D/PointsOptions.vue +++ b/components/Grid/3D/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/HybridSolid/EdgesOptions.vue b/components/HybridSolid/EdgesOptions.vue index 96532d56..58bad2d4 100644 --- a/components/HybridSolid/EdgesOptions.vue +++ b/components/HybridSolid/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/HybridSolid/PointsOptions.vue b/components/HybridSolid/PointsOptions.vue index 5cc591d5..01320719 100644 --- a/components/HybridSolid/PointsOptions.vue +++ b/components/HybridSolid/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/HybridSolid/PolygonsOptions.vue b/components/HybridSolid/PolygonsOptions.vue index e5068a50..67c81a7a 100644 --- a/components/HybridSolid/PolygonsOptions.vue +++ b/components/HybridSolid/PolygonsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/HybridSolid/PolyhedraOptions.vue b/components/HybridSolid/PolyhedraOptions.vue index 7a49f939..eb21bf47 100644 --- a/components/HybridSolid/PolyhedraOptions.vue +++ b/components/HybridSolid/PolyhedraOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Options/ColorPicker.vue b/components/Options/ColorPicker.vue index 06f1a871..c0671209 100644 --- a/components/Options/ColorPicker.vue +++ b/components/Options/ColorPicker.vue @@ -11,15 +11,15 @@ diff --git a/components/Options/ColoringTypeSelector.vue b/components/Options/ColoringTypeSelector.vue index c92b29d0..dca239d0 100644 --- a/components/Options/ColoringTypeSelector.vue +++ b/components/Options/ColoringTypeSelector.vue @@ -57,69 +57,69 @@ diff --git a/components/Options/PolygonAttributeSelector.vue b/components/Options/PolygonAttributeSelector.vue index 8eebac04..a80a02e2 100644 --- a/components/Options/PolygonAttributeSelector.vue +++ b/components/Options/PolygonAttributeSelector.vue @@ -8,52 +8,52 @@ diff --git a/components/Options/PolyhedronAttributeSelector.vue b/components/Options/PolyhedronAttributeSelector.vue index 562f029f..485c8ae3 100644 --- a/components/Options/PolyhedronAttributeSelector.vue +++ b/components/Options/PolyhedronAttributeSelector.vue @@ -8,56 +8,56 @@ diff --git a/components/Options/TextureItem.vue b/components/Options/TextureItem.vue index 3f5af816..4070bdc7 100644 --- a/components/Options/TextureItem.vue +++ b/components/Options/TextureItem.vue @@ -36,81 +36,81 @@ diff --git a/components/Options/TexturesSelector.vue b/components/Options/TexturesSelector.vue index a381f1de..66ec8517 100644 --- a/components/Options/TexturesSelector.vue +++ b/components/Options/TexturesSelector.vue @@ -39,29 +39,29 @@ diff --git a/components/Options/VertexAttributeSelector.vue b/components/Options/VertexAttributeSelector.vue index 5761040b..b7a6b5bd 100644 --- a/components/Options/VertexAttributeSelector.vue +++ b/components/Options/VertexAttributeSelector.vue @@ -8,53 +8,53 @@ diff --git a/components/Options/VisibilitySwitch.vue b/components/Options/VisibilitySwitch.vue index 9c1fed68..3dd8e9d6 100644 --- a/components/Options/VisibilitySwitch.vue +++ b/components/Options/VisibilitySwitch.vue @@ -10,5 +10,5 @@ diff --git a/components/PointSet/PointsOptions.vue b/components/PointSet/PointsOptions.vue index 792bd9fa..0d9369fd 100644 --- a/components/PointSet/PointsOptions.vue +++ b/components/PointSet/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/PointSet/SpecificPointsOptions.vue b/components/PointSet/SpecificPointsOptions.vue index f2f1cb42..8d2c7371 100644 --- a/components/PointSet/SpecificPointsOptions.vue +++ b/components/PointSet/SpecificPointsOptions.vue @@ -40,34 +40,35 @@ diff --git a/components/PolygonalSurface/EdgesOptions.vue b/components/PolygonalSurface/EdgesOptions.vue index 82de81b2..4e5d54de 100644 --- a/components/PolygonalSurface/EdgesOptions.vue +++ b/components/PolygonalSurface/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/PolygonalSurface/PointsOptions.vue b/components/PolygonalSurface/PointsOptions.vue index c75df1a9..a5c514d6 100644 --- a/components/PolygonalSurface/PointsOptions.vue +++ b/components/PolygonalSurface/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/PolygonalSurface/PolygonsOptions.vue b/components/PolygonalSurface/PolygonsOptions.vue index 65e86356..4f3865fb 100644 --- a/components/PolygonalSurface/PolygonsOptions.vue +++ b/components/PolygonalSurface/PolygonsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Solid/EdgesOptions.vue b/components/Solid/EdgesOptions.vue index e0e3909c..a9f00eb4 100644 --- a/components/Solid/EdgesOptions.vue +++ b/components/Solid/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Solid/PointsOptions.vue b/components/Solid/PointsOptions.vue index 5e818f2d..3746c2d4 100644 --- a/components/Solid/PointsOptions.vue +++ b/components/Solid/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Solid/PolygonsOptions.vue b/components/Solid/PolygonsOptions.vue index b741df2e..16733305 100644 --- a/components/Solid/PolygonsOptions.vue +++ b/components/Solid/PolygonsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/Solid/PolyhedraOptions.vue b/components/Solid/PolyhedraOptions.vue index c2e21e28..4b6468b5 100644 --- a/components/Solid/PolyhedraOptions.vue +++ b/components/Solid/PolyhedraOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/TetrahedralSolid/TetrahedraOptions.vue b/components/TetrahedralSolid/TetrahedraOptions.vue index 93b8d8b4..ca5eb0a0 100644 --- a/components/TetrahedralSolid/TetrahedraOptions.vue +++ b/components/TetrahedralSolid/TetrahedraOptions.vue @@ -7,9 +7,9 @@ diff --git a/components/TetrahedralSolid/TrianglesOptions.vue b/components/TetrahedralSolid/TrianglesOptions.vue index d675dd0f..fead6783 100644 --- a/components/TetrahedralSolid/TrianglesOptions.vue +++ b/components/TetrahedralSolid/TrianglesOptions.vue @@ -7,9 +7,9 @@ diff --git a/components/TriangulatedSurface/EdgesOptions.vue b/components/TriangulatedSurface/EdgesOptions.vue index a8ca0abd..9852fcb4 100644 --- a/components/TriangulatedSurface/EdgesOptions.vue +++ b/components/TriangulatedSurface/EdgesOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/TriangulatedSurface/PointsOptions.vue b/components/TriangulatedSurface/PointsOptions.vue index 66d12641..00a19abb 100644 --- a/components/TriangulatedSurface/PointsOptions.vue +++ b/components/TriangulatedSurface/PointsOptions.vue @@ -6,9 +6,9 @@ diff --git a/components/TriangulatedSurface/TrianglesOptions.vue b/components/TriangulatedSurface/TrianglesOptions.vue index 2519ee04..38dfb8c0 100644 --- a/components/TriangulatedSurface/TrianglesOptions.vue +++ b/components/TriangulatedSurface/TrianglesOptions.vue @@ -7,9 +7,9 @@ diff --git a/internal_stores/data_style_state.js b/internal_stores/data_style_state.js index 41517acf..967974ee 100644 --- a/internal_stores/data_style_state.js +++ b/internal_stores/data_style_state.js @@ -1,18 +1,18 @@ -import { reactive, computed } from "vue"; +import { reactive, computed } from "vue" export default function useDataStyleState() { - const styles = reactive({}); + const styles = reactive({}) - const objectVisibility = computed(() => (id) => styles[id]?.visibility); + const objectVisibility = computed(() => (id) => styles[id]?.visibility) const selectedObjects = computed(() => { - const selection = []; + const selection = [] for (const [id, value] of Object.entries(styles)) { if (value.visibility === true) { - selection.push(id); + selection.push(id) } } - return selection; - }); + return selection + }) - return { styles, objectVisibility, selectedObjects }; + return { styles, objectVisibility, selectedObjects } } diff --git a/internal_stores/mesh/edges.js b/internal_stores/mesh/edges.js index 180550aa..34a44b68 100644 --- a/internal_stores/mesh/edges.js +++ b/internal_stores/mesh/edges.js @@ -1,22 +1,22 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges export function useMeshEdgesStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() /** Getters **/ function edgesVisibility(id) { - return dataStyleStore.styles[id].edges.visibility; + return dataStyleStore.styles[id].edges.visibility } function edgesActiveColoring(id) { - return dataStyleStore.styles[id].edges.coloring.active; + return dataStyleStore.styles[id].edges.coloring.active } function edgesColor(id) { - return dataStyleStore.styles[id].edges.coloring.color; + return dataStyleStore.styles[id].edges.coloring.color } function edgesSize(id) { - return dataStyleStore.styles[id].edges.size; + return dataStyleStore.styles[id].edges.size } /** Actions **/ @@ -28,30 +28,30 @@ export function useMeshEdgesStyle() { }, { response_function: () => { - dataStyleStore.styles[id].edges.visibility = visibility; + dataStyleStore.styles[id].edges.visibility = visibility console.log( "setEdgesVisibility", - dataStyleStore.styles[id].edges.visibility - ); + dataStyleStore.styles[id].edges.visibility, + ) }, - } - ); + }, + ) } function setEdgesActiveColoring(id, type) { if (type == "color") - setEdgesColor(id, dataStyleStore.styles[id].edges.coloring.color); + setEdgesColor(id, dataStyleStore.styles[id].edges.coloring.color) else if (type == "vertex") { - const vertex = dataStyleStore.styles[id].edges.coloring.vertex; - if (vertex !== null) setEdgesVertexAttribute(id, vertex); + const vertex = dataStyleStore.styles[id].edges.coloring.vertex + if (vertex !== null) setEdgesVertexAttribute(id, vertex) } else if (type == "edges") { - const edges = dataStyleStore.styles[id].edges.coloring.edges; - if (edges !== null) setEdgesEdgeAttribute(id, edges); - } else throw new Error("Unknown edges coloring type: " + type); - dataStyleStore.styles[id].edges.coloring.active = type; + const edges = dataStyleStore.styles[id].edges.coloring.edges + if (edges !== null) setEdgesEdgeAttribute(id, edges) + } else throw new Error("Unknown edges coloring type: " + type) + dataStyleStore.styles[id].edges.coloring.active = type console.log( "setEdgesActiveColoring", - dataStyleStore.styles[id].edges.coloring.active - ); + dataStyleStore.styles[id].edges.coloring.active, + ) } function setEdgesColor(id, color) { @@ -62,14 +62,14 @@ export function useMeshEdgesStyle() { }, { response_function: () => { - dataStyleStore.styles[id].edges.coloring.color = color; + dataStyleStore.styles[id].edges.coloring.color = color console.log( "setEdgesColor", - dataStyleStore.styles[id].edges.coloring.color - ); + dataStyleStore.styles[id].edges.coloring.color, + ) }, - } - ); + }, + ) } function setEdgesSize(id, size) { viewer_call( @@ -79,16 +79,16 @@ export function useMeshEdgesStyle() { }, { response_function: () => { - dataStyleStore.styles[id].edges.size = size; - console.log("setEdgesSize", dataStyleStore.styles[id].edges.size); + dataStyleStore.styles[id].edges.size = size + console.log("setEdgesSize", dataStyleStore.styles[id].edges.size) }, - } - ); + }, + ) } function applyEdgesStyle(id, style) { - setEdgesVisibility(id, style.visibility); - setEdgesActiveColoring(id, style.coloring.active); + setEdgesVisibility(id, style.visibility) + setEdgesActiveColoring(id, style.coloring.active) // setEdgesSize(id, style.size); } @@ -102,5 +102,5 @@ export function useMeshEdgesStyle() { setEdgesColor, setEdgesSize, applyEdgesStyle, - }; + } } diff --git a/internal_stores/mesh/index.js b/internal_stores/mesh/index.js index 3527151e..e827a75c 100644 --- a/internal_stores/mesh/index.js +++ b/internal_stores/mesh/index.js @@ -1,15 +1,15 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -import { useMeshPointsStyle } from "./points.js"; -import { useMeshEdgesStyle } from "./edges.js"; -import { useMeshPolygonsStyle } from "./polygons.js"; -import { useMeshPolyhedraStyle } from "./polyhedra.js"; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +import { useMeshPointsStyle } from "./points.js" +import { useMeshEdgesStyle } from "./edges.js" +import { useMeshPolygonsStyle } from "./polygons.js" +import { useMeshPolyhedraStyle } from "./polyhedra.js" export default function useMeshStyle() { - const dataStyleStore = useDataStyleStore(); - const pointsStyleStore = useMeshPointsStyle(); - const edgesStyleStore = useMeshEdgesStyle(); - const polygonsStyleStore = useMeshPolygonsStyle(); - const polyhedraStyleStore = useMeshPolyhedraStyle(); + const dataStyleStore = useDataStyleStore() + const pointsStyleStore = useMeshPointsStyle() + const edgesStyleStore = useMeshEdgesStyle() + const polygonsStyleStore = useMeshPolygonsStyle() + const polyhedraStyleStore = useMeshPolyhedraStyle() function setMeshVisibility(id, visibility) { viewer_call( @@ -19,26 +19,23 @@ export default function useMeshStyle() { }, { response_function: () => { - dataStyleStore.styles[id].visibility = visibility; - console.log( - "setMeshVisibility", - dataStyleStore.styles[id].visibility - ); + dataStyleStore.styles[id].visibility = visibility + console.log("setMeshVisibility", dataStyleStore.styles[id].visibility) }, - } - ); + }, + ) } function applyMeshDefaultStyle(id) { - const id_style = dataStyleStore.styles[id]; + const id_style = dataStyleStore.styles[id] for (const [key, value] of Object.entries(id_style)) { - if (key == "visibility") setMeshVisibility(id, value); - else if (key == "points") pointsStyleStore.applyPointsStyle(id, value); - else if (key == "edges") edgesStyleStore.applyEdgesStyle(id, value); + if (key == "visibility") setMeshVisibility(id, value) + else if (key == "points") pointsStyleStore.applyPointsStyle(id, value) + else if (key == "edges") edgesStyleStore.applyEdgesStyle(id, value) else if (key == "polygons") - polygonsStyleStore.applyPolygonsStyle(id, value); + polygonsStyleStore.applyPolygonsStyle(id, value) else if (key == "polyhedra") - polyhedraStyleStore.applyPolyhedraStyle(id, value); + polyhedraStyleStore.applyPolyhedraStyle(id, value) } } @@ -49,5 +46,5 @@ export default function useMeshStyle() { ...useMeshEdgesStyle(), ...useMeshPolygonsStyle(), ...useMeshPolyhedraStyle(), - }; + } } diff --git a/internal_stores/mesh/points.js b/internal_stores/mesh/points.js index 285e73f5..91e1316f 100644 --- a/internal_stores/mesh/points.js +++ b/internal_stores/mesh/points.js @@ -1,25 +1,25 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points export function useMeshPointsStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() /** Getters **/ function pointsVisibility(id) { - return dataStyleStore.styles[id].points.visibility; + return dataStyleStore.styles[id].points.visibility } function pointsActiveColoring(id) { - return dataStyleStore.styles[id].points.coloring.active; + return dataStyleStore.styles[id].points.coloring.active } function pointsColor(id) { - return dataStyleStore.styles[id].points.coloring.color; + return dataStyleStore.styles[id].points.coloring.color } function pointsVertexAttribute(id) { - return dataStyleStore.styles[id].points.coloring.vertex; + return dataStyleStore.styles[id].points.coloring.vertex } function pointsSize(id) { - return dataStyleStore.styles[id].points.size; + return dataStyleStore.styles[id].points.size } /** Actions **/ @@ -31,14 +31,14 @@ export function useMeshPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.visibility = visibility; + dataStyleStore.styles[id].points.visibility = visibility console.log( "setPointsVisibility", - dataStyleStore.styles[id].points.visibility - ); + dataStyleStore.styles[id].points.visibility, + ) }, - } - ); + }, + ) } function setPointsColor(id, color) { @@ -49,14 +49,14 @@ export function useMeshPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.coloring.color = color; + dataStyleStore.styles[id].points.coloring.color = color console.log( "setPointsColor", - dataStyleStore.styles[id].points.coloring.color - ); + dataStyleStore.styles[id].points.coloring.color, + ) }, - } - ); + }, + ) } function setPointsVertexAttribute(id, vertex_attribute) { viewer_call( @@ -66,14 +66,14 @@ export function useMeshPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.coloring.vertex = vertex_attribute; + dataStyleStore.styles[id].points.coloring.vertex = vertex_attribute console.log( "setPointsVertexAttribute", - dataStyleStore.styles[id].points.coloring.vertex - ); + dataStyleStore.styles[id].points.coloring.vertex, + ) }, - } - ); + }, + ) } function setPointsSize(id, size) { viewer_call( @@ -83,34 +83,34 @@ export function useMeshPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.size = size; - console.log("setPointsSize", dataStyleStore.styles[id].points.size); + dataStyleStore.styles[id].points.size = size + console.log("setPointsSize", dataStyleStore.styles[id].points.size) }, - } - ); + }, + ) } function setPointsActiveColoring(id, type) { if (type == "color") dataStyleStore.setPointsColor( id, - dataStyleStore.styles[id].points.coloring.color - ); + dataStyleStore.styles[id].points.coloring.color, + ) else if (type == "vertex") { - const vertex = dataStyleStore.styles[id].points.coloring.vertex; - if (vertex !== null) dataStyleStore.setPointsVertexAttribute(id, vertex); - } else throw new Error("Unknown edges coloring type: " + type); - dataStyleStore.styles[id].points.coloring.active = type; + const vertex = dataStyleStore.styles[id].points.coloring.vertex + if (vertex !== null) dataStyleStore.setPointsVertexAttribute(id, vertex) + } else throw new Error("Unknown edges coloring type: " + type) + dataStyleStore.styles[id].points.coloring.active = type console.log( "setPointsActiveColoring", - dataStyleStore.styles[id].points.coloring.active - ); + dataStyleStore.styles[id].points.coloring.active, + ) } function applyPointsStyle(id, style) { - setPointsVisibility(id, style.visibility); - setPointsActiveColoring(id, style.coloring.active); - setPointsSize(id, style.size); + setPointsVisibility(id, style.visibility) + setPointsActiveColoring(id, style.coloring.active) + setPointsSize(id, style.size) } return { @@ -125,7 +125,7 @@ export function useMeshPointsStyle() { setPointsVertexAttribute, setPointsSize, applyPointsStyle, - }; + } } -export default useMeshPointsStyle; +export default useMeshPointsStyle diff --git a/internal_stores/mesh/polygons.js b/internal_stores/mesh/polygons.js index bbfe8f93..4c0ea40c 100644 --- a/internal_stores/mesh/polygons.js +++ b/internal_stores/mesh/polygons.js @@ -1,28 +1,28 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const mesh_polygons_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const mesh_polygons_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons export function useMeshPolygonsStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() /** Getters **/ function polygonsVisibility(id) { - return dataStyleStore.styles[id].polygons.visibility; + return dataStyleStore.styles[id].polygons.visibility } function polygonsActiveColoring(id) { - return dataStyleStore.styles[id].polygons.coloring.active; + return dataStyleStore.styles[id].polygons.coloring.active } function polygonsColor(id) { - return dataStyleStore.styles[id].polygons.coloring.color; + return dataStyleStore.styles[id].polygons.coloring.color } function polygonsTextures(id) { - return dataStyleStore.styles[id].polygons.coloring.textures; + return dataStyleStore.styles[id].polygons.coloring.textures } function polygonsPolygonAttribute(id) { - return dataStyleStore.styles[id].polygons.coloring.polygon; + return dataStyleStore.styles[id].polygons.coloring.polygon } function polygonsVertexAttribute(id) { - return dataStyleStore.styles[id].polygons.coloring.vertex; + return dataStyleStore.styles[id].polygons.coloring.vertex } /** Actions **/ @@ -34,37 +34,37 @@ export function useMeshPolygonsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polygons.visibility = visibility; + dataStyleStore.styles[id].polygons.visibility = visibility console.log( "setPolygonsVisibility", - dataStyleStore.styles[id].polygons.visibility - ); + dataStyleStore.styles[id].polygons.visibility, + ) }, - } - ); + }, + ) } function setPolygonsActiveColoring(id, type) { - console.log("setPolygonsActiveColoring", id, type); + console.log("setPolygonsActiveColoring", id, type) if (type == "color") { - setPolygonsColor(id, dataStyleStore.styles[id].polygons.coloring.color); + setPolygonsColor(id, dataStyleStore.styles[id].polygons.coloring.color) } else if (type == "textures") { - const textures = dataStyleStore.styles[id].polygons.coloring.textures; - if (textures !== null) setPolygonsTextures(id, textures); + const textures = dataStyleStore.styles[id].polygons.coloring.textures + if (textures !== null) setPolygonsTextures(id, textures) } else if (type == "vertex") { - const vertex = dataStyleStore.styles[id].polygons.coloring.vertex; + const vertex = dataStyleStore.styles[id].polygons.coloring.vertex if (vertex !== null) { - console.log("vertex", vertex); - setPolygonsVertexAttribute(id, vertex); + console.log("vertex", vertex) + setPolygonsVertexAttribute(id, vertex) } } else if (type == "polygon") { - const polygon = dataStyleStore.styles[id].polygons.coloring.polygon; - if (polygon !== null) setPolygonsPolygonAttribute(id, polygon); - } else throw new Error("Unknown polygons coloring type: " + type); - dataStyleStore.styles[id].polygons.coloring.active = type; + const polygon = dataStyleStore.styles[id].polygons.coloring.polygon + if (polygon !== null) setPolygonsPolygonAttribute(id, polygon) + } else throw new Error("Unknown polygons coloring type: " + type) + dataStyleStore.styles[id].polygons.coloring.active = type console.log( "setPolygonsActiveColoring", - dataStyleStore.styles[id].polygons.coloring.active - ); + dataStyleStore.styles[id].polygons.coloring.active, + ) } function setPolygonsColor(id, color) { viewer_call( @@ -74,14 +74,14 @@ export function useMeshPolygonsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polygons.coloring.color = color; + dataStyleStore.styles[id].polygons.coloring.color = color console.log( "setPolygonsColor", - dataStyleStore.styles[id].polygons.coloring.color - ); + dataStyleStore.styles[id].polygons.coloring.color, + ) }, - } - ); + }, + ) } function setPolygonsTextures(id, textures) { viewer_call( @@ -91,14 +91,14 @@ export function useMeshPolygonsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polygons.coloring.textures = textures; + dataStyleStore.styles[id].polygons.coloring.textures = textures console.log( "setPolygonsTextures", - dataStyleStore.styles[id].polygons.coloring.textures - ); + dataStyleStore.styles[id].polygons.coloring.textures, + ) }, - } - ); + }, + ) } function setPolygonsVertexAttribute(id, vertex_attribute) { viewer_call( @@ -108,14 +108,14 @@ export function useMeshPolygonsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polygons.coloring.vertex = vertex_attribute; + dataStyleStore.styles[id].polygons.coloring.vertex = vertex_attribute console.log( "setPolygonsVertexAttribute", - dataStyleStore.styles[id].polygons.coloring.vertex - ); + dataStyleStore.styles[id].polygons.coloring.vertex, + ) }, - } - ); + }, + ) } function setPolygonsPolygonAttribute(id, polygon_attribute) { viewer_call( @@ -126,19 +126,19 @@ export function useMeshPolygonsStyle() { { response_function: () => { dataStyleStore.styles[id].polygons.coloring.polygon = - polygon_attribute; + polygon_attribute console.log( "setPolygonsPolygonAttribute", - dataStyleStore.styles[id].polygons.coloring.polygon - ); + dataStyleStore.styles[id].polygons.coloring.polygon, + ) }, - } - ); + }, + ) } function applyPolygonsStyle(id, style) { - setPolygonsVisibility(id, style.visibility); - setPolygonsActiveColoring(id, style.coloring.active); + setPolygonsVisibility(id, style.visibility) + setPolygonsActiveColoring(id, style.coloring.active) } return { @@ -155,5 +155,5 @@ export function useMeshPolygonsStyle() { setPolygonsVertexAttribute, setPolygonsPolygonAttribute, applyPolygonsStyle, - }; + } } diff --git a/internal_stores/mesh/polyhedra.js b/internal_stores/mesh/polyhedra.js index 9e98b07a..eb225798 100644 --- a/internal_stores/mesh/polyhedra.js +++ b/internal_stores/mesh/polyhedra.js @@ -1,29 +1,28 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const mesh_polyhedra_schemas = - viewer_schemas.opengeodeweb_viewer.mesh.polyhedra; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const mesh_polyhedra_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra export function useMeshPolyhedraStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() /** Getters **/ function polyhedraVisibility(id) { - return dataStyleStore.styles[id].polyhedra.visibility; + return dataStyleStore.styles[id].polyhedra.visibility } function polyhedraActiveColoring(id) { - return dataStyleStore.styles[id].polyhedra.coloring.active; + return dataStyleStore.styles[id].polyhedra.coloring.active } function polyhedraColor(id) { - return dataStyleStore.styles[id].polyhedra.coloring.color; + return dataStyleStore.styles[id].polyhedra.coloring.color } function polyhedraVertexAttribute(id) { - return dataStyleStore.styles[id].polyhedra.coloring.vertex; + return dataStyleStore.styles[id].polyhedra.coloring.vertex } function polyhedraPolygonAttribute(id) { - return dataStyleStore.styles[id].polyhedra.coloring.polygon; + return dataStyleStore.styles[id].polyhedra.coloring.polygon } function polyhedraPolyhedronAttribute(id) { - return dataStyleStore.styles[id].polyhedra.coloring.polyhedron; + return dataStyleStore.styles[id].polyhedra.coloring.polyhedron } /** Actions **/ @@ -35,31 +34,30 @@ export function useMeshPolyhedraStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polyhedra.visibility = visibility; + dataStyleStore.styles[id].polyhedra.visibility = visibility console.log( "setPolyhedraVisibility", - dataStyleStore.styles[id].polyhedra.visibility - ); + dataStyleStore.styles[id].polyhedra.visibility, + ) }, - } - ); + }, + ) } function setPolyhedraActiveColoring(id, type) { if (type == "color") - setPolyhedraColor(id, dataStyleStore.styles[id].polyhedra.coloring.color); + setPolyhedraColor(id, dataStyleStore.styles[id].polyhedra.coloring.color) else if (type == "vertex") { - const vertex = dataStyleStore.styles[id].polyhedra.coloring.vertex; - if (vertex !== null) setPolyhedraVertexAttribute(id, vertex); + const vertex = dataStyleStore.styles[id].polyhedra.coloring.vertex + if (vertex !== null) setPolyhedraVertexAttribute(id, vertex) } else if (type == "polyhedron") { - const polyhedron = - dataStyleStore.styles[id].polyhedra.coloring.polyhedron; - if (polyhedron !== null) setPolyhedraPolyhedronAttribute(id, polyhedron); - } else throw new Error("Unknown polyhedra coloring type: " + type); - dataStyleStore.styles[id].polyhedra.coloring.active = type; + const polyhedron = dataStyleStore.styles[id].polyhedra.coloring.polyhedron + if (polyhedron !== null) setPolyhedraPolyhedronAttribute(id, polyhedron) + } else throw new Error("Unknown polyhedra coloring type: " + type) + dataStyleStore.styles[id].polyhedra.coloring.active = type console.log( "setPolyhedraActiveColoring", - dataStyleStore.styles[id].polyhedra.coloring.active - ); + dataStyleStore.styles[id].polyhedra.coloring.active, + ) } function setPolyhedraColor(id, color) { viewer_call( @@ -69,14 +67,14 @@ export function useMeshPolyhedraStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polyhedra.coloring.color = color; + dataStyleStore.styles[id].polyhedra.coloring.color = color console.log( "setPolyhedraColor", - dataStyleStore.styles[id].polyhedra.coloring.color - ); + dataStyleStore.styles[id].polyhedra.coloring.color, + ) }, - } - ); + }, + ) } function setPolyhedraVertexAttribute(id, vertex_attribute) { @@ -87,15 +85,14 @@ export function useMeshPolyhedraStyle() { }, { response_function: () => { - dataStyleStore.styles[id].polyhedra.coloring.vertex = - vertex_attribute; + dataStyleStore.styles[id].polyhedra.coloring.vertex = vertex_attribute console.log( "setPolyhedraVertexAttribute", - dataStyleStore.styles[id].polyhedra.coloring.vertex - ); + dataStyleStore.styles[id].polyhedra.coloring.vertex, + ) }, - } - ); + }, + ) } function setPolyhedraPolyhedronAttribute(id, polyhedron_attribute) { @@ -107,19 +104,19 @@ export function useMeshPolyhedraStyle() { { response_function: () => { dataStyleStore.styles[id].polyhedra.coloring.polyhedron = - polyhedron_attribute; + polyhedron_attribute console.log( "setPolyhedraPolyhedronAttribute", - dataStyleStore.styles[id].polyhedra.coloring.polyhedron - ); + dataStyleStore.styles[id].polyhedra.coloring.polyhedron, + ) }, - } - ); + }, + ) } function applyPolyhedraStyle(id, style) { - setPolyhedraVisibility(id, style.visibility); - setPolyhedraActiveColoring(id, style.coloring.active); + setPolyhedraVisibility(id, style.visibility) + setPolyhedraActiveColoring(id, style.coloring.active) } return { @@ -135,5 +132,5 @@ export function useMeshPolyhedraStyle() { setPolyhedraVertexAttribute, setPolyhedraPolyhedronAttribute, applyPolyhedraStyle, - }; + } } diff --git a/internal_stores/model/blocks.js b/internal_stores/model/blocks.js index 92eca583..3c64f7c6 100644 --- a/internal_stores/model/blocks.js +++ b/internal_stores/model/blocks.js @@ -1,20 +1,20 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -import _ from "lodash"; -const blocks_schemas = viewer_schemas.opengeodeweb_viewer.model.blocks; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +import _ from "lodash" +const blocks_schemas = viewer_schemas.opengeodeweb_viewer.model.blocks export function useBlocksStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); - const dataBaseStore = useDataBaseStore(); + const dataStyleStore = useDataStyleStore() + const dataBaseStore = useDataBaseStore() /** Getters **/ function blockVisibility(id, block_id) { - return dataStyleStore.styles[id].blocks[block_id].visibility; + return dataStyleStore.styles[id].blocks[block_id].visibility } /** Actions **/ function setBlockVisibility(id, block_ids, visibility) { - const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids); + const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids) viewer_call( { schema: blocks_schemas.visibility, @@ -24,28 +24,28 @@ export function useBlocksStyle() { response_function: () => { for (const block_id of block_ids) { if (!dataStyleStore.styles[id].blocks[block_id]) - dataStyleStore.styles[id].blocks[block_id] = {}; - dataStyleStore.styles[id].blocks[block_id].visibility = visibility; + dataStyleStore.styles[id].blocks[block_id] = {} + dataStyleStore.styles[id].blocks[block_id].visibility = visibility } - console.log("setBlockVisibility", block_ids, visibility); + console.log("setBlockVisibility", block_ids, visibility) }, - } - ); + }, + ) } function setBlocksDefaultStyle(id) { - const block_ids = dataBaseStore.getBlocksUuids(id); + const block_ids = dataBaseStore.getBlocksUuids(id) setBlockVisibility( id, block_ids, - dataStyleStore.styles[id].blocks.visibility - ); + dataStyleStore.styles[id].blocks.visibility, + ) } function applyBlocksStyle(id) { - const blocks = dataStyleStore.styles[id].blocks; + const blocks = dataStyleStore.styles[id].blocks for (const [block_id, style] of Object.entries(blocks)) { - setBlockVisibility(id, [block_id], style.visibility); + setBlockVisibility(id, [block_id], style.visibility) } } @@ -54,7 +54,7 @@ export function useBlocksStyle() { setBlocksDefaultStyle, setBlockVisibility, applyBlocksStyle, - }; + } } -export default useBlocksStyle; +export default useBlocksStyle diff --git a/internal_stores/model/corners.js b/internal_stores/model/corners.js index e7a3758f..e3b2a481 100644 --- a/internal_stores/model/corners.js +++ b/internal_stores/model/corners.js @@ -1,19 +1,19 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const corners_schemas = viewer_schemas.opengeodeweb_viewer.model.corners; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const corners_schemas = viewer_schemas.opengeodeweb_viewer.model.corners export function useCornersStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); - const dataBaseStore = useDataBaseStore(); + const dataStyleStore = useDataStyleStore() + const dataBaseStore = useDataBaseStore() /** Getters **/ function cornerVisibility(id, corner_id) { - return dataStyleStore.styles[id].corners[corner_id].visibility; + return dataStyleStore.styles[id].corners[corner_id].visibility } /** Actions **/ function setCornerVisibility(id, corner_ids, visibility) { - const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids); + const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids) viewer_call( { schema: corners_schemas.visibility, @@ -23,33 +23,32 @@ export function useCornersStyle() { response_function: () => { for (const corner_id of corner_ids) { if (!dataStyleStore.styles[id].corners[corner_id]) - dataStyleStore.styles[id].corners[corner_id] = {}; - dataStyleStore.styles[id].corners[corner_id].visibility = - visibility; + dataStyleStore.styles[id].corners[corner_id] = {} + dataStyleStore.styles[id].corners[corner_id].visibility = visibility } - console.log("setCornerVisibility", corner_ids, visibility); + console.log("setCornerVisibility", corner_ids, visibility) }, - } - ); + }, + ) } function setCornersDefaultStyle(id) { - const corner_ids = dataBaseStore.getCornersUuids(id); + const corner_ids = dataBaseStore.getCornersUuids(id) console.log( "dataStyleStore.styles[id].corners.visibility", - dataStyleStore.styles[id].corners.visibility - ); + dataStyleStore.styles[id].corners.visibility, + ) setCornerVisibility( id, corner_ids, - dataStyleStore.styles[id].corners.visibility - ); + dataStyleStore.styles[id].corners.visibility, + ) } function applyCornersStyle(id) { - const corners = dataStyleStore.styles[id].corners; + const corners = dataStyleStore.styles[id].corners for (const [corner_id, style] of Object.entries(corners)) { - setCornerVisibility(id, [corner_id], style.visibility); + setCornerVisibility(id, [corner_id], style.visibility) } } @@ -58,7 +57,7 @@ export function useCornersStyle() { setCornersDefaultStyle, setCornerVisibility, applyCornersStyle, - }; + } } -export default useCornersStyle; +export default useCornersStyle diff --git a/internal_stores/model/edges.js b/internal_stores/model/edges.js index 8ff334a5..4b62e8ac 100644 --- a/internal_stores/model/edges.js +++ b/internal_stores/model/edges.js @@ -1,19 +1,19 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const model_edges_schemas = viewer_schemas.opengeodeweb_viewer.model.edges; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const model_edges_schemas = viewer_schemas.opengeodeweb_viewer.model.edges export function useModelEdgesStyle() { - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() function modelEdgesVisibility(id) { - return dataStyleStore.styles[id].edges.visibility; + return dataStyleStore.styles[id].edges.visibility } function setModelEdgesVisibility(id, visibility) { if (!dataStyleStore.styles[id]) { - dataStyleStore.styles[id] = {}; + dataStyleStore.styles[id] = {} } if (!dataStyleStore.styles[id].edges) { - dataStyleStore.styles[id].edges = {}; + dataStyleStore.styles[id].edges = {} } viewer_call( @@ -23,19 +23,19 @@ export function useModelEdgesStyle() { }, { response_function: () => { - dataStyleStore.styles[id].edges.visibility = visibility; - console.log("setModelEdgesVisibility", visibility); + dataStyleStore.styles[id].edges.visibility = visibility + console.log("setModelEdgesVisibility", visibility) }, - } - ); + }, + ) } function applyModelEdgesStyle(id, style) { - setModelEdgesVisibility(id, style.visibility); + setModelEdgesVisibility(id, style.visibility) } function setModelEdgesDefaultStyle(id) { - setModelEdgesVisibility(id, false); + setModelEdgesVisibility(id, false) } return { @@ -43,5 +43,5 @@ export function useModelEdgesStyle() { setModelEdgesVisibility, applyModelEdgesStyle, setModelEdgesDefaultStyle, - }; + } } diff --git a/internal_stores/model/index.js b/internal_stores/model/index.js index a615167a..93a3b403 100644 --- a/internal_stores/model/index.js +++ b/internal_stores/model/index.js @@ -1,63 +1,63 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -import { useSurfacesStyle } from "./surfaces.js"; -import { useCornersStyle } from "./corners.js"; -import { useBlocksStyle } from "./blocks.js"; -import { useLinesStyle } from "./lines.js"; -import { useModelEdgesStyle } from "./edges.js"; -import { useModelPointsStyle } from "./points.js"; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +import { useSurfacesStyle } from "./surfaces.js" +import { useCornersStyle } from "./corners.js" +import { useBlocksStyle } from "./blocks.js" +import { useLinesStyle } from "./lines.js" +import { useModelEdgesStyle } from "./edges.js" +import { useModelPointsStyle } from "./points.js" export default function useModelStyle() { /** States **/ - const dataBaseStore = useDataBaseStore(); - const dataStyleStore = useDataStyleStore(); - const cornersStyleStore = useCornersStyle(); - const linesStyleStore = useLinesStyle(); - const surfacesStyleStore = useSurfacesStyle(); - const blocksStyleStore = useBlocksStyle(); - const modelEdgesStore = useModelEdgesStyle(); - const modelPointsStore = useModelPointsStyle(); + const dataBaseStore = useDataBaseStore() + const dataStyleStore = useDataStyleStore() + const cornersStyleStore = useCornersStyle() + const linesStyleStore = useLinesStyle() + const surfacesStyleStore = useSurfacesStyle() + const blocksStyleStore = useBlocksStyle() + const modelEdgesStore = useModelEdgesStyle() + const modelPointsStore = useModelPointsStyle() /** Getters **/ function modelVisibility(id) { - return dataStyleStore.styles[id]?.visibility; + return dataStyleStore.styles[id]?.visibility } function visibleMeshComponents(id) { - const visible_mesh_components = ref([]); - const styles = dataStyleStore.styles[id]; - if (!styles) return visible_mesh_components; + const visible_mesh_components = ref([]) + const styles = dataStyleStore.styles[id] + if (!styles) return visible_mesh_components Object.entries(styles.corners || {}).forEach(([corner_id, style]) => { - if (style.visibility) visible_mesh_components.value.push(corner_id); - }); + if (style.visibility) visible_mesh_components.value.push(corner_id) + }) Object.entries(styles.lines || {}).forEach(([line_id, style]) => { - if (style.visibility) visible_mesh_components.value.push(line_id); - }); + if (style.visibility) visible_mesh_components.value.push(line_id) + }) Object.entries(styles.surfaces || {}).forEach(([surface_id, style]) => { - if (style.visibility) visible_mesh_components.value.push(surface_id); - }); + if (style.visibility) visible_mesh_components.value.push(surface_id) + }) Object.entries(styles.blocks || {}).forEach(([block_id, style]) => { - if (style.visibility) visible_mesh_components.value.push(block_id); - }); + if (style.visibility) visible_mesh_components.value.push(block_id) + }) - return visible_mesh_components; + return visible_mesh_components } function modelMeshComponentVisibility(id, component_type, component_id) { switch (component_type) { case "Corner": - return cornersStyleStore.cornerVisibility(id, component_id); + return cornersStyleStore.cornerVisibility(id, component_id) case "Line": - return linesStyleStore.lineVisibility(id, component_id); + return linesStyleStore.lineVisibility(id, component_id) case "Surface": - return surfacesStyleStore.surfaceVisibility(id, component_id); + return surfacesStyleStore.surfaceVisibility(id, component_id) case "Block": - return blocksStyleStore.blockVisibility(id, component_id); + return blocksStyleStore.blockVisibility(id, component_id) default: - return false; + return false } } @@ -69,11 +69,11 @@ export default function useModelStyle() { }, { response_function: () => { - dataStyleStore.styles[id].visibility = visibility; - console.log("setModelVisibility", visibility); + dataStyleStore.styles[id].visibility = visibility + console.log("setModelVisibility", visibility) }, - } - ); + }, + ) } function setModelColor(id, color) { @@ -84,55 +84,55 @@ export default function useModelStyle() { }, { response_function: () => { - dataStyleStore.styles[id].color = color; - console.log("setModelColor", color); + dataStyleStore.styles[id].color = color + console.log("setModelColor", color) }, - } - ); + }, + ) } function setModelMeshComponentVisibility( id, component_type, component_id, - visibility + visibility, ) { switch (component_type) { case "Corner": - cornersStyleStore.setCornerVisibility(id, [component_id], visibility); - break; + cornersStyleStore.setCornerVisibility(id, [component_id], visibility) + break case "Line": - linesStyleStore.setLineVisibility(id, [component_id], visibility); - break; + linesStyleStore.setLineVisibility(id, [component_id], visibility) + break case "Surface": - surfacesStyleStore.setSurfaceVisibility(id, [component_id], visibility); - break; + surfacesStyleStore.setSurfaceVisibility(id, [component_id], visibility) + break case "Block": - blocksStyleStore.setBlockVisibility(id, [component_id], visibility); - break; + blocksStyleStore.setBlockVisibility(id, [component_id], visibility) + break } } function applyModelDefaultStyle(id) { - const id_style = dataStyleStore.styles[id]; + const id_style = dataStyleStore.styles[id] for (const [key, value] of Object.entries(id_style)) { - if (key === "visibility") setModelVisibility(id, value); - else if (key === "edges") modelEdgesStore.applyModelEdgesStyle(id, value); + if (key === "visibility") setModelVisibility(id, value) + else if (key === "edges") modelEdgesStore.applyModelEdgesStyle(id, value) else if (key === "points") - modelPointsStore.applyModelPointsStyle(id, value); + modelPointsStore.applyModelPointsStyle(id, value) } } function setMeshComponentsDefaultStyle(id) { - const { mesh_components } = dataBaseStore.itemMetaDatas(id); + const { mesh_components } = dataBaseStore.itemMetaDatas(id) if ("Corner" in mesh_components) - cornersStyleStore.setCornersDefaultStyle(id); - if ("Line" in mesh_components) linesStyleStore.setLinesDefaultStyle(id); + cornersStyleStore.setCornersDefaultStyle(id) + if ("Line" in mesh_components) linesStyleStore.setLinesDefaultStyle(id) if ("Surface" in mesh_components) - surfacesStyleStore.setSurfacesDefaultStyle(id); - if ("Block" in mesh_components) blocksStyleStore.setBlocksDefaultStyle(id); - modelEdgesStore.setModelEdgesDefaultStyle(id); - modelPointsStore.setModelPointsDefaultStyle(id); + surfacesStyleStore.setSurfacesDefaultStyle(id) + if ("Block" in mesh_components) blocksStyleStore.setBlocksDefaultStyle(id) + modelEdgesStore.setModelEdgesDefaultStyle(id) + modelPointsStore.setModelPointsDefaultStyle(id) } return { @@ -150,5 +150,5 @@ export default function useModelStyle() { ...useLinesStyle(), ...useModelEdgesStyle(), ...useModelPointsStyle(), - }; + } } diff --git a/internal_stores/model/lines.js b/internal_stores/model/lines.js index 24acd417..1b0eb70e 100644 --- a/internal_stores/model/lines.js +++ b/internal_stores/model/lines.js @@ -1,23 +1,23 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const lines_schemas = viewer_schemas.opengeodeweb_viewer.model.lines export function useLinesStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); - const dataBaseStore = useDataBaseStore(); + const dataStyleStore = useDataStyleStore() + const dataBaseStore = useDataBaseStore() /** Getters **/ function lineVisibility(id, line_id) { - return dataStyleStore.styles[id].lines[line_id].visibility; + return dataStyleStore.styles[id].lines[line_id].visibility } function linesColor(id) { - return dataStyleStore.styles[id].lines.color; + return dataStyleStore.styles[id].lines.color } /** Actions **/ function setLineVisibility(id, line_ids, visibility) { - const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids); + const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids) viewer_call( { schema: lines_schemas.visibility, @@ -27,17 +27,17 @@ export function useLinesStyle() { response_function: () => { for (const line_id of line_ids) { if (!dataStyleStore.styles[id].lines[line_id]) - dataStyleStore.styles[id].lines[line_id] = {}; - dataStyleStore.styles[id].lines[line_id].visibility = visibility; + dataStyleStore.styles[id].lines[line_id] = {} + dataStyleStore.styles[id].lines[line_id].visibility = visibility } - console.log("setLineVisibility", line_ids, visibility); + console.log("setLineVisibility", line_ids, visibility) }, - } - ); + }, + ) } function setLineColor(id, line_ids, color) { - const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids); + const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids) viewer_call( { schema: lines_schemas.color, @@ -47,25 +47,25 @@ export function useLinesStyle() { response_function: () => { for (const line_id of line_ids) { if (!dataStyleStore.styles[id].lines[line_id]) - dataStyleStore.styles[id].lines[line_id] = {}; - dataStyleStore.styles[id].lines[line_id].color = color; + dataStyleStore.styles[id].lines[line_id] = {} + dataStyleStore.styles[id].lines[line_id].color = color } - console.log("setLineColor", line_ids, color); + console.log("setLineColor", line_ids, color) }, - } - ); + }, + ) } function setLinesDefaultStyle(id) { - const line_ids = dataBaseStore.getLinesUuids(id); - setLineVisibility(id, line_ids, dataStyleStore.styles[id].lines.visibility); - setLineColor(id, line_ids, dataStyleStore.styles[id].lines.color); + const line_ids = dataBaseStore.getLinesUuids(id) + setLineVisibility(id, line_ids, dataStyleStore.styles[id].lines.visibility) + setLineColor(id, line_ids, dataStyleStore.styles[id].lines.color) } function applyLinesStyle(id) { - const lines = dataStyleStore.styles[id].lines; + const lines = dataStyleStore.styles[id].lines for (const [line_id, style] of Object.entries(lines)) { - setLineVisibility(id, [line_id], style.visibility); + setLineVisibility(id, [line_id], style.visibility) } } @@ -75,7 +75,7 @@ export function useLinesStyle() { setLinesDefaultStyle, setLineVisibility, applyLinesStyle, - }; + } } -export default useLinesStyle; +export default useLinesStyle diff --git a/internal_stores/model/points.js b/internal_stores/model/points.js index d10bb390..25d252e8 100644 --- a/internal_stores/model/points.js +++ b/internal_stores/model/points.js @@ -1,14 +1,14 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const model_points_schemas = viewer_schemas.opengeodeweb_viewer.model.points export function useModelPointsStyle() { - const dataStyleStore = useDataStyleStore(); + const dataStyleStore = useDataStyleStore() function modelPointsVisibility(id) { - return dataStyleStore.styles[id].points.visibility; + return dataStyleStore.styles[id].points.visibility } function modelPointsSize(id) { - return dataStyleStore.styles[id].points.size; + return dataStyleStore.styles[id].points.size } function setModelPointsVisibility(id, visibility) { @@ -19,11 +19,11 @@ export function useModelPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.visibility = visibility; - console.log("setModelPointsVisibility", visibility); + dataStyleStore.styles[id].points.visibility = visibility + console.log("setModelPointsVisibility", visibility) }, - } - ); + }, + ) } function setModelPointsSize(id, size) { @@ -34,20 +34,20 @@ export function useModelPointsStyle() { }, { response_function: () => { - dataStyleStore.styles[id].points.size = size; - console.log("setModelPointsSize", size); + dataStyleStore.styles[id].points.size = size + console.log("setModelPointsSize", size) }, - } - ); + }, + ) } function applyModelPointsStyle(id, style) { - setModelPointsVisibility(id, style.visibility); - setModelPointsSize(id, style.size); + setModelPointsVisibility(id, style.visibility) + setModelPointsSize(id, style.size) } function setModelPointsDefaultStyle(id) { - setModelPointsVisibility(id, false); + setModelPointsVisibility(id, false) } return { @@ -57,5 +57,5 @@ export function useModelPointsStyle() { setModelPointsSize, applyModelPointsStyle, setModelPointsDefaultStyle, - }; + } } diff --git a/internal_stores/model/surfaces.js b/internal_stores/model/surfaces.js index 273d5c27..cb58b9ed 100644 --- a/internal_stores/model/surfaces.js +++ b/internal_stores/model/surfaces.js @@ -1,19 +1,19 @@ -import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"; -const surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces; +import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +const surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces export function useSurfacesStyle() { /** State **/ - const dataStyleStore = useDataStyleStore(); - const dataBaseStore = useDataBaseStore(); + const dataStyleStore = useDataStyleStore() + const dataBaseStore = useDataBaseStore() /** Getters **/ function surfaceVisibility(id, surface_id) { - return dataStyleStore.styles[id].surfaces[surface_id].visibility; + return dataStyleStore.styles[id].surfaces[surface_id].visibility } /** Actions **/ function setSurfaceVisibility(id, surface_ids, visibility) { - const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids); + const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids) viewer_call( { schema: surfaces_schemas.visibility, @@ -23,29 +23,29 @@ export function useSurfacesStyle() { response_function: () => { for (const surface_id of surface_ids) { if (!dataStyleStore.styles[id].surfaces[surface_id]) - dataStyleStore.styles[id].surfaces[surface_id] = {}; + dataStyleStore.styles[id].surfaces[surface_id] = {} dataStyleStore.styles[id].surfaces[surface_id].visibility = - visibility; + visibility } - console.log("setSurfaceVisibility", surface_ids, visibility); + console.log("setSurfaceVisibility", surface_ids, visibility) }, - } - ); + }, + ) } function setSurfacesDefaultStyle(id) { - const surface_ids = dataBaseStore.getSurfacesUuids(id); + const surface_ids = dataBaseStore.getSurfacesUuids(id) setSurfaceVisibility( id, surface_ids, - dataStyleStore.styles[id].surfaces.visibility - ); + dataStyleStore.styles[id].surfaces.visibility, + ) } function applySurfacesStyle(id) { - const surfaces = dataStyleStore.styles[id].surfaces; + const surfaces = dataStyleStore.styles[id].surfaces for (const [surface_id, style] of Object.entries(surfaces)) { - setSurfaceVisibility(id, [surface_id], style.visibility); + setSurfaceVisibility(id, [surface_id], style.visibility) } } @@ -54,7 +54,7 @@ export function useSurfacesStyle() { setSurfacesDefaultStyle, setSurfaceVisibility, applySurfacesStyle, - }; + } } -export default useSurfacesStyle; +export default useSurfacesStyle diff --git a/stores/menu.js b/stores/menu.js index 0de55a04..f6fd0fb7 100644 --- a/stores/menu.js +++ b/stores/menu.js @@ -1,97 +1,97 @@ // PointSet components -import PointSetPointsOptions from "@ogw_f/components/Viewer/PointSet/PointsOptions.vue"; +import PointSetPointsOptions from "@ogw_f/components/Viewer/PointSet/PointsOptions.vue" // EdgedCurve components -import EdgedCurvePointsOptions from "@ogw_f/components/Viewer/EdgedCurve/PointsOptions.vue"; -import EdgedCurveEdgesOptions from "@ogw_f/components/Viewer/EdgedCurve/EdgesOptions.vue"; +import EdgedCurvePointsOptions from "@ogw_f/components/Viewer/EdgedCurve/PointsOptions.vue" +import EdgedCurveEdgesOptions from "@ogw_f/components/Viewer/EdgedCurve/EdgesOptions.vue" // PolygonalSurface components -import PolygonalSurfacePointsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PointsOptions.vue"; -import PolygonalSurfaceEdgesOptions from "@ogw_f/components/Viewer/PolygonalSurface/EdgesOptions.vue"; -import PolygonalSurfacePolygonsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PolygonsOptions.vue"; +import PolygonalSurfacePointsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PointsOptions.vue" +import PolygonalSurfaceEdgesOptions from "@ogw_f/components/Viewer/PolygonalSurface/EdgesOptions.vue" +import PolygonalSurfacePolygonsOptions from "@ogw_f/components/Viewer/PolygonalSurface/PolygonsOptions.vue" // TriangulatedSurface components -import TriangulatedSurfacePointsOptions from "@ogw_f/components/Viewer/TriangulatedSurface/PointsOptions.vue"; -import TriangulatedSurfaceEdgesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/EdgesOptions.vue"; -import TriangulatedSurfaceTrianglesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/TrianglesOptions.vue"; +import TriangulatedSurfacePointsOptions from "@ogw_f/components/Viewer/TriangulatedSurface/PointsOptions.vue" +import TriangulatedSurfaceEdgesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/EdgesOptions.vue" +import TriangulatedSurfaceTrianglesOptions from "@ogw_f/components/Viewer/TriangulatedSurface/TrianglesOptions.vue" // Grid 2D components -import Grid2DPointsOptions from "@ogw_f/components/Viewer/Grid/2D/PointsOptions.vue"; -import Grid2DEdgesOptions from "@ogw_f/components/Viewer/Grid/2D/EdgesOptions.vue"; -import Grid2DCellsOptions from "@ogw_f/components/Viewer/Grid/2D/CellsOptions.vue"; +import Grid2DPointsOptions from "@ogw_f/components/Viewer/Grid/2D/PointsOptions.vue" +import Grid2DEdgesOptions from "@ogw_f/components/Viewer/Grid/2D/EdgesOptions.vue" +import Grid2DCellsOptions from "@ogw_f/components/Viewer/Grid/2D/CellsOptions.vue" // Grid 3D components -import Grid3DPointsOptions from "@ogw_f/components/Viewer/Grid/3D/PointsOptions.vue"; -import Grid3DEdgesOptions from "@ogw_f/components/Viewer/Grid/3D/EdgesOptions.vue"; -import Grid3DFacetsOptions from "@ogw_f/components/Viewer/Grid/3D/FacetsOptions.vue"; -import Grid3DCellsOptions from "@ogw_f/components/Viewer/Grid/3D/CellsOptions.vue"; +import Grid3DPointsOptions from "@ogw_f/components/Viewer/Grid/3D/PointsOptions.vue" +import Grid3DEdgesOptions from "@ogw_f/components/Viewer/Grid/3D/EdgesOptions.vue" +import Grid3DFacetsOptions from "@ogw_f/components/Viewer/Grid/3D/FacetsOptions.vue" +import Grid3DCellsOptions from "@ogw_f/components/Viewer/Grid/3D/CellsOptions.vue" // Solid components -import SolidPointsOptions from "@ogw_f/components/Viewer/Solid/PointsOptions.vue"; -import SolidEdgesOptions from "@ogw_f/components/Viewer/Solid/EdgesOptions.vue"; -import SolidPolygonsOptions from "@ogw_f/components/Viewer/Solid/PolygonsOptions.vue"; -import SolidPolyhedraOptions from "@ogw_f/components/Viewer/Solid/PolyhedraOptions.vue"; +import SolidPointsOptions from "@ogw_f/components/Viewer/Solid/PointsOptions.vue" +import SolidEdgesOptions from "@ogw_f/components/Viewer/Solid/EdgesOptions.vue" +import SolidPolygonsOptions from "@ogw_f/components/Viewer/Solid/PolygonsOptions.vue" +import SolidPolyhedraOptions from "@ogw_f/components/Viewer/Solid/PolyhedraOptions.vue" // TetrahedralSolid components -import TetrahedralSolidTrianglesOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TrianglesOptions.vue"; -import TetrahedralSolidTetrahedraOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue"; +import TetrahedralSolidTrianglesOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TrianglesOptions.vue" +import TetrahedralSolidTetrahedraOptions from "@ogw_f/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue" // Model components -import ModelEdgesOptions from "@ogw_f/components/Viewer/Generic/Model/EdgesOptions.vue"; -import ModelPointsOptions from "@ogw_f/components/Viewer/Generic/Model/PointsOptions.vue"; +import ModelEdgesOptions from "@ogw_f/components/Viewer/Generic/Model/EdgesOptions.vue" +import ModelPointsOptions from "@ogw_f/components/Viewer/Generic/Model/PointsOptions.vue" -const PointSet_menu = [PointSetPointsOptions]; +const PointSet_menu = [PointSetPointsOptions] -const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions]; +const EdgedCurve_menu = [EdgedCurvePointsOptions, EdgedCurveEdgesOptions] const PolygonalSurface_menu = [ PolygonalSurfacePointsOptions, PolygonalSurfaceEdgesOptions, PolygonalSurfacePolygonsOptions, -]; +] const TriangulatedSurface_menu = [ TriangulatedSurfacePointsOptions, TriangulatedSurfaceEdgesOptions, TriangulatedSurfaceTrianglesOptions, -]; +] const Grid2D_menu = [ Grid2DPointsOptions, Grid2DEdgesOptions, Grid2DCellsOptions, -]; +] const Grid3D_menu = [ Grid3DPointsOptions, Grid3DEdgesOptions, Grid3DFacetsOptions, Grid3DCellsOptions, -]; +] const Solid_menu = [ SolidPointsOptions, SolidEdgesOptions, SolidPolygonsOptions, SolidPolyhedraOptions, -]; +] const TetrahedralSolid_menu = [ SolidPointsOptions, SolidEdgesOptions, TetrahedralSolidTrianglesOptions, TetrahedralSolidTetrahedraOptions, -]; +] -const BRep_menu = [ModelEdgesOptions, ModelPointsOptions]; +const BRep_menu = [ModelEdgesOptions, ModelPointsOptions] -const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]; +const CrossSection_menu = [ModelEdgesOptions, ModelPointsOptions] -const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions]; -const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]; +const ImplicitCrossSection_menu = [ModelEdgesOptions, ModelPointsOptions] +const ImplicitStructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions] -const Section_menu = [ModelEdgesOptions, ModelPointsOptions]; +const Section_menu = [ModelEdgesOptions, ModelPointsOptions] -const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions]; +const StructuralModel_menu = [ModelEdgesOptions, ModelPointsOptions] const menusData = { mesh: { @@ -119,52 +119,52 @@ const menusData = { Section: Section_menu, StructuralModel: StructuralModel_menu, }, -}; +} export const useMenuStore = defineStore("menu", () => { - const menus = ref(menusData); - const display_menu = ref(false); - const current_id = ref(null); - const menuX = ref(0); - const menuY = ref(0); - const containerWidth = ref(window.innerWidth); - const containerHeight = ref(window.innerHeight); + const menus = ref(menusData) + const display_menu = ref(false) + const current_id = ref(null) + const menuX = ref(0) + const menuY = ref(0) + const containerWidth = ref(window.innerWidth) + const containerHeight = ref(window.innerHeight) function getMenuItems(objectType, geodeObject) { if (!objectType || !geodeObject || !menus.value[objectType]) { - return []; + return [] } - return menus.value[objectType][geodeObject] || []; - }; + return menus.value[objectType][geodeObject] || [] + } function closeMenu() { - display_menu.value = false; - current_id.value = null; + display_menu.value = false + current_id.value = null } async function openMenu(id, x, y, containerWidth, containerHeight) { - await closeMenu(); - current_id.value = id; + await closeMenu() + current_id.value = id if (x !== undefined && y !== undefined) { - menuX.value = x; - menuY.value = y; + menuX.value = x + menuY.value = y } - if (containerWidth) containerWidth.value = containerWidth; - if (containerHeight) containerHeight.value = containerHeight; + if (containerWidth) containerWidth.value = containerWidth + if (containerHeight) containerHeight.value = containerHeight - display_menu.value = true; + display_menu.value = true } function showItemsWithDelay() { - const DELAY = 50; - const items = getMenuItems(); + const DELAY = 50 + const items = getMenuItems() items.forEach((item, index) => { setTimeout(() => { - item.visible = true; - }, index * DELAY); - }); + item.visible = true + }, index * DELAY) + }) } return { @@ -178,5 +178,5 @@ export const useMenuStore = defineStore("menu", () => { closeMenu, openMenu, showItemsWithDelay, - }; -}); + } +}) From 1d4c7beae13ee0fb7c45daf9e9cdd04234bdd8e7 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Fri, 1 Aug 2025 15:48:07 +0200 Subject: [PATCH 5/7] feat(Imports): Changing path imports --- .gitignore | 27 ++++++++++++++----- .../{ => Viewer}/EdgedCurve/EdgesOptions.vue | 0 .../{ => Viewer}/EdgedCurve/PointsOptions.vue | 0 .../{ => Viewer}/FeedBack/ErrorBanner.vue | 0 components/{ => Viewer}/FeedBack/Snackers.vue | 0 .../Generic/Mesh/EdgesOptions.vue | 0 .../Generic/Mesh/PointsOptions.vue | 0 .../Generic/Mesh/PolygonsOptions.vue | 0 .../Generic/Mesh/PolyhedraOptions.vue | 0 .../Generic/Model/EdgesOptions.vue | 0 .../Generic/Model/PointsOptions.vue | 0 .../{ => Viewer}/Grid/2D/CellsOptions.vue | 0 .../{ => Viewer}/Grid/2D/EdgesOptions.vue | 0 .../{ => Viewer}/Grid/2D/PointsOptions.vue | 0 .../{ => Viewer}/Grid/3D/CellsOptions.vue | 0 .../{ => Viewer}/Grid/3D/EdgesOptions.vue | 0 .../{ => Viewer}/Grid/3D/FacetsOptions.vue | 0 .../{ => Viewer}/Grid/3D/PointsOptions.vue | 0 .../{ => Viewer}/HybridSolid/EdgesOptions.vue | 0 .../HybridSolid/PointsOptions.vue | 0 .../HybridSolid/PolygonsOptions.vue | 0 .../HybridSolid/PolyhedraOptions.vue | 0 .../Inspector/InspectionButton.vue | 0 .../{ => Viewer}/Inspector/ResultPanel.vue | 0 .../{ => Viewer}/Options/ColorPicker.vue | 0 .../Options/ColoringTypeSelector.vue | 0 .../Options/PolygonAttributeSelector.vue | 0 .../Options/PolyhedronAttributeSelector.vue | 0 .../{ => Viewer}/Options/TextureItem.vue | 0 .../{ => Viewer}/Options/TexturesSelector.vue | 0 .../Options/VertexAttributeSelector.vue | 0 .../{ => Viewer}/Options/VisibilitySwitch.vue | 0 .../{ => Viewer}/PointSet/PointsOptions.vue | 0 .../PointSet/SpecificPointsOptions.vue | 0 .../PolygonalSurface/EdgesOptions.vue | 0 .../PolygonalSurface/PointsOptions.vue | 0 .../PolygonalSurface/PolygonsOptions.vue | 0 .../{ => Viewer}/Solid/EdgesOptions.vue | 0 .../{ => Viewer}/Solid/PointsOptions.vue | 0 .../{ => Viewer}/Solid/PolygonsOptions.vue | 0 .../{ => Viewer}/Solid/PolyhedraOptions.vue | 0 .../TetrahedralSolid/TetrahedraOptions.vue | 0 .../TetrahedralSolid/TrianglesOptions.vue | 0 .../TriangulatedSurface/EdgesOptions.vue | 0 .../TriangulatedSurface/PointsOptions.vue | 0 .../TriangulatedSurface/TrianglesOptions.vue | 0 46 files changed, 21 insertions(+), 6 deletions(-) rename components/{ => Viewer}/EdgedCurve/EdgesOptions.vue (100%) rename components/{ => Viewer}/EdgedCurve/PointsOptions.vue (100%) rename components/{ => Viewer}/FeedBack/ErrorBanner.vue (100%) rename components/{ => Viewer}/FeedBack/Snackers.vue (100%) rename components/{ => Viewer}/Generic/Mesh/EdgesOptions.vue (100%) rename components/{ => Viewer}/Generic/Mesh/PointsOptions.vue (100%) rename components/{ => Viewer}/Generic/Mesh/PolygonsOptions.vue (100%) rename components/{ => Viewer}/Generic/Mesh/PolyhedraOptions.vue (100%) rename components/{ => Viewer}/Generic/Model/EdgesOptions.vue (100%) rename components/{ => Viewer}/Generic/Model/PointsOptions.vue (100%) rename components/{ => Viewer}/Grid/2D/CellsOptions.vue (100%) rename components/{ => Viewer}/Grid/2D/EdgesOptions.vue (100%) rename components/{ => Viewer}/Grid/2D/PointsOptions.vue (100%) rename components/{ => Viewer}/Grid/3D/CellsOptions.vue (100%) rename components/{ => Viewer}/Grid/3D/EdgesOptions.vue (100%) rename components/{ => Viewer}/Grid/3D/FacetsOptions.vue (100%) rename components/{ => Viewer}/Grid/3D/PointsOptions.vue (100%) rename components/{ => Viewer}/HybridSolid/EdgesOptions.vue (100%) rename components/{ => Viewer}/HybridSolid/PointsOptions.vue (100%) rename components/{ => Viewer}/HybridSolid/PolygonsOptions.vue (100%) rename components/{ => Viewer}/HybridSolid/PolyhedraOptions.vue (100%) rename components/{ => Viewer}/Inspector/InspectionButton.vue (100%) rename components/{ => Viewer}/Inspector/ResultPanel.vue (100%) rename components/{ => Viewer}/Options/ColorPicker.vue (100%) rename components/{ => Viewer}/Options/ColoringTypeSelector.vue (100%) rename components/{ => Viewer}/Options/PolygonAttributeSelector.vue (100%) rename components/{ => Viewer}/Options/PolyhedronAttributeSelector.vue (100%) rename components/{ => Viewer}/Options/TextureItem.vue (100%) rename components/{ => Viewer}/Options/TexturesSelector.vue (100%) rename components/{ => Viewer}/Options/VertexAttributeSelector.vue (100%) rename components/{ => Viewer}/Options/VisibilitySwitch.vue (100%) rename components/{ => Viewer}/PointSet/PointsOptions.vue (100%) rename components/{ => Viewer}/PointSet/SpecificPointsOptions.vue (100%) rename components/{ => Viewer}/PolygonalSurface/EdgesOptions.vue (100%) rename components/{ => Viewer}/PolygonalSurface/PointsOptions.vue (100%) rename components/{ => Viewer}/PolygonalSurface/PolygonsOptions.vue (100%) rename components/{ => Viewer}/Solid/EdgesOptions.vue (100%) rename components/{ => Viewer}/Solid/PointsOptions.vue (100%) rename components/{ => Viewer}/Solid/PolygonsOptions.vue (100%) rename components/{ => Viewer}/Solid/PolyhedraOptions.vue (100%) rename components/{ => Viewer}/TetrahedralSolid/TetrahedraOptions.vue (100%) rename components/{ => Viewer}/TetrahedralSolid/TrianglesOptions.vue (100%) rename components/{ => Viewer}/TriangulatedSurface/EdgesOptions.vue (100%) rename components/{ => Viewer}/TriangulatedSurface/PointsOptions.vue (100%) rename components/{ => Viewer}/TriangulatedSurface/TrianglesOptions.vue (100%) diff --git a/.gitignore b/.gitignore index 4aae54c0..b7c6d75b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,15 @@ # Nuxt dev/build outputs .output +.data .nuxt .nitro .cache +build dist + # Node dependencies -node_modules +/node_modules # Logs logs @@ -21,9 +24,21 @@ logs .env .env.* !.env.example - # Other -.pytest_cache -__snapshots__ -coverage -# package-lock.json +/build +/dist-electron +/electron-server/back/dist +/electron-server/viewer/dist +/electron-server/back/venv +/electron-server/viewer/venv +/release +/uploads +vease-back* +vease-viewer* + +# Playwright +node_modules/ +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ \ No newline at end of file diff --git a/components/EdgedCurve/EdgesOptions.vue b/components/Viewer/EdgedCurve/EdgesOptions.vue similarity index 100% rename from components/EdgedCurve/EdgesOptions.vue rename to components/Viewer/EdgedCurve/EdgesOptions.vue diff --git a/components/EdgedCurve/PointsOptions.vue b/components/Viewer/EdgedCurve/PointsOptions.vue similarity index 100% rename from components/EdgedCurve/PointsOptions.vue rename to components/Viewer/EdgedCurve/PointsOptions.vue diff --git a/components/FeedBack/ErrorBanner.vue b/components/Viewer/FeedBack/ErrorBanner.vue similarity index 100% rename from components/FeedBack/ErrorBanner.vue rename to components/Viewer/FeedBack/ErrorBanner.vue diff --git a/components/FeedBack/Snackers.vue b/components/Viewer/FeedBack/Snackers.vue similarity index 100% rename from components/FeedBack/Snackers.vue rename to components/Viewer/FeedBack/Snackers.vue diff --git a/components/Generic/Mesh/EdgesOptions.vue b/components/Viewer/Generic/Mesh/EdgesOptions.vue similarity index 100% rename from components/Generic/Mesh/EdgesOptions.vue rename to components/Viewer/Generic/Mesh/EdgesOptions.vue diff --git a/components/Generic/Mesh/PointsOptions.vue b/components/Viewer/Generic/Mesh/PointsOptions.vue similarity index 100% rename from components/Generic/Mesh/PointsOptions.vue rename to components/Viewer/Generic/Mesh/PointsOptions.vue diff --git a/components/Generic/Mesh/PolygonsOptions.vue b/components/Viewer/Generic/Mesh/PolygonsOptions.vue similarity index 100% rename from components/Generic/Mesh/PolygonsOptions.vue rename to components/Viewer/Generic/Mesh/PolygonsOptions.vue diff --git a/components/Generic/Mesh/PolyhedraOptions.vue b/components/Viewer/Generic/Mesh/PolyhedraOptions.vue similarity index 100% rename from components/Generic/Mesh/PolyhedraOptions.vue rename to components/Viewer/Generic/Mesh/PolyhedraOptions.vue diff --git a/components/Generic/Model/EdgesOptions.vue b/components/Viewer/Generic/Model/EdgesOptions.vue similarity index 100% rename from components/Generic/Model/EdgesOptions.vue rename to components/Viewer/Generic/Model/EdgesOptions.vue diff --git a/components/Generic/Model/PointsOptions.vue b/components/Viewer/Generic/Model/PointsOptions.vue similarity index 100% rename from components/Generic/Model/PointsOptions.vue rename to components/Viewer/Generic/Model/PointsOptions.vue diff --git a/components/Grid/2D/CellsOptions.vue b/components/Viewer/Grid/2D/CellsOptions.vue similarity index 100% rename from components/Grid/2D/CellsOptions.vue rename to components/Viewer/Grid/2D/CellsOptions.vue diff --git a/components/Grid/2D/EdgesOptions.vue b/components/Viewer/Grid/2D/EdgesOptions.vue similarity index 100% rename from components/Grid/2D/EdgesOptions.vue rename to components/Viewer/Grid/2D/EdgesOptions.vue diff --git a/components/Grid/2D/PointsOptions.vue b/components/Viewer/Grid/2D/PointsOptions.vue similarity index 100% rename from components/Grid/2D/PointsOptions.vue rename to components/Viewer/Grid/2D/PointsOptions.vue diff --git a/components/Grid/3D/CellsOptions.vue b/components/Viewer/Grid/3D/CellsOptions.vue similarity index 100% rename from components/Grid/3D/CellsOptions.vue rename to components/Viewer/Grid/3D/CellsOptions.vue diff --git a/components/Grid/3D/EdgesOptions.vue b/components/Viewer/Grid/3D/EdgesOptions.vue similarity index 100% rename from components/Grid/3D/EdgesOptions.vue rename to components/Viewer/Grid/3D/EdgesOptions.vue diff --git a/components/Grid/3D/FacetsOptions.vue b/components/Viewer/Grid/3D/FacetsOptions.vue similarity index 100% rename from components/Grid/3D/FacetsOptions.vue rename to components/Viewer/Grid/3D/FacetsOptions.vue diff --git a/components/Grid/3D/PointsOptions.vue b/components/Viewer/Grid/3D/PointsOptions.vue similarity index 100% rename from components/Grid/3D/PointsOptions.vue rename to components/Viewer/Grid/3D/PointsOptions.vue diff --git a/components/HybridSolid/EdgesOptions.vue b/components/Viewer/HybridSolid/EdgesOptions.vue similarity index 100% rename from components/HybridSolid/EdgesOptions.vue rename to components/Viewer/HybridSolid/EdgesOptions.vue diff --git a/components/HybridSolid/PointsOptions.vue b/components/Viewer/HybridSolid/PointsOptions.vue similarity index 100% rename from components/HybridSolid/PointsOptions.vue rename to components/Viewer/HybridSolid/PointsOptions.vue diff --git a/components/HybridSolid/PolygonsOptions.vue b/components/Viewer/HybridSolid/PolygonsOptions.vue similarity index 100% rename from components/HybridSolid/PolygonsOptions.vue rename to components/Viewer/HybridSolid/PolygonsOptions.vue diff --git a/components/HybridSolid/PolyhedraOptions.vue b/components/Viewer/HybridSolid/PolyhedraOptions.vue similarity index 100% rename from components/HybridSolid/PolyhedraOptions.vue rename to components/Viewer/HybridSolid/PolyhedraOptions.vue diff --git a/components/Inspector/InspectionButton.vue b/components/Viewer/Inspector/InspectionButton.vue similarity index 100% rename from components/Inspector/InspectionButton.vue rename to components/Viewer/Inspector/InspectionButton.vue diff --git a/components/Inspector/ResultPanel.vue b/components/Viewer/Inspector/ResultPanel.vue similarity index 100% rename from components/Inspector/ResultPanel.vue rename to components/Viewer/Inspector/ResultPanel.vue diff --git a/components/Options/ColorPicker.vue b/components/Viewer/Options/ColorPicker.vue similarity index 100% rename from components/Options/ColorPicker.vue rename to components/Viewer/Options/ColorPicker.vue diff --git a/components/Options/ColoringTypeSelector.vue b/components/Viewer/Options/ColoringTypeSelector.vue similarity index 100% rename from components/Options/ColoringTypeSelector.vue rename to components/Viewer/Options/ColoringTypeSelector.vue diff --git a/components/Options/PolygonAttributeSelector.vue b/components/Viewer/Options/PolygonAttributeSelector.vue similarity index 100% rename from components/Options/PolygonAttributeSelector.vue rename to components/Viewer/Options/PolygonAttributeSelector.vue diff --git a/components/Options/PolyhedronAttributeSelector.vue b/components/Viewer/Options/PolyhedronAttributeSelector.vue similarity index 100% rename from components/Options/PolyhedronAttributeSelector.vue rename to components/Viewer/Options/PolyhedronAttributeSelector.vue diff --git a/components/Options/TextureItem.vue b/components/Viewer/Options/TextureItem.vue similarity index 100% rename from components/Options/TextureItem.vue rename to components/Viewer/Options/TextureItem.vue diff --git a/components/Options/TexturesSelector.vue b/components/Viewer/Options/TexturesSelector.vue similarity index 100% rename from components/Options/TexturesSelector.vue rename to components/Viewer/Options/TexturesSelector.vue diff --git a/components/Options/VertexAttributeSelector.vue b/components/Viewer/Options/VertexAttributeSelector.vue similarity index 100% rename from components/Options/VertexAttributeSelector.vue rename to components/Viewer/Options/VertexAttributeSelector.vue diff --git a/components/Options/VisibilitySwitch.vue b/components/Viewer/Options/VisibilitySwitch.vue similarity index 100% rename from components/Options/VisibilitySwitch.vue rename to components/Viewer/Options/VisibilitySwitch.vue diff --git a/components/PointSet/PointsOptions.vue b/components/Viewer/PointSet/PointsOptions.vue similarity index 100% rename from components/PointSet/PointsOptions.vue rename to components/Viewer/PointSet/PointsOptions.vue diff --git a/components/PointSet/SpecificPointsOptions.vue b/components/Viewer/PointSet/SpecificPointsOptions.vue similarity index 100% rename from components/PointSet/SpecificPointsOptions.vue rename to components/Viewer/PointSet/SpecificPointsOptions.vue diff --git a/components/PolygonalSurface/EdgesOptions.vue b/components/Viewer/PolygonalSurface/EdgesOptions.vue similarity index 100% rename from components/PolygonalSurface/EdgesOptions.vue rename to components/Viewer/PolygonalSurface/EdgesOptions.vue diff --git a/components/PolygonalSurface/PointsOptions.vue b/components/Viewer/PolygonalSurface/PointsOptions.vue similarity index 100% rename from components/PolygonalSurface/PointsOptions.vue rename to components/Viewer/PolygonalSurface/PointsOptions.vue diff --git a/components/PolygonalSurface/PolygonsOptions.vue b/components/Viewer/PolygonalSurface/PolygonsOptions.vue similarity index 100% rename from components/PolygonalSurface/PolygonsOptions.vue rename to components/Viewer/PolygonalSurface/PolygonsOptions.vue diff --git a/components/Solid/EdgesOptions.vue b/components/Viewer/Solid/EdgesOptions.vue similarity index 100% rename from components/Solid/EdgesOptions.vue rename to components/Viewer/Solid/EdgesOptions.vue diff --git a/components/Solid/PointsOptions.vue b/components/Viewer/Solid/PointsOptions.vue similarity index 100% rename from components/Solid/PointsOptions.vue rename to components/Viewer/Solid/PointsOptions.vue diff --git a/components/Solid/PolygonsOptions.vue b/components/Viewer/Solid/PolygonsOptions.vue similarity index 100% rename from components/Solid/PolygonsOptions.vue rename to components/Viewer/Solid/PolygonsOptions.vue diff --git a/components/Solid/PolyhedraOptions.vue b/components/Viewer/Solid/PolyhedraOptions.vue similarity index 100% rename from components/Solid/PolyhedraOptions.vue rename to components/Viewer/Solid/PolyhedraOptions.vue diff --git a/components/TetrahedralSolid/TetrahedraOptions.vue b/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue similarity index 100% rename from components/TetrahedralSolid/TetrahedraOptions.vue rename to components/Viewer/TetrahedralSolid/TetrahedraOptions.vue diff --git a/components/TetrahedralSolid/TrianglesOptions.vue b/components/Viewer/TetrahedralSolid/TrianglesOptions.vue similarity index 100% rename from components/TetrahedralSolid/TrianglesOptions.vue rename to components/Viewer/TetrahedralSolid/TrianglesOptions.vue diff --git a/components/TriangulatedSurface/EdgesOptions.vue b/components/Viewer/TriangulatedSurface/EdgesOptions.vue similarity index 100% rename from components/TriangulatedSurface/EdgesOptions.vue rename to components/Viewer/TriangulatedSurface/EdgesOptions.vue diff --git a/components/TriangulatedSurface/PointsOptions.vue b/components/Viewer/TriangulatedSurface/PointsOptions.vue similarity index 100% rename from components/TriangulatedSurface/PointsOptions.vue rename to components/Viewer/TriangulatedSurface/PointsOptions.vue diff --git a/components/TriangulatedSurface/TrianglesOptions.vue b/components/Viewer/TriangulatedSurface/TrianglesOptions.vue similarity index 100% rename from components/TriangulatedSurface/TrianglesOptions.vue rename to components/Viewer/TriangulatedSurface/TrianglesOptions.vue From 32f3d56feceae72fcb3ccd520d7f06fe14ec8f6e Mon Sep 17 00:00:00 2001 From: SpliiT Date: Fri, 1 Aug 2025 15:51:19 +0200 Subject: [PATCH 6/7] replace path --- components/{Viewer => }/FeedBack/ErrorBanner.vue | 0 components/{Viewer => }/FeedBack/Snackers.vue | 0 components/{Viewer => }/Inspector/InspectionButton.vue | 0 components/{Viewer => }/Inspector/ResultPanel.vue | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename components/{Viewer => }/FeedBack/ErrorBanner.vue (100%) rename components/{Viewer => }/FeedBack/Snackers.vue (100%) rename components/{Viewer => }/Inspector/InspectionButton.vue (100%) rename components/{Viewer => }/Inspector/ResultPanel.vue (100%) diff --git a/components/Viewer/FeedBack/ErrorBanner.vue b/components/FeedBack/ErrorBanner.vue similarity index 100% rename from components/Viewer/FeedBack/ErrorBanner.vue rename to components/FeedBack/ErrorBanner.vue diff --git a/components/Viewer/FeedBack/Snackers.vue b/components/FeedBack/Snackers.vue similarity index 100% rename from components/Viewer/FeedBack/Snackers.vue rename to components/FeedBack/Snackers.vue diff --git a/components/Viewer/Inspector/InspectionButton.vue b/components/Inspector/InspectionButton.vue similarity index 100% rename from components/Viewer/Inspector/InspectionButton.vue rename to components/Inspector/InspectionButton.vue diff --git a/components/Viewer/Inspector/ResultPanel.vue b/components/Inspector/ResultPanel.vue similarity index 100% rename from components/Viewer/Inspector/ResultPanel.vue rename to components/Inspector/ResultPanel.vue From 515cb59db5946aa22f1eaa47f2fd428ad6588470 Mon Sep 17 00:00:00 2001 From: SpliiT Date: Fri, 1 Aug 2025 15:52:08 +0200 Subject: [PATCH 7/7] changin gitignore --- .gitignore | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index b7c6d75b..18245e49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,12 @@ # Nuxt dev/build outputs .output -.data .nuxt .nitro .cache -build dist - # Node dependencies -/node_modules +node_modules # Logs logs @@ -24,21 +21,9 @@ logs .env .env.* !.env.example -# Other -/build -/dist-electron -/electron-server/back/dist -/electron-server/viewer/dist -/electron-server/back/venv -/electron-server/viewer/venv -/release -/uploads -vease-back* -vease-viewer* -# Playwright -node_modules/ -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ \ No newline at end of file +# Other +.pytest_cache +__snapshots__ +coverage +# package-lock.json \ No newline at end of file