|
@@ -29,11 +29,12 @@ export default class ListenLayer {
|
|
|
}
|
|
|
|
|
|
//开始监听,exceptPointId表示不考虑的点,exceptRoadIds表示不考虑的墙
|
|
|
- start(position, exceptPointId, exceptRoadIds) {
|
|
|
+ start(position, exceptPointId, exceptRoadIds, exceptCurveRoadId) {
|
|
|
let nearest = this.getNearForVectors(
|
|
|
position,
|
|
|
exceptPointId,
|
|
|
- exceptRoadIds
|
|
|
+ exceptRoadIds,
|
|
|
+ exceptCurveRoadId
|
|
|
);
|
|
|
|
|
|
if (
|
|
@@ -83,12 +84,12 @@ export default class ListenLayer {
|
|
|
// 获得最近的墙面和墙角
|
|
|
// 同时获得吸附的相关信息
|
|
|
// 找到选中的symbol(只有选中了,才算是最近的)
|
|
|
- getNearForVectors(position, exceptPointId, exceptRoadIds) {
|
|
|
+ getNearForVectors(position, exceptPointId, exceptRoadIds, exceptCurveRoadId) {
|
|
|
let info1 = this.getNearForRoad(position, exceptPointId, exceptRoadIds);
|
|
|
let info2 = this.getNearForCurveRoad(
|
|
|
position,
|
|
|
exceptPointId,
|
|
|
- exceptRoadIds
|
|
|
+ exceptCurveRoadId
|
|
|
);
|
|
|
|
|
|
let min1 = info1.min1;
|
|
@@ -327,7 +328,7 @@ export default class ListenLayer {
|
|
|
}
|
|
|
|
|
|
//暂时只考虑端点
|
|
|
- getNearForCurveRoad(position, exceptPointId, exceptRoadIds) {
|
|
|
+ getNearForCurveRoad(position, exceptPointId, exceptCurveRoadId) {
|
|
|
let min1 = null; // 与墙角的距离
|
|
|
let min2 = null; // 与墙面的距离
|
|
|
// 纠正
|
|
@@ -341,7 +342,7 @@ export default class ListenLayer {
|
|
|
}
|
|
|
const curveRoads = dataService.getCurveRoads();
|
|
|
for (const curveRoadId in curveRoads) {
|
|
|
- if (exceptRoadIds && exceptRoadIds.hasOwnProperty(curveRoadId)) {
|
|
|
+ if (exceptCurveRoadId && exceptCurveRoadId == curveRoadId) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -419,7 +420,6 @@ export default class ListenLayer {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- // position用来判断是否在墙的symbol上
|
|
|
updateSelectInfos(nearest, minDistance) {
|
|
|
console.log("实时监控:" + JSON.stringify(nearest));
|
|
|
// 墙角状态是否改变
|
|
@@ -475,17 +475,7 @@ export default class ListenLayer {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- const flag5 = this.isChanged(
|
|
|
- nearest.tagInfo.tagId,
|
|
|
- nearest.tagInfo.state,
|
|
|
- 5
|
|
|
- );
|
|
|
- this.tagInfo = {
|
|
|
- tagId: nearest.tagInfo.tagId,
|
|
|
- state: nearest.tagInfo.state,
|
|
|
- };
|
|
|
-
|
|
|
- return flag1 || flag2 || flag5;
|
|
|
+ return flag1 || flag2;
|
|
|
}
|
|
|
|
|
|
// type是1表示点,2表示墙,3表示symbol,4表示component, 5表示tag,6表示furniture
|