function data2d() { //全部墙 this.wallIds=[]; //默认是当前屏幕显示的全部墙 this.showWallIds=[]; this.symbol2DIds=[]; //楼梯 this.stairIds=[]; //还没有确定的wall,表示正在添加的墙 this.temp_wallId=null; //还没有确定的元素 this.temp_symbol2DIds=[]; //当前显示的元素 this.show_symbol2DIds=[]; //节点 //通过nodes计算wall上的joins,如果节点对应的是墙角,则endIndex为-1 //value大部分情况是二个元素的数组,如果大于两个元素,表示指向同一个join //key是整型 //{1:{info:[{startIndex:1,endIndex:2,wallId:26}],join:point},2:{info:[],join:point2}} this.nodes={}; this.currentnodeskey = 1; }; //根据wallid的值删除 data2d.prototype.deleteWallid = function(value) { if(this.wallIds!=null&&this.wallIds.length>0) { for(var i=0;iindex) { --node[i].startIndex; if(node[i].endIndex>index) { --node[i].endIndex; } this.nodes[key]["info"][i] = node[i]; } } } } }; data2d.prototype.addNode = function(np1,np2,join) { var interval=layer.parameter.wallThickness; for(var key in this.nodes){ var node = this.nodes[key]; var point = node["join"]; var distance=BABYLON.Vector2.Distance(point,join); //重合 if(distance