1234567891011121314151617181920212223242526272829303132333435 |
- import VectorType from '../enum/VectorType.js'
- import Arrow from '../Geometry/Arrow.js'
- import { mathUtil } from '../MathUtil.js'
- import { floorplanService } from './FloorplanService'
- import Constant from '../Constant'
- export default class ArrowService {
- constructor() {
- }
-
- createArrow(startPosition,endPosition,vectorId) {
- const arrow = new Arrow(startPosition, endPosition,vectorId)
- floorplanService.addArrow(arrow)
- return arrow
- }
- updateArrow(vectorId,newPosition,dir){
- const arrow = floorplanService.getArrow(vectorId)
- arrow.updatePoint(newPosition,dir)
- }
- setArrowInfo(arrowInfo) {
- let arrow = floorplanService.getArrow(arrowInfo.vectorId)
- arrow.vectorId = arrowInfo.vectorId
- arrow.startPoint = JSON.parse(JSON.stringify(arrowInfo.startPoint))
- arrow.endPoint = JSON.parse(JSON.stringify(arrowInfo.endPoint))
- }
- deleteArrow(arrowId, floorNum) {
- floorplanService.deleteArrow(arrowId, floorNum)
- }
- }
- const arrowService = new ArrowService()
- export { arrowService }
|