Skip to content

Commit

Permalink
PATCH: connect giro3d model loading to viewer new API (#178)
Browse files Browse the repository at this point in the history
* connect giro3d model loading to viewer new API

* update girod 3D plugin version

* update girod3d plugin version
  • Loading branch information
Kurtil authored Jun 4, 2024
1 parent 9b90581 commit b555705
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/plugins/giro3d/dist/giro3d.plugin.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/plugins/giro3d/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/plugins/giro3d/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bimdata/giro3d-viewer-plugin",
"type": "module",
"version": "2.0.1",
"version": "2.0.5",
"description": "giro3d BIMData Viewer Plugin",
"scripts": {
"build": "vite build && terser -c -m -o dist/giro3d.plugin.js --module dist/giro3d.plugin.js",
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/giro3d/src/Giro3d.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="bimdata-giro3d">
<NoModelWindowPlaceHolder v-if="loadedModelIds.length === 0 && !loading" />
<ModelsLoader :types="['POINT_CLOUD']" @load-models="loadModels" @unload-models="unloadModels" preview />
<ModelsLoader preview />
<div :id="giro3dDivId" class="bimdata-giro3d__viewer"></div>
</div>
</template>
Expand Down Expand Up @@ -32,6 +32,7 @@ export default {
},
unmounted() {
this.$viewer.globalContext.hub.off(this.localContextResizeSubscription);
this.localContextSubscriptions?.forEach(subscription => this.$viewer.localContext.hub.off(subscription));
},
async mounted() {
const viewerDiv = document.getElementById(this.giro3dDivId);
Expand Down Expand Up @@ -59,6 +60,11 @@ export default {
this.instance = instance;
this.controls = controls;
this.localContextSubscriptions = [
this.$viewer.localContext.hub.on("models-loaded", ({ models }) => this.loadModels(models), { getLastEvent: true }),
this.$viewer.localContext.hub.on("models-unloaded", ({ models }) => this.unloadModels(models), { getLastEvent: true })
]
},
methods: {
onResize({ width, height }) {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/giro3d/src/giro3d.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
name: 'giro3d',
label: 'Giro3dPlugin.window_label',
plugins: ['fullscreen'],
modelTypes: ["POINT_CLOUD"],
},
i18n: {
en: {
Expand Down

0 comments on commit b555705

Please sign in to comment.