<template>
    <div>
        <div id="domId" style="flex: 1;">

        </div>
    </div>
</template>

<script setup>
import {onMounted} from "vue";

onMounted(() => {
    initBimface()
})

const initBimface = () => {
    let loaderConfig = new BimfaceSDKLoaderConfig();
    loaderConfig.viewToken = '5e1fa10212fe4118b82c61ed41b6c1dc'
    BimfaceSDKLoader.load(loaderConfig, (viewMetaData) => {
        var domShow = document.getElementById('domId');
        var webAppConfig = new Glodon.Bimface.Application.WebApplication3DConfig();
        webAppConfig.domElement = domShow;
        var app = new Glodon.Bimface.Application.WebApplication3D(webAppConfig);
        app.addView(loaderConfig.viewToken);
        var viewer3D = app.getViewer();
        this.setBackgroundColor();

        //加载完成监听
        viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded, initModel);

        //新增模型监听
        //this.viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ModelAdded, this.translateModel);

        //点击监听
        viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.MouseClicked, setTableData);
    }, (error) => {
        console.log(error)
        //this.$message.error(error);
    });
}

const initModel = () => {

}

const setTableData = () => {

}
</script>

<style lang="scss">

</style>
