123456789101112131415161718192021222324252627282930 |
- //墙的边缘线
- import Geometry from "./Geometry.js";
- import VectorType from "../enum/VectorType.js";
- import { mathUtil } from "../Util/MathUtil";
- export default class Edge extends Geometry {
- constructor(start, end, parentId) {
- super();
- this.parent = parentId;
- this.start = {};
- this.end = {};
- this.vectorId = null;
- this.geoType = VectorType.Edge;
- 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;
- }
- getLine() {
- let line = mathUtil.createLine(this.start, this.end);
- return line;
- }
- }
|