door.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <canvas id="wall" width="800" height="400" tabindex="0"/>
  4. </div>
  5. </template>
  6. <script lang="ts">
  7. import { SGraphScene, SGraphView } from "@persagy-web/graph/";
  8. import { SDoorItem } from "@persagy-web/big/lib/items/floor/SDoorItem";
  9. import { Component, Vue } from "vue-property-decorator";
  10. @Component
  11. export default class WallCanvas extends Vue {
  12. view: SGraphView | undefined;
  13. outline1 = [[{X: 12000, Y: 10000}, {X: 12000, Y: 30000}]];
  14. /**
  15. * 页面挂载
  16. */
  17. mounted(): void {
  18. this.init();
  19. };
  20. init(): void {
  21. this.view = new SGraphView('wall');
  22. const scene = new SGraphScene();
  23. this.view.scene = scene;
  24. // 只模拟了轮廓数据
  25. // @ts-ignore
  26. const item = new SDoorItem(null,
  27. // @ts-ignore
  28. {
  29. OutLine: this.outline1,
  30. FaceDirection: {X: 0, Y: -1, Z: 0},
  31. HandDirection: {X: 1, Y: 0, Z: 0}
  32. }
  33. );
  34. scene.addItem(item);
  35. this.view.fitSceneToView();
  36. }
  37. }
  38. </script>
  39. <style scoped>
  40. </style>