<template>
    <div>
        <canvas id="wall" width="800" height="400"  tabindex="0" />
    </div>
</template>

<script>
    import {SGraphScene, SGraphView} from "@persagy-web/graph/";
    import {SZoneItem} from "../../../../guides/big/items/src/SZoneItem";
    export default {
        name: "zone",
        data(){
            return {
                outline:[
                    [
                        // 未掏洞的空间
                        [
                            {"X":30150.15,"Y":82300.04,"Z":59400.0},
                            {"X":30150.15,"Y":81400.04,"Z":59400.0},
                            {"X":33400.15,"Y":82300.04,"Z":59400.0},
                            {"X":30150.15,"Y":82300.04,"Z":59400.0}
                        ],
                    ],
                    [
                        // 掏洞的空间
                        [
                            {"X":25500.15,"Y":77100.04,"Z":59400.0},
                            {"X":28200.15,"Y":77100.04,"Z":59400.0},
                            {"X":28200.15,"Y":82300.04,"Z":59400.0},
                            {"X":25500.15,"Y":82300.04,"Z":59400.0},
                            {"X":25500.15,"Y":77100.04,"Z":59400.0}
                        ],
                        [
                            {"X":25900.15,"Y":80300.04,"Z":59400.0},
                            {"X":27200.15,"Y":80300.04,"Z":59400.0},
                            {"X":27200.15,"Y":77900.04,"Z":59400.0},
                            {"X":25900.15,"Y":77900.04,"Z":59400.0},
                        ]
                    ]
                ]
            }
        },
        mounted() {
            this.init();
        },
        methods:{
            init(){
                this.view = new SGraphView('wall');
                const scene = new SGraphScene();
                this.view.scene = scene;
                // 只模拟了轮廓数据
                const item = new SZoneItem(null,{OutLine:this.outline});
                scene.addItem(item);
                this.view.fitSceneToView();
                this.view.scalable = false;
            }
        }
    }
</script>

<style scoped>

</style>
