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

<script lang="ts">
    import {SGraphScene, SGraphView} from "@persagy-web/graph/";
    import {SDoorItem} from "@persagy-web/big/lib/items/floor/SDoorItem";
    import {Component, Vue} from "vue-property-decorator";

    @Component
    export default class WallCanvas extends Vue {
        view: SGraphView | undefined;
        outline1 = [[{X: 12000, Y: 10000}, {X: 12000, Y: 30000}]];

        mounted(): void {
            this.init();
        };

        init(): void {
            this.view = new SGraphView('wall');
            const scene = new SGraphScene();
            this.view.scene = scene;
            // 只模拟了轮廓数据
            // @ts-ignore
            const item = new SDoorItem(null,
                // @ts-ignore
                {
                    OutLine: this.outline1,
                    FaceDirection: {X: 0, Y: -1, Z: 0},
                    HandDirection: {X: 1, Y: 0, Z: 0}
                }
            );
            scene.addItem(item);
            this.view.fitSceneToView();
        }
    }
</script>

<style scoped>

</style>
