Wall.js 740 B

12345678910111213141516171819202122232425262728293031
  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?floor:0
  9. this.geoType = VectorType.Wall
  10. this.setId(vectorId)
  11. }
  12. getPointId(dir) {
  13. if (dir == 'start') {
  14. return this.start
  15. } else {
  16. return this.end
  17. }
  18. }
  19. getOtherPointId(pointId) {
  20. if (this.start == pointId) {
  21. return this.end
  22. } else if (this.end == pointId) {
  23. return this.start
  24. } else {
  25. return null
  26. }
  27. }
  28. }