| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- function CurrentState() {
- //画什么
- this.startbuild = null;
- //添加元素
- this.addSymbol = null;
- //选中门时候的两个端点
- this.currentSymbolCircleId1 = null;
- this.currentSymbolCircleId2 = null;
- //当前元素是否存在
- this.currentSymbol = false;
- //当前活动的墙
- this.currentWallId = null;
- //选中的线段所在位置的起始点
- //选中点的位置
- this.currentstartlinePointIndex = null;
- //选中的线段所在位置的终点
- this.currentendlinePointIndex = null;
- //当前选中的圆圈
- this.currentCircleId = null;
- //当前选中的点
- this.currentPointId = null;
- //当前选中的扇形
- this.currentSecotrId = null;
- //当前选中的线段
- this.currentLineId = null;
- //当前选中的symbol的id
- this.currentSymbolId = null;
- //当前选中的楼梯的id
- this.currentStairId = null;
- //选中的线段上的端点所在id
- this.currentLinePoint1Id = null;
- this.currentLinePoint2Id = null;
- //当前点是否被墙包含
- //id表示墙的vectorid,index表示墙对应的点的index,endindex表示墙的另一端对应的点的index,type表示对应的是墙角还是墙面
- this.selectWallSet = null;
- this.selectStairSet = null;
- //当前所处的状态
- //0表示什么也没有选中,1表示选中的是墙,2表示选中的是墙角,3表示选中的是墙上的门或窗户等元素
- //this.state=0;
- //当前状态和上一个状态一致
- CurrentState.prototype.isRetain = function (laststate) {
- if (this.currentstartlinePointIndex === laststate.currentstartlinePointIndex && this.currentendlinePointIndex === laststate.currentendlinePointIndex) {
- if (this.currentWallId === laststate.currentWallId && this.currentStairId === laststate.currentStairId) {
- return true;
- }
- }
- return false;
- };
- CurrentState.prototype.clearSelectSymbol = function () {
- this.currentSymbolCircleId1 = null;
- this.currentSymbolCircleId2 = null;
- this.currentSymbol = false;
- this.currentSymbolId = null;
- };
- CurrentState.prototype.clearSelects = function () {
- this.currentSymbolCircleId1 = null;
- this.currentSymbolCircleId2 = null;
- this.currentSymbol = false;
- this.currentWallId = null;
- this.currentstartlinePointIndex = null;
- this.currentendlinePointIndex = null;
- this.currentCircleId = null;
- this.currentPointId = null;
- this.currentSecotrId = null;
- this.currentLineId = null;
- this.currentSymbolId = null;
- this.currentLinePoint1Id = null;
- this.currentLinePoint2Id = null;
- //this.selectWallSet=null;
- };
- };
|