1
0

Wall.js 834 B

123456789101112131415161718192021222324252627282930313233343536
  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.color = 'rgba(0,0,0,1)';
  10. this.geoType = VectorType.Wall
  11. this.setId(vectorId)
  12. }
  13. getPointId(dir) {
  14. if (dir == 'start') {
  15. return this.start
  16. } else {
  17. return this.end
  18. }
  19. }
  20. getOtherPointId(pointId) {
  21. if (this.start == pointId) {
  22. return this.end
  23. } else if (this.end == pointId) {
  24. return this.start
  25. } else {
  26. return null
  27. }
  28. }
  29. setColor(color) {
  30. this.color = color
  31. }
  32. }