import VectorType from "../enum/VectorType.js"; import VectorCategory from "../enum/VectorCategory.js"; import SelectState from "../enum/SelectState.js"; import Geometry from "./Geometry"; import Constant from "../Constant.js"; import Style from "@/graphic/CanvasStyle/index.js"; import Settings from "../Settings"; export default class Line extends Geometry { constructor(startId, endId, vectorId) { super(); this.startId = startId; this.endId = endId; this.category = Settings.lineCategory; this.arrowColor = Style.Arrow.strokeStyle; //箭头类型会用到 this.geoType = VectorType.Line; this.setId(vectorId); } //NormalLine,GuideLine,MeasureLine,BaseLine setCategory(value) { if (!value) { this.category = Settings.lineCategory; } else { } this.category = value; } getCategory() { return this.category; } setArrowColor(value) { this.arrowColor = value; } getDir(pointId) { if (this.startId == pointId) { return "start"; } else if (this.endId == pointId) { return "end"; } else { return null; } } }