| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //墙的边缘线
- import Geometry from "./Geometry.js";
- import VectorType from "../enum/VectorType.js";
- import { mathUtil } from "../Util/MathUtil.js";
- import VectorWight from "../enum/VectorWeight.js";
- import VectorStyle from "../enum/VectorStyle.js";
- import Constant from '../Constant';
- 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 = VectorStyle.SingleSolidLine;
- this.weight = VectorWight.Thinning;
- this.points = points || [];
- this.curves = [];
- this.geoType = VectorType.CurveRoadEdge;
- this.roadSide = null;
- 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;
- }
- }
- // setRoadSide() {
- // if (!this.roadSide) {
- // this.roadSide = {};
- // this.roadSide['width'] = Constant.roadSideWidth;
- // }
- // this.roadSide['start'] = this.start;
- // this.roadSide['end'] = this.end;
- // }
- // removeRoadSide() {
- // this.roadSide = null;
- // }
- }
|