|
@@ -1,11 +1,11 @@
|
|
//墙的边缘线
|
|
//墙的边缘线
|
|
-import Geometry from './Geometry.js';
|
|
|
|
-import VectorType from '../enum/VectorType.js';
|
|
|
|
-import VectorWight from '../enum/VectorWeight.js';
|
|
|
|
-import VectorStyle from '../enum/VectorStyle.js';
|
|
|
|
-import { mathUtil } from '../Util/MathUtil.js';
|
|
|
|
-import { dataService } from '../Service/DataService.js';
|
|
|
|
-import Constant from '../Constant';
|
|
|
|
|
|
+import Geometry from "./Geometry.js";
|
|
|
|
+import VectorType from "../enum/VectorType.js";
|
|
|
|
+import VectorWight from "../enum/VectorWeight.js";
|
|
|
|
+import VectorStyle from "../enum/VectorStyle.js";
|
|
|
|
+import { mathUtil } from "../Util/MathUtil.js";
|
|
|
|
+import { dataService } from "../Service/DataService.js";
|
|
|
|
+import Constant from "../Constant";
|
|
export default class RoadEdge extends Geometry {
|
|
export default class RoadEdge extends Geometry {
|
|
constructor(start, end, vectorId, parentId) {
|
|
constructor(start, end, vectorId, parentId) {
|
|
super();
|
|
super();
|
|
@@ -31,9 +31,9 @@ export default class RoadEdge extends Geometry {
|
|
}
|
|
}
|
|
|
|
|
|
setPosition(position, dir) {
|
|
setPosition(position, dir) {
|
|
- if (dir == 'start') {
|
|
|
|
|
|
+ if (dir == "start") {
|
|
mathUtil.clonePoint(this.start, position);
|
|
mathUtil.clonePoint(this.start, position);
|
|
- } else if (dir == 'end') {
|
|
|
|
|
|
+ } else if (dir == "end") {
|
|
mathUtil.clonePoint(this.end, position);
|
|
mathUtil.clonePoint(this.end, position);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -43,9 +43,9 @@ export default class RoadEdge extends Geometry {
|
|
}
|
|
}
|
|
|
|
|
|
getPosition(dir) {
|
|
getPosition(dir) {
|
|
- if (dir == 'start') {
|
|
|
|
|
|
+ if (dir == "start") {
|
|
return this.start;
|
|
return this.start;
|
|
- } else if (dir == 'end') {
|
|
|
|
|
|
+ } else if (dir == "end") {
|
|
return this.end;
|
|
return this.end;
|
|
} else {
|
|
} else {
|
|
return null;
|
|
return null;
|
|
@@ -67,7 +67,6 @@ export default class RoadEdge extends Geometry {
|
|
|
|
|
|
let roadSidePoints = mathUtil.RectangleVertex(startPoint, endPoint, Constant.roadSideWidth * 2);
|
|
let roadSidePoints = mathUtil.RectangleVertex(startPoint, endPoint, Constant.roadSideWidth * 2);
|
|
|
|
|
|
-
|
|
|
|
// for (let key in road) {
|
|
// for (let key in road) {
|
|
// if (this.vectorId == road[key]) {
|
|
// if (this.vectorId == road[key]) {
|
|
// if (key == 'rightEdgeId') {
|
|
// if (key == 'rightEdgeId') {
|
|
@@ -84,16 +83,16 @@ export default class RoadEdge extends Geometry {
|
|
|
|
|
|
if (!this.roadSide) {
|
|
if (!this.roadSide) {
|
|
this.roadSide = {};
|
|
this.roadSide = {};
|
|
- this.roadSide['width'] = Constant.roadSideWidth;
|
|
|
|
|
|
+ this.roadSide["width"] = Constant.roadSideWidth;
|
|
}
|
|
}
|
|
for (let key in road) {
|
|
for (let key in road) {
|
|
if (this.vectorId == road[key]) {
|
|
if (this.vectorId == road[key]) {
|
|
- if (key == 'rightEdgeId') {
|
|
|
|
- this.roadSide['start'] = roadSidePoints.rightEdgeStart;
|
|
|
|
- this.roadSide['end'] = roadSidePoints.rightEdgeEnd;
|
|
|
|
- } else if (key == 'leftEdgeId') {
|
|
|
|
- this.roadSide['start'] = roadSidePoints.leftEdgeStart;
|
|
|
|
- this.roadSide['end'] = roadSidePoints.leftEdgeEnd;
|
|
|
|
|
|
+ if (key == "rightEdgeId") {
|
|
|
|
+ this.roadSide["start"] = roadSidePoints.rightEdgeStart;
|
|
|
|
+ this.roadSide["end"] = roadSidePoints.rightEdgeEnd;
|
|
|
|
+ } else if (key == "leftEdgeId") {
|
|
|
|
+ this.roadSide["start"] = roadSidePoints.leftEdgeStart;
|
|
|
|
+ this.roadSide["end"] = roadSidePoints.leftEdgeEnd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|