Wall.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import VectorType from '../enum/VectorType.js'
  2. import Geometry from './Geometry.js'
  3. export default class Wall extends Geometry {
  4. constructor(pointId1, pointId2, vectorId, floor) {
  5. super()
  6. this.start = pointId1
  7. this.end = pointId2
  8. this.floor = floor
  9. this.children = [] //门/窗
  10. this.out = false //是否外墙
  11. this.important = false //是否承重墙
  12. //this.border = true //true表示房间墙,粗一点,false表示非房间墙,细一点
  13. //this.exterior = null //是否外墙
  14. this.geoType = VectorType.Wall
  15. this.setId(vectorId)
  16. }
  17. getOtherPointId(pointId) {
  18. if (this.start == pointId) {
  19. return this.end
  20. } else if (this.end == pointId) {
  21. return this.start
  22. } else {
  23. return null
  24. }
  25. }
  26. getPointId(dir) {
  27. if (dir == 'start') {
  28. return this.start
  29. } else {
  30. return this.end
  31. }
  32. }
  33. clearChildren() {
  34. this.children = []
  35. }
  36. setImportant(flag) {
  37. this.important = flag
  38. }
  39. setOut(flag) {
  40. this.out = flag
  41. }
  42. setChildren(children) {
  43. this.children = children
  44. }
  45. }