door.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. mounted(): void {
  15. this.init();
  16. };
  17. init(): void {
  18. this.view = new SGraphView('wall');
  19. const scene = new SGraphScene();
  20. this.view.scene = scene;
  21. // 只模拟了轮廓数据
  22. // @ts-ignore
  23. const item = new SDoorItem(null,
  24. // @ts-ignore
  25. {
  26. OutLine:this.outline1,
  27. FaceDirection: {X: 0, Y: -1, Z: 0},
  28. HandDirection: {X: 1, Y: 0, Z: 0}
  29. }
  30. );
  31. scene.addItem(item);
  32. this.view.fitSceneToView();
  33. }
  34. }
  35. </script>
  36. <style scoped>
  37. </style>