123456789101112131415161718192021222324252627282930313233343536 |
- import VectorType from "../enum/VectorType.js";
- import VectorCategory from "../enum/VectorCategory.js";
- import Geometry from "./Geometry";
- import Settings from "../Settings";
- export default class Point extends Geometry {
- constructor(position, vectorId) {
- super();
- this.x = null;
- this.y = null;
- this.parent = {};
- this.category = Settings.pointCategory;
- this.geoType = VectorType.Point;
- this.setId(vectorId);
- this.setPosition(position);
- }
- setPosition(position) {
- this.x = position.x;
- this.y = position.y;
- }
- getCategory() {
- return this.category;
- }
- //基准点:BasePoint
- setCategory(value) {
- if (!value) {
- this.category = Settings.pointCategory;
- } else {
- this.category = value;
- }
- }
- }
|