Wall.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //CLASS: 显示图像类。
  2. function Wall(points, image) {
  3. Geometry.apply(this, arguments);
  4. this.points = points;
  5. this.image=image;
  6. this.disappearPointIndex=-1;
  7. //0表示闭合,1表示不闭合
  8. this.state=0;
  9. //1表示墙,2表示隔断
  10. this.wallType=1;
  11. //
  12. this.main=false;
  13. //对应三维部分的floor
  14. this.floorId=null;
  15. //交点,除去原生的
  16. //border,wallId,point,startIndex,endIndex;
  17. this.joins=[];
  18. /*
  19. this.inside=[];
  20. this.outside=[];
  21. //每块墙的高度
  22. this.height=[];
  23. //每块墙的厚度
  24. this.thick=[];
  25. //每块墙的测量距离
  26. this.measuredistance=[];
  27. */
  28. //每堵墙的信息
  29. //里面的元素是json格式: border1:,border2:,height:,thick:,measuredistance:
  30. this.wallInfo=[];
  31. this.initWall();
  32. };
  33. Wall.prototype.SetImage = function(image)
  34. {
  35. if(typeof image == Image) {
  36. this.useUrl = false;
  37. this.image = image;
  38. }
  39. else {
  40. this.useUrl = true;
  41. this.image = image;
  42. }
  43. };
  44. Wall.prototype = new Geometry();
  45. Wall.prototype.geoType = "Wall";
  46. Wall.prototype.initWall = function(){
  47. for(var i=0;i<this.points.length;++i)
  48. {
  49. this.wallInfo[i]={};
  50. this.wallInfo[i].height=layer.parameter.wallHeight;
  51. if(this.wallType==1)
  52. {
  53. this.wallInfo[i].thick=layer.parameter.wallThickness;
  54. this.wallInfo[i].measuredistance=layer.parameter.wallThickness/2;
  55. }
  56. else
  57. {
  58. this.wallInfo[i].thick=layer.parameter.partitionThickness;
  59. this.wallInfo[i].measuredistance=layer.parameter.partitionThickness/2;
  60. }
  61. }
  62. };