123456789101112131415161718192021222324252627282930313233343536 |
- import VectorType from '../enum/VectorType.js'
- import CustomImage from '../Geometry/CustomImage.js'
- import { mathUtil } from '../MathUtil.js'
- import { floorplanService } from './FloorplanService'
- import Constant from '../Constant'
- export default class CustomImageService {
- constructor() {
- this.url = null;
- }
- setCustomImageUrl(url){
- this.url = url;
- }
- async createCustomImage(center,vectorId) {
- const customImage = new CustomImage(this.url, center,vectorId)
- if(this.url){
- const imageData = await floorplanService.loadImageData(this.url)
- customImage.setImageData(imageData)
- customImage.width = imageData.width;
- customImage.height = imageData.height;
- }
- floorplanService.addCustomImage(customImage)
- this.url = null;
- return customImage
- }
- deleteCustomImage(customImageId, floorNum) {
- floorplanService.deleteCustomImage(customImageId, floorNum)
- }
- }
- const customImageService = new CustomImageService()
- export { customImageService }
|