CurrentState.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. function CurrentState() {
  2. //画什么
  3. this.startbuild=null;
  4. //添加元素
  5. this.addSymbol=null;
  6. //选中门时候的两个端点
  7. this.currentSymbolCircleId1=null;
  8. this.currentSymbolCircleId2=null;
  9. //当前元素是否存在
  10. this.currentSymbol=false;
  11. //当前活动的墙
  12. this.currentWallId=null;
  13. //选中的线段所在位置的起始点
  14. //选中点的位置
  15. this.currentstartlinePointIndex=null;
  16. //选中的线段所在位置的终点
  17. this.currentendlinePointIndex=null;
  18. //当前选中的圆圈
  19. this.currentCircleId=null;
  20. //当前选中的点
  21. this.currentPointId=null;
  22. //当前选中的扇形
  23. this.currentSecotrId=null;
  24. //当前选中的线段
  25. this.currentLineId=null;
  26. //当前选中的symbol的id
  27. this.currentSymbolId=null;
  28. //当前选中的楼梯的id
  29. this.currentStairId=null;
  30. //选中的线段上的端点所在id
  31. this.currentLinePoint1Id=null;
  32. this.currentLinePoint2Id=null;
  33. //当前点是否被墙包含
  34. //id表示墙的vectorid,index表示墙对应的点的index,endindex表示墙的另一端对应的点的index,type表示对应的是墙角还是墙面
  35. this.selectWallSet=null;
  36. this.selectStairSet=null;
  37. //当前所处的状态
  38. //0表示什么也没有选中,1表示选中的是墙,2表示选中的是墙角,3表示选中的是墙上的门或窗户等元素
  39. //this.state=0;
  40. //当前状态和上一个状态一致
  41. CurrentState.prototype.isRetain=function(laststate)
  42. {
  43. if(this.currentstartlinePointIndex===laststate.currentstartlinePointIndex&&this.currentendlinePointIndex===laststate.currentendlinePointIndex)
  44. {
  45. if(this.currentWallId===laststate.currentWallId&&this.currentStairId===laststate.currentStairId)
  46. {
  47. return true;
  48. }
  49. }
  50. return false;
  51. };
  52. CurrentState.prototype.clearSelectSymbol=function()
  53. {
  54. this.currentSymbolCircleId1=null;
  55. this.currentSymbolCircleId2=null;
  56. this.currentSymbol=false;
  57. this.currentSymbolId=null;
  58. };
  59. CurrentState.prototype.clearSelects=function()
  60. {
  61. this.currentSymbolCircleId1=null;
  62. this.currentSymbolCircleId2=null;
  63. this.currentSymbol=false;
  64. this.currentWallId=null;
  65. this.currentstartlinePointIndex=null;
  66. this.currentendlinePointIndex=null;
  67. this.currentCircleId=null;
  68. this.currentPointId=null;
  69. this.currentSecotrId=null;
  70. this.currentLineId=null;
  71. this.currentSymbolId=null;
  72. this.currentLinePoint1Id=null;
  73. this.currentLinePoint2Id=null;
  74. //this.selectWallSet=null;
  75. };
  76. };