//墙的边缘线 import Geometry from "./Geometry.js"; import VectorType from "../enum/VectorType.js"; import { mathUtil } from "../Util/MathUtil.js"; export default class CurveRoadEdge extends Geometry { constructor(start, end, vectorId, parentId, points) { super(); this.parent = parentId; this.start = {}; this.end = {}; this.vectorId = null; this.style = null; this.points = points || []; this.curves = []; this.geoType = VectorType.CurveRoadEdge; this.setId(vectorId); this.setPositions(start, end); } setPositions(point1, point2) { this.start.x = point1.x; this.start.y = point1.y; this.end.x = point2.x; this.end.y = point2.y; } setPosition(position, dir) { if (dir == "start") { mathUtil.clonePoint(this.start, position); } else if (dir == "end") { mathUtil.clonePoint(this.end, position); } } getPosition(dir) { if (dir == "start") { return this.start; } else if (dir == "end") { return this.end; } else { return null; } } }