-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(models): add support for photosphere models (wip)
- Loading branch information
1 parent
0941f26
commit 22f6a90
Showing
9 changed files
with
836 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/components/specific/models/models-manager/image-manager/ImageManager.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<GenericModelsManager | ||
:project="project" | ||
:types="types" | ||
:tabs="tabs" | ||
@file-uploaded="$emit('file-uploaded')" | ||
@view-photosphereBuilding="viewPhotosphereBuilding" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import { ref, watch } from "vue"; | ||
import { useAppSidePanel } from "../../../app/app-side-panel/app-side-panel.js"; | ||
import { segregateBySource } from "../../../../../utils/models.js"; | ||
// Components | ||
import GenericModelsManager from "../generic-models-manager/GenericModelsManager.vue"; | ||
import PhotosphereBuildingPanel from "./PhotosphereBuildingPanel.vue"; | ||
const tabsDef = [{ id: "upload" }, { id: "archive" }]; | ||
export default { | ||
components: { | ||
GenericModelsManager | ||
}, | ||
props: { | ||
project: { | ||
type: Object, | ||
required: true | ||
}, | ||
models: { | ||
type: Array, | ||
required: true | ||
}, | ||
types: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
emits: ["file-uploaded"], | ||
setup(props) { | ||
const { openSidePanel, closeSidePanel } = useAppSidePanel(); | ||
const tabs = ref(tabsDef); | ||
const viewPhotosphereBuilding = model => { | ||
openSidePanel("right", { | ||
component: { | ||
render() { | ||
return h(PhotosphereBuildingPanel, { | ||
onClose: closeSidePanel, | ||
space: props.project.cloud, | ||
project: props.project, | ||
model, | ||
}) | ||
} | ||
} | ||
}); | ||
}; | ||
watch( | ||
() => props.models, | ||
models => { | ||
const modelsBySource = segregateBySource(models); | ||
tabs.value = tabs.value.map(tab => ({ | ||
...tab, | ||
label: tab.label || tab.id, | ||
models: modelsBySource[tab.id] | ||
})); | ||
}, | ||
{ immediate: true } | ||
); | ||
return { | ||
tabs, | ||
viewPhotosphereBuilding | ||
}; | ||
} | ||
}; | ||
</script> |
65 changes: 65 additions & 0 deletions
65
src/components/specific/models/models-manager/image-manager/PhotosphereBuildingPanel.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script setup> | ||
import apiClient from "../../../../../services/api-client.js"; | ||
defineProps({ | ||
space: { | ||
type: Object, | ||
required: true | ||
}, | ||
project: { | ||
type: Object, | ||
required: true | ||
}, | ||
model: { | ||
type: Object, | ||
required: true | ||
}, | ||
}); | ||
defineEmits(["close"]); | ||
</script> | ||
|
||
<template> | ||
<div class="photosphere-building-panel"> | ||
<BIMDataButton | ||
class="close" | ||
ghost | ||
rounded | ||
icon | ||
@click="$emit('close')" | ||
> | ||
<BIMDataIconClose size="xxs" fill color="granite-light" /> | ||
</BIMDataButton> | ||
<div class="content"> | ||
<BIMDataPhotosphereBuilding | ||
:apiClient="apiClient" | ||
:space="space" | ||
:project="project" | ||
:model="model" | ||
:selectable="false" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.photosphere-building-panel { | ||
position: absolute; | ||
z-index: 0; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
.close { | ||
position: absolute; | ||
z-index: 1; | ||
top: calc(var(--spacing-unit) / 2); | ||
right: var(--spacing-unit); | ||
} | ||
.content { | ||
height: 100%; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters