@aibee/crc-bmap 0.0.71 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/main.ts +2 -2
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +79 -45
- package/lib/bmap.esm.js.map +3 -3
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +1 -1
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/config.d.ts +3 -0
- package/lib/src/context.d.ts +3 -1
- package/lib/src/elements/model.d.ts +3 -3
- package/lib/src/elements/overlay.d.ts +1 -0
- package/lib/src/elements/poi.d.ts +3 -0
- package/lib/src/layer/poi-layer.d.ts +1 -1
- package/package.json +1 -1
package/lib/bmap.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/bmap.ts", "../src/utils/timer.ts", "../src/utils/init-helper.ts", "../src/utils/dispose.ts", "../src/utils/rules.ts", "../src/utils/texture.ts", "../src/utils/coordinate.ts", "../src/utils/proxy.ts", "../src/utils/promise.ts", "../src/utils/svg.ts", "../src/utils/sleep.ts", "../src/utils/color.ts", "../src/utils/model.ts", "../src/utils/os.ts", "../src/utils/keyboard.ts", "../src/context.ts", "../src/operations/selection/selection.ts", "../src/elements/graphic.ts", "../src/elements/shadow.ts", "../src/elements/poi.ts", "../src/elements/overlay.ts", "../src/elements/floor.ts", "../src/layer/graphic-layer.ts", "../src/layer/layer.ts", "../src/layer/poi-layer.ts", "../src/elements/heatmap.ts", "../src/elements/model.ts", "../src/elements/base-svg.ts", "../src/elements/svg-line.ts", "../src/elements/svg-polygon.ts", "../src/elements/select-box.ts", "../src/operations/selection/box-selection.ts", "../src/operations/hover/hover-helper.ts", "../src/factory/material.ts", "../src/utils/camera-bound.ts", "../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import { EventDispatcher, Object3D, Vector3 } from \"three\";\nimport { Context } from \"./context\";\nimport { clearTextTexture, clearCanvas, vector3ToDevice, getCenter, getLongestSideDir } from \"./utils\";\nimport { Config, getConfig } from './config'\nimport {Floor, Graphic, HeatmapDataParam, Model, ModelOptions, PoiOptionsParam} from \"./elements\";\nimport { SvgLine, SvgPolygon } from \"./elements\";\nimport { GraphicInfo, GraphicOptions, PolygonGeometry, ResGraphicInfo } from \"./types\";\nimport { debounce } from \"lodash\";\nimport { disposeLoader } from \"./utils/model\";\n\nexport interface LoadQuery {\n brand: string;\n project: string;\n phase: string;\n building: string;\n floor: string;\n ts: string;\n resource_type_list: string;\n}\n\ninterface BmapEventMap {\n \"zoom-change\": {\n basicZoom: number;\n cameraZoom: number;\n }\n}\n\nexport type MapType = \"2d\" | \"3d\"\n\nexport enum MapTypePolar {\n D2 = 0,\n D3 = 0.9\n}\n\nexport class BMap extends EventDispatcher<BmapEventMap> {\n config: Config;\n\n public context: Context;\n\n private polarKeys: string[] = [];\n\n private azimuthalKeys: string[] = [];\n\n private svgLine?: SvgLine;\n\n private svgPolygon?: SvgPolygon;\n\n public basicZoom = 1;\n\n private prevCameraZoom = 1;\n\n type: MapType = \"2d\"\n\n floorDataMap: Map<string, GraphicInfo[]> = new Map()\n\n buildingGroundMap = new Map<string, GraphicInfo | null>()\n\n currentBuildGround: GraphicInfo | null = null\n\n private observe: ResizeObserver | null = null;\n\n constructor(private container: HTMLElement, config: Partial<Config> = {}) {\n super();\n this.config = getConfig(config)\n this.context = new Context(container, this.config);\n this.registryEvent();\n this.context.render();\n }\n\n private async loadGraphics({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): Promise<GraphicInfo[]> {\n const { apiDomain, apiPath: { floorGraphic }, apiInfo } = this.config\n const url = `${apiDomain}${floorGraphic}?brand=${brand}&project=${project}&phase=${phase}&building=${building}&floor=${floor}&ts=${ts}&resource_type_list=${resource_type_list}`\n const data = await fetch(url, apiInfo)\n .then((res) => res.json())\n .then(res => res.data)\n .then((res: ResGraphicInfo[]): GraphicInfo[] => {\n (res || []).map(item => item.info = (JSON.parse(item.info)))\n return (res || []) as unknown as GraphicInfo[]\n })\n return data\n }\n\n getBuildingKey({ brand, project, phase, building }: Omit<LoadQuery, \"floor\" | \"ts\" | \"resource_type_list\">) {\n const key = `${brand}-${project}-${phase}-${building}`\n return key\n }\n\n private async loadBuildingGround({ brand, project, phase, building }: Omit<LoadQuery, \"floor\" | \"ts\" | \"resource_type_list\">): Promise<GraphicInfo | null>{ \n const key = this.getBuildingKey({ brand, project, phase, building })\n if (this.buildingGroundMap.get(key)) { \n return this.buildingGroundMap.get(key) || null\n }\n const { apiDomain, apiPath: { floorRange }, apiInfo } = this.config\n const url = `${apiDomain}${floorRange}?brand=${brand}&project=${project}&phase=${phase}&building=${building}`\n const data = await fetch(url, apiInfo)\n .then((res) => res.json())\n .then(res => res.data)\n .then((res: ResGraphicInfo[]): GraphicInfo | null => {\n const data = (res || [])[0]\n if (data) {\n data.info = JSON.parse(data.info)\n }\n return data as unknown as GraphicInfo | null\n })\n this.buildingGroundMap.set(key, data)\n return data\n }\n \n getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) { \n const floorKey = `${brand}-${project}-${phase}-${building}-${floor}-${ts}-${resource_type_list}`\n return floorKey\n }\n\n async load({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) {\n const floorKey = this.getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list })\n if (this.floorDataMap.get(floorKey)) { return }\n const [data, buildGround] = await Promise.all([\n this.loadGraphics({ brand, project, phase, building, floor, ts, resource_type_list }),\n this.loadBuildingGround({ brand, project, phase, building })\n ])\n if (buildGround) {\n const center = getCenter((buildGround.info.geometry as PolygonGeometry).cds[0])\n data.forEach(item => {\n if (item.info.geometry.type === \"polygon\") { \n item.info.geometry.cds.map(cds => {\n if (Array.isArray(cds)) {\n cds.forEach(coord => {\n coord[0] -= center[0]\n coord[1] -= center[1]\n })\n }\n })\n } else {\n // point\n const [x, y] = item.info.geometry.cds\n item.info.geometry.cds = [x - center[0], y - center[1]]\n }\n item.info.transformToBuildingGround = true\n })\n }\n const { ground, markGraphic, graphic } = this.config\n for (let i = 0; i < data.length; i++) {\n const item = data[i]\n item.info.deltaHeight = 0.00001 * (i + 1)\n if (item.info.group === \"ground\") {\n item.info.fillColor = ground.color\n item.info.fillOpacity = ground.opacity\n item.info.height = ground.height\n item.info.stroke = ground.stroke\n item.info.strokeColor = ground.strokeColor\n item.info.strokeOpacity = ground.strokeOpacity\n } else if (item.info.userData.mark) {\n item.info.height = markGraphic.height;\n item.info.fillColor = markGraphic.color;\n item.info.fillOpacity = markGraphic.opacity;\n item.info.stroke = markGraphic.stroke;\n item.info.strokeColor = markGraphic.strokeColor;\n item.info.strokeOpacity = markGraphic.strokeOpacity;\n } else {\n item.info.fillOpacity = graphic.fillOpacity;\n if (this.config.initTransToMark) { \n item.info.height = markGraphic.height;\n item.info.fillColor = markGraphic.color;\n item.info.stroke = markGraphic.stroke;\n item.info.strokeColor = markGraphic.strokeColor;\n item.info.strokeOpacity = markGraphic.strokeOpacity;\n }\n }\n }\n if (!this.config.useFloorCache) {\n this.floorDataMap.clear()\n }\n this.floorDataMap.set(floorKey, data)\n return data\n }\n\n private createFloor(data: GraphicInfo[]) { \n const curFloor = new Floor(this.context)\n if (!data.length) { return { curFloor, graphics: [] } }\n const legacyToGraphicMap = new Map<string, Graphic>()\n const graphics = []\n for (const item of data) {\n if (item.info.group === \"ground\") {\n curFloor.createGround(item.info)\n } else {\n const graphic = curFloor.addGraphic(item.info)\n graphic.userData.data = item\n legacyToGraphicMap.set(item.legacy_id, graphic)\n graphics.push(graphic)\n }\n }\n curFloor.addShadow()\n curFloor.userData.legacyToGraphicMap = legacyToGraphicMap\n return { curFloor, graphics }\n }\n\n switchFloor({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) {\n const floorKey = this.getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list })\n const curFloorData = this.floorDataMap.get(floorKey)\n this.context.control.removeEventListener(\"change\", this.onControlChange)\n if (curFloorData) {\n const buildingKey = this.getBuildingKey({ brand, project, phase, building })\n this.currentBuildGround = this.buildingGroundMap.get(buildingKey) || null\n const createdFloor = this.createFloor(curFloorData)\n if (createdFloor) {\n this.context.cameraBound.setEnable(false)\n this.context.switchFloor(createdFloor.curFloor)\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = 0;\n this.context.control.maxZoom = Infinity;\n this.context.camera.zoom = 1;\n this.context.setAzimuthalAngle(0, 0);\n this.context.fitCameraToGround(undefined, 0);\n this.basicZoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = this.basicZoom;\n this.context.control.maxZoom = this.basicZoom * 25;\n this.context.control.addEventListener(\"change\", this.onControlChange)\n if (this.type === \"3d\") {\n this.context.fitCameraToGround([80, 20, 80, 20], 0, false)\n }\n this.onControlChange()\n this.context.cameraBound.setEnable(true)\n } else {\n console.warn(\"[switchFloor error] [\"+ floor +\"] \u697C\u5C42\u6CA1\u6709\u6570\u636E\")\n }\n } else {\n console.warn(\"[switchFloor error] \u6CA1\u6709\u8FD9\u4E2A\u697C\u5C42\uFF0C\u8BF7\u5148\u8C03\u7528load\u65B9\u6CD5\u52A0\u8F7D\u697C\u5C42\")\n }\n }\n\n onControlChange = () => {\n const { camera: { zoom } } = this.context\n if (zoom !== this.prevCameraZoom) {\n this.dispatchEvent({\n type: \"zoom-change\",\n basicZoom: this.basicZoom,\n cameraZoom: this.context.camera.zoom\n })\n this.prevCameraZoom = zoom\n }\n }\n\n // \u6276\u68AF\n addModel(graphic: Graphic, options: ModelOptions) { \n // \u6839\u636E\u6700\u957F\u8FB9\uFF0C\u83B7\u53D6\u6276\u68AF\u7684\u65B9\u5411\n if (graphic.options.geometry.type === \"polygon\") {\n // \u6839\u636E\u65B9\u5411\u6E32\u67D3\u6A21\u578B\n const model = this.context.currentFloor?.addModel({\n ...options,\n position: graphic.getPosition().setZ(0.1)\n })\n if (model) {\n const dir = getLongestSideDir(graphic.options.geometry.cds[0])\n const angleY = dir.angleTo(new Vector3(0, 1, 0))\n model.rotateZ(angleY)\n }\n }\n }\n\n addHeatmap(data: HeatmapDataParam) {\n return this.context.currentFloor?.addHeatmap(data)\n }\n\n getLegacyToGraphicMap(): Map<string, Graphic> {\n return this.context.currentFloor?.userData.legacyToGraphicMap || new Map()\n }\n\n /**\n * \u83B7\u53D6\u5F53\u524D\u697C\u5C42\u5168\u90E8\u7684graphic\n * @returns \n */\n getFloorAllGraphics(): Graphic[] {\n return this.context.currentFloor?.graphicLayer.children.filter(item => item instanceof Graphic) as Graphic[] || []\n }\n\n createGraphicPoi(graphic: Graphic, options: PoiOptionsParam) { \n if (this.context.currentFloor) {\n if (options.id === undefined) {\n options.id = graphic.options.id\n }\n const position = graphic.getCenter()\n const poi = this.context.currentFloor.addPoi({\n ...options,\n position: { ...position, z: position.z + graphic.options.height / 2 }\n })\n return poi\n }\n return null\n }\n\n removeHeatMap() {\n this.context.currentFloor?.removeHeatMap()\n }\n\n /**\n * \u79FB\u52A8\u76F8\u673A\u4F4D\u7F6E\u8BA9\u9009\u4E2D\u7684\u5143\u7D20\u5C45\u4E2D\u663E\u793A\n * @param ele { Graphic | Poi }\n * @param duration\n */\n translateElementToCenter(ele: { getPosition: () => Vector3 }, duration: number = 500) {\n const position = ele.getPosition()\n return this.context.setCameraPosition(position, duration);\n }\n\n /**\n * \u79FB\u52A8\u76F8\u673A\u4F4D\u7F6E\u8BA9\u9009\u4E2D\u7684\u5143\u7D20\u5C45\u4E2D\u663E\u793A\n * @param ele { Graphic | Poi }\n * @param duration\n */\n translateElementToCenterX(ele: { getPosition: () => Vector3 }, duration: number = 500) {\n const { y, z } = this.context.camera.position\n const position = ele.getPosition()\n position.setY(y)\n position.setZ(z)\n return this.context.setCameraPosition(position, duration);\n }\n\n /**\n * \u83B7\u53D6\u7269\u4F53\u7684\u5C4F\u5E55\u5750\u6807\n */\n getElementDeviceCoordinate(ele: Object3D) {\n const vector = ele.position.clone();\n const { clientWidth, clientHeight } = this.container;\n return vector3ToDevice(\n vector,\n this.context.camera,\n clientWidth,\n clientHeight\n );\n }\n\n /**\n * \u5207\u63622d\u30013d\u89C6\u89D2\n * @param type\n * @param duration\n */\n changeMapType(type: MapType, duration = 500) {\n this.type = type;\n if (type === \"2d\") {\n return this.context.setPolarAngle(MapTypePolar.D2, duration);\n } else {\n return this.context.setPolarAngle(MapTypePolar.D3, duration);\n }\n }\n\n async resetView(duration = 300) { \n const time = duration / 3\n await this.context.setAzimuthalAngle(0, time)\n await this.changeMapType(this.type, time)\n await this.context.fitCameraToGround(undefined, time)\n }\n\n /**\n * \u7F29\u5C0F\u5730\u56FE\n * @param zoom\n * @param duration\n * @returns\n */\n reduceMap(zoom = 0.5, duration = 500) {\n const cameraZoom = this.context.camera.zoom;\n return this.context.setZoom(\n cameraZoom - zoom,\n this.context.control.target,\n duration\n );\n }\n\n /**\n * \u653E\u5927\u5730\u56FE\n * @param zoom\n * @param duration\n * @returns\n */\n enlargeMap(zoom = 0.5, duration = 500) {\n const cameraZoom = this.context.camera.zoom;\n return this.context.setZoom(\n cameraZoom + zoom,\n this.context.control.target,\n duration\n );\n }\n\n onKeydown = (e: KeyboardEvent) => {\n if (this.polarKeys.includes(e.code)) {\n this.context.control.maxPolarAngle = this.config.control.maxPolar;\n this.context.control.minPolarAngle = 0;\n }\n if (this.azimuthalKeys.includes(e.code)) {\n this.context.control.maxAzimuthAngle = Infinity;\n this.context.control.minAzimuthAngle = Infinity;\n }\n };\n\n onKeyUp = (e: KeyboardEvent) => {\n if (this.polarKeys.includes(e.code)) {\n const polar = this.context.control.getPolarAngle();\n this.context.control.maxPolarAngle = polar;\n this.context.control.minPolarAngle = polar;\n }\n if (this.azimuthalKeys.includes(e.code)) {\n const azimuthal = this.context.control.getAzimuthalAngle();\n this.context.control.maxAzimuthAngle = azimuthal;\n this.context.control.minAzimuthAngle = azimuthal;\n }\n };\n\n registryEvent() {\n window.addEventListener(\"keydown\", this.onKeydown);\n window.addEventListener(\"keyup\", this.onKeyUp);\n if (this.config.resizeObserver) {\n const observe = new ResizeObserver(debounce(this.resize, 5))\n observe.observe(this.container)\n this.observe = observe\n }\n }\n\n unRegistryEvent() {\n window.removeEventListener(\"keydown\", this.onKeydown);\n window.removeEventListener(\"keyup\", this.onKeyUp);\n this.observe?.disconnect()\n this.observe = null;\n }\n\n /**\n * \u914D\u7F6E\u5750\u6807\u5B9A\u70B9 2D/3D\u7EBF\u6027\u5207\u6362\u7684\u5FEB\u6377\u952E\n * @param key\n */\n configurePolarShortcutKeys(keys: string[]) {\n this.polarKeys = keys;\n }\n\n configureAzimuthalShortcutKeys(keys: string[]) {\n this.azimuthalKeys = keys;\n }\n\n rotateMap(radius = 0.1) {\n const azimuthal = this.context.control.getAzimuthalAngle();\n this.context.control.maxAzimuthAngle = azimuthal + radius;\n this.context.control.minAzimuthAngle = azimuthal + radius;\n this.context.control.update()\n }\n\n /**\n * \u6D4B\u91CF\u8DDD\u79BB\n * @returns \n */\n async measureDistance() { \n this.cancelDistance()\n return new Promise((resolve, reject) => { \n this.changeMapType('2d', 0)\n this.context.control.enableRotate = false; // \u6D4B\u91CF\u53EA\u80FD\u57282d\u4E2D\u8FDB\u884C\n this.svgLine = new SvgLine(this.context)\n const dispose = this.svgLine.dispose.bind(this.svgLine)\n this.svgLine.dispose = function () {\n dispose();\n reject(\"cancel\")\n }\n this.svgLine.addEventListener(\"distance\", ({ distance }) => {\n resolve(distance)\n })\n }) \n }\n\n /**\n * \u53D6\u6D88\u6D4B\u91CF\u957F\u5EA6\n */\n cancelDistance() {\n if (this.svgLine) {\n this.svgLine.dispose()\n this.svgLine = undefined;\n this.context.control.enableRotate = true;\n }\n }\n\n /**\n * \u6D4B\u91CF\u9762\u79EF\n */\n measureArea() { \n this.cancelArea()\n return new Promise((resolve, reject) => {\n this.changeMapType('2d', 0)\n this.context.control.enableRotate = false; // \u6D4B\u91CF\u53EA\u80FD\u57282d\u4E2D\u8FDB\u884C\n this.svgPolygon = new SvgPolygon(this.context)\n const dispose = this.svgPolygon.dispose.bind(this.svgPolygon)\n this.svgPolygon.dispose = function () {\n dispose();\n reject(\"cancel\")\n }\n this.svgPolygon.addEventListener(\"area\", ({ area }) => {\n resolve(area)\n })\n })\n }\n\n /**\n * \u53D6\u6D88\u6D4B\u91CF\u9762\u79EF\n */\n cancelArea() {\n if (this.svgPolygon) {\n this.svgPolygon.dispose()\n this.svgPolygon = undefined\n this.context.control.enableRotate = true;\n }\n }\n\n /**\n * \u6839\u636EnodeId \u83B7\u53D6graphic\n */\n getGraphicByNodeId(nodeId: string) {\n return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(nodeId) || null\n }\n\n deleteGraphic(graphic: Graphic) {\n this.context.currentFloor?.graphicLayer.removeGraphic(graphic)\n }\n\n createGraphicByOptions(options: GraphicOptions) {\n if (!options.transformToBuildingGround) {\n if (this.currentBuildGround) {\n const center = getCenter((this.currentBuildGround.info.geometry as PolygonGeometry).cds[0])\n if (options.geometry.type === \"polygon\") {\n options.geometry.cds.map(cds => {\n if (Array.isArray(cds)) {\n cds.forEach(coord => {\n coord[0] -= center[0]\n coord[1] -= center[1]\n })\n }\n })\n } else {\n // point\n const [x, y] = options.geometry.cds\n options.geometry.cds = [x - center[0], y - center[1]]\n }\n }\n }\n return this.context.currentFloor?.graphicLayer.createGraphic(options)\n }\n\n removePoiById(id: string) { \n return this.context.currentFloor?.poiLayer.removePoiById(id)\n }\n\n getPoiById(id: string) { \n return this.context.currentFloor?.poiLayer.getPoiById(id)\n }\n\n getPois() { \n return this.context.currentFloor?.poiLayer.pois || []\n }\n\n clearPoi() {\n if (this.context.currentFloor) { \n this.context.currentFloor.poiLayer.clear()\n }\n }\n\n removeSelectGraphic(graphic: Graphic) { \n this.context.selection.remove(graphic)\n }\n\n resize = () => { \n this.context.cameraBound.setEnable(false)\n this.context.onWindowResize();\n const azimuthal = this.context.control.getAzimuthalAngle();\n const zoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = 0;\n this.context.control.maxZoom = Infinity;\n this.context.camera.zoom = 1;\n this.context.setAzimuthalAngle(0, 0);\n this.context.fitCameraToGround(undefined, 0);\n this.basicZoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = this.basicZoom;\n this.context.control.maxZoom = this.basicZoom * 25;\n this.context.camera.zoom = zoom;\n this.context.control.addEventListener(\"change\", this.onControlChange)\n this.context.setAzimuthalAngle(azimuthal, 0);\n this.context.cameraBound.setEnable(true)\n }\n\n dispose() {\n this.context.dispose();\n this.floorDataMap.clear();\n this.buildingGroundMap.clear();\n clearTextTexture();\n clearCanvas();\n disposeLoader();\n this.unRegistryEvent();\n }\n}\n", "type Fn = (...arg: any) => any\n\n/**\n * \u4EFB\u52A1\u7BA1\u7406\u5668\n * \u5728\u7C7B\u9500\u6BC1\u7684\u65F6\u5019\uFF0C\u8981\u6E05\u9664\u6240\u6709\u7684\u5F02\u6B65\u5B9A\u65F6\u5668\n */\nexport class Timer { \n tasks = {\n requestAnimation: new Set<number>(),\n timeout: new Set<number>(),\n interval: new Set<number>()\n }\n\n requestAnimationFrame(fn: Fn): number { \n const timer = window.requestAnimationFrame(() => {\n this.tasks.requestAnimation.delete(timer)\n fn()\n })\n this.tasks.requestAnimation.add(timer)\n return timer\n }\n\n cancelAnimationFrame(timer: number) { \n this.tasks.requestAnimation.delete(timer)\n window.cancelAnimationFrame(timer)\n }\n\n setTimeout(fn: Fn, wait: number): number { \n const timer = window.setTimeout(() => {\n this.tasks.timeout.delete(timer)\n fn()\n }, wait)\n this.tasks.timeout.add(timer)\n return timer\n }\n\n clearTimeout(timer: number) {\n this.tasks.timeout.delete(timer)\n window.clearTimeout(timer)\n }\n\n setInterval(fn: Fn, wait: number): number { \n const timer = window.setInterval(() => {\n this.tasks.interval.delete(timer)\n fn()\n }, wait)\n this.tasks.interval.add(timer)\n return timer\n }\n\n clearInterval(timer: number) {\n this.tasks.interval.delete(timer)\n window.clearInterval(timer)\n }\n\n dispose() { \n this.tasks.requestAnimation.forEach(timer => {\n window.cancelAnimationFrame(timer)\n })\n this.tasks.requestAnimation.clear()\n this.tasks.timeout.forEach(timer => {\n window.clearTimeout(timer)\n })\n this.tasks.timeout.clear()\n this.tasks.interval.forEach(timer => {\n window.clearInterval(timer)\n }) \n this.tasks.interval.clear()\n }\n}", "import { Coordinate } from 'src/types'\nimport {\n Scene, WebGLRenderer, OrthographicCamera, HemisphereLight, Shape, \n PCFSoftShadowMap, Group, Color, DirectionalLight, AmbientLight, Path, Vector2\n} from 'three'\nimport { MapControls } from 'three/examples/jsm/controls/MapControls'\n\nexport function initScene() {\n const scene = new Scene()\n scene.background = new Color(0xffffff)\n return scene\n}\n\nexport function initRenderer() {\n const renderer = new WebGLRenderer({\n antialias: true,\n // logarithmicDepthBuffer: true,\n // alpha: false,\n // premultipliedAlpha: false\n })\n renderer.autoClear = true\n renderer.setClearAlpha(1);\n renderer.setClearColor(0xffffff);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.autoUpdate = true;\n renderer.shadowMap.type = PCFSoftShadowMap;\n return renderer\n}\n\nexport function initCamera(width: number, height: number): OrthographicCamera {\n const camera = new OrthographicCamera(-width / 2, width / 2, height / 2, -height / 2, -1000, 5000)\n camera.up.set(0, 0, 1);\n camera.position.set(0, 0, 100);\n camera.lookAt(0, 0, 0);\n return camera\n}\n\nexport function initLight() {\n const lights = new Group()\n // \u534A\u7403\u5149\n // const hemisphereLight = new HemisphereLight(0xffffff, 0xffffff, 1);\n // hemisphereLight.intensity = 1;\n // hemisphereLight.position.set(0, 0, 10);\n // hemisphereLight.up.set(0, 0, 1);\n // lights.add(hemisphereLight)\n const ambientLight = new AmbientLight(0xffffff, 2.6);\n lights.add(ambientLight)\n return lights\n}\n\nexport function initControl(camera: OrthographicCamera, domElement: HTMLCanvasElement) {\n const control = new MapControls(camera, domElement)\n // \u7981\u7528\u963B\u5C3C\n control.enableDamping = false\n // \u8BBE\u7F6E2.5D\n // control.maxPolarAngle = 0\n // control.minPolarAngle = 0\n // \u7981\u7528\u6C34\u5E73\u65CB\u8F6C\n // control.maxAzimuthAngle = 0\n // control.minAzimuthAngle = 0\n control.zoomSpeed = 2\n return control\n}\n\nexport function initShape(path: Coordinate[], holePath: Coordinate[][] = []) { \n const shape = new Shape(path.map(item => new Vector2(...item)));\n if (holePath.length) {\n holePath.forEach(cur => {\n var hole = new Path(cur.map(item => new Vector2(...item)));\n shape.holes.push(hole);\n })\n }\n return shape\n}\n\nexport function initDirectionalLight(color = 0xffffff, intensity = 1) {\n const directionalLight = new DirectionalLight(color, intensity);\n directionalLight.castShadow = true;\n directionalLight.shadow.radius = 8;\n directionalLight.shadow.bias = -0.001;\n directionalLight.shadow.mapSize.set(256, 256);\n directionalLight.shadow.camera.left = -200;\n directionalLight.shadow.camera.right = 200;\n directionalLight.shadow.camera.top = 200;\n directionalLight.shadow.camera.bottom = -200;\n return directionalLight\n}", "import { Object3D, Mesh, Light } from 'three'\n\nexport function dispose(o: Object3D, recursive?: boolean): void {\n if (recursive && o.children && o.children.length) {\n o.children.forEach((child) => {\n dispose(child, recursive);\n });\n }\n if ((o as Mesh).isMesh) {\n const m = o as Mesh;\n if (m.geometry) m.geometry.dispose();\n if (m.material) {\n if (Array.isArray(m.material)) {\n m.material.forEach((mat) => {\n mat.dispose();\n });\n } else {\n m.material.dispose();\n }\n }\n }\n if ((o as Light).isLight) {\n (o as Light).dispose?.()\n }\n}", "export function hasChinese(str:string) {\n return /[\\u4E00-\\u9FA5]+/g.test(str);\n}", "import { hasChinese } from './rules'\nimport { DataTexture, RGBAFormat, LinearFilter } from 'three'\n\nconst urlTextureMap = new Map()\nconst textTextureMap = new Map<string, DataTexture>()\n\nexport function initCanvas() {\n const canvas = document.createElement('canvas');\n canvas.width = 1024;\n canvas.height = 64;\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n }) as CanvasRenderingContext2D;\n ctx.font = '54px sans-serif';\n ctx.textBaseline = 'hanging';\n ctx.lineWidth = 12;\n ctx.fillStyle = 'rgba(0,0,0,1)';\n ctx.strokeStyle = 'white';\n return { canvas, ctx }\n}\n\nlet canvas: HTMLCanvasElement;\nlet ctx: CanvasRenderingContext2D;\n\nexport function createCanvas() {\n if (!canvas) {\n const { canvas: c, ctx: t } = initCanvas()\n canvas = c;\n ctx = t;\n }\n}\n\nexport function getTextureByText(text: string): DataTexture {\n if (textTextureMap.has(text)) {\n return textTextureMap.get(text)!\n }\n createCanvas()\n\n ctx.clearRect(0, 0, 1024, 64);\n const y = hasChinese(text) ? 4 : 8;\n ctx.strokeText(text, 2, y);\n ctx.fillText(text, 2, y);\n\n let width = Math.ceil(ctx.measureText(text).width);\n width = width % 2 === 0 ? width : width + 1;\n width += 2;\n const imageData = ctx.getImageData(0, 0, width, 64);\n const texture = new DataTexture(\n Uint8Array.from(imageData.data),\n width,\n 64,\n RGBAFormat,\n );\n texture.flipY = true;\n texture.minFilter = LinearFilter;\n texture.magFilter = LinearFilter;\n\n textTextureMap.set(text, texture);\n return texture;\n}\n\nexport function clearTextTexture() {\n textTextureMap.clear()\n}\n\nexport function clearCanvas() {\n ctx = null as unknown as CanvasRenderingContext2D;\n canvas = null as unknown as HTMLCanvasElement;\n}", "import { Coordinate } from 'src/types';\nimport { Vector3, Camera } from 'three';\nimport { point, featureCollection, center } from '@turf/turf'\n\n/**\n * 3D\u5750\u6807\u8F6C\u5C4F\u5E55\u5750\u6807\n * @param vector \n * @param camera \n * @param w container\u7684\u5BBD\n * @param h container\u7684\u9AD8\n * @returns \n */\nexport function vector3ToDevice(vector: Vector3, camera: Camera, w: number, h: number) {\n const _vector = vector.clone().project(camera);//\u901A\u8FC7\u4E16\u754C\u5750\u6807\u83B7\u53D6\u8F6C\u6807\u51C6\u8BBE\u5907\u5750\u6807\n const _w = w / 2;\n const _h = h / 2;\n const x = Math.round(_vector.x * _w + _w);//\u6807\u51C6\u8BBE\u5907\u5750\u6807\u8F6C\u5C4F\u5E55\u5750\u6807\n const y = Math.round(-_vector.y * _h + _h);\n return { x, y }\n}\n\n\n/**\n * \u83B7\u53D6\u591A\u53D8\u5F62\u7684\u4E2D\u5FC3\u70B9\n * @param coordinates \n */\nexport function getCenter(coordinates: Coordinate[]) {\n const features = featureCollection(coordinates.map(item => point(item)))\n const cent = center(features)\n return cent.geometry.coordinates\n}\n\ntype Position = {\n x: number,\n y: number\n}\nexport function isContain(point: Position, start: Position, end: Position) {\n // \u5224\u65AD point\u662F\u5426\u5728 start \u548Cend\u5F62\u6210\u7684\u77E9\u5F62\u4E2D\n return point.x >= start.x &&\n point.x <= end.x &&\n point.y >= start.y &&\n point.y <= end.y \n}\n\n/**\n * \u83B7\u53D6\u6700\u957F\u8FB9\u7684\u65B9\u5411\n * @param cds \n */\nexport function getLongestSideDir(cds: Coordinate[]) { \n let maxDistance = 0;\n let dir = new Vector3();\n for (let i = 1; i < cds.length; i++) { \n const point_0 = new Vector3(cds[i - 1][0], cds[i - 1][1], 0);\n const point_1 = new Vector3(cds[i][0], cds[i][1], 0);\n const distance = point_1.distanceTo(point_0)\n if (distance > maxDistance) {\n maxDistance = distance;\n dir = point_1.clone().sub(point_0).normalize();\n }\n }\n return dir;\n}", "import { EventDispatcher } from 'three'\n\nexport function proxyOptions\n <T extends Record<string, any>, M extends { [K in keyof T as `change-${Extract<K, string>}`]: { value: T[K] } }>\n (target: T, master: EventDispatcher<M>): T\n{ \n return new Proxy<T>(target, {\n get: (target, p, receiver) => {\n return Reflect.get(target, p, receiver)\n },\n set: (target, p, newValue, receiver) => {\n const oldValue = Reflect.get(target, p, receiver)\n const res = Reflect.set(target, p, newValue, receiver)\n if (oldValue !== newValue) {\n master.dispatchEvent({ type: `change-${p as Extract<keyof T, string>}`, value: newValue } as any)\n }\n return res\n }\n })\n}", "/**\n * \u53EF\u4EE5\u8BBE\u7F6E\u8D85\u65F6\u65F6\u95F4\u7684promise\n * @param promise \n * @param timeout \n * @returns \n */\nexport function timeoutPromise<T>(promise: Promise<T>, timeout: number): Promise<T> {\n return Promise.race([\n promise,\n new Promise<T>((resolve, reject) => {\n setTimeout(() => reject(new Error(\"Promise timeout\")), timeout);\n })\n ]);\n}", "export function createSvgElement(tag: string) {\n return document.createElementNS('http://www.w3.org/2000/svg', tag); \n}\n\n/**\n * \u521B\u5EFAsvg\n */\nexport function createSvg(w: string, h: string) {\n const svg = createSvgElement(\"svg\");\n svg.setAttribute(\"width\", w)\n svg.setAttribute(\"height\", h)\n svg.style.cssText = \"position: absolute; left: 0; top: 0; pointer-events: none;\"\n return svg;\n}\n\n/**\n * \u521B\u5EFA\u5706\u70B9\n * @param radius \n */\nexport function createCircle(radius = \"2\", fill: string) {\n const circle = createSvgElement(\"circle\");\n circle.setAttribute(\"r\", radius)\n circle.setAttribute(\"fill\", fill)\n return circle\n}\n\n/**\n * \u521B\u5EFA\u7EBF\n * @param stroke \n */\nexport function createLine(stroke: string) {\n const line = createSvgElement(\"line\")\n line.setAttribute(\"stroke\", stroke)\n return line\n}\n\n/**\n * \u521B\u5EFA\u77E9\u5F62\n * @param stroke \n * @returns \n */\nexport function createRect(stroke: string, fill: string) {\n const rect = createSvgElement(\"rect\")\n rect.setAttribute(\"stroke\", stroke)\n rect.setAttribute(\"fill\", fill)\n return rect\n}\n\nexport function setCirclePosition(circle: SVGElement, x: number, y: number) {\n circle.setAttribute('cx', `${x}`)\n circle.setAttribute('cy', `${y}`)\n}\n\ntype Position = { x: number; y: number }\n\nexport function setLineStartEnd(line: SVGElement, start?: Position, end?: Position) {\n if (start) { \n line.setAttribute(\"x1\", `${start.x}`)\n line.setAttribute(\"y1\", `${start.y}`)\n }\n if (end) {\n line.setAttribute(\"x2\", `${end.x}`)\n line.setAttribute(\"y2\", `${end.y}`)\n }\n}\n\nexport function setRectPosition(rect: SVGElement, x: number, y: number, w: number, h: number) {\n rect.setAttribute('x', `${x}`)\n rect.setAttribute('y', `${y}`)\n rect.setAttribute('width', `${w}`)\n rect.setAttribute('height', `${h}`)\n}", "export function sleepOnePromise() {\n return Promise.resolve()\n}\n\nexport function sleepOneRf() { \n return new Promise(resolve => {\n requestAnimationFrame(resolve)\n })\n}", "export function strToNumber(str: string) {\n return parseInt(str.replace(\"#\", \"0x\"), 16);\n}\n\n/**\n * \u7ED9\u989C\u8272\u52A0\u4E0A\u900F\u660E\u5EA6\n * @param hexColor \n * @param alpha \n * @returns \n */\nexport function addAlphaToHexColor(hexColor: string, alpha: number) {\n // \u5C0616\u8FDB\u5236\u989C\u8272\u503C\u8F6C\u6362\u4E3ARGB\u6570\u503C\n let r = parseInt(hexColor.substring(1, 3), 16);\n let g = parseInt(hexColor.substring(3, 5), 16);\n let b = parseInt(hexColor.substring(5, 7), 16);\n\n // \u8BA1\u7B97\u65B0\u7684RGB\u6570\u503C\n let newR = Math.round(r * alpha);\n let newG = Math.round(g * alpha);\n let newB = Math.round(b * alpha);\n\n // \u5C06\u65B0\u7684RGB\u6570\u503C\u8F6C\u6362\u4E3A16\u8FDB\u5236\u683C\u5F0F\n let newHexColor = `#${(1 << 24 | newR << 16 | newG << 8 | newB).toString(16).slice(1)}`;\n\n return newHexColor;\n}\n\nexport function darkenColor(hexColor: string) {\n // \u5C06\u5341\u516D\u8FDB\u5236\u989C\u8272\u8F6C\u6362\u4E3ARGB\n let r = parseInt(hexColor.substring(1, 3), 16);\n let g = parseInt(hexColor.substring(3, 5), 16);\n let b = parseInt(hexColor.substring(5, 7), 16);\n\n // \u8BA1\u7B97\u6697\u70B9\u989C\u8272\n r = Math.floor(r * 0.95);\n g = Math.floor(g * 0.95);\n b = Math.floor(b * 0.95);\n\n // \u5C06RGB\u989C\u8272\u8F6C\u6362\u56DE\u5341\u516D\u8FDB\u5236\n let darkHexColor = \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n\n return darkHexColor;\n}\n", "import { Object3D, Scene, Mesh, MeshBasicMaterial } from 'three'\nimport { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'\n\nfunction createLoader() { \n const loader = new GLTFLoader()\n return loader\n}\n\nlet loader: GLTFLoader | null = null\nlet modelMap = new Map<string, Promise<GLTF>>()\n\n/**\n * \u52A0\u8F7D\u6A21\u578B\n * @param url \n * @returns \n */\nexport function loadModel(url: string): Promise<GLTF> { \n if (modelMap.has(url)) {\n const gltf = modelMap.get(url)!.then(gltf => { \n gltf.scene = gltf.scene.clone()\n return gltf\n })\n }\n if (!loader) {\n loader = createLoader()\n }\n const p = new Promise<GLTF>((resolve, reject) => { \n loader!.load(url, gltf => {\n resolve(gltf)\n }, undefined, reject)\n })\n modelMap.set(url, p)\n return p.then(gltf => { \n gltf.scene = gltf.scene.clone()\n return gltf\n })\n}\n\nexport function disposeLoader() { \n loader = null\n modelMap.clear()\n}", "export const isMac = navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;\n", "import { isMac } from \"./os\";\n\nexport function isControl(key: string) { \n if (isMac) {\n return key === \"Meta\"\n }\n return key === \"Control\"\n}", "import { MapControls } from \"three/examples/jsm/controls/MapControls\";\nimport {\n Timer,\n initCamera,\n initRenderer,\n initScene,\n initLight,\n initControl,\n dispose,\n vector3ToDevice,\n timeoutPromise,\n} from \"./utils\";\nimport {\n EventDispatcher,\n OrthographicCamera,\n Light,\n Box2,\n Vector3,\n Vector2,\n Raycaster,\n Object3D,\n Box3,\n Color,\n AmbientLight,\n} from \"three\";\nimport { Graphic, Poi, Floor } from \"./elements\";\nimport { Group as TweenGroup, Tween } from \"@tweenjs/tween.js\";\nimport { Config } from \"./config\";\nimport { Selection } from \"./operations/selection/selection\";\nimport { HoverHelper } from \"./operations\";\nimport { MaterialFactory } from \"./factory\";\nimport { CameraBound } from \"./utils/camera-bound\";\n\nexport interface ContextEventMap {\n update: {};\n \"graphic-click\": {\n graphics: Graphic[];\n position: Vector3 | null\n };\n \"poi-click\": {\n pois: Poi[];\n };\n 'pointer-level': {};\n 'pointer-over': {\n graphics: Graphic[];\n pois: Poi[];\n position: Vector3 | null;\n };\n 'pointer-move': {\n graphics: Graphic[];\n pois: Poi[];\n position: Vector3 | null;\n },\n 'change-ratio': {\n px: number;\n },\n \"select-graphic\": {\n graphics: Graphic[],\n isMultipleSelect: boolean,\n },\n \"hover\": {\n graphics: Graphic[];\n },\n \"control-change\": {},\n \"resize\": {\n width: number;\n height: number;\n }\n}\n\nexport class Context extends EventDispatcher<ContextEventMap> {\n scene = initScene();\n\n renderer = initRenderer();\n\n camera!: OrthographicCamera;\n\n control!: MapControls;\n\n lights = initLight();\n\n // \u7BA1\u7406\u4EFB\u52A1\uFF0C\u9632\u6B62\u5185\u5B58\u6CC4\u6F0F\n timer = new Timer();\n \n tweenGroup = new TweenGroup();\n \n currentFloor?: Floor;\n\n selection: Selection;\n\n hoverHelper: HoverHelper;\n \n private basicRatio?: number; // zoom=1\u7684\u65F6\u5019\uFF0C100M\u5BF9\u5E94\u7684\u50CF\u7D20\u4E2A\u6570\n\n public materialFactory!: MaterialFactory;\n\n cameraBound!: CameraBound;\n\n clientSize = {\n width: 0,\n height: 0\n }\n\n constructor(public container: HTMLElement, public config: Config) {\n super();\n this.container.style.position = \"relative\";\n this.container.style.overflow = \"hidden\";\n this.init();\n this.selection = new Selection(this);\n this.hoverHelper = new HoverHelper(this);\n this.materialFactory = new MaterialFactory(this);\n this.resizeClientSize()\n this.registryEvent();\n }\n\n resizeClientSize(width?: number, height?: number) { \n this.clientSize = {\n width: width || this.container.clientWidth,\n height: height || this.container.clientHeight\n }\n }\n\n init() {\n const { clientWidth: w, clientHeight: h } = this.container;\n this.camera = initCamera(w, h);\n this.renderer.setSize(w, h);\n this.control = initControl(this.camera, this.renderer.domElement);\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.container.appendChild(this.renderer.domElement);\n this.scene.add(this.lights);\n this.basicRatio = this.getRatio()\n // \u65CB\u8F6C\u89C6\u89D2\u7684\u65F6\u5019\uFF0C\u9690\u85CF\u548C\u663E\u793A\u9634\u5F71\n this.control.addEventListener(\"change\", () => {\n const polarAngle = this.control.getPolarAngle();\n this.currentFloor?.setShadowOpacity(polarAngle / this.config.control.maxPolar)\n this.dispatchEvent({ type: 'change-ratio', px: (this.basicRatio || 0) * this.camera.zoom })\n this.dispatchEvent({ type: 'control-change' })\n });\n this.cameraBound = new CameraBound(this);\n }\n\n /**\n * \u83B7\u53D6\u4E24\u4E2A\u70B9\u4E4B\u95F4\u7684\u50CF\u7D20\u6570\n */\n getRatio(point1 = new Vector3(0, 0, 0), point2 = new Vector3(100, 0, 0)) {\n const { clientWidth, clientHeight } = this.container\n const device1 = vector3ToDevice(point1, this.camera, clientWidth, clientHeight)\n const device2 = vector3ToDevice(point2, this.camera, clientWidth, clientHeight)\n return Math.ceil(Math.sqrt((device2.x - device1.x) ** 2 + (device2.y - device1.y) ** 2))\n }\n\n changeAmbientLightColor(color: string | number) {\n this.lights.children.forEach((item) => {\n if (item instanceof AmbientLight) {\n item.color = new Color(color);\n }\n });\n }\n\n switchFloor(floor: Floor) {\n if (this.currentFloor) {\n this.scene.remove(this.currentFloor)\n this.currentFloor.dispose()\n }\n this.currentFloor = floor\n this.scene.add(floor)\n // \u4FEE\u6539\u706F\u5149\u7684\u4F4D\u7F6E\n const position = floor.getCenter()\n if (position) {\n this.lights.position.x = position.x\n this.lights.position.y = position.y\n }\n }\n\n onWindowResize = () => {\n const { container, camera, renderer } = this;\n let { clientWidth: w, clientHeight: h } = container;\n w = Math.max(1, w);\n h = Math.max(1, h);\n camera.left = -w / 2;\n camera.right = w / 2;\n camera.top = h / 2;\n camera.bottom = -h / 2;\n camera.updateProjectionMatrix();\n renderer.setSize(w, h);\n this.resizeClientSize(w, h)\n this.dispatchEvent({ type:'resize', width: w, height: h })\n };\n\n onClick = (e: MouseEvent) => {\n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);\n if (graphics.length) {\n this.dispatchEvent({\n type: \"graphic-click\",\n graphics: graphics,\n position\n });\n }\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY);\n if (pois.length) {\n this.dispatchEvent({ type: \"poi-click\", pois: pois as Poi[] });\n }\n };\n\n /**\n * \u83B7\u53D6\u5C4F\u5E55\u5750\u6807\u5BF9\u5E94\u7684graphic\n * @param x\n * @param y\n * @returns\n */\n getGraphicsByDeviceXy(x: number, y: number): { graphics: Graphic[], position: Vector3 | null } {\n const point = new Vector2();\n point.x = (x / this.clientSize.width) * 2 - 1;\n point.y = (y / this.clientSize.height) * -2 + 1;\n const raycaster = new Raycaster();\n raycaster.setFromCamera(point, this.camera);\n const res = this.currentFloor?.graphicLayer.getGraphicByRaycaster(raycaster)\n return res || { graphics: [], position: null }\n }\n\n /**\n * \u83B7\u53D6\u5C4F\u5E55\u5750\u6807\u5BF9\u5E94\u7684poi\n * @param x\n * @param y\n * @returns\n */\n getPoisByDeviceXy(x: number, y: number) {\n const pois = this.currentFloor?.poiLayer.getPoiByDeviceXy(x, y)\n return pois || [];\n }\n\n onPointerover = (e: PointerEvent) => { \n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY) as Poi[];\n this.dispatchEvent({ type: 'pointer-over', graphics, pois, position })\n }\n\n onPointermove = (e: PointerEvent) => { \n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY)\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY) as Poi[];\n // console.log(graphics, position, e.offsetX, e.offsetY)\n this.dispatchEvent({ type: 'pointer-move', graphics, pois, position })\n }\n\n onPointerleave = () => { \n this.dispatchEvent({ type: \"pointer-level\" })\n }\n\n onSelectionSelect = ({ graphics, isMultipleSelect }: {graphics: Graphic[], isMultipleSelect: boolean}) => { \n this.dispatchEvent({ type: \"select-graphic\", graphics, isMultipleSelect })\n }\n\n onHoverChange = ({ graphics }: { graphics: Graphic[] }) => { \n this.dispatchEvent({ type: \"hover\", graphics })\n }\n\n registryEvent() {\n window.addEventListener(\"resize\", this.onWindowResize);\n this.container.addEventListener(\"click\", this.onClick);\n this.container.addEventListener(\"pointerover\", this.onPointerover)\n this.container.addEventListener(\"pointermove\", this.onPointermove)\n this.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.selection.addEventListener(\"select\", this.onSelectionSelect)\n this.hoverHelper.addEventListener(\"hover-change\", this.onHoverChange)\n }\n\n unRegistryEvent() {\n window.removeEventListener(\"resize\", this.onWindowResize);\n this.container.removeEventListener(\"click\", this.onClick);\n this.container.removeEventListener(\"pointerover\", this.onPointerover)\n this.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.selection.removeEventListener(\"select\", this.onSelectionSelect)\n this.hoverHelper.removeEventListener(\"hover-change\", this.onHoverChange)\n }\n\n /**\n * \u8BBE\u7F6E\u7EB5\u5411\u65CB\u8F6C\u89D2\u5EA6\n * @param polar \u5F27\u5EA6\n */\n public setPolarAngle(polar: number, duration = 500) {\n if (duration === 0) {\n this.control.maxPolarAngle = polar;\n this.control.minPolarAngle = polar;\n this.control.update();\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.control.minPolarAngle = 0;\n return Promise.resolve();\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const start = { polar: this.control.getPolarAngle() };\n const end = { polar };\n const tween = new Tween(start, this.tweenGroup)\n .to(end, duration)\n .onUpdate(() => {\n this.control.maxPolarAngle = start.polar;\n this.control.minPolarAngle = start.polar;\n this.control.update();\n })\n .onComplete(() => {\n this.control.enabled = true;\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.control.minPolarAngle = 0;\n this.tweenGroup.remove(tween);\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n /**\n * \u8BBE\u7F6E\u6A2A\u5411\u65CB\u8F6C\u89D2\u5EA6\n * @param azimuthal \u5F27\u5EA6\n */\n public setAzimuthalAngle(azimuthal: number, duration = 500) {\n if (duration === 0) {\n this.control.maxAzimuthAngle = azimuthal;\n this.control.minAzimuthAngle = azimuthal;\n this.control.update();\n this.control.maxAzimuthAngle = Infinity;\n this.control.minAzimuthAngle = Infinity;\n return\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const start = { azimuthal: this.control.getAzimuthalAngle() };\n const end = { azimuthal };\n const tween = new Tween(start, this.tweenGroup)\n .to(end, duration)\n .onUpdate(() => {\n this.control.maxAzimuthAngle = start.azimuthal;\n this.control.minAzimuthAngle = start.azimuthal;\n this.control.update();\n })\n .onComplete(() => {\n this.control.enabled = true;\n this.control.maxAzimuthAngle = Infinity;\n this.control.minAzimuthAngle = Infinity;\n this.tweenGroup.remove(tween);\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n getCameraLookAt() {\n return new Vector3().subVectors(this.control.target, this.camera.position);\n }\n\n /**\n * \u6309\u7167\u4E00\u4E2A\u4E2D\u5FC3\u70B9\u8BBE\u7F6E\u76F8\u673A\u7684\u653E\u5927\u7F29\u5C0F\n * @param zoom\n * @param center\n * @returns\n */\n public setZoom(zoom: number, center: Vector3, duration = 500) {\n const lookAtVector = this.getCameraLookAt();\n const start = {\n zoom: this.camera.zoom,\n target: this.control.target.clone(),\n };\n if (!duration) { \n this.camera.position.copy(center.clone().sub(lookAtVector));\n this.control.target.copy(center);\n this.camera.zoom = zoom;\n this.control.update()\n return\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const tween = new Tween(start, this.tweenGroup)\n .to(\n {\n zoom,\n target: center,\n },\n duration\n )\n .onUpdate(() => {\n this.camera.position.copy(start.target.clone().sub(lookAtVector));\n this.control.target.copy(start.target);\n this.camera.zoom = start.zoom;\n this.control.update();\n })\n .onComplete(() => {\n this.tweenGroup.remove(tween);\n this.control.enabled = true;\n resolve(true)\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n /**\n * \u653E\u5927\u76F8\u673A\u5230\u7269\u4F53\u5360\u5168\u5C4F\n * @param object\n * @param padding\n * @param duration\n * @returns\n */\n fitCameraToObject(\n object: Object3D,\n padding: [number, number, number, number] = [20, 20, 20, 20],\n duration = 500,\n force2DView = true, // \u5F3A\u5236\u8BA1\u7B972d\u89C6\u89D2\u7684\u5927\u5C0F\n ) {\n const [top, right, bottom, left] = padding;\n const { clientSize: { width, height } } = this;\n const polar = this.control.getPolarAngle()\n if (force2DView) {\n // \u83B7\u53D6\u57282D\u89C6\u56FE\u4E0B\u7684\u5927\u5C0F\n this.setPolarAngle(0, 0)\n }\n // \u83B7\u53D6\u7269\u4F53\u7684\u4E09\u7EF4\u76D2\u5B50\u5750\u6807\n const boundingBox = new Box3().setFromObject(object);\n this.setPolarAngle(polar, 0)\n const { max, min } = boundingBox;\n // \u5750\u6807\u8F6C\u6210\u5C4F\u5E55\u5750\u6807\u5E76\u8BA1\u7B97\u51FA\u5360\u7528\u5C4F\u5E55\u5750\u6807\u7684\u5927\u5C0F\n const max2d = vector3ToDevice(max, this.camera, width, height);\n const min2d = vector3ToDevice(min, this.camera, width, height);\n const boundingBox2d = new Box2().setFromPoints([\n new Vector2(max2d.x, max2d.y),\n new Vector2(min2d.x, min2d.y),\n ]);\n const size = boundingBox2d.getSize(new Vector2());\n // \u8BA1\u7B97\u5728\u5C4F\u5E55\u4E0Ax,y\u65B9\u5411\u4E0A\u9700\u8981\u8C03\u6574\u7684\u500D\u6570\n const xScale = (width - right - left) / size.x;\n const yScale = (height - top - bottom) / size.y;\n const scale = Math.min(xScale, yScale);\n const center = new Vector3((max.x + min.x) / 2, (max.y + min.y) / 2, max.z);\n return this.setZoom(scale * this.camera.zoom, center, duration);\n }\n\n fitCameraToGround(padding: [number, number, number, number] = [20, 20, 20, 20], duration = 500, force2DView = true) { \n if (this.currentFloor && this.currentFloor.hasElement) {\n return this.fitCameraToObject(this.currentFloor.groundUpper, padding, duration, force2DView);\n } else {\n return Promise.resolve(false);\n }\n }\n\n /**\n * \u4FEE\u6539\u76F8\u673A\u4F4D\u7F6E\n * @param position \u4FEE\u6539\u540E\u7684\u76F8\u673A\u7684\u4F4D\u7F6E\n * @param duration \u52A8\u753B\u6301\u7EED\u65F6\u95F4\n */\n public setCameraPosition(position: Vector3, duration: number) {\n return timeoutPromise(\n new Promise((resolve) => {\n const start = this.camera.position.clone();\n const lookAtVector = this.getCameraLookAt();\n const tween = new Tween(start, this.tweenGroup)\n .to(position, duration)\n .onUpdate(() => {\n this.camera.position.copy(start.clone().sub(lookAtVector));\n this.control.target.copy(start.clone());\n this.control.update();\n })\n .onComplete(() => {\n this.tweenGroup.remove(tween);\n this.camera.position.copy(start.clone().sub(lookAtVector));\n this.control.target.copy(position.clone());\n this.control.update();\n this.control.enabled = true;\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n render() {\n this.renderer.render(this.scene, this.camera);\n this.dispatchEvent({ type: \"update\" });\n this.timer.requestAnimationFrame(() => {\n this.render();\n });\n this.tweenGroup.update();\n }\n\n dispose() {\n this.cameraBound.dispose()\n this.selection.dispose()\n this.hoverHelper.dispose()\n this.tweenGroup.getAll().forEach((item) => item.stop());\n this.tweenGroup.removeAll();\n this.unRegistryEvent();\n this.container.removeChild(this.renderer.domElement);\n this.timer.dispose();\n this.renderer.dispose();\n (this.lights.children as Light[]).forEach((light: Light) =>\n light.dispose()\n );\n this.materialFactory.dispose();\n dispose(this.scene);\n }\n}\n", "import { EventDispatcher } from \"three\";\nimport { Context } from \"../../context\";\nimport { Graphic, Poi } from \"../../elements\";\nimport { BoxSelection } from \"./box-selection\";\nimport { isControl } from \"../../utils\";\n\ninterface SelectionEventMap {\n \"select\": {\n graphics: Graphic[],\n isMultipleSelect: boolean,\n }\n}\n\nexport class Selection extends EventDispatcher<SelectionEventMap> {\n private _list = new Set<Graphic>()\n\n private boxSelection: BoxSelection;\n private prevPanStatus?: boolean;\n private prevRotateStatus?: boolean;\n private downPoint: { x: number, y: number } | null = null\n\n private isMultipleSelect = false;\n\n constructor(private context: Context) {\n super()\n this.boxSelection = new BoxSelection(context)\n this.boxSelection.setEnable(false)\n this.registryEvent()\n }\n\n get list() {\n return this._list\n }\n\n onPointerDown = (e: PointerEvent) => {\n this.downPoint = { x: e.offsetX, y: e.offsetY }\n }\n\n onPointerUp = (e: PointerEvent) => {\n if (!this.downPoint) { return }\n const { offsetX, offsetY } = e\n const { x, y } = this.downPoint\n if (Math.sqrt((x - offsetX) ** 2 + (y - offsetY) ** 2) > 3) {\n return\n }\n const { graphics } = this.context.getGraphicsByDeviceXy(offsetX, offsetY)\n const graphicIdSet = new Set(graphics.map(item => item.options.id))\n const pois = this.context.getPoisByDeviceXy(offsetX, offsetY) as Poi[];\n pois.forEach(item => { \n if (!graphicIdSet.has(item.options.id)) {\n const graphic = this.context.currentFloor?.graphicLayer.graphicMap.get(item.options.id) || null\n if (graphic && graphic.options.geometry.type === 'point') { \n graphics.push(graphic)\n graphicIdSet.add(item.options.id)\n }\n }\n })\n if (!e.ctrlKey) {\n this._list.clear()\n }\n graphics.forEach(item => this._list.add(item))\n this.selectEnd()\n this.downPoint = null\n }\n\n onKeyDown = (e: KeyboardEvent) => {\n if (isControl(e.key)) {\n this.isMultipleSelect = true;\n this.boxSelection.setEnable(true)\n this.prevPanStatus = this.context.control.enablePan\n this.prevRotateStatus = this.context.control.enableRotate\n this.context.control.enablePan = false\n this.context.control.enableRotate = false\n }\n }\n\n onKeyUp = (e: KeyboardEvent) => {\n if (isControl(e.key)) {\n this.isMultipleSelect = false;\n this.boxSelection.setEnable(false)\n this.context.control.enablePan = !!this.prevPanStatus\n this.context.control.enableRotate = !!this.prevRotateStatus\n }\n }\n\n onBoxSelected = ({ list }: { list: Graphic[] }) => { \n this._list.clear()\n list.forEach(item => {\n this._list.add(item)\n })\n this.selectEnd()\n }\n\n selectEnd() {\n this.dispatchEvent({type: \"select\", graphics: [...this._list], isMultipleSelect: this.isMultipleSelect})\n }\n\n registryEvent() {\n this.context.container.addEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.addEventListener(\"pointerup\", this.onPointerUp)\n window.addEventListener(\"keydown\", this.onKeyDown)\n window.addEventListener(\"keyup\", this.onKeyUp)\n this.boxSelection.addEventListener(\"selected\", this.onBoxSelected)\n }\n\n unRegistryEvent() {\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.removeEventListener(\"pointerup\", this.onPointerUp)\n window.removeEventListener(\"keydown\", this.onKeyDown)\n window.removeEventListener(\"keyup\", this.onKeyUp)\n this.boxSelection.removeEventListener(\"selected\", this.onBoxSelected)\n }\n\n clear() {\n this._list.clear()\n }\n\n remove(graphic: Graphic) { \n this._list.delete(graphic)\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}", "import {\n Object3D, ExtrudeGeometry, Mesh, Box3, MeshBasicMaterial,\n Raycaster, Object3DEventMap, Vector3, BufferGeometry, LineBasicMaterial, LineSegments\n} from 'three';\nimport { initShape, proxyOptions, darkenColor } from '../utils'\nimport { GraphicOptions, PolygonGeometry } from 'src/types';\nimport { Context } from '../context'\n\n// \u95E8\u7684\u7C7B\u578B\nconst DoorType = {\n single: \"\u5355\u5F00\u95E8\",\n double: \"\u53CC\u5F00\u95E8\",\n move: \"\u79FB\u52A8\u95E8\",\n};\n\n// \u95E8\u7684\u6750\u8D28\nconst DoorMaterial = {\n wood: \"\u6728\u95E8\",\n glass: \"\u73BB\u7483\u95E8\",\n aluminum: \"\u94DD\u5408\u91D1\u95E8\",\n}\n\n// \u5355\u4E2A\u95E8\u7684\u914D\u7F6E\nexport interface Door {\n // \u540D\u79F0\n name: string;\n id: string;\n width: number;\n // \u5185\u5F00/\u5916\u5F00\n open: boolean;\n // \u7C7B\u578B \u5355\u5F00\u95E8 \u53CC\u5F00\u95E8 \u79FB\u52A8\u95E8\n type: keyof typeof DoorType;\n // \u6750\u8D28\n material: keyof typeof DoorMaterial;\n}\n\nexport type GraphicOptionsParam = Partial<GraphicOptions>\n\ntype GraphicEventMap = {\n [K in keyof GraphicOptions as `change-${K}`]: { value: GraphicOptions[K] };\n} & Object3DEventMap;\n\n\nconst defaultOptions: GraphicOptions = {\n id: \"\", // \u56FE\u5F62id\n height: 0.1, // \u56FE\u5F62\u9AD8\u5EA6\n airHeight: 0, // \u60AC\u7A7A\u9AD8\u5EA6\n area: 0, // \u9762\u79EF\n group: \"\", // \u5206\u7EC4\n fillColor: \"#EFF4FB\", // \u989C\u8272\n strokeColor: \"#ffffff\", // \u8FB9\u6846\n fillOpacity: 1, // \u900F\u660E\u5EA6\n strokeOpacity: 1, // \u63CF\u8FB9\u900F\u660E\u5EA6\n strokeWidth: 1, // \u63CF\u8FB9\u5BBD\u5EA6 \n doors: [], // \u95E8\u914D\u7F6E\n locked: false,\n visible: true,\n geometry: {\n type: 'polygon',\n cds: [],\n curveCpt: [],\n curveIndex: []\n },\n layerType: \"\",\n zIndex: 0,\n stroke: true,\n deltaHeight: 0,\n userData: {}\n}\n\nexport class Graphic extends Object3D<GraphicEventMap> {\n\n private geometry!: ExtrudeGeometry;\n\n private material!: MeshBasicMaterial | MeshBasicMaterial[];\n\n public mesh!: Mesh;\n\n private line!: LineSegments;\n\n private lineMaterial?: LineBasicMaterial;\n\n private lineGeometry?: BufferGeometry;\n \n public options: GraphicOptions\n \n constructor(private context: Context, options: GraphicOptionsParam) {\n super()\n this.options = proxyOptions<GraphicOptions, GraphicEventMap>({...defaultOptions, ...options}, this)\n if (this.options.geometry.type === \"point\") { \n const [x, y] = this.options.geometry.cds\n this.position.set(x, y, this.options.height + this.options.airHeight)\n return this\n }\n this.init()\n this.visible = this.options.visible\n this.addEventListener('change-fillColor', ({ value }) => {\n this.initMaterial()\n this.initMesh()\n })\n this.addEventListener('change-fillOpacity', ({ value }) => {\n this.initMaterial()\n this.initMesh()\n })\n this.addEventListener('change-height', ({ value }) => {\n this.dispose()\n this.init()\n })\n this.addEventListener('change-strokeColor', ({ value }) => {\n if (!this.options.stroke) { return }\n this.initLineMaterial();\n this.createBorder();\n })\n this.addEventListener('change-strokeOpacity', ({ value }) => {\n if (!this.options.stroke) { return }\n this.initLineMaterial();\n this.createBorder();\n })\n // this.addEventListener('change-strokeWidth', ({ value }) => {\n // this.initLineMaterial();\n // this.createBorder();\n // })\n this.addEventListener('change-airHeight', ({ value }) => {\n this.position.z = value\n })\n this.addEventListener('change-visible', ({ value }) => {\n this.visible = value\n })\n this.addEventListener('change-stroke', ({ value }) => {\n if (value) {\n if (this.line) { return }\n this.initLineGeometry()\n this.initLineMaterial()\n this.createBorder()\n } else if (this.line) {\n this.remove(this.line);\n this.lineGeometry?.dispose()\n }\n })\n }\n\n getCenter() { \n if (this.options.geometry.type === \"point\") { \n return this.position.clone()\n }\n const center = new Vector3()\n const box = new Box3()\n box.setFromObject(this)\n box.getCenter(center)\n return center\n }\n\n getSize() {\n if (this.options.geometry.type === \"point\") { \n return new Vector3(0, 0, 0)\n }\n const box = new Box3()\n const size = new Vector3()\n box.setFromObject(this)\n box.getSize(size)\n return size\n }\n\n getPosition() {\n const center = this.getCenter()\n center.setZ(center.z + this.options.height)\n return center\n }\n\n init() {\n this.geometry = this.initGeometry()\n this.initMaterial()\n this.initMesh()\n this.mesh.position.z = this.options.airHeight + this.options.deltaHeight;\n if (this.options.stroke) {\n // \u521B\u5EFA\u8FB9\u6846\n this.initLineMaterial()\n this.initLineGeometry()\n this.createBorder()\n }\n }\n\n initGeometry() {\n const shape = initShape(\n (this.options.geometry as PolygonGeometry).cds[0],\n (this.options.geometry as PolygonGeometry).cds.slice(1)\n )\n const geometry = new ExtrudeGeometry(shape, {\n steps: 1,\n bevelEnabled: false,\n depth: this.options.height,\n curveSegments: 4,\n });\n return geometry\n }\n\n initMaterial() {\n const material = this.context.materialFactory.createMeshBasicMaterial({\n color: this.options.fillColor,\n opacity: this.options.fillOpacity\n })\n if (this.options.height <= 0.001) {\n this.material = material\n return material\n }\n const material1 = this.context.materialFactory.createMeshBasicMaterial({\n color: darkenColor(this.options.fillColor),\n opacity: this.options.fillOpacity,\n })\n this.material = [material, material1]\n return [material, material1]\n }\n\n initLineMaterial() { \n const lineMaterial = this.context.materialFactory.createLineMaterial({\n color: this.options.strokeColor,\n opacity: this.options.strokeOpacity,\n })\n this.lineMaterial = lineMaterial;\n return lineMaterial\n }\n\n initMesh() {\n if (this.mesh) { \n this.remove(this.mesh)\n }\n this.mesh = new Mesh(this.geometry, this.material)\n this.add(this.mesh)\n }\n\n getBorderPoints() {\n const points = [];\n const height = this.options.height + this.options.deltaHeight\n // \u70B9\u7684\u5750\u6807\u8981\u81EA\u5DF1\u7B97\uFF0C\u53EA\u753B\u5173\u952E\u8282\u70B9\u7684\u5782\u76F4\u7EBFcurveIndex\u662F\u5173\u952E\u8282\u70B9,\u5982\u679C\u662F\u66F2\u7EBF\u6709\u8FD9\u4E2A\u503C\uFF0C\u4E0D\u662F\u66F2\u7EBF\u4E0D\u4E00\u5B9A\u6709\n const { cds } = this.options.geometry as PolygonGeometry\n for (let j = 0; j < cds.length; j++) { \n const curCds = cds[j]\n for (let i = 0; i < curCds.length; i++) {\n const cur = curCds[i];\n const next = i + 1 === curCds.length ? curCds[0] : curCds[i + 1];\n // \u628A\u62C9\u5347\u4E0A\u53BB\u7684\u70B9\u653E\u8FDB\u53BB\n points.push(new Vector3(cur[0], cur[1], height))\n points.push(new Vector3(next[0], next[1], height))\n }\n }\n return points\n }\n\n initLineGeometry() { \n if (this.lineGeometry) { \n this.lineGeometry.dispose()\n }\n const points = this.getBorderPoints()\n const lineGeometry = new BufferGeometry()\n .setFromPoints(points)\n this.lineGeometry = lineGeometry;\n }\n\n createBorder() {\n if (this.line) { \n this.remove(this.line)\n }\n const line = new LineSegments(this.lineGeometry, this.lineMaterial)\n line.position.z = this.options.airHeight + 0.01\n this.line = line;\n this.add(line)\n return line\n }\n\n raycast(raycaster: Raycaster) {\n if (!this.visible) { return false }\n if (this.options.geometry.type === \"point\") { return false }\n const intersects = raycaster.intersectObject(this.mesh)\n if (intersects[0]) {\n const {point: position, distance} = intersects[0]\n return { position, distance }\n }\n return false\n }\n \n dispose() {\n this.geometry.dispose()\n this.line?.geometry.dispose()\n this.clear()\n }\n\n}", "import {\n Object3D, PlaneGeometry, DirectionalLight,\n Mesh, MeshStandardMaterial, ShadowMaterial, Color, Vector3, DoubleSide\n} from 'three';\nimport { dispose, initDirectionalLight } from '../utils'\n\nexport class Shadow extends Object3D {\n\n private directionalLight: DirectionalLight\n\n private plane!: Mesh\n\n public basicOpacity = 0.07\n\n constructor() {\n super()\n this.directionalLight = this.initLight()\n this.initPlane()\n }\n\n // \u521B\u5EFA\u5149\u6E90\n initLight() { \n const directionalLight = initDirectionalLight(0xffffff, 0.5)\n directionalLight.position.set(0, 0, 100);\n this.add(directionalLight);\n return directionalLight\n }\n \n changeLightCamera(size: Vector3) {\n const x = size.x\n const y = size.y\n this.directionalLight.shadow.camera.left = -x;\n this.directionalLight.shadow.camera.right = x;\n this.directionalLight.shadow.camera.top = y;\n this.directionalLight.shadow.camera.bottom = -y;\n this.directionalLight.shadow.camera.near = 0.5;\n this.directionalLight.shadow.camera.far = Math.max(x, y);\n }\n\n changeLightColor(color: number | string) {\n this.directionalLight.color = new Color(color)\n }\n\n setPosition(position: Vector3) {\n this.position.copy(position)\n this.directionalLight.position.set(-position.x / 2, -position.y / 2, 100)\n }\n\n // \u521B\u5EFA\u5E73\u9762\u767D\u8272\n initPlane(width = 1000, height = 1000) { \n const geometry = new PlaneGeometry(width, height)\n const material = new ShadowMaterial({\n transparent: true,\n opacity: 0,\n side: DoubleSide\n })\n const mesh = new Mesh(geometry, material)\n mesh.receiveShadow = true\n mesh.position.z = -10\n this.add(mesh)\n this.plane = mesh\n return mesh\n }\n\n setTarget(target: Object3D) {\n this.directionalLight.target = target\n }\n\n transformOpacity(opacity: number): number {\n return opacity * this.basicOpacity\n }\n\n setOpacity(opacity: number) { \n (this.plane.material as MeshStandardMaterial).opacity = this.transformOpacity(opacity);\n }\n \n dispose() {\n dispose(this, true)\n }\n\n}", "import { proxyOptions, sleepOnePromise } from '../utils';\nimport { EventDispatcher, Object3D, Object3DEventMap, Vector3 } from 'three';\nimport { Context } from '../context'\nimport { Overlay } from './overlay';\n\nexport interface PoiOptions {\n texts: { text: string, styles?: { [key: string]: string }; }[];\n icon?: string;\n icon_size?: [number, number]; // \u5BBD \u9AD8\n level: number; // \u6E32\u67D3\u4F18\u5148\u7EA7\n collision_enable: boolean; // \u662F\u5426\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\n opacity: number;\n id: string; // poi\u7684key\n position: { x: number; y: number; z: number };\n icon_opacity: number;\n icon_border: { color: string, width: number };\n background: string;\n}\n\ntype PoiEventMap = {\n [K in keyof PoiOptions as `change-${K}`]: { value: PoiOptions[K] };\n} & Object3DEventMap;\n\nconst defaultOptions: PoiOptions = {\n texts: [{ text: \"\" }],\n level: 1,\n collision_enable: true,\n opacity: 1,\n id: \"\",\n position: { x: 0, y: 0, z: 0 },\n icon_opacity: 1,\n icon_border: { color: \"#586EE0\", width: 0 },\n background: \"\"\n}\n\nexport type PoiOptionsParam = Partial<PoiOptions>\n\nexport class Poi extends EventDispatcher<PoiEventMap> {\n\n private div!: HTMLDivElement\n\n private textDiv!: HTMLDivElement\n\n private img?: HTMLImageElement\n\n private overlay: Overlay\n\n public options: PoiOptions\n\n public visible = true\n\n size = { width: 0, height: 0 }\n\n position = new Vector3()\n\n userData = {};\n\n constructor(private context: Context, options: PoiOptionsParam) {\n super()\n this.options = proxyOptions<PoiOptions, PoiEventMap>({...defaultOptions, ...options}, this)\n this.position.set(options.position?.x || 0, options.position?.y || 0, options.position?.z || 0)\n this.overlay = new Overlay(this.context, { autoUpdate: false })\n this.overlay.addEventListener(\"update-position\", ({x, y, height}) => { \n this.overlay.div.style.transform = `translate3d(calc(${x}px - 50%), calc(${-height + y}px - ${this.options.icon ? '100%' : '50%'}), 0)`;\n })\n this.overlay.bindElement(this as unknown as Object3D)\n this.registryEvent()\n this.initDiv()\n this.addEventListener(\"change-icon\", ({ value }) => {\n if (value) {\n if (!this.img) {\n this.div.appendChild(this.initIcon())\n } else {\n this.img.setAttribute('src', value)\n }\n } else {\n this.img && this.div.removeChild(this.img)\n this.img = undefined\n this._changePosition()\n this.resetSize()\n }\n })\n this.addEventListener(\"change-texts\", ({ value }) => {\n this.div.removeChild(this.textDiv)\n this.div.appendChild(this.initText())\n this.resetSize()\n })\n this.addEventListener(\"change-opacity\", ({ value }) => {\n this.overlay.setOpacity(value)\n })\n this.addEventListener(\"change-icon_size\", ({ value }) => {\n if (this.img) {\n this.img.style.width = `${value?.[0] || 32}px`\n this.img.style.height = `${value?.[1] || 32}px`\n this.resetSize()\n }\n })\n this.addEventListener(\"change-icon_opacity\", ({ value }) => {\n if (this.img) {\n this.img.style.opacity = `${value}`\n }\n })\n this.addEventListener(\"change-icon_border\", ({ value }) => {\n if (this.img) {\n this.img.style.border = `${value.width}px solid ${value.color}`\n this.resetSize()\n }\n })\n this.addEventListener(\"change-background\", ({ value }) => {\n this.div.style.background = value;\n })\n }\n\n get withinDisplayRange() {\n return this.overlay.withinDisplayRange\n }\n\n async resetSize() {\n await sleepOnePromise()\n const { width, height } = this.div.getBoundingClientRect()\n this.size = {\n width: width + 4, \n height: height + 4\n }\n }\n\n renderHelperBox() {\n const div = document.createElement('div')\n const box = this.getBox()\n div.style.cssText = `position: absolute; top: ${box.top}px;left: ${box.left}px;width: ${box.right - box.left}px;height: ${box.bottom - box.top}px;border: 1px solid red;`\n this.context.container.appendChild(div)\n }\n\n get clientPos() {\n return this.overlay.clientPos\n }\n\n initDiv() {\n const div = document.createElement(\"div\");\n div.appendChild(this.initText())\n if (this.options.icon) { \n div.appendChild(this.initIcon())\n }\n div.style.fontSize = `12px`;\n div.style.textShadow = `#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0`;\n div.style.display = `flex`;\n div.style.flexDirection = `column`;\n div.style.justifyContent = `center`;\n div.style.alignItems = `center`;\n div.style.padding = \"4px\";\n this.overlay.setOpacity(this.options.opacity);\n this.overlay.div.style.pointerEvents = `none`;\n this.overlay.div.style.userSelect = `none`;\n this.overlay.div.appendChild(div)\n this.div = div;\n this._changePosition()\n this.resetSize()\n return div\n }\n\n getPosition() {\n return this.position\n }\n\n initText() {\n const textDiv = document.createElement(\"div\")\n textDiv.appendChild(this.createTextFragment())\n textDiv.style.textAlign = \"center\"\n this.textDiv = textDiv\n return textDiv\n }\n\n createTextFragment() { \n const f = document.createDocumentFragment()\n this.options.texts.forEach(item => { \n const div = document.createElement(\"div\")\n div.style.whiteSpace = 'nowrap';\n if (item.styles) { \n for (let [key, value] of Object.entries(item.styles)) { \n div.style[key as any] = value;\n }\n }\n div.textContent = item.text;\n f.appendChild(div)\n })\n return f\n }\n\n initIcon() {\n const img = document.createElement(\"img\")\n img.setAttribute(\"src\", this.options.icon!)\n img.style.width = `${this.options.icon_size?.[0] || 32}px`\n img.style.height = `${this.options.icon_size?.[1] || 32}px`\n img.style.opacity = `${this.options.icon_opacity}px`\n img.style.borderRadius = '50%';\n if (this.options.icon_border.width) {\n img.style.border = `${this.options.icon_border.width}px solid ${this.options.icon_border.color}`\n }\n img.onload = () => {\n this._changePosition()\n this.resetSize()\n }\n this.img = img\n return img\n }\n\n private _changePosition = () => {\n // this.div.style.transform = `translate3d(-50%, ${this.options.icon ? '-100%' : '-50%'}, 0)`;\n }\n\n registryEvent() {\n // this.context.addEventListener('update', this._changePosition)\n }\n\n unRegistryEvent() {\n // this.context.removeEventListener('update', this._changePosition)\n }\n\n setVisible(visible: boolean) {\n if (visible === this.visible) { return }\n this.visible = visible\n this.changeOverlayVisible(visible)\n }\n\n changeOverlayVisible(visible: boolean) {\n if (visible === this.overlay.visible) { return }\n this.overlay.visible = visible;\n this.overlay.div.style.visibility = visible ? \"visible\" : \"hidden\"\n }\n\n parentSetVisible(visible: boolean) { \n if (!this.visible) { \n return\n }\n this.changeOverlayVisible(visible)\n }\n\n getBox() {\n const { width, height } = this.size\n const { x, y } = this.overlay.clientPos\n return {\n left: x - width / 2,\n right: x + width / 2,\n top: this.options.icon ? y - height : y - height / 2,\n bottom: this.options.icon ? y : y + height / 2,\n }\n }\n\n isContain(x: number, y: number) {\n if (!this.overlay.visible) { return false }\n const box = this.getBox()\n return x >= box.left && x <= box.right && y >= box.top && y <= box.bottom\n }\n\n dispose() {\n this.unRegistryEvent();\n this.div = null as unknown as HTMLDivElement;\n this.textDiv = null as unknown as HTMLDivElement;\n this.img = undefined\n this.overlay.dispose();\n }\n}", "import { Context } from \"../context\";\nimport { Box3, EventDispatcher, Object3D, Vector3 } from \"three\";\nimport { vector3ToDevice } from '../utils'\n\ninterface OverlayOptions {\n autoUpdate: boolean;\n}\n\nconst defaultOptions: OverlayOptions = {\n autoUpdate: true\n}\n\ninterface OverlayEventMap {\n \"update-position\": {\n x: number;\n y: number;\n width: number;\n height: number;\n }\n}\n\nexport class Overlay extends EventDispatcher<OverlayEventMap> {\n\n public div: HTMLDivElement\n\n private element?: Object3D & { getPosition?: () => Vector3 }\n\n public position = new Vector3()\n\n clientPos = { x: 0, y: 0 }\n\n visible = true\n\n private options: OverlayOptions\n\n constructor(private context: Context, options: Partial<OverlayOptions> = {}) {\n super()\n this.options = { ...defaultOptions, ...options };\n this.registryEvent()\n this.div = this.initDiv()\n this.context.container.appendChild(this.div)\n }\n\n initDiv() {\n const div = document.createElement(\"div\")\n div.style.position = \"absolute\";\n return div\n }\n\n bindElement(element: Object3D) {\n this.element = element\n this.onUpdate() \n }\n\n unBindElement() {\n this.element = undefined;\n }\n\n setVisible(visible: boolean, display = 'block') {\n if (visible === this.visible) { return }\n this.div.style.display = visible ? display : 'none'\n this.visible = visible\n }\n\n setOpacity(opacity: number) {\n this.div.style.opacity = `${opacity}`\n }\n\n getPosition() {\n if (this.element) {\n if (typeof this.element.getPosition === \"function\") {\n return this.element.getPosition()\n }\n const box = new Box3().setFromObject(this.element)\n const center = box.getCenter(new Vector3())\n return center\n } else {\n return this.position\n }\n }\n\n get withinDisplayRange() { \n const { x, y } = this.clientPos\n const { width, height } = this.context.clientSize\n return x >=0 && x <= width && y >= 0 && y <= height\n }\n\n onUpdate = () => {\n const vector = this.getPosition()\n const { width, height } = this.context.clientSize\n const { x, y } = vector3ToDevice(vector, this.context.camera, width, height)\n if (this.clientPos.x === x && this.clientPos.y === y) { return }\n this.clientPos = { x, y }\n if (this.options.autoUpdate) { \n this.div.style.transform = `translate3d(${x}px, ${-height+y}px, 0)`\n } else {\n this.dispatchEvent({ type: \"update-position\", x, y, width, height })\n }\n }\n\n registryEvent() {\n this.context.addEventListener('update', this.onUpdate)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener('update', this.onUpdate)\n }\n\n dispose() {\n this.unRegistryEvent()\n this.unBindElement()\n this.div && this.context.container.removeChild(this.div)\n this.div = null as unknown as HTMLDivElement\n }\n}", "import { Context } from \"../context\";\nimport { Box3, Object3D, Vector3 } from \"three\";\nimport { GraphicLayer } from '../layer/graphic-layer'\nimport { PoiLayer } from '../layer/poi-layer'\nimport { Graphic, GraphicOptionsParam } from \"./graphic\";\nimport { Shadow } from \"./shadow\";\nimport { PoiOptionsParam } from \"./poi\";\nimport { HeatmapDataParam, HeatmapElement } from './heatmap'\nimport { Model, ModelOptions } from \"./model\";\n\nexport class Floor extends Object3D {\n \n graphicLayer: GraphicLayer;\n\n poiLayer: PoiLayer;\n\n grounds: Set<Graphic> = new Set();\n\n shadow = new Shadow();\n\n heatmap?: HeatmapElement;\n\n groundUpper = new Object3D();\n\n models = new Object3D()\n\n private groundMaxHeight = 0;\n\n constructor(public context: Context) {\n super()\n this.graphicLayer = new GraphicLayer(this.context);\n this.poiLayer = new PoiLayer(this.context);\n this.groundUpper.add(this.graphicLayer)\n this.groundUpper.add(this.poiLayer)\n this.add(this.groundUpper)\n this.add(this.models)\n }\n\n createGround(options: GraphicOptionsParam) {\n // options.deltaHeight = 0.00001 * this.grounds.size\n const ground = new Graphic(this.context, options)\n this.addGrounds([ground])\n }\n\n addGrounds(grounds: Graphic[]) {\n grounds.forEach(ground => { \n if (!this.grounds.has(ground)) {\n ground.mesh.castShadow = true;\n this.grounds.add(ground)\n this.groundUpper.add(ground)\n }\n })\n this.changeGroundMaxHeight()\n }\n\n changeGroundMaxHeight() { \n const grounds = Array.from(this.grounds)\n this.groundMaxHeight = this.grounds.size > 0 ? Math.max(...grounds.map(ground => ground.options.height + ground.options.airHeight + ground.options.deltaHeight)) : 0\n this.graphicLayer.position.z = this.groundMaxHeight\n this.models.position.z = this.groundMaxHeight\n }\n\n get hasElement() { \n return !!(this.grounds.size || this.graphicLayer.children.length)\n }\n\n getCenter() { \n return new Box3().setFromObject(this.groundUpper).getCenter(new Vector3())\n }\n \n addModel(options: ModelOptions) { \n const model = new Model(this.context, options)\n this.models.add(model)\n return model\n }\n\n addShadow() { \n const box = new Box3().setFromObject(this.groundUpper)\n const center = box.getCenter(new Vector3())\n const size = box.getSize(new Vector3())\n this.shadow.setPosition(center)\n this.shadow.changeLightCamera(size)\n this.add(this.shadow)\n }\n\n addGraphic(graphicOptions: GraphicOptionsParam) {\n return this.graphicLayer.createGraphic(graphicOptions)\n }\n\n addPoi(poiOptions: PoiOptionsParam) {\n return this.poiLayer.createPoi(poiOptions)\n }\n\n addHeatmap(data: HeatmapDataParam) {\n if (!this.heatmap) {\n this.heatmap = new HeatmapElement(this.context)\n this.add(this.heatmap)\n }\n this.heatmap.loadData(data)\n const box = new Box3().setFromObject(this.graphicLayer)\n this.heatmap.position.setZ(box.max.z)\n return this.heatmap\n }\n\n removeHeatMap() {\n if (this.heatmap) {\n this.remove(this.heatmap)\n this.heatmap.dispose()\n this.heatmap = undefined\n }\n }\n\n setShadowOpacity(opacity: number) {\n this.shadow.setOpacity(opacity)\n }\n\n setShadowVisible(visible: boolean) {\n this.shadow.visible = visible;\n }\n\n dispose() {\n this.shadow.dispose();\n this.graphicLayer.dispose()\n this.poiLayer.dispose()\n this.grounds.forEach(ground => ground.dispose())\n this.heatmap?.dispose()\n this.groundUpper.clear()\n this.models.children.forEach((model) => (model as unknown as Model).dispose())\n this.models.clear()\n this.clear()\n }\n\n}", "import { Graphic, GraphicOptionsParam } from \"../elements\";\nimport { Box3, Raycaster, Vector3 } from \"three\";\nimport { Layer } from \"./layer\";\nimport { Context } from \"../context\";\n\nexport class GraphicLayer extends Layer {\n\n graphicMap = new Map<string, Graphic>()\n\n constructor(context: Context) {\n super(context)\n }\n\n getCenter(): Vector3 { \n const box = new Box3().setFromObject(this)\n return box.getCenter(new Vector3())\n }\n\n createGraphic(options: GraphicOptionsParam) {\n // options.deltaHeight = 0.00001 * this.graphicMap.size;\n const graphic = new Graphic(this.context, options)\n this.add(graphic)\n this.graphicMap.set(options.id!, graphic)\n return graphic\n }\n\n removeGraphic(graphic: Graphic) { \n this.remove(graphic)\n this.graphicMap.delete(graphic.options.id!)\n graphic.dispose()\n }\n\n removeGraphicById(id: string) {\n if (this.graphicMap.has(id)) {\n this.removeGraphic(this.graphicMap.get(id)!)\n }\n }\n\n getGraphicByNodeId(id: string) {\n return this.graphicMap.get(id) || null\n }\n\n /**\n * \u83B7\u53D6\u5C04\u7EBF\u76F8\u4EA4\u7684\u5143\u7D20\n * @param raycaster \n */\n getGraphicByRaycaster(raycaster: Raycaster): { graphics: Graphic[], position: Vector3 | null } {\n const initData: {\n position: Vector3 | null,\n graphic: Graphic | null,\n distance: number\n } = { distance: 10000, graphic: null, position: null }\n const data = this.children.reduce((res, item) => {\n if (item instanceof Graphic) {\n const pos = item.raycast(raycaster)\n if (pos) {\n const { distance } = pos\n if (distance < res.distance) {\n return {\n distance: res.distance,\n position: res.position,\n graphic: item\n }\n }\n }\n return res\n } else {\n return res\n }\n }, initData)\n if (data === initData) {\n return { graphics: [], position: null }\n }\n return { graphics: [data.graphic!], position: data.position }\n }\n}", "import { Context } from \"../context\";\nimport { Object3D } from \"three\";\nimport { dispose } from '../utils'\n\nexport class Layer extends Object3D {\n constructor(public context: Context) {\n super();\n }\n\n dispose() {\n dispose(this)\n this.clear()\n }\n}", "import { Poi, PoiOptionsParam } from \"../elements\";\nimport { Layer } from \"./layer\";\nimport { Context } from '../context'\nimport { debounce } from 'lodash'\nimport { Timer } from \"../utils\";\n\nexport class PoiLayer extends Layer {\n pois: Poi[] = []\n debounceCollisionDetection: () => void\n\n timer = new Timer()\n \n constructor(context: Context) {\n super(context)\n this.registryEvent()\n this.debounceCollisionDetection = debounce(this.collisionDetection, 10)\n }\n\n clear() { \n super.clear()\n this.pois.forEach(item => item.dispose())\n this.pois = []\n return this\n }\n\n createPoi(options: PoiOptionsParam) {\n const poi = new Poi(this.context, options)\n this.pushPoi(poi)\n poi.addEventListener(\"change-level\", () => this.changePoiLevelOrCollisionEnable(poi))\n poi.addEventListener(\"change-collision_enable\", () => this.changePoiLevelOrCollisionEnable(poi))\n Promise.resolve().then(() => { \n this.debounceCollisionDetection()\n })\n return poi\n }\n\n changePoiLevelOrCollisionEnable(poi: Poi) {\n const index = this.pois.findIndex(item => item === poi)\n if (index === -1) { return }\n this.pois.splice(index, 1)\n this.pushPoi(poi)\n }\n\n removePoi(poi: Poi) {\n const index = this.pois.findIndex(item => item === poi)\n if (index === -1) { return }\n this.pois.splice(index, 1)\n poi.dispose()\n }\n\n removePoiById(id: string) {\n const poi = this.pois.find(item => item.options.id === id)\n if (poi) {\n this.removePoi(poi)\n }\n }\n\n getPoiById(id: string) { \n const poi = this.pois.find(item => item.options.id === id)\n return poi || null\n }\n\n /**\n * \u4FDD\u5B58poi\u6309\u7167level\u6392\u5E8F\n * @param poi \n */\n pushPoi(poi: Poi) {\n // \u4E0D\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\u7684\u5728\u6700\u524D\u9762\n if (!poi.options.collision_enable) {\n this.pois.unshift(poi)\n return\n }\n // level\u6700\u5C0F\u7684\u5728\u6700\u540E\u9762\n if (poi.options.level === 1) {\n this.pois.push(poi)\n return\n }\n for (let i = 0; i < this.pois.length; i++) {\n const item = this.pois[i]\n // \u4E0D\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\u7684\u5728\u524D\u9762\n if (!item.options.collision_enable) { \n continue\n }\n if (item.options.level <= poi.options.level) {\n this.pois.splice(i, 0, poi)\n return\n }\n }\n // \u63D2\u5165\u5230\u6700\u540E\n this.pois.push(poi) \n }\n\n getPoiByDeviceXy(x: number, y: number) {\n const pois = this.pois.filter(item => {\n return (item instanceof Poi) && item.isContain(x, y)\n })\n return pois\n }\n\n onUpdate = () => { \n this.timer.requestAnimationFrame(() => { \n this.collisionDetection()\n })\n }\n\n /**\n * \u78B0\u649E\u68C0\u6D4B\n */\n collisionDetection() {\n const range: { left: number; right: number; top: number; bottom: number; }[] = []\n // \u6392\u9664\u5728\u5C4F\u5E55\u5916\u7684poi\n const pois = this.pois.filter(item => item.visible && item.withinDisplayRange)\n pois.forEach((item, index) => {\n const { left, right, top, bottom } = item.getBox()\n if (index === 0) {\n range.push({ left, right, top, bottom })\n // item.renderHelperBox()\n return\n }\n // valid boolean \u8868\u793A\u53D1\u751F\u4E86\u78B0\u649E\n const valid = range.some((box) => { \n // \u5224\u65AD\u56DB\u4E2A\u70B9\u662F\u4E0D\u662F\u90FD\u4E0D\u5728box\u7684\u8303\u56F4\u5185\n const xIntersect = (right < box.right && right > box.left) ||\n (left > box.left && left < box.right) ||\n (left === box.left && right === box.right);\n if (xIntersect) {\n const yIntersect = (bottom <= box.bottom && bottom > box.top) || (top >= box.top && top < box.bottom) \n return yIntersect\n } \n return false\n })\n item.parentSetVisible(!valid)\n if (!valid) { \n range.push({ left, right, top, bottom })\n // item.renderHelperBox()\n }\n })\n }\n\n registryEvent() {\n this.context.addEventListener('update', this.onUpdate)\n }\n\n unRegistryEvent() { \n this.context.removeEventListener('update', this.onUpdate)\n }\n \n dispose() {\n this.timer.dispose()\n this.pois.forEach(item => item.dispose())\n this.pois.length = 0;\n this.debounceCollisionDetection = () => { }\n super.dispose()\n this.unRegistryEvent()\n }\n}", "import { Context } from \"../context\";\nimport {\n MeshBasicMaterial, Object3D, PlaneGeometry,\n Texture, DoubleSide, Mesh, Matrix3, Vector2\n} from \"three\";\nimport { create, Heatmap, HeatmapData, DataPoint } from '@mars3d/heatmap.js'\nimport { featureCollection, point, bbox, center as getCenter } from '@turf/turf'\n\ntype V = 'value'\ntype X = 'x'\ntype Y = 'y'\n\nexport type HeatmapDataParam = HeatmapData<DataPoint<V, X, Y>>\n\nexport class HeatmapElement extends Object3D {\n\n private heatmap?: Heatmap<V, X, Y>;\n\n private div: HTMLDivElement\n\n private plane?: Mesh;\n\n constructor(private context: Context) {\n super()\n this.div = document.createElement(\"div\")\n }\n\n clearHeatmap() {\n if (this.div.firstChild) {\n this.div.removeChild(this.div.firstChild)\n }\n this.heatmap = undefined;\n }\n\n loadData(data: HeatmapDataParam) {\n this.clearHeatmap()\n const { width, height, leftTop, center } = this.getBox(data)\n this.heatmap = create({\n width: width,\n height: height,\n container: this.div,\n ...this.context.config.heatMap,\n } as any);\n this.heatmap.setData(this.transformData(data, leftTop))\n this.initPlane(width, height)\n this.position.set(center[0], center[1], this.position.z)\n }\n\n initPlane(width: number, height: number) {\n if (this.plane) { this.remove(this.plane) }\n const geometry = new PlaneGeometry(width, height)\n const texture = new Texture(this.div.firstChild as HTMLCanvasElement);\n texture.needsUpdate = true;\n const material = new MeshBasicMaterial({\n transparent: true,\n side: DoubleSide,\n map: texture,\n });\n material.needsUpdate = true;\n this.plane = new Mesh(geometry, material)\n this.add(this.plane)\n }\n\n getTransMatrix({ x, y }: { x: number, y: number }) {\n // \u5148\u628A\u5DE6\u4E0A\u89D2\u5E73\u79FB\u523000\u70B9\uFF0C\u7136\u540E\u5BF9y\u8F74\u53D6\u53CD\n return new Matrix3().makeScale(1, -1).multiply(new Matrix3().makeTranslation(0 - x, 0 - y))\n }\n\n /**\n * \u6240\u6709\u70B9\u7684\u5750\u6807\u51CF\u53BB\u5DE6\u4E0A\u89D2\u4ECE00\u70B9\u5F00\u59CB\u753Bcanvas\n * @param data \n * @param leftTop \n * @returns \n */\n transformData(data: HeatmapDataParam, leftTop: { x: number, y: number }): HeatmapDataParam {\n const matrix = this.getTransMatrix(leftTop)\n const $data = data.data.map(item => { \n const vector = new Vector2(item.x, item.y).applyMatrix3(matrix)\n return {\n x: vector.x,\n y: vector.y,\n value: item.value\n }\n })\n return {\n data: $data,\n max: data.max,\n min: data.min\n }\n }\n\n getBox(data: HeatmapDataParam) {\n const features = featureCollection(data.data.map(item => point([item.x, item.y])))\n // \u8FD4\u56DE\u4E00\u4E2A\u77E9\u5F62\u8FB9\u6846\u5750\u6807\n const box = bbox(features);\n const width = box[2] - box[0]\n const height = box[3] - box[1]\n const leftTop = { x: box[0], y: box[3] }\n const center = getCenter(features)\n return { width, height, leftTop, center: center.geometry.coordinates }\n }\n\n dispose() {\n this.div = null as unknown as HTMLDivElement\n this.heatmap = undefined\n }\n}", "import { Box3, Object3D, Vector3 } from \"three\";\nimport { Context } from \"../context\";\nimport { loadModel, dispose } from \"../utils\";\nimport { Overlay } from \"./overlay\";\nimport { GLTF } from \"three/examples/jsm/loaders/GLTFLoader\";\n\nexport interface ModelOptions {\n modelUrl: string;\n icon?: string;\n icon_size?: [number, number];\n position?: Vector3;\n}\n\nexport class Model extends Object3D {\n overlay: Overlay | null = null;\n\n model: GLTF | null = null\n\n constructor(public context: Context, private options: ModelOptions) {\n super()\n this.position.copy(options.position || new Vector3(0, 0, 0))\n this.loadModel()\n }\n \n async loadModel() { \n const object = await loadModel(this.options.modelUrl);\n object.scene.rotation.set(Math.PI / 2, Math.PI / 2, 0)\n this.add(object.scene)\n this.model = object\n this.initOverlay()\n }\n\n initOverlay() {\n if (!this.options.icon) {\n return\n }\n if (this.model) {\n const w = this.options.icon_size?.[0] || 14\n const h = this.options.icon_size?.[1] || 14\n const box = new Box3().setFromObject(this)\n const overlay = new Overlay(this.context, { autoUpdate: false })\n overlay.addEventListener(\"update-position\", ({ x, y, height }) => { \n overlay.div.style.transform = `translate3d(${x - w / 2}px, ${-height + y - h}px, 0)`\n })\n const img = document.createElement('img')\n img.src = this.options.icon\n img.style.width = `${w}px`\n img.style.height = `${h}px`\n overlay.div.appendChild(img)\n const center = box.getCenter(new Vector3())\n overlay.position = center\n this.overlay = overlay\n }\n }\n\n dispose() {\n dispose(this)\n this.model = null\n if (this.overlay) {\n this.overlay.dispose()\n this.overlay = null\n }\n }\n}", "import { Context } from \"../context\";\nimport { EventDispatcher, Vector3 } from \"three\";\nimport { createSvg, vector3ToDevice } from '../utils'\n\nexport class BaseSvg<T extends {} = {}> extends EventDispatcher<T> {\n protected points: Vector3[] = [];\n\n protected svg: SVGElement;\n\n protected enable = true;\n\n constructor(public context: Context) {\n super()\n this.svg = createSvg(`${context.container.clientWidth}`, `${context.container.clientHeight}`)\n context.container.appendChild(this.svg)\n this._registryEvent()\n }\n\n private _onResize = ({ width, height }: { width: number; height: number }) => {\n if (this.svg) {\n this.svg.setAttribute(\"width\", `${width}`)\n this.svg.setAttribute(\"height\", `${height}`)\n }\n }\n\n private _registryEvent() {\n this.context.addEventListener(\"resize\", this._onResize)\n }\n\n private _unRegistryEvent() { \n this.context.removeEventListener(\"resize\", this._onResize)\n }\n\n setEnable(enable: boolean) {\n this.enable = enable;\n if (enable) {\n this.svg.style.display = 'block';\n } else {\n this.svg.style.display = 'none';\n }\n }\n\n getIntersectByPointerEvent(e: PointerEvent) {\n const { camera, renderer } = this.context\n const { offsetX: x, offsetY: y } = e\n const { clientWidth, clientHeight } = renderer.domElement;\n const nx = x / clientWidth * 2 - 1;\n const ny = 1 - y / clientHeight * 2;\n\n const v = new Vector3(nx, ny, 0);\n\n return v.unproject(camera);\n }\n\n getSvgCoordinate(vector: Vector3) {\n const { camera, container } = this.context\n const coord = vector3ToDevice(vector, camera, container.clientWidth, container.clientHeight)\n return coord\n }\n \n dispose() {\n this._unRegistryEvent()\n this.context.container.removeChild(this.svg)\n this.svg = null as unknown as SVGElement\n }\n}", "import { Context } from \"../context\";\nimport { Vector3 } from \"three\";\nimport { setCirclePosition, createCircle, createLine, setLineStartEnd } from '../utils'\nimport { BaseSvg } from './base-svg'\n\ninterface SvgLineEventMap {\n 'distance': { distance: number }\n}\n\nexport class SvgLine extends BaseSvg<SvgLineEventMap> {\n\n private circles: SVGElement[] \n \n private line: SVGElement\n\n constructor(public context: Context) {\n super(context)\n const { config: { svg: { circle, line } } } = context\n this.circles = [createCircle(circle.radius, circle.fill), createCircle(circle.radius, circle.fill)]\n this.line = createLine(line.stroke)\n this.svg.appendChild(this.circles[0]);\n this.svg.appendChild(this.circles[1]);\n this.svg.appendChild(this.line);\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.addEventListener(\"pointermove\", this.onPointermove)\n this.context.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.addEventListener(\"pointerdown\", this.onPointerdown)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.context.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerdown)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (this.points[0]) {\n const point1 = this.getSvgCoordinate(this.points[0])\n setCirclePosition(this.circles[0], point1.x, point1.y)\n setLineStartEnd(this.line, point1)\n }\n if (this.points[1]) {\n const point2 = this.getSvgCoordinate(this.points[1])\n setCirclePosition(this.circles[1], point2.x, point2.y)\n setLineStartEnd(this.line, undefined, point2)\n }\n }\n \n \n onPointermove = (e: PointerEvent) => { \n // \u53EA\u5728\u6709\u7B2C\u4E00\u4E2A\u70B9\u7684\u65F6\u5019\u9700\u8981\n if (this.points.length !== 1) { return }\n this.line.style.display = \"block\";\n setLineStartEnd(this.line, undefined, { x: e.offsetX, y: e.offsetY })\n }\n \n onPointerleave = () => { \n if (this.points[1]) { return } // \u5982\u679C\u5DF2\u7ECF\u6709\u4E24\u4E2A\u70B9\u4E86\u5C31\u4E0D\u505A\u5904\u7406\n this.line.style.display = \"none\";\n }\n \n onPointerdown = (e: PointerEvent) => {\n if (this.points[1]) { return } // \u5982\u679C\u5DF2\u7ECF\u6709\u4E24\u4E2A\u70B9\u4E86\u5C31\u4E0D\u505A\u5904\u7406\n const point = this.getIntersectByPointerEvent(e)\n if (point) {\n const { offsetX: x, offsetY: y } = e\n // \u4FEE\u6539\u70B9\n const circle = this.circles[this.points.length]\n setCirclePosition(circle, x, y)\n if (!this.points.length) { \n // \u8BBE\u7F6E\u7EBF\u7684\u8D77\u59CB\u70B9\n setLineStartEnd(this.line, { x, y }, { x, y })\n }\n this.addPoint(point)\n }\n }\n\n addPoint(vector: Vector3) {\n this.points.push(vector)\n if (this.points.length >= 2) {\n const distance = this.calculatedDistance()\n this.dispatchEvent({ type: 'distance', distance })\n }\n }\n\n /**\n * \u8BA1\u7B97\u4E24\u4E2A\u70B9\u4E4B\u95F4\u7684\u8DDD\u79BB\n */\n calculatedDistance() { \n const [{ x: x1, y: y1 }, { x: x2, y: y2 }] = this.points\n return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n }\n \n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.line = null as unknown as SVGElement\n this.circles = []\n }\n}", "import { Context } from \"../context\";\nimport { BaseSvg } from \"./base-svg\";\nimport { setCirclePosition, setLineStartEnd, createLine, createCircle } from '../utils'\nimport { Vector3 } from \"three\";\n\ninterface SvgPolygonEventMap {\n 'area': { area: number }\n}\n\nexport class SvgPolygon extends BaseSvg<SvgPolygonEventMap> {\n\n private circles: SVGElement[] = []\n\n private lines: SVGElement[] = []\n\n private isClose = false\n\n constructor(context: Context) {\n super(context)\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n private get lastLine() {\n return this.lines.slice(-1)[0]\n }\n\n private addCircle(circle: SVGElement) {\n this.circles.push(circle)\n this.svg.appendChild(circle)\n }\n\n private addLine(line: SVGElement) {\n this.lines.push(line)\n this.svg.appendChild(line)\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.addEventListener(\"pointermove\", this.onPointermove)\n this.context.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.addEventListener(\"pointerdown\", this.onPointerdown)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.context.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerdown)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (this.points.length) {\n this.points.forEach((point, index) => {\n const devicePoint = this.getSvgCoordinate(point)\n if (this.circles[index]) {\n setCirclePosition(this.circles[index], devicePoint.x, devicePoint.y)\n }\n if (index !== 0) {\n setLineStartEnd(this.lines[index - 1], undefined, devicePoint)\n }\n if (this.lines[index]) {\n setLineStartEnd(this.lines[index], devicePoint)\n }\n }) \n }\n }\n \n \n onPointermove = (e: PointerEvent) => { \n // \u5FC5\u987B\u8981\u6709\u4E00\u4E2A\u70B9\u5E76\u4E14\u8FD8\u6CA1\u6709\u95ED\u5408\u624D\u9700\u8981\u5904\u7406\n if (!this.lastLine || this.isClose) { return }\n this.lastLine.style.display = \"block\";\n setLineStartEnd(this.lastLine, undefined, { x: e.offsetX, y: e.offsetY })\n }\n \n onPointerleave = () => { \n // \u5982\u679C\u5DF2\u7ECF\u95ED\u5408\u4E86\u5C31\u4E0D\u9700\u8981\u5904\u7406\u4E86\n if (this.isClose) { return } \n this.lastLine.style.display = \"none\";\n }\n \n onPointerdown = (e: PointerEvent) => {\n // \u5982\u679C\u5DF2\u7ECF\u95ED\u5408\u4E86\n if (this.isClose) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) {\n const { offsetX: x, offsetY: y } = e\n if (this.checkAdsorb(x, y)) {\n this.isClose = true\n this.addPoint(this.points[0])\n } else {\n this.addPoint(point)\n }\n const { circle: { fill, radius }, line: { stroke } } = this.context.config.svg\n if (!this.isClose) {\n // \u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u70B9\n const circle = createCircle(radius, fill)\n setCirclePosition(circle, x, y)\n this.addCircle(circle)\n }\n if (this.lines.length) {\n // \u5982\u679C\u5DF2\u7ECF\u6709\u4E00\u6761\u7EBF\u4E86 \u8981\u95ED\u5408\u8FD9\u6761\u7EBF\n setLineStartEnd(this.lastLine, undefined, { x, y })\n }\n // \u5982\u679C\u8FD9\u4E2A\u591A\u8FB9\u5F62\u8FD8\u6CA1\u6709\u95ED\u5408 \u5C31\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u7EBF \u5305\u62EC\u521B\u5EFA\u7B2C\u4E00\u6761\u7EBF\n if (!this.isClose) {\n const line = createLine(stroke)\n // \u8BBE\u7F6E\u7EBF\u7684\u8D77\u59CB\u70B9\n setLineStartEnd(line, { x, y }, { x, y })\n this.addLine(line)\n }\n }\n }\n\n /**\n * \u68C0\u6D4B\u662F\u5426\u53EF\u4EE5\u5438\u9644\n * \u5750\u6807\u70B9\u6700\u5C113\u4E2A \u4F20\u5165\u7684\u5750\u6807\u70B9\u548C\u7B2C\u4E00\u4E2A\u5750\u6807\u7684\u50CF\u7D20\u76F8\u5DEE\u4E0D\u8D85\u8FC75\u4E2A\u50CF\u7D20\n */\n checkAdsorb(x: number, y: number) {\n if (this.points.length < 3) { return false }\n const circle = this.circles[0]\n const cx = +circle.getAttribute(\"cx\")!\n const cy = +circle.getAttribute(\"cy\")!\n return Math.sqrt((x - cx) ** 2 + (y - cy) ** 2) <= 5\n }\n\n addPoint(vector: Vector3) {\n this.points.push(vector)\n if (this.isClose) {\n const area = this.calculatedArea()\n this.dispatchEvent({ type: 'area', area })\n }\n }\n // \u8BA1\u7B97\u9762\u79EF\n calculatedArea() {\n const cds = this.points.map(item => [item.x, item.y])\n let area = 0\n const numPoints = cds.length\n for (let i = 0; i < numPoints; i++) {\n const j = (i + 1) % numPoints\n area += (cds[i][0] * cds[j][1] - cds[j][0] * cds[i][1])\n }\n return Math.abs(area / 2)\n }\n\n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.lines = []\n this.circles = []\n }\n}", "import { Context } from \"../context\";\nimport { Box3 } from \"three\";\nimport { vector3ToDevice, createRect, setRectPosition } from '../utils'\nimport { BaseSvg } from './base-svg'\nimport { Graphic } from \"./graphic\";\n\ninterface SvgLineEventMap {\n 'distance': { distance: number }\n}\n\nexport class SelectBox extends BaseSvg<SvgLineEventMap> {\n\n private rect!: SVGElement\n\n private cornerRect: SVGElement[] = [] // \u56DB\u4E2A\u89D2\u4E0A\u7684\u65B9\u5757\n\n private centerRect: SVGElement[] = [] // \u56DB\u4E2A\u7EBF\u4E2D\u95F4\u7684\u65B9\u5757\n\n private graphic?: Graphic\n\n constructor(public context: Context) {\n super(context)\n const { config: { svg: { line } } } = context\n this.rect = createRect(line.stroke, \"transparent\")\n this.svg.appendChild(this.rect)\n for (let i = 0; i < 4; i++) {\n this.cornerRect[i] = createRect(line.stroke, \"#ffffff\")\n this.centerRect[i] = createRect(line.stroke, \"#ffffff\")\n this.svg.appendChild(this.cornerRect[i])\n this.svg.appendChild(this.centerRect[i])\n }\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n registryEvent() { \n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (!this.graphic) {\n setRectPosition(this.rect, 0, 0, 0, 0)\n for (let i = 0; i < this.cornerRect.length; i++) {\n setRectPosition(this.cornerRect[i], 0, 0, 0, 0)\n setRectPosition(this.centerRect[i], 0, 0, 0, 0)\n }\n } else {\n const box = new Box3().setFromObject(this.graphic)\n const { camera, container: { clientWidth: w, clientHeight: h } } = this.context\n const { min, max } = box\n const leftBottom = vector3ToDevice(min, camera, w, h)\n const rightTop = vector3ToDevice(max, camera, w, h)\n // \u753B\u51FA\u4E00\u4E2A\u6846\u6765\n setRectPosition(this.rect, leftBottom.x, rightTop.y, Math.abs(rightTop.x - leftBottom.x), Math.abs(rightTop.y - leftBottom.y))\n // \u56DB\u4E2A\u89D2\u7684\u4F4D\u7F6E\n const { x: left, y: bottom } = leftBottom\n const { x: right, y: top } = rightTop\n const halfWidth = 5;\n const corners = [\n { x: left - halfWidth, y: top - halfWidth }, // \u5DE6\u4E0A\u89D2\n { x: right - halfWidth, y: top - halfWidth }, // \u53F3\u4E0A\u89D2\n { x: left - halfWidth, y: bottom - halfWidth }, // \u5DE6\u4E0B\u89D2\n { x: right - halfWidth, y: bottom - halfWidth }, // \u53F3\u4E0B\u89D2 \n ]\n for (let i = 0; i < corners.length; i++) {\n setRectPosition(this.cornerRect[i], corners[i].x, corners[i].y, halfWidth * 2, halfWidth * 2)\n }\n // \u56DB\u4E2A\u4E2D\u95F4\u7684\u4F4D\u7F6E\n const centerHalfWidth = 4;\n const centerX = (left + right) / 2\n const centerY = (bottom + top) / 2\n const centers = [\n { x: centerX - centerHalfWidth, y: top - centerHalfWidth }, // \u4E0A\n { x: left - centerHalfWidth, y: centerY - centerHalfWidth }, // \u5DE6\n { x: right - centerHalfWidth, y: centerY - centerHalfWidth }, // \u53F3\n { x: centerX - centerHalfWidth, y: bottom - centerHalfWidth }, // \u4E0B\n ]\n for (let i = 0; i < centers.length; i++) {\n setRectPosition(this.centerRect[i], centers[i].x, centers[i].y, centerHalfWidth * 2, centerHalfWidth * 2)\n }\n }\n }\n \n selectGraphic(graphic: Graphic) { \n this.graphic = graphic\n }\n\n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.rect = null as unknown as SVGElement\n this.cornerRect = []\n this.centerRect = []\n }\n}", "import { createRect, isContain, setRectPosition, vector3ToDevice } from \"../../utils\";\nimport { Context } from \"../../context\";\nimport { BaseSvg, Graphic } from \"../../elements\";\nimport { Frustum, Vector3 } from \"three\";\n\ninterface BoxSelectionEventMap { \n \"selected\": {\n list: Graphic[]\n }\n}\n\nexport class BoxSelection extends BaseSvg<BoxSelectionEventMap> {\n\n private startPoint?: Vector3;\n\n private endPoint?: Vector3;\n\n rect: SVGElement;\n\n frustum = new Frustum();\n\n constructor(context: Context) { \n super(context);\n const { config: { selectBox: { fill, stroke } } } = context\n this.rect = createRect(stroke, fill)\n this.svg.appendChild(this.rect)\n this.registryEvent()\n }\n\n setEnable(enable: boolean): void {\n super.setEnable(enable)\n setRectPosition(this.rect, 0, 0, 0, 0)\n if (enable) {\n this.registryEvent()\n } else {\n this.startPoint = undefined\n this.unRegistryEvent()\n }\n }\n\n onPointerDown = (e: PointerEvent) => { \n if (!this.enable) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.startPoint = point\n }\n this.endPoint = undefined;\n }\n\n onPointerMove = (e: PointerEvent) => { \n if (!this.enable || !this.startPoint) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.endPoint = point\n }\n }\n\n onPointerUp = (e: PointerEvent) => { \n if (!this.enable) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.endPoint = point\n }\n this.doSelect()\n this.startPoint = undefined\n }\n\n onUpdate = () => {\n if (this.startPoint) {\n const startPoint = this.getSvgCoordinate(this.startPoint)\n let endPoint = { ...startPoint }\n if (this.endPoint) {\n endPoint = this.getSvgCoordinate(this.endPoint)\n }\n const leftTop = { x: Math.min(startPoint.x, endPoint.x), y: Math.min(startPoint.y, endPoint.y) }\n const width = Math.abs(endPoint.x - startPoint.x)\n const height = Math.abs(endPoint.y - startPoint.y)\n setRectPosition(this.rect, leftTop.x, leftTop.y, width, height)\n } else {\n setRectPosition(this.rect, 0, 0, 0, 0)\n }\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.addEventListener(\"pointermove\", this.onPointerMove)\n this.context.container.addEventListener(\"pointerup\", this.onPointerUp)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.removeEventListener(\"pointermove\", this.onPointerMove)\n this.context.container.removeEventListener(\"pointerup\", this.onPointerUp)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n doSelect() { \n if (this.startPoint && this.endPoint) {\n const dis = this.startPoint.distanceTo(this.endPoint);\n if (dis < 0.1) { return }\n const { context: { camera, container: { clientWidth: w, clientHeight: h } } } = this\n const startDevice = vector3ToDevice(this.startPoint!, camera, w, h)\n const endDevice = vector3ToDevice(this.endPoint!, camera, w, h)\n const leftTop = { x: Math.min(startDevice.x, endDevice.x), y: Math.min(startDevice.y, endDevice.y) }\n const rightBottom = { x: Math.max(startDevice.x, endDevice.x), y: Math.max(startDevice.y, endDevice.y) }\n const list = this.searchMapInFrustum(leftTop, rightBottom);\n this.dispatchEvent({ type: \"selected\", list })\n }\n }\n\n searchMapInFrustum(leftTop: { x: number, y: number }, rightBottom: { x: number, y: number }): Graphic[] {\n const { context } = this\n return context.currentFloor?.graphicLayer.children.filter(item => {\n return item instanceof Graphic && this.searchChildInFrustum(item, leftTop, rightBottom)\n }) as Graphic[] || []\n }\n\n searchChildInFrustum(object: Graphic, leftTop: { x: number, y: number }, rightBottom: { x: number, y: number }): boolean {\n const { context: { camera, container: { clientWidth: w, clientHeight: h } } } = this\n if (!object) return false;\n if (!object.mesh) { \n // \u70B9\n const position = object.getPosition()\n if (position) {\n const position2d = vector3ToDevice(position, camera, w, h)\n return isContain(position2d, leftTop, rightBottom)\n }\n return false\n }\n if (!object.mesh.geometry.boundingBox) {\n object.mesh.geometry.computeBoundingBox();\n }\n const box = object.mesh.geometry.boundingBox;\n if (!box) { return false }\n const { min, max } = box\n const minDevice = vector3ToDevice(min, camera, w, h)\n const maxDevice = vector3ToDevice(max, camera, w, h)\n \n if (!isContain(minDevice, leftTop, rightBottom)) { return false }\n if (!isContain(maxDevice, leftTop, rightBottom)) { return false; }\n return true;\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}\n\n", "import { Graphic, Poi } from \"../../elements\";\nimport { Context } from \"../../context\";\nimport { EventDispatcher } from \"three\";\nimport { Timer } from \"../../utils\";\n\ninterface HoverHelperEventMap {\n \"hover-change\": {\n graphics: Graphic[]\n },\n}\n\nexport class HoverHelper extends EventDispatcher<HoverHelperEventMap> { \n\n curGraphics = new Set<Graphic>()\n\n timer = new Timer()\n\n graphicTimerMap = new Map<Graphic, number>()\n \n constructor(private context: Context) {\n super()\n this.registryEvent()\n }\n\n onPointerMove = ({ graphics, pois }: { graphics: Graphic[], pois: Poi[] }) => {\n const poiGraphics = pois\n .map(item => this.context.currentFloor?.graphicLayer.graphicMap.get(item.options.id))\n .filter(graphic => graphic && graphic.options.geometry.type === \"point\") as Graphic[]\n if (!graphics.length && !poiGraphics && this.curGraphics.size) {\n this.curGraphics.clear()\n this.handleHoverGraphicsChange()\n return\n }\n const { time } = this.context.config.hover\n const allGraphics = new Set(graphics)\n if (!allGraphics.size) { \n poiGraphics.forEach(graphic => { \n allGraphics.add(graphic)\n })\n }\n allGraphics.forEach((graphic) => {\n // \u5982\u679C\u5DF2\u7ECF\u6709hover\u7684\u5B9A\u65F6\u5668\u5728\u6267\u884C\u4E86\u5C31\u8FD4\u56DE\n if (this.graphicTimerMap.get(graphic)) { \n return\n }\n // \u5982\u679C\u8FD9\u4E2A\u5143\u7D20\u7684hover\u5DF2\u7ECF\u89E6\u53D1\u8FC7\u4E86\u5C31\u8FD4\u56DE\n if (this.curGraphics.has(graphic)) { \n return\n }\n // \u8FD9\u4E2A\u5143\u7D20\u6CA1\u6709\u89E6\u53D1\u8FC7\u4E5F\u6CA1\u6709\u5B9A\u65F6\u5668\u5C31\u6DFB\u52A0\u4E00\u4E2A\u5B9A\u65F6\u5668\n const timer = this.timer.setTimeout(() => {\n this.curGraphics.add(graphic)\n this.handleHoverGraphicsChange()\n }, time)\n this.graphicTimerMap.set(graphic, timer)\n })\n // \u5982\u679C\u5B9A\u65F6\u5668\u7684\u5143\u7D20\u4E0D\u5B58\u5728\u5728\u5F53\u524Dgraphics\u4E2D\u4E86\u5C31\u5220\u9664\n this.graphicTimerMap.forEach((timer, graphic) => { \n if (!allGraphics.has(graphic)) { \n this.timer.clearTimeout(timer)\n this.graphicTimerMap.delete(graphic)\n }\n })\n // \u5982\u679C\u5DF2\u7ECFhover\u7684\u5143\u7D20\u4E0D\u5B58\u5728\u5728\u5F53\u524D\u7684graphics\u4E86\u5C31\u5220\u9664\n const size = this.curGraphics.size\n this.curGraphics.forEach((graphic) => { \n if (!allGraphics.has(graphic)) { \n this.curGraphics.delete(graphic)\n }\n })\n // \u5982\u679C\u6709\u5220\u9664\u5C31\u89E6\u53D1\u4E8B\u4EF6\n if (size !== this.curGraphics.size) {\n this.handleHoverGraphicsChange()\n }\n }\n\n onPointerLevel = () => {\n this.curGraphics.clear()\n this.handleHoverGraphicsChange()\n }\n\n handleHoverGraphicsChange(graphics = this.curGraphics) { \n this.dispatchEvent({ type: 'hover-change', graphics: Array.from(graphics) })\n }\n\n registryEvent() {\n this.context.addEventListener(\"pointer-over\", this.onPointerMove)\n this.context.addEventListener(\"pointer-move\", this.onPointerMove)\n this.context.addEventListener(\"pointer-level\", this.onPointerLevel)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener(\"pointer-over\", this.onPointerMove)\n this.context.removeEventListener(\"pointer-move\", this.onPointerMove)\n this.context.removeEventListener(\"pointer-level\", this.onPointerLevel)\n }\n\n dispose() {\n this.unRegistryEvent()\n this.timer.dispose()\n }\n}", "import { Context } from \"../context\";\nimport { Color, LineBasicMaterial, MeshStandardMaterial, MeshBasicMaterial } from \"three\";\n\ninterface LineMaterialOptions {\n color: string;\n opacity: number;\n}\n\ninterface MeshStandardMaterialOptions {\n color: string,\n opacity: number,\n}\n\ninterface MeshBasicMaterialOptions {\n color: string,\n opacity: number,\n}\n\nexport class MaterialFactory {\n\n private lineMaterialMap = new Map<string, LineBasicMaterial>()\n\n private meshStandardMaterialMap = new Map<string, MeshStandardMaterial>()\n\n private meshBasicMaterialMap = new Map<string, MeshBasicMaterial>()\n\n constructor(private context: Context) {\n\n }\n\n generateLineMaterialKey({ color, opacity }: LineMaterialOptions) { \n return `${color}-${opacity}`;\n }\n\n createLineMaterial({ color, opacity }: LineMaterialOptions) {\n const key = this.generateLineMaterialKey({ color, opacity })\n if (this.lineMaterialMap.has(key)) {\n return this.lineMaterialMap.get(key)!\n }\n const lineMaterial = new LineBasicMaterial({\n color: color,\n transparent: true,\n opacity: opacity\n })\n this.lineMaterialMap.set(key, lineMaterial);\n return lineMaterial\n }\n\n createMeshStandardMaterial({ color, opacity }: MeshStandardMaterialOptions) {\n const key = `${color}-${opacity}`;\n if (this.meshStandardMaterialMap.has(key)) {\n return this.meshStandardMaterialMap.get(key)!\n }\n const material = new MeshStandardMaterial({\n color: color,\n roughness: 1,\n transparent: true,\n opacity: opacity,\n depthWrite: true,\n })\n this.meshStandardMaterialMap.set(key, material);\n return material;\n }\n\n createMeshBasicMaterial({ color, opacity }: MeshBasicMaterialOptions) {\n const key = `${color}-${opacity}`;\n if (this.meshBasicMaterialMap.has(key)) {\n return this.meshBasicMaterialMap.get(key)!\n }\n const material = new MeshBasicMaterial({\n color: color,\n transparent: true,\n opacity: opacity,\n depthWrite: true,\n })\n this.meshBasicMaterialMap.set(key, material);\n return material;\n }\n\n dispose() { \n this.lineMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.lineMaterialMap.clear()\n this.meshStandardMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.meshStandardMaterialMap.clear();\n this.meshBasicMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.meshBasicMaterialMap.clear()\n }\n \n}", "import { Box3, Vector3 } from \"three\";\nimport { Context } from \"../context\";\nimport { vector3ToDevice } from \"./coordinate\";\n\nexport class CameraBound {\n private prevCamera = {\n position: new Vector3(),\n zoom: 1,\n target: new Vector3()\n }\n\n private enable = true;\n\n constructor(private context: Context) {\n this.registryEvent()\n this.changePrevCamera()\n }\n\n setEnable(enable: boolean) {\n this.enable = enable;\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n changePrevCamera() {\n this.prevCamera = {\n position: this.context.camera.position.clone(),\n zoom: this.context.camera.zoom,\n target: this.context.control.target.clone()\n }\n }\n\n backToPrevCamera() {\n this.setEnable(false)\n this.context.camera.position.copy(this.prevCamera.position)\n this.context.camera.zoom = this.prevCamera.zoom;\n this.context.control.target.copy(this.prevCamera.target)\n this.context.control.update()\n this.setEnable(true)\n }\n\n registryEvent() { \n this.context.addEventListener(\"control-change\", this.onCameraChange)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener(\"control-change\", this.onCameraChange)\n }\n\n getCurFloorScreenPosition() {\n if (!this.context.currentFloor) {\n return null\n }\n const box = new Box3().setFromObject(this.context.currentFloor.groundUpper);\n const { camera, container: { clientWidth: w, clientHeight: h } } = this.context\n const { min, max } = box\n const lb = vector3ToDevice(min, camera, w, h)\n const rt = vector3ToDevice(max, camera, w, h)\n const lt = vector3ToDevice(new Vector3(min.x, max.y, max.z), camera, w, h)\n const rb = vector3ToDevice(new Vector3(max.x, min.y, min.z), camera, w, h)\n const left = Math.min(lb.x, rt.x, lt.x, rb.x)\n const right = Math.max(lb.x, rt.x, lt.x, rb.x)\n const top = Math.min(lb.y, rt.y, lt.y, rb.y)\n const bottom = Math.max(lb.y, rt.y, lt.y, rb.y)\n return { left, right, top, bottom }\n }\n\n /**\n * \u68C0\u6D4B\u5730\u56FE\u662F\u4E0D\u662F\u5728\u663E\u793A\u8303\u56F4\n * @param param0 \n * @returns \n */\n checkDistanceToScreenEdge({ left, right, top, bottom }: { left: number, right: number, top: number, bottom: number }) { \n const { width, height } = this.context.clientSize\n const [pt, pr, pb, pl] = this.context.config.cameraBound.padding\n // console.log(left, left <= pl , width - right, width - right <= pr , top <= pt , height - bottom <= pb)\n // \u6240\u6709\u7684\u8FB9\u90FD\u4E0D\u8D85\u51FA\n return (left <= pl && width - right <= pr && top <= pt && height - bottom <= pb)\n }\n\n onCameraChange = () => {\n // \u5224\u65AD\u5982\u679C\u8D85\u51FA\u5C31\u7528\u4E4B\u524D\u7684prevCamera\n // \u83B7\u53D6\u5730\u56FE\u7684\u5C4F\u5E55\u4F4D\u7F6E\n // \u5148\u4E0D\u505A\u8FB9\u754C\u5224\u65AD\n // const bound = this.getCurFloorScreenPosition();\n // if (bound) {\n // const { left, right, top, bottom } = bound\n // const isInBound = this.checkDistanceToScreenEdge({ left, right, top, bottom });\n // console.log(\"isInBound\", isInBound)\n // if (isInBound) {\n // this.changePrevCamera()\n // } else {\n // this.backToPrevCamera()\n // }\n // }\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}", "import { merge } from 'lodash'\nimport { HeatmapConfiguration } from '@mars3d/heatmap.js'\n\nexport interface Config {\n apiDomain: string,\n apiInfo: RequestInit,\n apiPath: {\n floorGraphic: string,\n floorRange: string\n },\n resizeObserver: boolean;\n heatMap: Partial<HeatmapConfiguration>,\n useFloorCache: boolean;\n control: {\n maxPolar: number;\n defaultPolar: number;\n },\n initTransToMark: boolean;\n svg: {\n circle: {\n radius: string;\n fill: string;\n },\n line: {\n stroke: string;\n }\n },\n selectBox: {\n stroke: string;\n fill: string;\n },\n hover: {\n time: number;\n },\n ground: {\n color: string;\n opacity: number;\n height: number;\n stroke: boolean,\n strokeColor: string,\n strokeOpacity: number\n },\n markGraphic: {\n color: string;\n opacity: number;\n height: number;\n stroke: boolean;\n strokeColor: string;\n strokeOpacity: number;\n },\n graphic: {\n fillOpacity: number,\n },\n cameraBound: {\n padding: [number, number, number, number]\n }\n}\n\nexport const defaultConfig: Config = {\n apiDomain: \"\",\n apiInfo: {},\n apiPath: {\n floorGraphic: \"/api/inception-map/floor/get\",\n floorRange: \"/api/inception-map/range/get\"\n },\n resizeObserver: false,\n initTransToMark: false,\n heatMap: {\n radius: 50,\n gradient: {\n 0: '#8F9FCD',\n 0.5: '#6284FF',\n 1: '#F95D5D',\n },\n },\n useFloorCache: true,\n control: {\n maxPolar: 1.2,\n defaultPolar: 0.9\n },\n svg: {\n circle: {\n radius: \"2\",\n fill: \"#1CADFF\"\n },\n line: {\n stroke: \"#1CADFF\"\n }\n },\n selectBox: {\n stroke: \"#1CADFF\",\n fill: \"rgba(28, 173, 255, 0.3)\"\n },\n hover: {\n time: 100\n },\n ground: {\n color: \"#FAFAFA\",\n opacity: 1,\n height: 3,\n stroke: true,\n strokeColor: \"#E6E6E6\",\n strokeOpacity: 1\n },\n markGraphic: {\n color: \"#EEF0F3\",\n opacity: 1,\n height: 0.001,\n stroke: false,\n strokeColor: \"#000\",\n strokeOpacity: 1\n },\n graphic: {\n fillOpacity: 1,\n },\n cameraBound: {\n padding: [150, 150, 150, 150]\n }\n}\n\nexport function getConfig(config: Partial<Config>): Config {\n return merge({}, defaultConfig, config);\n}"],
|
|
5
|
-
"mappings": "2/BAAA,IAAAA,GAAmD,WCM5C,IAAMC,EAAN,KAAY,CAAZ,cACLC,EAAA,aAAQ,CACN,iBAAkB,IAAI,IACtB,QAAS,IAAI,IACb,SAAU,IAAI,GAChB,GAEA,sBAAsBC,EAAgB,CACpC,IAAMC,EAAQ,OAAO,sBAAsB,IAAM,CAC/C,KAAK,MAAM,iBAAiB,OAAOA,CAAK,EACxCD,EAAG,CACL,CAAC,EACD,YAAK,MAAM,iBAAiB,IAAIC,CAAK,EAC9BA,CACT,CAEA,qBAAqBA,EAAe,CAClC,KAAK,MAAM,iBAAiB,OAAOA,CAAK,EACxC,OAAO,qBAAqBA,CAAK,CACnC,CAEA,WAAWD,EAA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GAAc,EACd,KAAK,gBAAgB,CACvB,CACF",
|
|
6
|
-
"names": ["import_three", "Timer", "__publicField", "fn", "timer", "wait", "import_three", "import_MapControls", "initScene", "scene", "initRenderer", "renderer", "initCamera", "width", "height", "camera", "initLight", "lights", "ambientLight", "initControl", "domElement", "control", "initShape", "path", "holePath", "shape", "item", "cur", "hole", "initDirectionalLight", "color", "intensity", "directionalLight", "dispose", "o", "recursive", "_a", "child", "m", "mat", "hasChinese", "str", "import_three", "textTextureMap", "initCanvas", "canvas", "ctx", "createCanvas", "c", "t", "getTextureByText", "text", "y", "hasChinese", "width", "imageData", "texture", "clearTextTexture", "clearCanvas", "import_three", "import_turf", "vector3ToDevice", "vector", "camera", "w", "h", "_vector", "_w", "_h", "x", "y", "getCenter", "coordinates", "features", "item", "isContain", "point", "start", "end", "getLongestSideDir", "cds", "maxDistance", "dir", "i", "point_0", "point_1", "distance", "proxyOptions", "target", "master", "p", "receiver", "newValue", "oldValue", "res", "timeoutPromise", "promise", "timeout", "resolve", "reject", "createSvgElement", "tag", "createSvg", "w", "h", "svg", "createCircle", "radius", "fill", "circle", "createLine", "stroke", "line", "createRect", "rect", "setCirclePosition", "x", "y", "setLineStartEnd", "start", "end", "setRectPosition", "sleepOnePromise", "sleepOneRf", "resolve", "strToNumber", "str", "addAlphaToHexColor", "hexColor", "alpha", "r", "g", "b", "newR", "newG", "newB", "darkenColor", "import_GLTFLoader", "createLoader", "loader", "modelMap", "loadModel", "url", "gltf", "p", "resolve", "reject", "disposeLoader", "isMac", "isControl", "key", "isMac", "import_three", "import_tween", "import_three", "import_three", "defaultOptions", "Graphic", "context", "options", "__publicField", "proxyOptions", "__spreadValues", "x", "y", "value", "_a", "center", "box", "size", "shape", "initShape", "material", "material1", "darkenColor", "lineMaterial", "points", "height", "cds", "j", "curCds", "i", "cur", "next", "lineGeometry", "line", "raycaster", "intersects", "position", "distance", "import_three", "Shadow", "__publicField", "directionalLight", "initDirectionalLight", "size", "x", "y", "color", "position", "width", "height", "geometry", "material", "mesh", "target", "opacity", "dispose", "import_three", "import_three", "defaultOptions", "Overlay", "context", "options", "__publicField", "vector", "width", "height", "x", "y", "vector3ToDevice", "__spreadValues", "div", "element", "visible", "display", "opacity", "defaultOptions", "Poi", "context", "options", "_a", "_b", "_c", "__publicField", "proxyOptions", "__spreadValues", "Overlay", "x", "y", "height", "value", "__async", "sleepOnePromise", "width", "div", "box", "textDiv", "f", "item", "key", "img", "visible", "import_three", "import_three", "import_three", "Layer", "context", "dispose", "GraphicLayer", "Layer", "context", "__publicField", "options", "graphic", "Graphic", "id", "raycaster", "initData", "data", "res", "item", "pos", "distance", "import_lodash", "PoiLayer", "Layer", "context", "__publicField", "Timer", "item", "options", "poi", "Poi", "index", "id", "i", "x", "y", "range", "left", "right", "top", "bottom", "valid", "box", "import_three", "import_heatmap", "import_turf", "HeatmapElement", "context", "__publicField", "data", "width", "height", "leftTop", "center", "__spreadValues", "geometry", "texture", "material", "x", "y", "matrix", "item", "vector", "features", "box", "getCenter", "import_three", "Model", "context", "options", "__publicField", "__async", "object", "loadModel", "_a", "
|
|
4
|
+
"sourcesContent": ["import { EventDispatcher, Object3D, Vector3 } from \"three\";\nimport { Context } from \"./context\";\nimport { clearTextTexture, clearCanvas, vector3ToDevice, getCenter, getLongestSideDir } from \"./utils\";\nimport { Config, getConfig } from './config'\nimport {Floor, Graphic, HeatmapDataParam, Model, ModelOptions, PoiOptionsParam} from \"./elements\";\nimport { SvgLine, SvgPolygon } from \"./elements\";\nimport { GraphicInfo, GraphicOptions, PolygonGeometry, ResGraphicInfo } from \"./types\";\nimport { debounce } from \"lodash\";\nimport { disposeLoader } from \"./utils/model\";\n\nexport interface LoadQuery {\n brand: string;\n project: string;\n phase: string;\n building: string;\n floor: string;\n ts: string;\n resource_type_list: string;\n}\n\ninterface BmapEventMap {\n \"zoom-change\": {\n basicZoom: number;\n cameraZoom: number;\n }\n}\n\nexport type MapType = \"2d\" | \"3d\"\n\nexport enum MapTypePolar {\n D2 = 0,\n D3 = 0.9\n}\n\nexport class BMap extends EventDispatcher<BmapEventMap> {\n config: Config;\n\n public context: Context;\n\n private polarKeys: string[] = [];\n\n private azimuthalKeys: string[] = [];\n\n private svgLine?: SvgLine;\n\n private svgPolygon?: SvgPolygon;\n\n public basicZoom = 1;\n\n private prevCameraZoom = 1;\n\n type: MapType = \"2d\"\n\n floorDataMap: Map<string, GraphicInfo[]> = new Map()\n\n buildingGroundMap = new Map<string, GraphicInfo | null>()\n\n currentBuildGround: GraphicInfo | null = null\n\n private observe: ResizeObserver | null = null;\n\n constructor(private container: HTMLElement, config: Partial<Config> = {}) {\n super();\n this.config = getConfig(config)\n this.context = new Context(container, this.config);\n this.registryEvent();\n this.context.render();\n }\n\n private async loadGraphics({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): Promise<GraphicInfo[]> {\n const { apiDomain, apiPath: { floorGraphic }, apiInfo } = this.config\n const url = `${apiDomain}${floorGraphic}?brand=${brand}&project=${project}&phase=${phase}&building=${building}&floor=${floor}&ts=${ts}&resource_type_list=${resource_type_list}`\n const data = await fetch(url, apiInfo)\n .then((res) => res.json())\n .then(res => res.data)\n .then((res: ResGraphicInfo[]): GraphicInfo[] => {\n (res || []).map(item => item.info = (JSON.parse(item.info)))\n return (res || []) as unknown as GraphicInfo[]\n })\n return data\n }\n\n getBuildingKey({ brand, project, phase, building }: Omit<LoadQuery, \"floor\" | \"ts\" | \"resource_type_list\">) {\n const key = `${brand}-${project}-${phase}-${building}`\n return key\n }\n\n private async loadBuildingGround({ brand, project, phase, building }: Omit<LoadQuery, \"floor\" | \"ts\" | \"resource_type_list\">): Promise<GraphicInfo | null>{ \n const key = this.getBuildingKey({ brand, project, phase, building })\n if (this.buildingGroundMap.get(key)) { \n return this.buildingGroundMap.get(key) || null\n }\n const { apiDomain, apiPath: { floorRange }, apiInfo } = this.config\n const url = `${apiDomain}${floorRange}?brand=${brand}&project=${project}&phase=${phase}&building=${building}`\n const data = await fetch(url, apiInfo)\n .then((res) => res.json())\n .then(res => res.data)\n .then((res: ResGraphicInfo[]): GraphicInfo | null => {\n const data = (res || [])[0]\n if (data) {\n data.info = JSON.parse(data.info)\n }\n return data as unknown as GraphicInfo | null\n })\n this.buildingGroundMap.set(key, data)\n return data\n }\n \n getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) { \n const floorKey = `${brand}-${project}-${phase}-${building}-${floor}-${ts}-${resource_type_list}`\n return floorKey\n }\n\n async load({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) {\n const floorKey = this.getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list })\n if (this.floorDataMap.get(floorKey)) { return }\n const [data, buildGround] = await Promise.all([\n this.loadGraphics({ brand, project, phase, building, floor, ts, resource_type_list }),\n this.loadBuildingGround({ brand, project, phase, building })\n ])\n if (buildGround) {\n const center = getCenter((buildGround.info.geometry as PolygonGeometry).cds[0])\n data.forEach(item => {\n if (item.info.geometry.type === \"polygon\") { \n item.info.geometry.cds.map(cds => {\n if (Array.isArray(cds)) {\n cds.forEach(coord => {\n coord[0] -= center[0]\n coord[1] -= center[1]\n })\n }\n })\n } else {\n // point\n const [x, y] = item.info.geometry.cds\n item.info.geometry.cds = [x - center[0], y - center[1]]\n }\n item.info.transformToBuildingGround = true\n })\n }\n const { ground, markGraphic, graphic } = this.config\n for (let i = 0; i < data.length; i++) {\n const item = data[i]\n item.info.deltaHeight = 0.00001 * (i + 1)\n if (item.info.group === \"ground\") {\n item.info.fillColor = ground.color\n item.info.fillOpacity = ground.opacity\n item.info.height = ground.height\n item.info.stroke = ground.stroke\n item.info.strokeColor = ground.strokeColor\n item.info.strokeOpacity = ground.strokeOpacity\n } else if (item.info.userData.mark) {\n item.info.height = markGraphic.height;\n item.info.fillColor = markGraphic.color;\n item.info.fillOpacity = markGraphic.opacity;\n item.info.stroke = markGraphic.stroke;\n item.info.strokeColor = markGraphic.strokeColor;\n item.info.strokeOpacity = markGraphic.strokeOpacity;\n } else {\n item.info.fillOpacity = graphic.fillOpacity;\n if (this.config.initTransToMark) { \n item.info.height = markGraphic.height;\n item.info.fillColor = markGraphic.color;\n item.info.stroke = markGraphic.stroke;\n item.info.strokeColor = markGraphic.strokeColor;\n item.info.strokeOpacity = markGraphic.strokeOpacity;\n }\n }\n }\n if (!this.config.useFloorCache) {\n this.floorDataMap.clear()\n }\n this.floorDataMap.set(floorKey, data)\n return data\n }\n\n private createFloor(data: GraphicInfo[]) { \n const curFloor = new Floor(this.context)\n if (!data.length) { return { curFloor, graphics: [] } }\n const legacyToGraphicMap = new Map<string, Graphic>()\n const graphics = []\n for (const item of data) {\n if (item.info.group === \"ground\") {\n curFloor.createGround(item.info)\n } else {\n const graphic = curFloor.addGraphic(item.info)\n graphic.userData.data = item\n legacyToGraphicMap.set(item.legacy_id, graphic)\n graphics.push(graphic)\n }\n }\n curFloor.addShadow()\n curFloor.userData.legacyToGraphicMap = legacyToGraphicMap\n return { curFloor, graphics }\n }\n\n switchFloor({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery) {\n const floorKey = this.getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list })\n const curFloorData = this.floorDataMap.get(floorKey)\n this.context.control.removeEventListener(\"change\", this.onControlChange)\n if (curFloorData) {\n const buildingKey = this.getBuildingKey({ brand, project, phase, building })\n this.currentBuildGround = this.buildingGroundMap.get(buildingKey) || null\n const createdFloor = this.createFloor(curFloorData)\n if (createdFloor) {\n this.context.cameraBound.setEnable(false)\n this.context.switchFloor(createdFloor.curFloor)\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = 0;\n this.context.control.maxZoom = Infinity;\n this.context.camera.zoom = 1;\n this.context.setAzimuthalAngle(0, 0);\n this.context.fitCameraToGround(undefined, 0);\n this.basicZoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = this.basicZoom;\n this.context.control.maxZoom = this.basicZoom * 25;\n this.context.control.addEventListener(\"change\", this.onControlChange)\n if (this.type === \"3d\") {\n this.context.fitCameraToGround([80, 20, 80, 20], 0, false)\n }\n this.onControlChange()\n this.context.cameraBound.setEnable(true)\n } else {\n console.warn(\"[switchFloor error] [\"+ floor +\"] \u697C\u5C42\u6CA1\u6709\u6570\u636E\")\n }\n } else {\n console.warn(\"[switchFloor error] \u6CA1\u6709\u8FD9\u4E2A\u697C\u5C42\uFF0C\u8BF7\u5148\u8C03\u7528load\u65B9\u6CD5\u52A0\u8F7D\u697C\u5C42\")\n }\n }\n\n onControlChange = () => {\n const { camera: { zoom } } = this.context\n if (zoom !== this.prevCameraZoom) {\n this.dispatchEvent({\n type: \"zoom-change\",\n basicZoom: this.basicZoom,\n cameraZoom: this.context.camera.zoom\n })\n this.prevCameraZoom = zoom\n }\n }\n\n // \u6276\u68AF\n addModel(graphic: Graphic, options: ModelOptions) { \n // \u6839\u636E\u6700\u957F\u8FB9\uFF0C\u83B7\u53D6\u6276\u68AF\u7684\u65B9\u5411\n if (graphic.options.geometry.type === \"polygon\") {\n // \u6839\u636E\u65B9\u5411\u6E32\u67D3\u6A21\u578B\n const model = this.context.currentFloor?.addModel({\n ...options,\n position: graphic.getPosition().setZ(0.1)\n })\n if (model) {\n const dir = getLongestSideDir(graphic.options.geometry.cds[0])\n const angleY = dir.angleTo(new Vector3(0, 1, 0))\n model.rotateZ(angleY)\n }\n }\n }\n\n addHeatmap(data: HeatmapDataParam) {\n return this.context.currentFloor?.addHeatmap(data)\n }\n\n getLegacyToGraphicMap(): Map<string, Graphic> {\n return this.context.currentFloor?.userData.legacyToGraphicMap || new Map()\n }\n\n /**\n * \u83B7\u53D6\u5F53\u524D\u697C\u5C42\u5168\u90E8\u7684graphic\n * @returns \n */\n getFloorAllGraphics(): Graphic[] {\n return this.context.currentFloor?.graphicLayer.children.filter(item => item instanceof Graphic) as Graphic[] || []\n }\n\n createGraphicPoi(graphic: Graphic, options: PoiOptionsParam) { \n if (this.context.currentFloor) {\n if (options.id === undefined) {\n options.id = graphic.options.id\n }\n const position = graphic.getCenter()\n const poi = this.context.currentFloor.addPoi({\n ...options,\n position: { ...position, z: position.z + graphic.options.height / 2 }\n })\n return poi\n }\n return null\n }\n\n removeHeatMap() {\n this.context.currentFloor?.removeHeatMap()\n }\n\n /**\n * \u79FB\u52A8\u76F8\u673A\u4F4D\u7F6E\u8BA9\u9009\u4E2D\u7684\u5143\u7D20\u5C45\u4E2D\u663E\u793A\n * @param ele { Graphic | Poi }\n * @param duration\n */\n translateElementToCenter(ele: { getPosition: () => Vector3 }, duration: number = 500) {\n const position = ele.getPosition()\n return this.context.setCameraPosition(position, duration);\n }\n\n /**\n * \u79FB\u52A8\u76F8\u673A\u4F4D\u7F6E\u8BA9\u9009\u4E2D\u7684\u5143\u7D20\u5C45\u4E2D\u663E\u793A\n * @param ele { Graphic | Poi }\n * @param duration\n */\n translateElementToCenterX(ele: { getPosition: () => Vector3 }, duration: number = 500) {\n const { y, z } = this.context.camera.position\n const position = ele.getPosition()\n position.setY(y)\n position.setZ(z)\n return this.context.setCameraPosition(position, duration);\n }\n\n /**\n * \u83B7\u53D6\u7269\u4F53\u7684\u5C4F\u5E55\u5750\u6807\n */\n getElementDeviceCoordinate(ele: Object3D) {\n const vector = ele.position.clone();\n const { clientWidth, clientHeight } = this.container;\n return vector3ToDevice(\n vector,\n this.context.camera,\n clientWidth,\n clientHeight\n );\n }\n\n /**\n * \u5207\u63622d\u30013d\u89C6\u89D2\n * @param type\n * @param duration\n */\n changeMapType(type: MapType, duration = 500) {\n this.type = type;\n if (type === \"2d\") {\n return this.context.setPolarAngle(MapTypePolar.D2, duration);\n } else {\n return this.context.setPolarAngle(MapTypePolar.D3, duration);\n }\n }\n\n async resetView(duration = 300) { \n const time = duration / 3\n await this.context.setAzimuthalAngle(0, time)\n await this.changeMapType(this.type, time)\n await this.context.fitCameraToGround(undefined, time)\n }\n\n /**\n * \u7F29\u5C0F\u5730\u56FE\n * @param zoom\n * @param duration\n * @returns\n */\n reduceMap(zoom = 0.5, duration = 500) {\n const cameraZoom = this.context.camera.zoom;\n return this.context.setZoom(\n cameraZoom - zoom,\n this.context.control.target,\n duration\n );\n }\n\n /**\n * \u653E\u5927\u5730\u56FE\n * @param zoom\n * @param duration\n * @returns\n */\n enlargeMap(zoom = 0.5, duration = 500) {\n const cameraZoom = this.context.camera.zoom;\n return this.context.setZoom(\n cameraZoom + zoom,\n this.context.control.target,\n duration\n );\n }\n\n onKeydown = (e: KeyboardEvent) => {\n if (this.polarKeys.includes(e.code)) {\n this.context.control.maxPolarAngle = this.config.control.maxPolar;\n this.context.control.minPolarAngle = 0;\n }\n if (this.azimuthalKeys.includes(e.code)) {\n this.context.control.maxAzimuthAngle = Infinity;\n this.context.control.minAzimuthAngle = Infinity;\n }\n };\n\n onKeyUp = (e: KeyboardEvent) => {\n if (this.polarKeys.includes(e.code)) {\n const polar = this.context.control.getPolarAngle();\n this.context.control.maxPolarAngle = polar;\n this.context.control.minPolarAngle = polar;\n }\n if (this.azimuthalKeys.includes(e.code)) {\n const azimuthal = this.context.control.getAzimuthalAngle();\n this.context.control.maxAzimuthAngle = azimuthal;\n this.context.control.minAzimuthAngle = azimuthal;\n }\n };\n\n registryEvent() {\n window.addEventListener(\"keydown\", this.onKeydown);\n window.addEventListener(\"keyup\", this.onKeyUp);\n if (this.config.resizeObserver) {\n const observe = new ResizeObserver(debounce(this.resize, 5))\n observe.observe(this.container)\n this.observe = observe\n }\n }\n\n unRegistryEvent() {\n window.removeEventListener(\"keydown\", this.onKeydown);\n window.removeEventListener(\"keyup\", this.onKeyUp);\n this.observe?.disconnect()\n this.observe = null;\n }\n\n /**\n * \u914D\u7F6E\u5750\u6807\u5B9A\u70B9 2D/3D\u7EBF\u6027\u5207\u6362\u7684\u5FEB\u6377\u952E\n * @param key\n */\n configurePolarShortcutKeys(keys: string[]) {\n this.polarKeys = keys;\n }\n\n configureAzimuthalShortcutKeys(keys: string[]) {\n this.azimuthalKeys = keys;\n }\n\n rotateMap(radius = 0.1) {\n const azimuthal = this.context.control.getAzimuthalAngle();\n this.context.control.maxAzimuthAngle = azimuthal + radius;\n this.context.control.minAzimuthAngle = azimuthal + radius;\n this.context.control.update()\n }\n\n /**\n * \u6D4B\u91CF\u8DDD\u79BB\n * @returns \n */\n async measureDistance() { \n this.cancelDistance()\n return new Promise((resolve, reject) => { \n this.changeMapType('2d', 0)\n this.context.control.enableRotate = false; // \u6D4B\u91CF\u53EA\u80FD\u57282d\u4E2D\u8FDB\u884C\n this.svgLine = new SvgLine(this.context)\n const dispose = this.svgLine.dispose.bind(this.svgLine)\n this.svgLine.dispose = function () {\n dispose();\n reject(\"cancel\")\n }\n this.svgLine.addEventListener(\"distance\", ({ distance }) => {\n resolve(distance)\n })\n }) \n }\n\n /**\n * \u53D6\u6D88\u6D4B\u91CF\u957F\u5EA6\n */\n cancelDistance() {\n if (this.svgLine) {\n this.svgLine.dispose()\n this.svgLine = undefined;\n this.context.control.enableRotate = true;\n }\n }\n\n /**\n * \u6D4B\u91CF\u9762\u79EF\n */\n measureArea() { \n this.cancelArea()\n return new Promise((resolve, reject) => {\n this.changeMapType('2d', 0)\n this.context.control.enableRotate = false; // \u6D4B\u91CF\u53EA\u80FD\u57282d\u4E2D\u8FDB\u884C\n this.svgPolygon = new SvgPolygon(this.context)\n const dispose = this.svgPolygon.dispose.bind(this.svgPolygon)\n this.svgPolygon.dispose = function () {\n dispose();\n reject(\"cancel\")\n }\n this.svgPolygon.addEventListener(\"area\", ({ area }) => {\n resolve(area)\n })\n })\n }\n\n /**\n * \u53D6\u6D88\u6D4B\u91CF\u9762\u79EF\n */\n cancelArea() {\n if (this.svgPolygon) {\n this.svgPolygon.dispose()\n this.svgPolygon = undefined\n this.context.control.enableRotate = true;\n }\n }\n\n /**\n * \u6839\u636EnodeId \u83B7\u53D6graphic\n */\n getGraphicByNodeId(nodeId: string) {\n return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(nodeId) || null\n }\n\n deleteGraphic(graphic: Graphic) {\n this.context.currentFloor?.graphicLayer.removeGraphic(graphic)\n }\n\n createGraphicByOptions(options: GraphicOptions) {\n if (!options.transformToBuildingGround) {\n if (this.currentBuildGround) {\n const center = getCenter((this.currentBuildGround.info.geometry as PolygonGeometry).cds[0])\n if (options.geometry.type === \"polygon\") {\n options.geometry.cds.map(cds => {\n if (Array.isArray(cds)) {\n cds.forEach(coord => {\n coord[0] -= center[0]\n coord[1] -= center[1]\n })\n }\n })\n } else {\n // point\n const [x, y] = options.geometry.cds\n options.geometry.cds = [x - center[0], y - center[1]]\n }\n }\n }\n return this.context.currentFloor?.graphicLayer.createGraphic(options)\n }\n\n removePoiById(id: string) { \n return this.context.currentFloor?.poiLayer.removePoiById(id)\n }\n\n getPoiById(id: string) { \n return this.context.currentFloor?.poiLayer.getPoiById(id)\n }\n\n getPois() { \n return (this.context.currentFloor?.poiLayer.pois || []).filter(item => !item.options.built_in)\n }\n\n clearPoi() {\n if (this.context.currentFloor) { \n this.context.currentFloor.poiLayer.clear()\n }\n }\n\n removeSelectGraphic(graphic: Graphic) { \n this.context.selection.remove(graphic)\n }\n\n resize = () => { \n this.context.cameraBound.setEnable(false)\n this.context.onWindowResize();\n const azimuthal = this.context.control.getAzimuthalAngle();\n const zoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = 0;\n this.context.control.maxZoom = Infinity;\n this.context.camera.zoom = 1;\n this.context.setAzimuthalAngle(0, 0);\n this.context.fitCameraToGround(undefined, 0);\n this.basicZoom = this.context.camera.zoom;\n // \u8BBE\u7F6Ezoom\n this.context.control.minZoom = this.basicZoom;\n this.context.control.maxZoom = this.basicZoom * 25;\n this.context.camera.zoom = zoom;\n this.context.control.addEventListener(\"change\", this.onControlChange)\n this.context.setAzimuthalAngle(azimuthal, 0);\n this.context.cameraBound.setEnable(true)\n }\n\n dispose() {\n this.context.dispose();\n this.floorDataMap.clear();\n this.buildingGroundMap.clear();\n clearTextTexture();\n clearCanvas();\n disposeLoader();\n this.unRegistryEvent();\n }\n}\n", "type Fn = (...arg: any) => any\n\n/**\n * \u4EFB\u52A1\u7BA1\u7406\u5668\n * \u5728\u7C7B\u9500\u6BC1\u7684\u65F6\u5019\uFF0C\u8981\u6E05\u9664\u6240\u6709\u7684\u5F02\u6B65\u5B9A\u65F6\u5668\n */\nexport class Timer { \n tasks = {\n requestAnimation: new Set<number>(),\n timeout: new Set<number>(),\n interval: new Set<number>()\n }\n\n requestAnimationFrame(fn: Fn): number { \n const timer = window.requestAnimationFrame(() => {\n this.tasks.requestAnimation.delete(timer)\n fn()\n })\n this.tasks.requestAnimation.add(timer)\n return timer\n }\n\n cancelAnimationFrame(timer: number) { \n this.tasks.requestAnimation.delete(timer)\n window.cancelAnimationFrame(timer)\n }\n\n setTimeout(fn: Fn, wait: number): number { \n const timer = window.setTimeout(() => {\n this.tasks.timeout.delete(timer)\n fn()\n }, wait)\n this.tasks.timeout.add(timer)\n return timer\n }\n\n clearTimeout(timer: number) {\n this.tasks.timeout.delete(timer)\n window.clearTimeout(timer)\n }\n\n setInterval(fn: Fn, wait: number): number { \n const timer = window.setInterval(() => {\n this.tasks.interval.delete(timer)\n fn()\n }, wait)\n this.tasks.interval.add(timer)\n return timer\n }\n\n clearInterval(timer: number) {\n this.tasks.interval.delete(timer)\n window.clearInterval(timer)\n }\n\n dispose() { \n this.tasks.requestAnimation.forEach(timer => {\n window.cancelAnimationFrame(timer)\n })\n this.tasks.requestAnimation.clear()\n this.tasks.timeout.forEach(timer => {\n window.clearTimeout(timer)\n })\n this.tasks.timeout.clear()\n this.tasks.interval.forEach(timer => {\n window.clearInterval(timer)\n }) \n this.tasks.interval.clear()\n }\n}", "import { Coordinate } from 'src/types'\nimport {\n Scene, WebGLRenderer, OrthographicCamera, HemisphereLight, Shape, \n PCFSoftShadowMap, Group, Color, DirectionalLight, AmbientLight, Path, Vector2\n} from 'three'\nimport { MapControls } from 'three/examples/jsm/controls/MapControls'\n\nexport function initScene() {\n const scene = new Scene()\n scene.background = new Color(0xffffff)\n return scene\n}\n\nexport function initRenderer() {\n const renderer = new WebGLRenderer({\n antialias: true,\n // logarithmicDepthBuffer: true,\n // alpha: false,\n // premultipliedAlpha: false\n })\n renderer.autoClear = true\n renderer.setClearAlpha(1);\n renderer.setClearColor(0xffffff);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.autoUpdate = true;\n renderer.shadowMap.type = PCFSoftShadowMap;\n return renderer\n}\n\nexport function initCamera(width: number, height: number): OrthographicCamera {\n const camera = new OrthographicCamera(-width / 2, width / 2, height / 2, -height / 2, -1000, 5000)\n camera.up.set(0, 0, 1);\n camera.position.set(0, 0, 100);\n camera.lookAt(0, 0, 0);\n return camera\n}\n\nexport function initLight() {\n const lights = new Group()\n // \u534A\u7403\u5149\n // const hemisphereLight = new HemisphereLight(0xffffff, 0xffffff, 1);\n // hemisphereLight.intensity = 1;\n // hemisphereLight.position.set(0, 0, 10);\n // hemisphereLight.up.set(0, 0, 1);\n // lights.add(hemisphereLight)\n const ambientLight = new AmbientLight(0xffffff, 2.6);\n lights.add(ambientLight)\n return lights\n}\n\nexport function initControl(camera: OrthographicCamera, domElement: HTMLCanvasElement) {\n const control = new MapControls(camera, domElement)\n // \u7981\u7528\u963B\u5C3C\n control.enableDamping = false\n // \u8BBE\u7F6E2.5D\n // control.maxPolarAngle = 0\n // control.minPolarAngle = 0\n // \u7981\u7528\u6C34\u5E73\u65CB\u8F6C\n // control.maxAzimuthAngle = 0\n // control.minAzimuthAngle = 0\n control.zoomSpeed = 2\n return control\n}\n\nexport function initShape(path: Coordinate[], holePath: Coordinate[][] = []) { \n const shape = new Shape(path.map(item => new Vector2(...item)));\n if (holePath.length) {\n holePath.forEach(cur => {\n var hole = new Path(cur.map(item => new Vector2(...item)));\n shape.holes.push(hole);\n })\n }\n return shape\n}\n\nexport function initDirectionalLight(color = 0xffffff, intensity = 1) {\n const directionalLight = new DirectionalLight(color, intensity);\n directionalLight.castShadow = true;\n directionalLight.shadow.radius = 8;\n directionalLight.shadow.bias = -0.001;\n directionalLight.shadow.mapSize.set(256, 256);\n directionalLight.shadow.camera.left = -200;\n directionalLight.shadow.camera.right = 200;\n directionalLight.shadow.camera.top = 200;\n directionalLight.shadow.camera.bottom = -200;\n return directionalLight\n}", "import { Object3D, Mesh, Light } from 'three'\n\nexport function dispose(o: Object3D, recursive?: boolean): void {\n if (recursive && o.children && o.children.length) {\n o.children.forEach((child) => {\n dispose(child, recursive);\n });\n }\n if ((o as Mesh).isMesh) {\n const m = o as Mesh;\n if (m.geometry) m.geometry.dispose();\n if (m.material) {\n if (Array.isArray(m.material)) {\n m.material.forEach((mat) => {\n mat.dispose();\n });\n } else {\n m.material.dispose();\n }\n }\n }\n if ((o as Light).isLight) {\n (o as Light).dispose?.()\n }\n}", "export function hasChinese(str:string) {\n return /[\\u4E00-\\u9FA5]+/g.test(str);\n}", "import { hasChinese } from './rules'\nimport { DataTexture, RGBAFormat, LinearFilter } from 'three'\n\nconst urlTextureMap = new Map()\nconst textTextureMap = new Map<string, DataTexture>()\n\nexport function initCanvas() {\n const canvas = document.createElement('canvas');\n canvas.width = 1024;\n canvas.height = 64;\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n }) as CanvasRenderingContext2D;\n ctx.font = '54px sans-serif';\n ctx.textBaseline = 'hanging';\n ctx.lineWidth = 12;\n ctx.fillStyle = 'rgba(0,0,0,1)';\n ctx.strokeStyle = 'white';\n return { canvas, ctx }\n}\n\nlet canvas: HTMLCanvasElement;\nlet ctx: CanvasRenderingContext2D;\n\nexport function createCanvas() {\n if (!canvas) {\n const { canvas: c, ctx: t } = initCanvas()\n canvas = c;\n ctx = t;\n }\n}\n\nexport function getTextureByText(text: string): DataTexture {\n if (textTextureMap.has(text)) {\n return textTextureMap.get(text)!\n }\n createCanvas()\n\n ctx.clearRect(0, 0, 1024, 64);\n const y = hasChinese(text) ? 4 : 8;\n ctx.strokeText(text, 2, y);\n ctx.fillText(text, 2, y);\n\n let width = Math.ceil(ctx.measureText(text).width);\n width = width % 2 === 0 ? width : width + 1;\n width += 2;\n const imageData = ctx.getImageData(0, 0, width, 64);\n const texture = new DataTexture(\n Uint8Array.from(imageData.data),\n width,\n 64,\n RGBAFormat,\n );\n texture.flipY = true;\n texture.minFilter = LinearFilter;\n texture.magFilter = LinearFilter;\n\n textTextureMap.set(text, texture);\n return texture;\n}\n\nexport function clearTextTexture() {\n textTextureMap.clear()\n}\n\nexport function clearCanvas() {\n ctx = null as unknown as CanvasRenderingContext2D;\n canvas = null as unknown as HTMLCanvasElement;\n}", "import { Coordinate } from 'src/types';\nimport { Vector3, Camera } from 'three';\nimport { point, featureCollection, center } from '@turf/turf'\n\n/**\n * 3D\u5750\u6807\u8F6C\u5C4F\u5E55\u5750\u6807\n * @param vector \n * @param camera \n * @param w container\u7684\u5BBD\n * @param h container\u7684\u9AD8\n * @returns \n */\nexport function vector3ToDevice(vector: Vector3, camera: Camera, w: number, h: number) {\n const _vector = vector.clone().project(camera);//\u901A\u8FC7\u4E16\u754C\u5750\u6807\u83B7\u53D6\u8F6C\u6807\u51C6\u8BBE\u5907\u5750\u6807\n const _w = w / 2;\n const _h = h / 2;\n const x = Math.round(_vector.x * _w + _w);//\u6807\u51C6\u8BBE\u5907\u5750\u6807\u8F6C\u5C4F\u5E55\u5750\u6807\n const y = Math.round(-_vector.y * _h + _h);\n return { x, y }\n}\n\n\n/**\n * \u83B7\u53D6\u591A\u53D8\u5F62\u7684\u4E2D\u5FC3\u70B9\n * @param coordinates \n */\nexport function getCenter(coordinates: Coordinate[]) {\n const features = featureCollection(coordinates.map(item => point(item)))\n const cent = center(features)\n return cent.geometry.coordinates\n}\n\ntype Position = {\n x: number,\n y: number\n}\nexport function isContain(point: Position, start: Position, end: Position) {\n // \u5224\u65AD point\u662F\u5426\u5728 start \u548Cend\u5F62\u6210\u7684\u77E9\u5F62\u4E2D\n return point.x >= start.x &&\n point.x <= end.x &&\n point.y >= start.y &&\n point.y <= end.y \n}\n\n/**\n * \u83B7\u53D6\u6700\u957F\u8FB9\u7684\u65B9\u5411\n * @param cds \n */\nexport function getLongestSideDir(cds: Coordinate[]) { \n let maxDistance = 0;\n let dir = new Vector3();\n for (let i = 1; i < cds.length; i++) { \n const point_0 = new Vector3(cds[i - 1][0], cds[i - 1][1], 0);\n const point_1 = new Vector3(cds[i][0], cds[i][1], 0);\n const distance = point_1.distanceTo(point_0)\n if (distance > maxDistance) {\n maxDistance = distance;\n dir = point_1.clone().sub(point_0).normalize();\n }\n }\n return dir;\n}", "import { EventDispatcher } from 'three'\n\nexport function proxyOptions\n <T extends Record<string, any>, M extends { [K in keyof T as `change-${Extract<K, string>}`]: { value: T[K] } }>\n (target: T, master: EventDispatcher<M>): T\n{ \n return new Proxy<T>(target, {\n get: (target, p, receiver) => {\n return Reflect.get(target, p, receiver)\n },\n set: (target, p, newValue, receiver) => {\n const oldValue = Reflect.get(target, p, receiver)\n const res = Reflect.set(target, p, newValue, receiver)\n if (oldValue !== newValue) {\n master.dispatchEvent({ type: `change-${p as Extract<keyof T, string>}`, value: newValue } as any)\n }\n return res\n }\n })\n}", "/**\n * \u53EF\u4EE5\u8BBE\u7F6E\u8D85\u65F6\u65F6\u95F4\u7684promise\n * @param promise \n * @param timeout \n * @returns \n */\nexport function timeoutPromise<T>(promise: Promise<T>, timeout: number): Promise<T> {\n return Promise.race([\n promise,\n new Promise<T>((resolve, reject) => {\n setTimeout(() => reject(new Error(\"Promise timeout\")), timeout);\n })\n ]);\n}", "export function createSvgElement(tag: string) {\n return document.createElementNS('http://www.w3.org/2000/svg', tag); \n}\n\n/**\n * \u521B\u5EFAsvg\n */\nexport function createSvg(w: string, h: string) {\n const svg = createSvgElement(\"svg\");\n svg.setAttribute(\"width\", w)\n svg.setAttribute(\"height\", h)\n svg.style.cssText = \"position: absolute; left: 0; top: 0; pointer-events: none;\"\n return svg;\n}\n\n/**\n * \u521B\u5EFA\u5706\u70B9\n * @param radius \n */\nexport function createCircle(radius = \"2\", fill: string) {\n const circle = createSvgElement(\"circle\");\n circle.setAttribute(\"r\", radius)\n circle.setAttribute(\"fill\", fill)\n return circle\n}\n\n/**\n * \u521B\u5EFA\u7EBF\n * @param stroke \n */\nexport function createLine(stroke: string) {\n const line = createSvgElement(\"line\")\n line.setAttribute(\"stroke\", stroke)\n return line\n}\n\n/**\n * \u521B\u5EFA\u77E9\u5F62\n * @param stroke \n * @returns \n */\nexport function createRect(stroke: string, fill: string) {\n const rect = createSvgElement(\"rect\")\n rect.setAttribute(\"stroke\", stroke)\n rect.setAttribute(\"fill\", fill)\n return rect\n}\n\nexport function setCirclePosition(circle: SVGElement, x: number, y: number) {\n circle.setAttribute('cx', `${x}`)\n circle.setAttribute('cy', `${y}`)\n}\n\ntype Position = { x: number; y: number }\n\nexport function setLineStartEnd(line: SVGElement, start?: Position, end?: Position) {\n if (start) { \n line.setAttribute(\"x1\", `${start.x}`)\n line.setAttribute(\"y1\", `${start.y}`)\n }\n if (end) {\n line.setAttribute(\"x2\", `${end.x}`)\n line.setAttribute(\"y2\", `${end.y}`)\n }\n}\n\nexport function setRectPosition(rect: SVGElement, x: number, y: number, w: number, h: number) {\n rect.setAttribute('x', `${x}`)\n rect.setAttribute('y', `${y}`)\n rect.setAttribute('width', `${w}`)\n rect.setAttribute('height', `${h}`)\n}", "export function sleepOnePromise() {\n return Promise.resolve()\n}\n\nexport function sleepOneRf() { \n return new Promise(resolve => {\n requestAnimationFrame(resolve)\n })\n}", "export function strToNumber(str: string) {\n return parseInt(str.replace(\"#\", \"0x\"), 16);\n}\n\n/**\n * \u7ED9\u989C\u8272\u52A0\u4E0A\u900F\u660E\u5EA6\n * @param hexColor \n * @param alpha \n * @returns \n */\nexport function addAlphaToHexColor(hexColor: string, alpha: number) {\n // \u5C0616\u8FDB\u5236\u989C\u8272\u503C\u8F6C\u6362\u4E3ARGB\u6570\u503C\n let r = parseInt(hexColor.substring(1, 3), 16);\n let g = parseInt(hexColor.substring(3, 5), 16);\n let b = parseInt(hexColor.substring(5, 7), 16);\n\n // \u8BA1\u7B97\u65B0\u7684RGB\u6570\u503C\n let newR = Math.round(r * alpha);\n let newG = Math.round(g * alpha);\n let newB = Math.round(b * alpha);\n\n // \u5C06\u65B0\u7684RGB\u6570\u503C\u8F6C\u6362\u4E3A16\u8FDB\u5236\u683C\u5F0F\n let newHexColor = `#${(1 << 24 | newR << 16 | newG << 8 | newB).toString(16).slice(1)}`;\n\n return newHexColor;\n}\n\nexport function darkenColor(hexColor: string) {\n // \u5C06\u5341\u516D\u8FDB\u5236\u989C\u8272\u8F6C\u6362\u4E3ARGB\n let r = parseInt(hexColor.substring(1, 3), 16);\n let g = parseInt(hexColor.substring(3, 5), 16);\n let b = parseInt(hexColor.substring(5, 7), 16);\n\n // \u8BA1\u7B97\u6697\u70B9\u989C\u8272\n r = Math.floor(r * 0.95);\n g = Math.floor(g * 0.95);\n b = Math.floor(b * 0.95);\n\n // \u5C06RGB\u989C\u8272\u8F6C\u6362\u56DE\u5341\u516D\u8FDB\u5236\n let darkHexColor = \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n\n return darkHexColor;\n}\n", "import { Object3D, Scene, Mesh, MeshBasicMaterial } from 'three'\nimport { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'\n\nfunction createLoader() { \n const loader = new GLTFLoader()\n return loader\n}\n\nlet loader: GLTFLoader | null = null\nlet modelMap = new Map<string, Promise<GLTF>>()\n\n/**\n * \u52A0\u8F7D\u6A21\u578B\n * @param url \n * @returns \n */\nexport function loadModel(url: string): Promise<GLTF> { \n if (modelMap.has(url)) {\n const gltf = modelMap.get(url)!.then(gltf => { \n gltf.scene = gltf.scene.clone()\n return gltf\n })\n }\n if (!loader) {\n loader = createLoader()\n }\n const p = new Promise<GLTF>((resolve, reject) => { \n loader!.load(url, gltf => {\n resolve(gltf)\n }, undefined, reject)\n })\n modelMap.set(url, p)\n return p.then(gltf => { \n gltf.scene = gltf.scene.clone()\n return gltf\n })\n}\n\nexport function disposeLoader() { \n loader = null\n modelMap.clear()\n}", "export const isMac = navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;\n", "import { isMac } from \"./os\";\n\nexport function isControl(key: string) { \n if (isMac) {\n return key === \"Meta\"\n }\n return key === \"Control\"\n}", "import { MapControls } from \"three/examples/jsm/controls/MapControls\";\nimport {\n Timer,\n initCamera,\n initRenderer,\n initScene,\n initLight,\n initControl,\n dispose,\n vector3ToDevice,\n timeoutPromise,\n} from \"./utils\";\nimport {\n EventDispatcher,\n OrthographicCamera,\n Light,\n Box2,\n Vector3,\n Vector2,\n Raycaster,\n Object3D,\n Box3,\n Color,\n AmbientLight,\n} from \"three\";\nimport { Graphic, Poi, Floor } from \"./elements\";\nimport { Group as TweenGroup, Tween } from \"@tweenjs/tween.js\";\nimport { Config } from \"./config\";\nimport { Selection } from \"./operations/selection/selection\";\nimport { HoverHelper } from \"./operations\";\nimport { MaterialFactory } from \"./factory\";\nimport { CameraBound } from \"./utils/camera-bound\";\n\nexport interface ContextEventMap {\n update: {};\n \"graphic-click\": {\n graphics: Graphic[];\n position: Vector3 | null\n };\n \"poi-click\": {\n pois: Poi[];\n };\n 'pointer-level': {};\n 'pointer-over': {\n graphics: Graphic[];\n pois: Poi[];\n position: Vector3 | null;\n };\n 'pointer-move': {\n graphics: Graphic[];\n pois: Poi[];\n position: Vector3 | null;\n },\n 'change-ratio': {\n px: number;\n },\n \"select-graphic\": {\n graphics: Graphic[],\n isMultipleSelect: boolean,\n },\n \"hover\": {\n graphics: Graphic[];\n },\n \"control-change\": {},\n \"resize\": {\n width: number;\n height: number;\n }\n}\n\nexport class Context extends EventDispatcher<ContextEventMap> {\n scene = initScene();\n\n renderer = initRenderer();\n\n camera!: OrthographicCamera;\n\n control!: MapControls;\n\n lights = initLight();\n\n // \u7BA1\u7406\u4EFB\u52A1\uFF0C\u9632\u6B62\u5185\u5B58\u6CC4\u6F0F\n timer = new Timer();\n \n tweenGroup = new TweenGroup();\n \n currentFloor?: Floor;\n\n selection: Selection;\n\n hoverHelper: HoverHelper;\n \n private basicRatio?: number; // zoom=1\u7684\u65F6\u5019\uFF0C100M\u5BF9\u5E94\u7684\u50CF\u7D20\u4E2A\u6570\n\n public materialFactory!: MaterialFactory;\n\n cameraBound!: CameraBound;\n\n clientSize = {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n }\n\n constructor(public container: HTMLElement, public config: Config) {\n super();\n this.container.style.position = \"relative\";\n this.container.style.overflow = \"hidden\";\n this.init();\n this.selection = new Selection(this);\n this.hoverHelper = new HoverHelper(this);\n this.materialFactory = new MaterialFactory(this);\n this.resizeClientSize()\n this.registryEvent();\n }\n\n resizeClientSize() { \n const { x, y, width, height } = this.container.getBoundingClientRect()\n this.clientSize = {\n width: width || this.container.clientWidth,\n height: height || this.container.clientHeight,\n x,\n y\n }\n }\n\n init() {\n const { clientWidth: w, clientHeight: h } = this.container;\n this.camera = initCamera(w, h);\n this.renderer.setSize(w, h);\n this.control = initControl(this.camera, this.renderer.domElement);\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.container.appendChild(this.renderer.domElement);\n this.scene.add(this.lights);\n this.basicRatio = this.getRatio()\n // \u65CB\u8F6C\u89C6\u89D2\u7684\u65F6\u5019\uFF0C\u9690\u85CF\u548C\u663E\u793A\u9634\u5F71\n this.control.addEventListener(\"change\", () => {\n const polarAngle = this.control.getPolarAngle();\n this.currentFloor?.setShadowOpacity(polarAngle / this.config.control.maxPolar)\n this.dispatchEvent({ type: 'change-ratio', px: (this.basicRatio || 0) * this.camera.zoom })\n this.dispatchEvent({ type: 'control-change' })\n });\n this.cameraBound = new CameraBound(this);\n }\n\n /**\n * \u83B7\u53D6\u4E24\u4E2A\u70B9\u4E4B\u95F4\u7684\u50CF\u7D20\u6570\n */\n getRatio(point1 = new Vector3(0, 0, 0), point2 = new Vector3(100, 0, 0)) {\n const { clientWidth, clientHeight } = this.container\n const device1 = vector3ToDevice(point1, this.camera, clientWidth, clientHeight)\n const device2 = vector3ToDevice(point2, this.camera, clientWidth, clientHeight)\n return Math.ceil(Math.sqrt((device2.x - device1.x) ** 2 + (device2.y - device1.y) ** 2))\n }\n\n changeAmbientLightColor(color: string | number) {\n this.lights.children.forEach((item) => {\n if (item instanceof AmbientLight) {\n item.color = new Color(color);\n }\n });\n }\n\n switchFloor(floor: Floor) {\n if (this.currentFloor) {\n this.scene.remove(this.currentFloor)\n this.currentFloor.dispose()\n }\n this.currentFloor = floor\n this.scene.add(floor)\n // \u4FEE\u6539\u706F\u5149\u7684\u4F4D\u7F6E\n const position = floor.getCenter()\n if (position) {\n this.lights.position.x = position.x\n this.lights.position.y = position.y\n }\n }\n\n onWindowResize = () => {\n const { container, camera, renderer } = this;\n let { clientWidth: w, clientHeight: h } = container;\n w = Math.max(1, w);\n h = Math.max(1, h);\n camera.left = -w / 2;\n camera.right = w / 2;\n camera.top = h / 2;\n camera.bottom = -h / 2;\n camera.updateProjectionMatrix();\n renderer.setSize(w, h);\n this.resizeClientSize()\n this.dispatchEvent({ type:'resize', width: w, height: h })\n };\n\n onClick = (e: MouseEvent) => {\n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);\n if (graphics.length) {\n this.dispatchEvent({\n type: \"graphic-click\",\n graphics: graphics,\n position\n });\n }\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY);\n if (pois.length) {\n this.dispatchEvent({ type: \"poi-click\", pois: pois as Poi[] });\n }\n };\n\n /**\n * \u83B7\u53D6\u5C4F\u5E55\u5750\u6807\u5BF9\u5E94\u7684graphic\n * @param x\n * @param y\n * @returns\n */\n getGraphicsByDeviceXy(x: number, y: number): { graphics: Graphic[], position: Vector3 | null } {\n const point = new Vector2();\n point.x = (x / this.clientSize.width) * 2 - 1;\n point.y = (y / this.clientSize.height) * -2 + 1;\n const raycaster = new Raycaster();\n raycaster.setFromCamera(point, this.camera);\n const res = this.currentFloor?.graphicLayer.getGraphicByRaycaster(raycaster)\n return res || { graphics: [], position: null }\n }\n\n /**\n * \u83B7\u53D6\u5C4F\u5E55\u5750\u6807\u5BF9\u5E94\u7684poi\n * @param x\n * @param y\n * @returns\n */\n getPoisByDeviceXy(x: number, y: number) {\n const pois = this.currentFloor?.poiLayer.getPoiByDeviceXy(x, y)\n return pois || [];\n }\n\n onPointerover = (e: PointerEvent) => { \n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY) as Poi[];\n this.dispatchEvent({ type: 'pointer-over', graphics, pois, position })\n }\n\n onPointermove = (e: PointerEvent) => { \n const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY)\n const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY) as Poi[];\n // console.log(graphics, position, e.offsetX, e.offsetY)\n this.dispatchEvent({ type: 'pointer-move', graphics, pois, position })\n }\n\n onPointerleave = () => { \n this.dispatchEvent({ type: \"pointer-level\" })\n }\n\n onSelectionSelect = ({ graphics, isMultipleSelect }: {graphics: Graphic[], isMultipleSelect: boolean}) => { \n this.dispatchEvent({ type: \"select-graphic\", graphics, isMultipleSelect })\n }\n\n onHoverChange = ({ graphics }: { graphics: Graphic[] }) => { \n this.dispatchEvent({ type: \"hover\", graphics })\n }\n\n registryEvent() {\n window.addEventListener(\"resize\", this.onWindowResize);\n this.container.addEventListener(\"click\", this.onClick);\n this.container.addEventListener(\"pointerover\", this.onPointerover)\n this.container.addEventListener(\"pointermove\", this.onPointermove)\n this.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.selection.addEventListener(\"select\", this.onSelectionSelect)\n this.hoverHelper.addEventListener(\"hover-change\", this.onHoverChange)\n }\n\n unRegistryEvent() {\n window.removeEventListener(\"resize\", this.onWindowResize);\n this.container.removeEventListener(\"click\", this.onClick);\n this.container.removeEventListener(\"pointerover\", this.onPointerover)\n this.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.selection.removeEventListener(\"select\", this.onSelectionSelect)\n this.hoverHelper.removeEventListener(\"hover-change\", this.onHoverChange)\n }\n\n /**\n * \u8BBE\u7F6E\u7EB5\u5411\u65CB\u8F6C\u89D2\u5EA6\n * @param polar \u5F27\u5EA6\n */\n public setPolarAngle(polar: number, duration = 500) {\n if (duration === 0) {\n this.control.maxPolarAngle = polar;\n this.control.minPolarAngle = polar;\n this.control.update();\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.control.minPolarAngle = 0;\n return Promise.resolve();\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const start = { polar: this.control.getPolarAngle() };\n const end = { polar };\n const tween = new Tween(start, this.tweenGroup)\n .to(end, duration)\n .onUpdate(() => {\n this.control.maxPolarAngle = start.polar;\n this.control.minPolarAngle = start.polar;\n this.control.update();\n })\n .onComplete(() => {\n this.control.enabled = true;\n this.control.maxPolarAngle = this.config.control.maxPolar;\n this.control.minPolarAngle = 0;\n this.tweenGroup.remove(tween);\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n /**\n * \u8BBE\u7F6E\u6A2A\u5411\u65CB\u8F6C\u89D2\u5EA6\n * @param azimuthal \u5F27\u5EA6\n */\n public setAzimuthalAngle(azimuthal: number, duration = 500) {\n if (duration === 0) {\n this.control.maxAzimuthAngle = azimuthal;\n this.control.minAzimuthAngle = azimuthal;\n this.control.update();\n this.control.maxAzimuthAngle = Infinity;\n this.control.minAzimuthAngle = Infinity;\n return\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const start = { azimuthal: this.control.getAzimuthalAngle() };\n const end = { azimuthal };\n const tween = new Tween(start, this.tweenGroup)\n .to(end, duration)\n .onUpdate(() => {\n this.control.maxAzimuthAngle = start.azimuthal;\n this.control.minAzimuthAngle = start.azimuthal;\n this.control.update();\n })\n .onComplete(() => {\n this.control.enabled = true;\n this.control.maxAzimuthAngle = Infinity;\n this.control.minAzimuthAngle = Infinity;\n this.tweenGroup.remove(tween);\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n getCameraLookAt() {\n return new Vector3().subVectors(this.control.target, this.camera.position);\n }\n\n /**\n * \u6309\u7167\u4E00\u4E2A\u4E2D\u5FC3\u70B9\u8BBE\u7F6E\u76F8\u673A\u7684\u653E\u5927\u7F29\u5C0F\n * @param zoom\n * @param center\n * @returns\n */\n public setZoom(zoom: number, center: Vector3, duration = 500) {\n const lookAtVector = this.getCameraLookAt();\n const start = {\n zoom: this.camera.zoom,\n target: this.control.target.clone(),\n };\n if (!duration) { \n this.camera.position.copy(center.clone().sub(lookAtVector));\n this.control.target.copy(center);\n this.camera.zoom = zoom;\n this.control.update()\n return\n }\n return timeoutPromise(\n new Promise((resolve) => {\n const tween = new Tween(start, this.tweenGroup)\n .to(\n {\n zoom,\n target: center,\n },\n duration\n )\n .onUpdate(() => {\n this.camera.position.copy(start.target.clone().sub(lookAtVector));\n this.control.target.copy(start.target);\n this.camera.zoom = start.zoom;\n this.control.update();\n })\n .onComplete(() => {\n this.tweenGroup.remove(tween);\n this.control.enabled = true;\n resolve(true)\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n /**\n * \u653E\u5927\u76F8\u673A\u5230\u7269\u4F53\u5360\u5168\u5C4F\n * @param object\n * @param padding\n * @param duration\n * @returns\n */\n fitCameraToObject(\n object: Object3D,\n padding: [number, number, number, number] = [20, 20, 20, 20],\n duration = 500,\n force2DView = true, // \u5F3A\u5236\u8BA1\u7B972d\u89C6\u89D2\u7684\u5927\u5C0F\n ) {\n const [top, right, bottom, left] = padding;\n const { clientSize: { width, height } } = this;\n const polar = this.control.getPolarAngle()\n if (force2DView) {\n // \u83B7\u53D6\u57282D\u89C6\u56FE\u4E0B\u7684\u5927\u5C0F\n this.setPolarAngle(0, 0)\n }\n // \u83B7\u53D6\u7269\u4F53\u7684\u4E09\u7EF4\u76D2\u5B50\u5750\u6807\n const boundingBox = new Box3().setFromObject(object);\n this.setPolarAngle(polar, 0)\n const { max, min } = boundingBox;\n // \u5750\u6807\u8F6C\u6210\u5C4F\u5E55\u5750\u6807\u5E76\u8BA1\u7B97\u51FA\u5360\u7528\u5C4F\u5E55\u5750\u6807\u7684\u5927\u5C0F\n const max2d = vector3ToDevice(max, this.camera, width, height);\n const min2d = vector3ToDevice(min, this.camera, width, height);\n const boundingBox2d = new Box2().setFromPoints([\n new Vector2(max2d.x, max2d.y),\n new Vector2(min2d.x, min2d.y),\n ]);\n const size = boundingBox2d.getSize(new Vector2());\n // \u8BA1\u7B97\u5728\u5C4F\u5E55\u4E0Ax,y\u65B9\u5411\u4E0A\u9700\u8981\u8C03\u6574\u7684\u500D\u6570\n const xScale = (width - right - left) / size.x;\n const yScale = (height - top - bottom) / size.y;\n const scale = Math.min(xScale, yScale);\n const center = new Vector3((max.x + min.x) / 2, (max.y + min.y) / 2, max.z);\n return this.setZoom(scale * this.camera.zoom, center, duration);\n }\n\n fitCameraToGround(padding: [number, number, number, number] = [20, 20, 20, 20], duration = 500, force2DView = true) { \n if (this.currentFloor && this.currentFloor.hasElement) {\n return this.fitCameraToObject(this.currentFloor.groundUpper, padding, duration, force2DView);\n } else {\n return Promise.resolve(false);\n }\n }\n\n /**\n * \u4FEE\u6539\u76F8\u673A\u4F4D\u7F6E\n * @param position \u4FEE\u6539\u540E\u7684\u76F8\u673A\u7684\u4F4D\u7F6E\n * @param duration \u52A8\u753B\u6301\u7EED\u65F6\u95F4\n */\n public setCameraPosition(position: Vector3, duration: number) {\n return timeoutPromise(\n new Promise((resolve) => {\n const start = this.camera.position.clone();\n const lookAtVector = this.getCameraLookAt();\n const tween = new Tween(start, this.tweenGroup)\n .to(position, duration)\n .onUpdate(() => {\n this.camera.position.copy(start.clone().sub(lookAtVector));\n this.control.target.copy(start.clone());\n this.control.update();\n })\n .onComplete(() => {\n this.tweenGroup.remove(tween);\n this.camera.position.copy(start.clone().sub(lookAtVector));\n this.control.target.copy(position.clone());\n this.control.update();\n this.control.enabled = true;\n resolve(true);\n })\n .onStart(() => {\n this.control.enabled = false;\n })\n .start();\n }),\n duration + 500\n );\n }\n\n render() {\n this.renderer.render(this.scene, this.camera);\n this.dispatchEvent({ type: \"update\" });\n this.timer.requestAnimationFrame(() => {\n this.render();\n });\n this.tweenGroup.update();\n }\n\n dispose() {\n this.cameraBound.dispose()\n this.selection.dispose()\n this.hoverHelper.dispose()\n this.tweenGroup.getAll().forEach((item) => item.stop());\n this.tweenGroup.removeAll();\n this.unRegistryEvent();\n this.container.removeChild(this.renderer.domElement);\n this.timer.dispose();\n this.renderer.dispose();\n (this.lights.children as Light[]).forEach((light: Light) =>\n light.dispose()\n );\n this.materialFactory.dispose();\n dispose(this.scene);\n }\n}\n", "import { EventDispatcher } from \"three\";\nimport { Context } from \"../../context\";\nimport { Graphic, Poi } from \"../../elements\";\nimport { BoxSelection } from \"./box-selection\";\nimport { isControl } from \"../../utils\";\n\ninterface SelectionEventMap {\n \"select\": {\n graphics: Graphic[],\n isMultipleSelect: boolean,\n }\n}\n\nexport class Selection extends EventDispatcher<SelectionEventMap> {\n private _list = new Set<Graphic>()\n\n private boxSelection: BoxSelection;\n private prevPanStatus?: boolean;\n private prevRotateStatus?: boolean;\n private downPoint: { x: number, y: number } | null = null\n\n private isMultipleSelect = false;\n\n constructor(private context: Context) {\n super()\n this.boxSelection = new BoxSelection(context)\n this.boxSelection.setEnable(false)\n this.registryEvent()\n }\n\n get list() {\n return this._list\n }\n\n onPointerDown = (e: PointerEvent) => {\n this.downPoint = { x: e.offsetX, y: e.offsetY }\n }\n\n onPointerUp = (e: PointerEvent) => {\n if (!this.downPoint) { return }\n const { offsetX, offsetY } = e\n const { x, y } = this.downPoint\n if (Math.sqrt((x - offsetX) ** 2 + (y - offsetY) ** 2) > 3) {\n return\n }\n const { graphics } = this.context.getGraphicsByDeviceXy(offsetX, offsetY)\n const graphicIdSet = new Set(graphics.map(item => item.options.id))\n const pois = this.context.getPoisByDeviceXy(offsetX, offsetY) as Poi[];\n pois.forEach(item => { \n if (!graphicIdSet.has(item.options.id)) {\n const graphic = this.context.currentFloor?.graphicLayer.graphicMap.get(item.options.id) || null\n if (graphic && graphic.options.geometry.type === 'point') { \n graphics.push(graphic)\n graphicIdSet.add(item.options.id)\n }\n }\n })\n if (!e.ctrlKey) {\n this._list.clear()\n }\n graphics.forEach(item => this._list.add(item))\n this.selectEnd()\n this.downPoint = null\n }\n\n onKeyDown = (e: KeyboardEvent) => {\n if (isControl(e.key)) {\n this.isMultipleSelect = true;\n this.boxSelection.setEnable(true)\n this.prevPanStatus = this.context.control.enablePan\n this.prevRotateStatus = this.context.control.enableRotate\n this.context.control.enablePan = false\n this.context.control.enableRotate = false\n }\n }\n\n onKeyUp = (e: KeyboardEvent) => {\n if (isControl(e.key)) {\n this.isMultipleSelect = false;\n this.boxSelection.setEnable(false)\n this.context.control.enablePan = !!this.prevPanStatus\n this.context.control.enableRotate = !!this.prevRotateStatus\n }\n }\n\n onBoxSelected = ({ list }: { list: Graphic[] }) => { \n this._list.clear()\n list.forEach(item => {\n this._list.add(item)\n })\n this.selectEnd()\n }\n\n selectEnd() {\n this.dispatchEvent({type: \"select\", graphics: [...this._list], isMultipleSelect: this.isMultipleSelect})\n }\n\n registryEvent() {\n this.context.container.addEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.addEventListener(\"pointerup\", this.onPointerUp)\n window.addEventListener(\"keydown\", this.onKeyDown)\n window.addEventListener(\"keyup\", this.onKeyUp)\n this.boxSelection.addEventListener(\"selected\", this.onBoxSelected)\n }\n\n unRegistryEvent() {\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.removeEventListener(\"pointerup\", this.onPointerUp)\n window.removeEventListener(\"keydown\", this.onKeyDown)\n window.removeEventListener(\"keyup\", this.onKeyUp)\n this.boxSelection.removeEventListener(\"selected\", this.onBoxSelected)\n }\n\n clear() {\n this._list.clear()\n }\n\n remove(graphic: Graphic) { \n this._list.delete(graphic)\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}", "import {\n Object3D, ExtrudeGeometry, Mesh, Box3, MeshBasicMaterial,\n Raycaster, Object3DEventMap, Vector3, BufferGeometry, LineBasicMaterial, LineSegments\n} from 'three';\nimport { initShape, proxyOptions, darkenColor } from '../utils'\nimport { GraphicOptions, PolygonGeometry } from 'src/types';\nimport { Context } from '../context'\n\n// \u95E8\u7684\u7C7B\u578B\nconst DoorType = {\n single: \"\u5355\u5F00\u95E8\",\n double: \"\u53CC\u5F00\u95E8\",\n move: \"\u79FB\u52A8\u95E8\",\n};\n\n// \u95E8\u7684\u6750\u8D28\nconst DoorMaterial = {\n wood: \"\u6728\u95E8\",\n glass: \"\u73BB\u7483\u95E8\",\n aluminum: \"\u94DD\u5408\u91D1\u95E8\",\n}\n\n// \u5355\u4E2A\u95E8\u7684\u914D\u7F6E\nexport interface Door {\n // \u540D\u79F0\n name: string;\n id: string;\n width: number;\n // \u5185\u5F00/\u5916\u5F00\n open: boolean;\n // \u7C7B\u578B \u5355\u5F00\u95E8 \u53CC\u5F00\u95E8 \u79FB\u52A8\u95E8\n type: keyof typeof DoorType;\n // \u6750\u8D28\n material: keyof typeof DoorMaterial;\n}\n\nexport type GraphicOptionsParam = Partial<GraphicOptions>\n\ntype GraphicEventMap = {\n [K in keyof GraphicOptions as `change-${K}`]: { value: GraphicOptions[K] };\n} & Object3DEventMap;\n\n\nconst defaultOptions: GraphicOptions = {\n id: \"\", // \u56FE\u5F62id\n height: 0.1, // \u56FE\u5F62\u9AD8\u5EA6\n airHeight: 0, // \u60AC\u7A7A\u9AD8\u5EA6\n area: 0, // \u9762\u79EF\n group: \"\", // \u5206\u7EC4\n fillColor: \"#EFF4FB\", // \u989C\u8272\n strokeColor: \"#ffffff\", // \u8FB9\u6846\n fillOpacity: 1, // \u900F\u660E\u5EA6\n strokeOpacity: 1, // \u63CF\u8FB9\u900F\u660E\u5EA6\n strokeWidth: 1, // \u63CF\u8FB9\u5BBD\u5EA6 \n doors: [], // \u95E8\u914D\u7F6E\n locked: false,\n visible: true,\n geometry: {\n type: 'polygon',\n cds: [],\n curveCpt: [],\n curveIndex: []\n },\n layerType: \"\",\n zIndex: 0,\n stroke: true,\n deltaHeight: 0,\n userData: {}\n}\n\nexport class Graphic extends Object3D<GraphicEventMap> {\n\n private geometry!: ExtrudeGeometry;\n\n private material!: MeshBasicMaterial | MeshBasicMaterial[];\n\n public mesh!: Mesh;\n\n private line!: LineSegments;\n\n private lineMaterial?: LineBasicMaterial;\n\n private lineGeometry?: BufferGeometry;\n \n public options: GraphicOptions\n \n constructor(private context: Context, options: GraphicOptionsParam) {\n super()\n this.options = proxyOptions<GraphicOptions, GraphicEventMap>({...defaultOptions, ...options}, this)\n if (this.options.geometry.type === \"point\") { \n const [x, y] = this.options.geometry.cds\n this.position.set(x, y, this.options.height + this.options.airHeight)\n return this\n }\n this.init()\n this.visible = this.options.visible\n this.addEventListener('change-fillColor', ({ value }) => {\n this.initMaterial()\n this.initMesh()\n })\n this.addEventListener('change-fillOpacity', ({ value }) => {\n this.initMaterial()\n this.initMesh()\n })\n this.addEventListener('change-height', ({ value }) => {\n this.dispose()\n this.init()\n })\n this.addEventListener('change-strokeColor', ({ value }) => {\n if (!this.options.stroke) { return }\n this.initLineMaterial();\n this.createBorder();\n })\n this.addEventListener('change-strokeOpacity', ({ value }) => {\n if (!this.options.stroke) { return }\n this.initLineMaterial();\n this.createBorder();\n })\n // this.addEventListener('change-strokeWidth', ({ value }) => {\n // this.initLineMaterial();\n // this.createBorder();\n // })\n this.addEventListener('change-airHeight', ({ value }) => {\n this.position.z = value\n })\n this.addEventListener('change-visible', ({ value }) => {\n this.visible = value\n })\n this.addEventListener('change-stroke', ({ value }) => {\n if (value) {\n if (this.line) { return }\n this.initLineGeometry()\n this.initLineMaterial()\n this.createBorder()\n } else if (this.line) {\n this.remove(this.line);\n this.lineGeometry?.dispose()\n }\n })\n }\n\n getCenter() { \n if (this.options.geometry.type === \"point\") { \n return this.position.clone()\n }\n const center = new Vector3()\n const box = new Box3()\n box.setFromObject(this)\n box.getCenter(center)\n return center\n }\n\n getSize() {\n if (this.options.geometry.type === \"point\") { \n return new Vector3(0, 0, 0)\n }\n const box = new Box3()\n const size = new Vector3()\n box.setFromObject(this)\n box.getSize(size)\n return size\n }\n\n getPosition() {\n const center = this.getCenter()\n center.setZ(center.z + this.options.height)\n return center\n }\n\n init() {\n this.geometry = this.initGeometry()\n this.initMaterial()\n this.initMesh()\n this.mesh.position.z = this.options.airHeight + this.options.deltaHeight;\n if (this.options.stroke) {\n // \u521B\u5EFA\u8FB9\u6846\n this.initLineMaterial()\n this.initLineGeometry()\n this.createBorder()\n }\n }\n\n initGeometry() {\n const shape = initShape(\n (this.options.geometry as PolygonGeometry).cds[0],\n (this.options.geometry as PolygonGeometry).cds.slice(1)\n )\n const geometry = new ExtrudeGeometry(shape, {\n steps: 1,\n bevelEnabled: false,\n depth: this.options.height,\n curveSegments: 4,\n });\n return geometry\n }\n\n initMaterial() {\n const material = this.context.materialFactory.createMeshBasicMaterial({\n color: this.options.fillColor,\n opacity: this.options.fillOpacity\n })\n if (this.options.height <= 0.001) {\n this.material = material\n return material\n }\n const material1 = this.context.materialFactory.createMeshBasicMaterial({\n color: darkenColor(this.options.fillColor),\n opacity: this.options.fillOpacity,\n })\n this.material = [material, material1]\n return [material, material1]\n }\n\n initLineMaterial() { \n const lineMaterial = this.context.materialFactory.createLineMaterial({\n color: this.options.strokeColor,\n opacity: this.options.strokeOpacity,\n })\n this.lineMaterial = lineMaterial;\n return lineMaterial\n }\n\n initMesh() {\n if (this.mesh) { \n this.remove(this.mesh)\n }\n this.mesh = new Mesh(this.geometry, this.material)\n this.add(this.mesh)\n }\n\n getBorderPoints() {\n const points = [];\n const height = this.options.height + this.options.deltaHeight\n // \u70B9\u7684\u5750\u6807\u8981\u81EA\u5DF1\u7B97\uFF0C\u53EA\u753B\u5173\u952E\u8282\u70B9\u7684\u5782\u76F4\u7EBFcurveIndex\u662F\u5173\u952E\u8282\u70B9,\u5982\u679C\u662F\u66F2\u7EBF\u6709\u8FD9\u4E2A\u503C\uFF0C\u4E0D\u662F\u66F2\u7EBF\u4E0D\u4E00\u5B9A\u6709\n const { cds } = this.options.geometry as PolygonGeometry\n for (let j = 0; j < cds.length; j++) { \n const curCds = cds[j]\n for (let i = 0; i < curCds.length; i++) {\n const cur = curCds[i];\n const next = i + 1 === curCds.length ? curCds[0] : curCds[i + 1];\n // \u628A\u62C9\u5347\u4E0A\u53BB\u7684\u70B9\u653E\u8FDB\u53BB\n points.push(new Vector3(cur[0], cur[1], height))\n points.push(new Vector3(next[0], next[1], height))\n }\n }\n return points\n }\n\n initLineGeometry() { \n if (this.lineGeometry) { \n this.lineGeometry.dispose()\n }\n const points = this.getBorderPoints()\n const lineGeometry = new BufferGeometry()\n .setFromPoints(points)\n this.lineGeometry = lineGeometry;\n }\n\n createBorder() {\n if (this.line) { \n this.remove(this.line)\n }\n const line = new LineSegments(this.lineGeometry, this.lineMaterial)\n line.position.z = this.options.airHeight + 0.01\n this.line = line;\n this.add(line)\n return line\n }\n\n raycast(raycaster: Raycaster) {\n if (!this.visible) { return false }\n if (this.options.geometry.type === \"point\") { return false }\n const intersects = raycaster.intersectObject(this.mesh)\n if (intersects[0]) {\n const {point: position, distance} = intersects[0]\n return { position, distance }\n }\n return false\n }\n \n dispose() {\n this.geometry.dispose()\n this.line?.geometry.dispose()\n this.clear()\n }\n\n}", "import {\n Object3D, PlaneGeometry, DirectionalLight,\n Mesh, MeshStandardMaterial, ShadowMaterial, Color, Vector3, DoubleSide\n} from 'three';\nimport { dispose, initDirectionalLight } from '../utils'\n\nexport class Shadow extends Object3D {\n\n private directionalLight: DirectionalLight\n\n private plane!: Mesh\n\n public basicOpacity = 0.07\n\n constructor() {\n super()\n this.directionalLight = this.initLight()\n this.initPlane()\n }\n\n // \u521B\u5EFA\u5149\u6E90\n initLight() { \n const directionalLight = initDirectionalLight(0xffffff, 0.5)\n directionalLight.position.set(0, 0, 100);\n this.add(directionalLight);\n return directionalLight\n }\n \n changeLightCamera(size: Vector3) {\n const x = size.x\n const y = size.y\n this.directionalLight.shadow.camera.left = -x;\n this.directionalLight.shadow.camera.right = x;\n this.directionalLight.shadow.camera.top = y;\n this.directionalLight.shadow.camera.bottom = -y;\n this.directionalLight.shadow.camera.near = 0.5;\n this.directionalLight.shadow.camera.far = Math.max(x, y);\n }\n\n changeLightColor(color: number | string) {\n this.directionalLight.color = new Color(color)\n }\n\n setPosition(position: Vector3) {\n this.position.copy(position)\n this.directionalLight.position.set(-position.x / 2, -position.y / 2, 100)\n }\n\n // \u521B\u5EFA\u5E73\u9762\u767D\u8272\n initPlane(width = 1000, height = 1000) { \n const geometry = new PlaneGeometry(width, height)\n const material = new ShadowMaterial({\n transparent: true,\n opacity: 0,\n side: DoubleSide\n })\n const mesh = new Mesh(geometry, material)\n mesh.receiveShadow = true\n mesh.position.z = -10\n this.add(mesh)\n this.plane = mesh\n return mesh\n }\n\n setTarget(target: Object3D) {\n this.directionalLight.target = target\n }\n\n transformOpacity(opacity: number): number {\n return opacity * this.basicOpacity\n }\n\n setOpacity(opacity: number) { \n (this.plane.material as MeshStandardMaterial).opacity = this.transformOpacity(opacity);\n }\n \n dispose() {\n dispose(this, true)\n }\n\n}", "import { proxyOptions, sleepOnePromise } from '../utils';\nimport { EventDispatcher, Object3D, Object3DEventMap, Vector3 } from 'three';\nimport { Context } from '../context'\nimport { Overlay } from './overlay';\n\nexport interface PoiOptions {\n texts: { text: string, styles?: { [key: string]: string }; }[];\n icon?: string;\n icon_size?: [number, number]; // \u5BBD \u9AD8\n level: number; // \u6E32\u67D3\u4F18\u5148\u7EA7\n collision_enable: boolean; // \u662F\u5426\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\n opacity: number;\n id: string; // poi\u7684key\n position: { x: number; y: number; z: number };\n icon_opacity: number;\n icon_border: { color: string, width: number };\n background: string;\n collision_hide_icon: boolean;\n built_in: boolean; // \u662F\u5426\u662F\u5185\u7F6E\u7684poi\n}\n\ntype PoiEventMap = {\n [K in keyof PoiOptions as `change-${K}`]: { value: PoiOptions[K] };\n} & Object3DEventMap;\n\nconst defaultOptions: PoiOptions = {\n texts: [{ text: \"\" }],\n level: 1,\n collision_enable: true,\n opacity: 1,\n id: \"\",\n position: { x: 0, y: 0, z: 0 },\n icon_opacity: 1,\n icon_border: { color: \"#586EE0\", width: 0 },\n background: \"\",\n collision_hide_icon: true,\n built_in: false\n}\n\nexport type PoiOptionsParam = Partial<PoiOptions>\n\nexport class Poi extends EventDispatcher<PoiEventMap> {\n\n private div!: HTMLDivElement\n\n private textDiv!: HTMLDivElement\n\n private img?: HTMLImageElement\n\n private overlay: Overlay\n\n public options: PoiOptions\n\n public visible = true\n\n size = { width: 0, height: 0 }\n\n position = new Vector3()\n\n userData = {};\n\n showTextStatus = true\n\n constructor(private context: Context, options: PoiOptionsParam) {\n super()\n this.options = proxyOptions<PoiOptions, PoiEventMap>({...defaultOptions, ...options}, this)\n this.position.set(options.position?.x || 0, options.position?.y || 0, options.position?.z || 0)\n this.overlay = new Overlay(this.context, { autoUpdate: false })\n this.overlay.addEventListener(\"update-position\", ({x, y, height}) => { \n this.overlay.div.style.transform = `translate3d(calc(${x}px - 50%), calc(${-height + y}px - ${this.options.icon ? '100%' : '50%'}), 0)`;\n })\n this.overlay.bindElement(this as unknown as Object3D)\n this.registryEvent()\n this.initDiv()\n this.addEventListener(\"change-icon\", ({ value }) => {\n if (value) {\n if (!this.img) {\n this.div.appendChild(this.initIcon())\n } else {\n this.img.setAttribute('src', value)\n }\n } else {\n this.img && this.div.removeChild(this.img)\n this.img = undefined\n this._changePosition()\n this.resetSize()\n }\n })\n this.addEventListener(\"change-texts\", ({ value }) => {\n this.div.removeChild(this.textDiv)\n this.div.appendChild(this.initText())\n this.resetSize()\n })\n this.addEventListener(\"change-opacity\", ({ value }) => {\n this.overlay.setOpacity(value)\n })\n this.addEventListener(\"change-icon_size\", ({ value }) => {\n if (this.img) {\n this.img.style.width = `${value?.[0] || 32}px`\n this.img.style.height = `${value?.[1] || 32}px`\n this.resetSize()\n }\n })\n this.addEventListener(\"change-icon_opacity\", ({ value }) => {\n if (this.img) {\n this.img.style.opacity = `${value}`\n }\n })\n this.addEventListener(\"change-icon_border\", ({ value }) => {\n if (this.img) {\n this.img.style.border = `${value.width}px solid ${value.color}`\n }\n })\n this.addEventListener(\"change-background\", ({ value }) => {\n this.div.style.background = value;\n })\n }\n\n get withinDisplayRange() {\n return this.overlay.withinDisplayRange\n }\n\n async resetSize() {\n await sleepOnePromise()\n const { width, height } = this.div.getBoundingClientRect()\n const { boxScale } = this.context.config.poi\n this.size = {\n width: width * boxScale, \n height: height * boxScale\n }\n }\n\n renderHelperBox() {\n const div = document.createElement('div')\n const box = this.getBox()\n div.style.cssText = `position: absolute; top: ${box.top}px;left: ${box.left}px;width: ${box.right - box.left}px;height: ${box.bottom - box.top}px;border: 1px solid red;`\n this.context.container.appendChild(div)\n }\n\n get clientPos() {\n return this.overlay.clientPos\n }\n\n initDiv() {\n const div = document.createElement(\"div\");\n div.appendChild(this.initText())\n if (this.options.icon) { \n div.appendChild(this.initIcon())\n }\n div.style.fontSize = `12px`;\n div.style.textShadow = `#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0`;\n div.style.display = `flex`;\n div.style.flexDirection = `column`;\n div.style.justifyContent = `center`;\n div.style.alignItems = `center`;\n div.style.padding = \"4px\";\n this.overlay.setOpacity(this.options.opacity);\n this.overlay.div.style.pointerEvents = `none`;\n this.overlay.div.style.userSelect = `none`;\n this.overlay.div.appendChild(div)\n this.div = div;\n this._changePosition()\n this.resetSize()\n return div\n }\n\n getPosition() {\n return this.position\n }\n\n initText() {\n const textDiv = document.createElement(\"div\")\n textDiv.appendChild(this.createTextFragment())\n textDiv.style.textAlign = \"center\"\n this.textDiv = textDiv\n return textDiv\n }\n\n createTextFragment() { \n const f = document.createDocumentFragment()\n this.options.texts.forEach(item => { \n const div = document.createElement(\"div\")\n div.style.whiteSpace = 'nowrap';\n if (item.styles) { \n for (let [key, value] of Object.entries(item.styles)) { \n div.style[key as any] = value;\n }\n }\n div.textContent = item.text;\n f.appendChild(div)\n })\n return f\n }\n\n initIcon() {\n const img = document.createElement(\"img\")\n img.setAttribute(\"src\", this.options.icon!)\n img.style.width = `${this.options.icon_size?.[0] || 32}px`\n img.style.height = `${this.options.icon_size?.[1] || 32}px`\n img.style.opacity = `${this.options.icon_opacity}px`\n img.style.borderRadius = '50%';\n if (this.options.icon_border.width) {\n img.style.border = `${this.options.icon_border.width}px solid ${this.options.icon_border.color}`\n }\n img.onload = () => {\n this._changePosition()\n this.resetSize()\n }\n this.img = img\n return img\n }\n\n private _changePosition = () => {\n // this.div.style.transform = `translate3d(-50%, ${this.options.icon ? '-100%' : '-50%'}, 0)`;\n }\n\n registryEvent() {\n // this.context.addEventListener('update', this._changePosition)\n }\n\n unRegistryEvent() {\n // this.context.removeEventListener('update', this._changePosition)\n }\n\n setVisible(visible: boolean) {\n if (visible === this.visible) { return }\n this.visible = visible\n this.changeOverlayVisible(visible)\n }\n\n changeOverlayVisible(visible: boolean) {\n if (visible === this.overlay.visible && this.options.collision_hide_icon) { return }\n if (this.options.collision_hide_icon) {\n this.overlay.visible = visible;\n this.overlay.div.style.visibility = visible ? \"visible\" : \"hidden\"\n } else {\n if (this.showTextStatus === visible) { return }\n console.log(\"visible\", visible)\n this.textDiv.style.display = visible ? \"block\" : \"none\"\n this.showTextStatus = visible\n }\n }\n\n parentSetVisible(visible: boolean) { \n if (!this.visible) { \n return\n }\n this.changeOverlayVisible(visible)\n }\n\n getBox() {\n const { width, height } = this.size\n const { x, y } = this.overlay.clientPos\n return {\n left: x - width / 2,\n right: x + width / 2,\n top: this.options.icon ? y - height : y - height / 2,\n bottom: this.options.icon ? y : y + height / 2,\n }\n }\n\n isContain(x: number, y: number) {\n if (!this.overlay.visible) { return false }\n const box = this.getBox()\n return x >= box.left && x <= box.right && y >= box.top && y <= box.bottom\n }\n\n dispose() {\n this.unRegistryEvent();\n this.div = null as unknown as HTMLDivElement;\n this.textDiv = null as unknown as HTMLDivElement;\n this.img = undefined\n this.overlay.dispose();\n }\n}", "import { Context } from \"../context\";\nimport { Box3, EventDispatcher, Object3D, Vector3 } from \"three\";\nimport { vector3ToDevice } from '../utils'\n\ninterface OverlayOptions {\n autoUpdate: boolean;\n appendToBody: boolean;\n}\n\nconst defaultOptions: OverlayOptions = {\n autoUpdate: true,\n appendToBody: false\n}\n\ninterface OverlayEventMap {\n \"update-position\": {\n x: number;\n y: number;\n width: number;\n height: number;\n }\n}\n\nexport class Overlay extends EventDispatcher<OverlayEventMap> {\n\n public div: HTMLDivElement\n\n private element?: Object3D & { getPosition?: () => Vector3 }\n\n public position = new Vector3()\n\n clientPos = { x: 0, y: 0 }\n\n visible = true\n\n private options: OverlayOptions\n\n constructor(private context: Context, options: Partial<OverlayOptions> = {}) {\n super()\n this.options = { ...defaultOptions, ...options };\n this.registryEvent()\n this.div = this.initDiv()\n if (this.options.appendToBody) {\n document.body.appendChild(this.div)\n } else {\n this.context.container.appendChild(this.div)\n }\n }\n\n initDiv() {\n const div = document.createElement(\"div\")\n div.style.position = \"absolute\";\n return div\n }\n\n bindElement(element: Object3D) {\n this.element = element\n this.onUpdate() \n }\n\n unBindElement() {\n this.element = undefined;\n }\n\n setVisible(visible: boolean, display = 'block') {\n if (visible === this.visible) { return }\n this.div.style.display = visible ? display : 'none'\n this.visible = visible\n }\n\n setOpacity(opacity: number) {\n this.div.style.opacity = `${opacity}`\n }\n\n getPosition() {\n if (this.element) {\n if (typeof this.element.getPosition === \"function\") {\n return this.element.getPosition()\n }\n const box = new Box3().setFromObject(this.element)\n const center = box.getCenter(new Vector3())\n return center\n } else {\n return this.position\n }\n }\n\n get withinDisplayRange() { \n const { x, y } = this.clientPos\n const { width, height } = this.context.clientSize\n return x >=0 && x <= width && y >= 0 && y <= height\n }\n\n onUpdate = () => {\n const vector = this.getPosition()\n const { width, height, x: clientX, y: clientY } = this.context.clientSize\n const { x, y } = vector3ToDevice(vector, this.context.camera, width, height)\n if (this.clientPos.x === x && this.clientPos.y === y) { return }\n this.clientPos = { x, y }\n if (this.options.appendToBody) {\n this.div.style.left = `${clientX}px`\n this.div.style.top = `${clientY + height}px`\n }\n if (this.options.autoUpdate) { \n this.div.style.transform = `translate3d(${x}px, ${-height+y}px, 0)`\n } else {\n this.dispatchEvent({ type: \"update-position\", x, y, width, height })\n }\n }\n\n registryEvent() {\n this.context.addEventListener('update', this.onUpdate)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener('update', this.onUpdate)\n }\n\n dispose() {\n this.unRegistryEvent()\n this.unBindElement()\n this.div?.remove();\n this.div = null as unknown as HTMLDivElement\n }\n}", "import { Context } from \"../context\";\nimport { Box3, Object3D, Vector3 } from \"three\";\nimport { GraphicLayer } from '../layer/graphic-layer'\nimport { PoiLayer } from '../layer/poi-layer'\nimport { Graphic, GraphicOptionsParam } from \"./graphic\";\nimport { Shadow } from \"./shadow\";\nimport { PoiOptionsParam } from \"./poi\";\nimport { HeatmapDataParam, HeatmapElement } from './heatmap'\nimport { Model, ModelOptions } from \"./model\";\n\nexport class Floor extends Object3D {\n \n graphicLayer: GraphicLayer;\n\n poiLayer: PoiLayer;\n\n grounds: Set<Graphic> = new Set();\n\n shadow = new Shadow();\n\n heatmap?: HeatmapElement;\n\n groundUpper = new Object3D();\n\n models = new Object3D()\n\n private groundMaxHeight = 0;\n\n constructor(public context: Context) {\n super()\n this.graphicLayer = new GraphicLayer(this.context);\n this.poiLayer = new PoiLayer(this.context);\n this.groundUpper.add(this.graphicLayer)\n this.groundUpper.add(this.poiLayer)\n this.add(this.groundUpper)\n this.add(this.models)\n }\n\n createGround(options: GraphicOptionsParam) {\n // options.deltaHeight = 0.00001 * this.grounds.size\n const ground = new Graphic(this.context, options)\n this.addGrounds([ground])\n }\n\n addGrounds(grounds: Graphic[]) {\n grounds.forEach(ground => { \n if (!this.grounds.has(ground)) {\n ground.mesh.castShadow = true;\n this.grounds.add(ground)\n this.groundUpper.add(ground)\n }\n })\n this.changeGroundMaxHeight()\n }\n\n changeGroundMaxHeight() { \n const grounds = Array.from(this.grounds)\n this.groundMaxHeight = this.grounds.size > 0 ? Math.max(...grounds.map(ground => ground.options.height + ground.options.airHeight + ground.options.deltaHeight)) : 0\n this.graphicLayer.position.z = this.groundMaxHeight\n this.models.position.z = this.groundMaxHeight\n }\n\n get hasElement() { \n return !!(this.grounds.size || this.graphicLayer.children.length)\n }\n\n getCenter() { \n return new Box3().setFromObject(this.groundUpper).getCenter(new Vector3())\n }\n \n addModel(options: ModelOptions) { \n const model = new Model(this.context, options)\n this.models.add(model)\n return model\n }\n\n addShadow() { \n const box = new Box3().setFromObject(this.groundUpper)\n const center = box.getCenter(new Vector3())\n const size = box.getSize(new Vector3())\n this.shadow.setPosition(center)\n this.shadow.changeLightCamera(size)\n this.add(this.shadow)\n }\n\n addGraphic(graphicOptions: GraphicOptionsParam) {\n return this.graphicLayer.createGraphic(graphicOptions)\n }\n\n addPoi(poiOptions: PoiOptionsParam) {\n return this.poiLayer.createPoi(poiOptions)\n }\n\n addHeatmap(data: HeatmapDataParam) {\n if (!this.heatmap) {\n this.heatmap = new HeatmapElement(this.context)\n this.add(this.heatmap)\n }\n this.heatmap.loadData(data)\n const box = new Box3().setFromObject(this.graphicLayer)\n this.heatmap.position.setZ(box.max.z)\n return this.heatmap\n }\n\n removeHeatMap() {\n if (this.heatmap) {\n this.remove(this.heatmap)\n this.heatmap.dispose()\n this.heatmap = undefined\n }\n }\n\n setShadowOpacity(opacity: number) {\n this.shadow.setOpacity(opacity)\n }\n\n setShadowVisible(visible: boolean) {\n this.shadow.visible = visible;\n }\n\n dispose() {\n this.shadow.dispose();\n this.graphicLayer.dispose()\n this.poiLayer.dispose()\n this.grounds.forEach(ground => ground.dispose())\n this.heatmap?.dispose()\n this.groundUpper.clear()\n this.models.children.forEach((model) => (model as unknown as Model).dispose())\n this.models.clear()\n this.clear()\n }\n\n}", "import { Graphic, GraphicOptionsParam } from \"../elements\";\nimport { Box3, Raycaster, Vector3 } from \"three\";\nimport { Layer } from \"./layer\";\nimport { Context } from \"../context\";\n\nexport class GraphicLayer extends Layer {\n\n graphicMap = new Map<string, Graphic>()\n\n constructor(context: Context) {\n super(context)\n }\n\n getCenter(): Vector3 { \n const box = new Box3().setFromObject(this)\n return box.getCenter(new Vector3())\n }\n\n createGraphic(options: GraphicOptionsParam) {\n // options.deltaHeight = 0.00001 * this.graphicMap.size;\n const graphic = new Graphic(this.context, options)\n this.add(graphic)\n this.graphicMap.set(options.id!, graphic)\n return graphic\n }\n\n removeGraphic(graphic: Graphic) { \n this.remove(graphic)\n this.graphicMap.delete(graphic.options.id!)\n graphic.dispose()\n }\n\n removeGraphicById(id: string) {\n if (this.graphicMap.has(id)) {\n this.removeGraphic(this.graphicMap.get(id)!)\n }\n }\n\n getGraphicByNodeId(id: string) {\n return this.graphicMap.get(id) || null\n }\n\n /**\n * \u83B7\u53D6\u5C04\u7EBF\u76F8\u4EA4\u7684\u5143\u7D20\n * @param raycaster \n */\n getGraphicByRaycaster(raycaster: Raycaster): { graphics: Graphic[], position: Vector3 | null } {\n const initData: {\n position: Vector3 | null,\n graphic: Graphic | null,\n distance: number\n } = { distance: 10000, graphic: null, position: null }\n const data = this.children.reduce((res, item) => {\n if (item instanceof Graphic) {\n const pos = item.raycast(raycaster)\n if (pos) {\n const { distance } = pos\n if (distance < res.distance) {\n return {\n distance: res.distance,\n position: res.position,\n graphic: item\n }\n }\n }\n return res\n } else {\n return res\n }\n }, initData)\n if (data === initData) {\n return { graphics: [], position: null }\n }\n return { graphics: [data.graphic!], position: data.position }\n }\n}", "import { Context } from \"../context\";\nimport { Object3D } from \"three\";\nimport { dispose } from '../utils'\n\nexport class Layer extends Object3D {\n constructor(public context: Context) {\n super();\n }\n\n dispose() {\n dispose(this)\n this.clear()\n }\n}", "import { Poi, PoiOptionsParam } from \"../elements\";\nimport { Layer } from \"./layer\";\nimport { Context } from '../context'\nimport { debounce } from 'lodash'\nimport { Timer } from \"../utils\";\n\nexport class PoiLayer extends Layer {\n pois: Poi[] = []\n debounceCollisionDetection: () => void\n\n timer = new Timer()\n \n constructor(context: Context) {\n super(context)\n this.registryEvent()\n this.debounceCollisionDetection = debounce(this.collisionDetection, 10)\n }\n\n clear(force = false) {\n this.pois.forEach(item => {\n if (item.options.built_in && !force) { \n return\n }\n item.dispose()\n })\n this.pois = force ? [] : this.pois.filter(item => item.options.built_in)\n return this\n }\n\n createPoi(options: PoiOptionsParam) {\n const poi = new Poi(this.context, options)\n this.pushPoi(poi)\n poi.addEventListener(\"change-level\", () => this.changePoiLevelOrCollisionEnable(poi))\n poi.addEventListener(\"change-collision_enable\", () => this.changePoiLevelOrCollisionEnable(poi))\n Promise.resolve().then(() => { \n this.debounceCollisionDetection()\n })\n return poi\n }\n\n changePoiLevelOrCollisionEnable(poi: Poi) {\n const index = this.pois.findIndex(item => item === poi)\n if (index === -1) { return }\n this.pois.splice(index, 1)\n this.pushPoi(poi)\n }\n\n removePoi(poi: Poi) {\n const index = this.pois.findIndex(item => item === poi)\n if (index === -1) { return }\n this.pois.splice(index, 1)\n poi.dispose()\n }\n\n removePoiById(id: string) {\n const poi = this.pois.find(item => item.options.id === id)\n if (poi) {\n this.removePoi(poi)\n }\n }\n\n getPoiById(id: string) { \n const poi = this.pois.find(item => item.options.id === id)\n return poi || null\n }\n\n /**\n * \u4FDD\u5B58poi\u6309\u7167level\u6392\u5E8F\n * @param poi \n */\n pushPoi(poi: Poi) {\n // \u4E0D\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\u7684\u5728\u6700\u524D\u9762\n if (!poi.options.collision_enable) {\n this.pois.unshift(poi)\n return\n }\n // level\u6700\u5C0F\u7684\u5728\u6700\u540E\u9762\n if (poi.options.level === 0) {\n this.pois.push(poi)\n return\n }\n for (let i = 0; i < this.pois.length; i++) {\n const item = this.pois[i]\n // \u4E0D\u53C2\u4E0E\u78B0\u649E\u68C0\u6D4B\u7684\u5728\u524D\u9762\n if (!item.options.collision_enable) { \n continue\n }\n if (item.options.level <= poi.options.level) {\n this.pois.splice(i, 0, poi)\n return\n }\n }\n // \u63D2\u5165\u5230\u6700\u540E\n this.pois.push(poi) \n }\n\n getPoiByDeviceXy(x: number, y: number) {\n const pois = this.pois.filter(item => {\n return (item instanceof Poi) && item.isContain(x, y)\n })\n return pois\n }\n\n onUpdate = () => { \n this.timer.requestAnimationFrame(() => { \n this.collisionDetection()\n })\n }\n\n /**\n * \u78B0\u649E\u68C0\u6D4B\n */\n collisionDetection() {\n const range: { left: number; right: number; top: number; bottom: number; }[] = []\n // \u6392\u9664\u5728\u5C4F\u5E55\u5916\u7684poi\n const pois = this.pois.filter(item => {\n if (item.visible && item.withinDisplayRange) {\n return true\n } else {\n item.parentSetVisible(false)\n }\n })\n pois.forEach((item, index) => {\n const { left, right, top, bottom } = item.getBox()\n if (index === 0) {\n range.push({ left, right, top, bottom })\n // item.renderHelperBox()\n return\n }\n // valid boolean \u8868\u793A\u53D1\u751F\u4E86\u78B0\u649E\n const valid = range.some((box) => { \n // \u5224\u65AD\u56DB\u4E2A\u70B9\u662F\u4E0D\u662F\u90FD\u4E0D\u5728box\u7684\u8303\u56F4\u5185\n const xIntersect = (right < box.right && right > box.left) ||\n (left > box.left && left < box.right) ||\n (left === box.left && right === box.right);\n if (xIntersect) {\n const yIntersect = (bottom <= box.bottom && bottom > box.top) || (top >= box.top && top < box.bottom) \n return yIntersect\n } \n return false\n })\n item.parentSetVisible(!valid)\n if (!valid) { \n range.push({ left, right, top, bottom })\n // item.renderHelperBox()\n }\n })\n }\n\n registryEvent() {\n this.context.addEventListener('update', this.onUpdate)\n }\n\n unRegistryEvent() { \n this.context.removeEventListener('update', this.onUpdate)\n }\n \n dispose() {\n this.timer.dispose()\n this.pois.forEach(item => item.dispose())\n this.pois.length = 0;\n this.debounceCollisionDetection = () => { }\n super.dispose()\n this.unRegistryEvent()\n }\n}", "import { Context } from \"../context\";\nimport {\n MeshBasicMaterial, Object3D, PlaneGeometry,\n Texture, DoubleSide, Mesh, Matrix3, Vector2\n} from \"three\";\nimport { create, Heatmap, HeatmapData, DataPoint } from '@mars3d/heatmap.js'\nimport { featureCollection, point, bbox, center as getCenter } from '@turf/turf'\n\ntype V = 'value'\ntype X = 'x'\ntype Y = 'y'\n\nexport type HeatmapDataParam = HeatmapData<DataPoint<V, X, Y>>\n\nexport class HeatmapElement extends Object3D {\n\n private heatmap?: Heatmap<V, X, Y>;\n\n private div: HTMLDivElement\n\n private plane?: Mesh;\n\n constructor(private context: Context) {\n super()\n this.div = document.createElement(\"div\")\n }\n\n clearHeatmap() {\n if (this.div.firstChild) {\n this.div.removeChild(this.div.firstChild)\n }\n this.heatmap = undefined;\n }\n\n loadData(data: HeatmapDataParam) {\n this.clearHeatmap()\n const { width, height, leftTop, center } = this.getBox(data)\n this.heatmap = create({\n width: width,\n height: height,\n container: this.div,\n ...this.context.config.heatMap,\n } as any);\n this.heatmap.setData(this.transformData(data, leftTop))\n this.initPlane(width, height)\n this.position.set(center[0], center[1], this.position.z)\n }\n\n initPlane(width: number, height: number) {\n if (this.plane) { this.remove(this.plane) }\n const geometry = new PlaneGeometry(width, height)\n const texture = new Texture(this.div.firstChild as HTMLCanvasElement);\n texture.needsUpdate = true;\n const material = new MeshBasicMaterial({\n transparent: true,\n side: DoubleSide,\n map: texture,\n });\n material.needsUpdate = true;\n this.plane = new Mesh(geometry, material)\n this.add(this.plane)\n }\n\n getTransMatrix({ x, y }: { x: number, y: number }) {\n // \u5148\u628A\u5DE6\u4E0A\u89D2\u5E73\u79FB\u523000\u70B9\uFF0C\u7136\u540E\u5BF9y\u8F74\u53D6\u53CD\n return new Matrix3().makeScale(1, -1).multiply(new Matrix3().makeTranslation(0 - x, 0 - y))\n }\n\n /**\n * \u6240\u6709\u70B9\u7684\u5750\u6807\u51CF\u53BB\u5DE6\u4E0A\u89D2\u4ECE00\u70B9\u5F00\u59CB\u753Bcanvas\n * @param data \n * @param leftTop \n * @returns \n */\n transformData(data: HeatmapDataParam, leftTop: { x: number, y: number }): HeatmapDataParam {\n const matrix = this.getTransMatrix(leftTop)\n const $data = data.data.map(item => { \n const vector = new Vector2(item.x, item.y).applyMatrix3(matrix)\n return {\n x: vector.x,\n y: vector.y,\n value: item.value\n }\n })\n return {\n data: $data,\n max: data.max,\n min: data.min\n }\n }\n\n getBox(data: HeatmapDataParam) {\n const features = featureCollection(data.data.map(item => point([item.x, item.y])))\n // \u8FD4\u56DE\u4E00\u4E2A\u77E9\u5F62\u8FB9\u6846\u5750\u6807\n const box = bbox(features);\n const width = box[2] - box[0]\n const height = box[3] - box[1]\n const leftTop = { x: box[0], y: box[3] }\n const center = getCenter(features)\n return { width, height, leftTop, center: center.geometry.coordinates }\n }\n\n dispose() {\n this.div = null as unknown as HTMLDivElement\n this.heatmap = undefined\n }\n}", "import { Box3, Object3D, Vector3 } from \"three\";\nimport { Context } from \"../context\";\nimport { loadModel, dispose } from \"../utils\";\nimport { Poi } from \"./poi\";\nimport { GLTF } from \"three/examples/jsm/loaders/GLTFLoader\";\n\nexport interface ModelOptions {\n modelUrl: string;\n icon?: string;\n icon_size?: [number, number];\n position?: Vector3;\n}\n\nexport class Model extends Object3D {\n poi: Poi | null = null;\n\n model: GLTF | null = null\n\n constructor(public context: Context, private options: ModelOptions) {\n super()\n this.position.copy(options.position || new Vector3(0, 0, 0))\n this.loadModel()\n }\n \n async loadModel() { \n const object = await loadModel(this.options.modelUrl);\n object.scene.rotation.set(Math.PI / 2, Math.PI / 2, 0)\n this.add(object.scene)\n this.model = object\n this.initPoi()\n }\n\n initPoi() {\n if (!this.options.icon) {\n return\n }\n const poi = this.context.currentFloor?.addPoi({\n icon: this.options.icon,\n icon_size: this.options.icon_size,\n built_in: true,\n level: 0\n })\n this.poi = poi || null\n if (this.model && poi) {\n poi.position = (new Box3().setFromObject(this)).getCenter(new Vector3())\n }\n }\n\n dispose() {\n dispose(this)\n this.model = null\n if (this.poi) {\n this.context.currentFloor?.poiLayer.removePoi(this.poi)\n this.poi = null;\n }\n }\n}", "import { Context } from \"../context\";\nimport { EventDispatcher, Vector3 } from \"three\";\nimport { createSvg, vector3ToDevice } from '../utils'\n\nexport class BaseSvg<T extends {} = {}> extends EventDispatcher<T> {\n protected points: Vector3[] = [];\n\n protected svg: SVGElement;\n\n protected enable = true;\n\n constructor(public context: Context) {\n super()\n this.svg = createSvg(`${context.container.clientWidth}`, `${context.container.clientHeight}`)\n context.container.appendChild(this.svg)\n this._registryEvent()\n }\n\n private _onResize = ({ width, height }: { width: number; height: number }) => {\n if (this.svg) {\n this.svg.setAttribute(\"width\", `${width}`)\n this.svg.setAttribute(\"height\", `${height}`)\n }\n }\n\n private _registryEvent() {\n this.context.addEventListener(\"resize\", this._onResize)\n }\n\n private _unRegistryEvent() { \n this.context.removeEventListener(\"resize\", this._onResize)\n }\n\n setEnable(enable: boolean) {\n this.enable = enable;\n if (enable) {\n this.svg.style.display = 'block';\n } else {\n this.svg.style.display = 'none';\n }\n }\n\n getIntersectByPointerEvent(e: PointerEvent) {\n const { camera, renderer } = this.context\n const { offsetX: x, offsetY: y } = e\n const { clientWidth, clientHeight } = renderer.domElement;\n const nx = x / clientWidth * 2 - 1;\n const ny = 1 - y / clientHeight * 2;\n\n const v = new Vector3(nx, ny, 0);\n\n return v.unproject(camera);\n }\n\n getSvgCoordinate(vector: Vector3) {\n const { camera, container } = this.context\n const coord = vector3ToDevice(vector, camera, container.clientWidth, container.clientHeight)\n return coord\n }\n \n dispose() {\n this._unRegistryEvent()\n this.context.container.removeChild(this.svg)\n this.svg = null as unknown as SVGElement\n }\n}", "import { Context } from \"../context\";\nimport { Vector3 } from \"three\";\nimport { setCirclePosition, createCircle, createLine, setLineStartEnd } from '../utils'\nimport { BaseSvg } from './base-svg'\n\ninterface SvgLineEventMap {\n 'distance': { distance: number }\n}\n\nexport class SvgLine extends BaseSvg<SvgLineEventMap> {\n\n private circles: SVGElement[] \n \n private line: SVGElement\n\n constructor(public context: Context) {\n super(context)\n const { config: { svg: { circle, line } } } = context\n this.circles = [createCircle(circle.radius, circle.fill), createCircle(circle.radius, circle.fill)]\n this.line = createLine(line.stroke)\n this.svg.appendChild(this.circles[0]);\n this.svg.appendChild(this.circles[1]);\n this.svg.appendChild(this.line);\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.addEventListener(\"pointermove\", this.onPointermove)\n this.context.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.addEventListener(\"pointerdown\", this.onPointerdown)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.context.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerdown)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (this.points[0]) {\n const point1 = this.getSvgCoordinate(this.points[0])\n setCirclePosition(this.circles[0], point1.x, point1.y)\n setLineStartEnd(this.line, point1)\n }\n if (this.points[1]) {\n const point2 = this.getSvgCoordinate(this.points[1])\n setCirclePosition(this.circles[1], point2.x, point2.y)\n setLineStartEnd(this.line, undefined, point2)\n }\n }\n \n \n onPointermove = (e: PointerEvent) => { \n // \u53EA\u5728\u6709\u7B2C\u4E00\u4E2A\u70B9\u7684\u65F6\u5019\u9700\u8981\n if (this.points.length !== 1) { return }\n this.line.style.display = \"block\";\n setLineStartEnd(this.line, undefined, { x: e.offsetX, y: e.offsetY })\n }\n \n onPointerleave = () => { \n if (this.points[1]) { return } // \u5982\u679C\u5DF2\u7ECF\u6709\u4E24\u4E2A\u70B9\u4E86\u5C31\u4E0D\u505A\u5904\u7406\n this.line.style.display = \"none\";\n }\n \n onPointerdown = (e: PointerEvent) => {\n if (this.points[1]) { return } // \u5982\u679C\u5DF2\u7ECF\u6709\u4E24\u4E2A\u70B9\u4E86\u5C31\u4E0D\u505A\u5904\u7406\n const point = this.getIntersectByPointerEvent(e)\n if (point) {\n const { offsetX: x, offsetY: y } = e\n // \u4FEE\u6539\u70B9\n const circle = this.circles[this.points.length]\n setCirclePosition(circle, x, y)\n if (!this.points.length) { \n // \u8BBE\u7F6E\u7EBF\u7684\u8D77\u59CB\u70B9\n setLineStartEnd(this.line, { x, y }, { x, y })\n }\n this.addPoint(point)\n }\n }\n\n addPoint(vector: Vector3) {\n this.points.push(vector)\n if (this.points.length >= 2) {\n const distance = this.calculatedDistance()\n this.dispatchEvent({ type: 'distance', distance })\n }\n }\n\n /**\n * \u8BA1\u7B97\u4E24\u4E2A\u70B9\u4E4B\u95F4\u7684\u8DDD\u79BB\n */\n calculatedDistance() { \n const [{ x: x1, y: y1 }, { x: x2, y: y2 }] = this.points\n return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n }\n \n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.line = null as unknown as SVGElement\n this.circles = []\n }\n}", "import { Context } from \"../context\";\nimport { BaseSvg } from \"./base-svg\";\nimport { setCirclePosition, setLineStartEnd, createLine, createCircle } from '../utils'\nimport { Vector3 } from \"three\";\n\ninterface SvgPolygonEventMap {\n 'area': { area: number }\n}\n\nexport class SvgPolygon extends BaseSvg<SvgPolygonEventMap> {\n\n private circles: SVGElement[] = []\n\n private lines: SVGElement[] = []\n\n private isClose = false\n\n constructor(context: Context) {\n super(context)\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n private get lastLine() {\n return this.lines.slice(-1)[0]\n }\n\n private addCircle(circle: SVGElement) {\n this.circles.push(circle)\n this.svg.appendChild(circle)\n }\n\n private addLine(line: SVGElement) {\n this.lines.push(line)\n this.svg.appendChild(line)\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.addEventListener(\"pointermove\", this.onPointermove)\n this.context.container.addEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.addEventListener(\"pointerdown\", this.onPointerdown)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerenter\", this.onPointermove)\n this.context.container.removeEventListener(\"pointermove\", this.onPointermove)\n this.context.container.removeEventListener(\"pointerleave\", this.onPointerleave)\n this.context.container.removeEventListener(\"pointerdown\", this.onPointerdown)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (this.points.length) {\n this.points.forEach((point, index) => {\n const devicePoint = this.getSvgCoordinate(point)\n if (this.circles[index]) {\n setCirclePosition(this.circles[index], devicePoint.x, devicePoint.y)\n }\n if (index !== 0) {\n setLineStartEnd(this.lines[index - 1], undefined, devicePoint)\n }\n if (this.lines[index]) {\n setLineStartEnd(this.lines[index], devicePoint)\n }\n }) \n }\n }\n \n \n onPointermove = (e: PointerEvent) => { \n // \u5FC5\u987B\u8981\u6709\u4E00\u4E2A\u70B9\u5E76\u4E14\u8FD8\u6CA1\u6709\u95ED\u5408\u624D\u9700\u8981\u5904\u7406\n if (!this.lastLine || this.isClose) { return }\n this.lastLine.style.display = \"block\";\n setLineStartEnd(this.lastLine, undefined, { x: e.offsetX, y: e.offsetY })\n }\n \n onPointerleave = () => { \n // \u5982\u679C\u5DF2\u7ECF\u95ED\u5408\u4E86\u5C31\u4E0D\u9700\u8981\u5904\u7406\u4E86\n if (this.isClose) { return } \n this.lastLine.style.display = \"none\";\n }\n \n onPointerdown = (e: PointerEvent) => {\n // \u5982\u679C\u5DF2\u7ECF\u95ED\u5408\u4E86\n if (this.isClose) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) {\n const { offsetX: x, offsetY: y } = e\n if (this.checkAdsorb(x, y)) {\n this.isClose = true\n this.addPoint(this.points[0])\n } else {\n this.addPoint(point)\n }\n const { circle: { fill, radius }, line: { stroke } } = this.context.config.svg\n if (!this.isClose) {\n // \u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u70B9\n const circle = createCircle(radius, fill)\n setCirclePosition(circle, x, y)\n this.addCircle(circle)\n }\n if (this.lines.length) {\n // \u5982\u679C\u5DF2\u7ECF\u6709\u4E00\u6761\u7EBF\u4E86 \u8981\u95ED\u5408\u8FD9\u6761\u7EBF\n setLineStartEnd(this.lastLine, undefined, { x, y })\n }\n // \u5982\u679C\u8FD9\u4E2A\u591A\u8FB9\u5F62\u8FD8\u6CA1\u6709\u95ED\u5408 \u5C31\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u7EBF \u5305\u62EC\u521B\u5EFA\u7B2C\u4E00\u6761\u7EBF\n if (!this.isClose) {\n const line = createLine(stroke)\n // \u8BBE\u7F6E\u7EBF\u7684\u8D77\u59CB\u70B9\n setLineStartEnd(line, { x, y }, { x, y })\n this.addLine(line)\n }\n }\n }\n\n /**\n * \u68C0\u6D4B\u662F\u5426\u53EF\u4EE5\u5438\u9644\n * \u5750\u6807\u70B9\u6700\u5C113\u4E2A \u4F20\u5165\u7684\u5750\u6807\u70B9\u548C\u7B2C\u4E00\u4E2A\u5750\u6807\u7684\u50CF\u7D20\u76F8\u5DEE\u4E0D\u8D85\u8FC75\u4E2A\u50CF\u7D20\n */\n checkAdsorb(x: number, y: number) {\n if (this.points.length < 3) { return false }\n const circle = this.circles[0]\n const cx = +circle.getAttribute(\"cx\")!\n const cy = +circle.getAttribute(\"cy\")!\n return Math.sqrt((x - cx) ** 2 + (y - cy) ** 2) <= 5\n }\n\n addPoint(vector: Vector3) {\n this.points.push(vector)\n if (this.isClose) {\n const area = this.calculatedArea()\n this.dispatchEvent({ type: 'area', area })\n }\n }\n // \u8BA1\u7B97\u9762\u79EF\n calculatedArea() {\n const cds = this.points.map(item => [item.x, item.y])\n let area = 0\n const numPoints = cds.length\n for (let i = 0; i < numPoints; i++) {\n const j = (i + 1) % numPoints\n area += (cds[i][0] * cds[j][1] - cds[j][0] * cds[i][1])\n }\n return Math.abs(area / 2)\n }\n\n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.lines = []\n this.circles = []\n }\n}", "import { Context } from \"../context\";\nimport { Box3 } from \"three\";\nimport { vector3ToDevice, createRect, setRectPosition } from '../utils'\nimport { BaseSvg } from './base-svg'\nimport { Graphic } from \"./graphic\";\n\ninterface SvgLineEventMap {\n 'distance': { distance: number }\n}\n\nexport class SelectBox extends BaseSvg<SvgLineEventMap> {\n\n private rect!: SVGElement\n\n private cornerRect: SVGElement[] = [] // \u56DB\u4E2A\u89D2\u4E0A\u7684\u65B9\u5757\n\n private centerRect: SVGElement[] = [] // \u56DB\u4E2A\u7EBF\u4E2D\u95F4\u7684\u65B9\u5757\n\n private graphic?: Graphic\n\n constructor(public context: Context) {\n super(context)\n const { config: { svg: { line } } } = context\n this.rect = createRect(line.stroke, \"transparent\")\n this.svg.appendChild(this.rect)\n for (let i = 0; i < 4; i++) {\n this.cornerRect[i] = createRect(line.stroke, \"#ffffff\")\n this.centerRect[i] = createRect(line.stroke, \"#ffffff\")\n this.svg.appendChild(this.cornerRect[i])\n this.svg.appendChild(this.centerRect[i])\n }\n this.registryEvent()\n }\n\n setEnable(enable: boolean) {\n super.setEnable(enable)\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n registryEvent() { \n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n onUpdate = () => {\n if (!this.graphic) {\n setRectPosition(this.rect, 0, 0, 0, 0)\n for (let i = 0; i < this.cornerRect.length; i++) {\n setRectPosition(this.cornerRect[i], 0, 0, 0, 0)\n setRectPosition(this.centerRect[i], 0, 0, 0, 0)\n }\n } else {\n const box = new Box3().setFromObject(this.graphic)\n const { camera, container: { clientWidth: w, clientHeight: h } } = this.context\n const { min, max } = box\n const leftBottom = vector3ToDevice(min, camera, w, h)\n const rightTop = vector3ToDevice(max, camera, w, h)\n // \u753B\u51FA\u4E00\u4E2A\u6846\u6765\n setRectPosition(this.rect, leftBottom.x, rightTop.y, Math.abs(rightTop.x - leftBottom.x), Math.abs(rightTop.y - leftBottom.y))\n // \u56DB\u4E2A\u89D2\u7684\u4F4D\u7F6E\n const { x: left, y: bottom } = leftBottom\n const { x: right, y: top } = rightTop\n const halfWidth = 5;\n const corners = [\n { x: left - halfWidth, y: top - halfWidth }, // \u5DE6\u4E0A\u89D2\n { x: right - halfWidth, y: top - halfWidth }, // \u53F3\u4E0A\u89D2\n { x: left - halfWidth, y: bottom - halfWidth }, // \u5DE6\u4E0B\u89D2\n { x: right - halfWidth, y: bottom - halfWidth }, // \u53F3\u4E0B\u89D2 \n ]\n for (let i = 0; i < corners.length; i++) {\n setRectPosition(this.cornerRect[i], corners[i].x, corners[i].y, halfWidth * 2, halfWidth * 2)\n }\n // \u56DB\u4E2A\u4E2D\u95F4\u7684\u4F4D\u7F6E\n const centerHalfWidth = 4;\n const centerX = (left + right) / 2\n const centerY = (bottom + top) / 2\n const centers = [\n { x: centerX - centerHalfWidth, y: top - centerHalfWidth }, // \u4E0A\n { x: left - centerHalfWidth, y: centerY - centerHalfWidth }, // \u5DE6\n { x: right - centerHalfWidth, y: centerY - centerHalfWidth }, // \u53F3\n { x: centerX - centerHalfWidth, y: bottom - centerHalfWidth }, // \u4E0B\n ]\n for (let i = 0; i < centers.length; i++) {\n setRectPosition(this.centerRect[i], centers[i].x, centers[i].y, centerHalfWidth * 2, centerHalfWidth * 2)\n }\n }\n }\n \n selectGraphic(graphic: Graphic) { \n this.graphic = graphic\n }\n\n dispose() {\n super.dispose()\n this.unRegistryEvent()\n this.rect = null as unknown as SVGElement\n this.cornerRect = []\n this.centerRect = []\n }\n}", "import { createRect, isContain, setRectPosition, vector3ToDevice } from \"../../utils\";\nimport { Context } from \"../../context\";\nimport { BaseSvg, Graphic } from \"../../elements\";\nimport { Frustum, Vector3 } from \"three\";\n\ninterface BoxSelectionEventMap { \n \"selected\": {\n list: Graphic[]\n }\n}\n\nexport class BoxSelection extends BaseSvg<BoxSelectionEventMap> {\n\n private startPoint?: Vector3;\n\n private endPoint?: Vector3;\n\n rect: SVGElement;\n\n frustum = new Frustum();\n\n constructor(context: Context) { \n super(context);\n const { config: { selectBox: { fill, stroke } } } = context\n this.rect = createRect(stroke, fill)\n this.svg.appendChild(this.rect)\n this.registryEvent()\n }\n\n setEnable(enable: boolean): void {\n super.setEnable(enable)\n setRectPosition(this.rect, 0, 0, 0, 0)\n if (enable) {\n this.registryEvent()\n } else {\n this.startPoint = undefined\n this.unRegistryEvent()\n }\n }\n\n onPointerDown = (e: PointerEvent) => { \n if (!this.enable) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.startPoint = point\n }\n this.endPoint = undefined;\n }\n\n onPointerMove = (e: PointerEvent) => { \n if (!this.enable || !this.startPoint) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.endPoint = point\n }\n }\n\n onPointerUp = (e: PointerEvent) => { \n if (!this.enable) { return }\n const point = this.getIntersectByPointerEvent(e)\n if (point) { \n this.endPoint = point\n }\n this.doSelect()\n this.startPoint = undefined\n }\n\n onUpdate = () => {\n if (this.startPoint) {\n const startPoint = this.getSvgCoordinate(this.startPoint)\n let endPoint = { ...startPoint }\n if (this.endPoint) {\n endPoint = this.getSvgCoordinate(this.endPoint)\n }\n const leftTop = { x: Math.min(startPoint.x, endPoint.x), y: Math.min(startPoint.y, endPoint.y) }\n const width = Math.abs(endPoint.x - startPoint.x)\n const height = Math.abs(endPoint.y - startPoint.y)\n setRectPosition(this.rect, leftTop.x, leftTop.y, width, height)\n } else {\n setRectPosition(this.rect, 0, 0, 0, 0)\n }\n }\n\n registryEvent() { \n this.context.container.addEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.addEventListener(\"pointermove\", this.onPointerMove)\n this.context.container.addEventListener(\"pointerup\", this.onPointerUp)\n this.context.addEventListener(\"update\", this.onUpdate)\n }\n \n unRegistryEvent() { \n this.context.container.removeEventListener(\"pointerdown\", this.onPointerDown)\n this.context.container.removeEventListener(\"pointermove\", this.onPointerMove)\n this.context.container.removeEventListener(\"pointerup\", this.onPointerUp)\n this.context.removeEventListener(\"update\", this.onUpdate)\n }\n\n doSelect() { \n if (this.startPoint && this.endPoint) {\n const dis = this.startPoint.distanceTo(this.endPoint);\n if (dis < 0.1) { return }\n const { context: { camera, container: { clientWidth: w, clientHeight: h } } } = this\n const startDevice = vector3ToDevice(this.startPoint!, camera, w, h)\n const endDevice = vector3ToDevice(this.endPoint!, camera, w, h)\n const leftTop = { x: Math.min(startDevice.x, endDevice.x), y: Math.min(startDevice.y, endDevice.y) }\n const rightBottom = { x: Math.max(startDevice.x, endDevice.x), y: Math.max(startDevice.y, endDevice.y) }\n const list = this.searchMapInFrustum(leftTop, rightBottom);\n this.dispatchEvent({ type: \"selected\", list })\n }\n }\n\n searchMapInFrustum(leftTop: { x: number, y: number }, rightBottom: { x: number, y: number }): Graphic[] {\n const { context } = this\n return context.currentFloor?.graphicLayer.children.filter(item => {\n return item instanceof Graphic && this.searchChildInFrustum(item, leftTop, rightBottom)\n }) as Graphic[] || []\n }\n\n searchChildInFrustum(object: Graphic, leftTop: { x: number, y: number }, rightBottom: { x: number, y: number }): boolean {\n const { context: { camera, container: { clientWidth: w, clientHeight: h } } } = this\n if (!object) return false;\n if (!object.mesh) { \n // \u70B9\n const position = object.getPosition()\n if (position) {\n const position2d = vector3ToDevice(position, camera, w, h)\n return isContain(position2d, leftTop, rightBottom)\n }\n return false\n }\n if (!object.mesh.geometry.boundingBox) {\n object.mesh.geometry.computeBoundingBox();\n }\n const box = object.mesh.geometry.boundingBox;\n if (!box) { return false }\n const { min, max } = box\n const minDevice = vector3ToDevice(min, camera, w, h)\n const maxDevice = vector3ToDevice(max, camera, w, h)\n \n if (!isContain(minDevice, leftTop, rightBottom)) { return false }\n if (!isContain(maxDevice, leftTop, rightBottom)) { return false; }\n return true;\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}\n\n", "import { Graphic, Poi } from \"../../elements\";\nimport { Context } from \"../../context\";\nimport { EventDispatcher } from \"three\";\nimport { Timer } from \"../../utils\";\n\ninterface HoverHelperEventMap {\n \"hover-change\": {\n graphics: Graphic[]\n },\n}\n\nexport class HoverHelper extends EventDispatcher<HoverHelperEventMap> { \n\n curGraphics = new Set<Graphic>()\n\n timer = new Timer()\n\n graphicTimerMap = new Map<Graphic, number>()\n \n constructor(private context: Context) {\n super()\n this.registryEvent()\n }\n\n onPointerMove = ({ graphics, pois }: { graphics: Graphic[], pois: Poi[] }) => {\n const poiGraphics = pois\n .map(item => this.context.currentFloor?.graphicLayer.graphicMap.get(item.options.id))\n .filter(graphic => graphic && graphic.options.geometry.type === \"point\") as Graphic[]\n if (!graphics.length && !poiGraphics && this.curGraphics.size) {\n this.curGraphics.clear()\n this.handleHoverGraphicsChange()\n return\n }\n const { time } = this.context.config.hover\n const allGraphics = new Set(graphics)\n if (!allGraphics.size) { \n poiGraphics.forEach(graphic => { \n allGraphics.add(graphic)\n })\n }\n allGraphics.forEach((graphic) => {\n // \u5982\u679C\u5DF2\u7ECF\u6709hover\u7684\u5B9A\u65F6\u5668\u5728\u6267\u884C\u4E86\u5C31\u8FD4\u56DE\n if (this.graphicTimerMap.get(graphic)) { \n return\n }\n // \u5982\u679C\u8FD9\u4E2A\u5143\u7D20\u7684hover\u5DF2\u7ECF\u89E6\u53D1\u8FC7\u4E86\u5C31\u8FD4\u56DE\n if (this.curGraphics.has(graphic)) { \n return\n }\n // \u8FD9\u4E2A\u5143\u7D20\u6CA1\u6709\u89E6\u53D1\u8FC7\u4E5F\u6CA1\u6709\u5B9A\u65F6\u5668\u5C31\u6DFB\u52A0\u4E00\u4E2A\u5B9A\u65F6\u5668\n const timer = this.timer.setTimeout(() => {\n this.curGraphics.add(graphic)\n this.handleHoverGraphicsChange()\n }, time)\n this.graphicTimerMap.set(graphic, timer)\n })\n // \u5982\u679C\u5B9A\u65F6\u5668\u7684\u5143\u7D20\u4E0D\u5B58\u5728\u5728\u5F53\u524Dgraphics\u4E2D\u4E86\u5C31\u5220\u9664\n this.graphicTimerMap.forEach((timer, graphic) => { \n if (!allGraphics.has(graphic)) { \n this.timer.clearTimeout(timer)\n this.graphicTimerMap.delete(graphic)\n }\n })\n // \u5982\u679C\u5DF2\u7ECFhover\u7684\u5143\u7D20\u4E0D\u5B58\u5728\u5728\u5F53\u524D\u7684graphics\u4E86\u5C31\u5220\u9664\n const size = this.curGraphics.size\n this.curGraphics.forEach((graphic) => { \n if (!allGraphics.has(graphic)) { \n this.curGraphics.delete(graphic)\n }\n })\n // \u5982\u679C\u6709\u5220\u9664\u5C31\u89E6\u53D1\u4E8B\u4EF6\n if (size !== this.curGraphics.size) {\n this.handleHoverGraphicsChange()\n }\n }\n\n onPointerLevel = () => {\n this.curGraphics.clear()\n this.handleHoverGraphicsChange()\n }\n\n handleHoverGraphicsChange(graphics = this.curGraphics) { \n this.dispatchEvent({ type: 'hover-change', graphics: Array.from(graphics) })\n }\n\n registryEvent() {\n this.context.addEventListener(\"pointer-over\", this.onPointerMove)\n this.context.addEventListener(\"pointer-move\", this.onPointerMove)\n this.context.addEventListener(\"pointer-level\", this.onPointerLevel)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener(\"pointer-over\", this.onPointerMove)\n this.context.removeEventListener(\"pointer-move\", this.onPointerMove)\n this.context.removeEventListener(\"pointer-level\", this.onPointerLevel)\n }\n\n dispose() {\n this.unRegistryEvent()\n this.timer.dispose()\n }\n}", "import { Context } from \"../context\";\nimport { Color, LineBasicMaterial, MeshStandardMaterial, MeshBasicMaterial } from \"three\";\n\ninterface LineMaterialOptions {\n color: string;\n opacity: number;\n}\n\ninterface MeshStandardMaterialOptions {\n color: string,\n opacity: number,\n}\n\ninterface MeshBasicMaterialOptions {\n color: string,\n opacity: number,\n}\n\nexport class MaterialFactory {\n\n private lineMaterialMap = new Map<string, LineBasicMaterial>()\n\n private meshStandardMaterialMap = new Map<string, MeshStandardMaterial>()\n\n private meshBasicMaterialMap = new Map<string, MeshBasicMaterial>()\n\n constructor(private context: Context) {\n\n }\n\n generateLineMaterialKey({ color, opacity }: LineMaterialOptions) { \n return `${color}-${opacity}`;\n }\n\n createLineMaterial({ color, opacity }: LineMaterialOptions) {\n const key = this.generateLineMaterialKey({ color, opacity })\n if (this.lineMaterialMap.has(key)) {\n return this.lineMaterialMap.get(key)!\n }\n const lineMaterial = new LineBasicMaterial({\n color: color,\n transparent: true,\n opacity: opacity\n })\n this.lineMaterialMap.set(key, lineMaterial);\n return lineMaterial\n }\n\n createMeshStandardMaterial({ color, opacity }: MeshStandardMaterialOptions) {\n const key = `${color}-${opacity}`;\n if (this.meshStandardMaterialMap.has(key)) {\n return this.meshStandardMaterialMap.get(key)!\n }\n const material = new MeshStandardMaterial({\n color: color,\n roughness: 1,\n transparent: true,\n opacity: opacity,\n depthWrite: true,\n })\n this.meshStandardMaterialMap.set(key, material);\n return material;\n }\n\n createMeshBasicMaterial({ color, opacity }: MeshBasicMaterialOptions) {\n const key = `${color}-${opacity}`;\n if (this.meshBasicMaterialMap.has(key)) {\n return this.meshBasicMaterialMap.get(key)!\n }\n const material = new MeshBasicMaterial({\n color: color,\n transparent: true,\n opacity: opacity,\n depthWrite: true,\n })\n this.meshBasicMaterialMap.set(key, material);\n return material;\n }\n\n dispose() { \n this.lineMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.lineMaterialMap.clear()\n this.meshStandardMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.meshStandardMaterialMap.clear();\n this.meshBasicMaterialMap.forEach((val, _) => { \n val.dispose()\n })\n this.meshBasicMaterialMap.clear()\n }\n \n}", "import { Box3, Vector3 } from \"three\";\nimport { Context } from \"../context\";\nimport { vector3ToDevice } from \"./coordinate\";\n\nexport class CameraBound {\n private prevCamera = {\n position: new Vector3(),\n zoom: 1,\n target: new Vector3()\n }\n\n private enable = true;\n\n constructor(private context: Context) {\n this.registryEvent()\n this.changePrevCamera()\n }\n\n setEnable(enable: boolean) {\n this.enable = enable;\n if (enable) {\n this.registryEvent()\n } else {\n this.unRegistryEvent()\n }\n }\n\n changePrevCamera() {\n this.prevCamera = {\n position: this.context.camera.position.clone(),\n zoom: this.context.camera.zoom,\n target: this.context.control.target.clone()\n }\n }\n\n backToPrevCamera() {\n this.setEnable(false)\n this.context.camera.position.copy(this.prevCamera.position)\n this.context.camera.zoom = this.prevCamera.zoom;\n this.context.control.target.copy(this.prevCamera.target)\n this.context.control.update()\n this.setEnable(true)\n }\n\n registryEvent() { \n this.context.addEventListener(\"control-change\", this.onCameraChange)\n }\n\n unRegistryEvent() {\n this.context.removeEventListener(\"control-change\", this.onCameraChange)\n }\n\n getCurFloorScreenPosition() {\n if (!this.context.currentFloor) {\n return null\n }\n const box = new Box3().setFromObject(this.context.currentFloor.groundUpper);\n const { camera, container: { clientWidth: w, clientHeight: h } } = this.context\n const { min, max } = box\n const lb = vector3ToDevice(min, camera, w, h)\n const rt = vector3ToDevice(max, camera, w, h)\n const lt = vector3ToDevice(new Vector3(min.x, max.y, max.z), camera, w, h)\n const rb = vector3ToDevice(new Vector3(max.x, min.y, min.z), camera, w, h)\n const left = Math.min(lb.x, rt.x, lt.x, rb.x)\n const right = Math.max(lb.x, rt.x, lt.x, rb.x)\n const top = Math.min(lb.y, rt.y, lt.y, rb.y)\n const bottom = Math.max(lb.y, rt.y, lt.y, rb.y)\n return { left, right, top, bottom }\n }\n\n /**\n * \u68C0\u6D4B\u5730\u56FE\u662F\u4E0D\u662F\u5728\u663E\u793A\u8303\u56F4\n * @param param0 \n * @returns \n */\n checkDistanceToScreenEdge({ left, right, top, bottom }: { left: number, right: number, top: number, bottom: number }) { \n const { width, height } = this.context.clientSize\n const [pt, pr, pb, pl] = this.context.config.cameraBound.padding\n // console.log(left, left <= pl , width - right, width - right <= pr , top <= pt , height - bottom <= pb)\n // \u6240\u6709\u7684\u8FB9\u90FD\u4E0D\u8D85\u51FA\n return (left <= pl && width - right <= pr && top <= pt && height - bottom <= pb)\n }\n\n onCameraChange = () => {\n // \u5224\u65AD\u5982\u679C\u8D85\u51FA\u5C31\u7528\u4E4B\u524D\u7684prevCamera\n // \u83B7\u53D6\u5730\u56FE\u7684\u5C4F\u5E55\u4F4D\u7F6E\n // \u5148\u4E0D\u505A\u8FB9\u754C\u5224\u65AD\n // const bound = this.getCurFloorScreenPosition();\n // if (bound) {\n // const { left, right, top, bottom } = bound\n // const isInBound = this.checkDistanceToScreenEdge({ left, right, top, bottom });\n // console.log(\"isInBound\", isInBound)\n // if (isInBound) {\n // this.changePrevCamera()\n // } else {\n // this.backToPrevCamera()\n // }\n // }\n }\n\n dispose() {\n this.unRegistryEvent()\n }\n}", "import { merge } from 'lodash'\nimport { HeatmapConfiguration } from '@mars3d/heatmap.js'\n\nexport interface Config {\n apiDomain: string,\n apiInfo: RequestInit,\n apiPath: {\n floorGraphic: string,\n floorRange: string\n },\n resizeObserver: boolean;\n heatMap: Partial<HeatmapConfiguration>,\n useFloorCache: boolean;\n control: {\n maxPolar: number;\n defaultPolar: number;\n },\n initTransToMark: boolean;\n svg: {\n circle: {\n radius: string;\n fill: string;\n },\n line: {\n stroke: string;\n }\n },\n selectBox: {\n stroke: string;\n fill: string;\n },\n hover: {\n time: number;\n },\n ground: {\n color: string;\n opacity: number;\n height: number;\n stroke: boolean,\n strokeColor: string,\n strokeOpacity: number\n },\n markGraphic: {\n color: string;\n opacity: number;\n height: number;\n stroke: boolean;\n strokeColor: string;\n strokeOpacity: number;\n },\n graphic: {\n fillOpacity: number,\n },\n cameraBound: {\n padding: [number, number, number, number]\n },\n poi: {\n boxScale: number;\n }\n}\n\nexport const defaultConfig: Config = {\n apiDomain: \"\",\n apiInfo: {},\n apiPath: {\n floorGraphic: \"/api/inception-map/floor/get\",\n floorRange: \"/api/inception-map/range/get\"\n },\n resizeObserver: false,\n initTransToMark: false,\n heatMap: {\n radius: 50,\n gradient: {\n 0: '#8F9FCD',\n 0.5: '#6284FF',\n 1: '#F95D5D',\n },\n },\n useFloorCache: true,\n control: {\n maxPolar: 1.2,\n defaultPolar: 0.9\n },\n svg: {\n circle: {\n radius: \"2\",\n fill: \"#1CADFF\"\n },\n line: {\n stroke: \"#1CADFF\"\n }\n },\n selectBox: {\n stroke: \"#1CADFF\",\n fill: \"rgba(28, 173, 255, 0.3)\"\n },\n hover: {\n time: 100\n },\n ground: {\n color: \"#FAFAFA\",\n opacity: 1,\n height: 3,\n stroke: true,\n strokeColor: \"#E6E6E6\",\n strokeOpacity: 1\n },\n markGraphic: {\n color: \"#EEF0F3\",\n opacity: 1,\n height: 0.001,\n stroke: false,\n strokeColor: \"#000\",\n strokeOpacity: 1\n },\n graphic: {\n fillOpacity: 1,\n },\n cameraBound: {\n padding: [150, 150, 150, 150]\n },\n poi: {\n boxScale: 1.0\n }\n}\n\nexport function getConfig(config: Partial<Config>): Config {\n return merge({}, defaultConfig, config);\n}"],
|
|
5
|
+
"mappings": "2/BAAA,IAAAA,GAAmD,WCM5C,IAAMC,EAAN,KAAY,CAAZ,cACLC,EAAA,aAAQ,CACN,iBAAkB,IAAI,IACtB,QAAS,IAAI,IACb,SAAU,IAAI,GAChB,GAEA,sBAAsBC,EAAgB,CACpC,IAAMC,EAAQ,OAAO,sBAAsB,IAAM,CAC/C,KAAK,MAAM,iBAAiB,OAAOA,CAAK,EACxCD,EAAG,CACL,CAAC,EACD,YAAK,MAAM,iBAAiB,IAAIC,CAAK,EAC9BA,CACT,CAEA,qBAAqBA,EAAe,CAClC,KAAK,MAAM,iBAAiB,OAAOA,CAAK,EACxC,OAAO,qBAAqBA,CAAK,CACnC,CAEA,WAAWD,EAAQE,EAAsB,CACvC,IAAMD,EAAQ,OAAO,WAAW,IAAM,CACpC,KAAK,MAAM,QAAQ,OAAOA,CAAK,EAC/BD,EAAG,CACL,EAAGE,CAAI,EACP,YAAK,MAA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xB,GAAQ,CAACA,EAAK,QAAQ,QAAQ,CAC/F,CAEA,UAAW,CACL,KAAK,QAAQ,cACf,KAAK,QAAQ,aAAa,SAAS,MAAM,CAE7C,CAEA,oBAAoBc,EAAkB,CACpC,KAAK,QAAQ,UAAU,OAAOA,CAAO,CACvC,CAuBA,SAAU,CACR,KAAK,QAAQ,QAAQ,EACrB,KAAK,aAAa,MAAM,EACxB,KAAK,kBAAkB,MAAM,EAC7BwC,GAAiB,EACjBC,GAAY,EACZC,GAAc,EACd,KAAK,gBAAgB,CACvB,CACF",
|
|
6
|
+
"names": ["import_three", "Timer", "__publicField", "fn", "timer", "wait", "import_three", "import_MapControls", "initScene", "scene", "initRenderer", "renderer", "initCamera", "width", "height", "camera", "initLight", "lights", "ambientLight", "initControl", "domElement", "control", "initShape", "path", "holePath", "shape", "item", "cur", "hole", "initDirectionalLight", "color", "intensity", "directionalLight", "dispose", "o", "recursive", "_a", "child", "m", "mat", "hasChinese", "str", "import_three", "textTextureMap", "initCanvas", "canvas", "ctx", "createCanvas", "c", "t", "getTextureByText", "text", "y", "hasChinese", "width", "imageData", "texture", "clearTextTexture", "clearCanvas", "import_three", "import_turf", "vector3ToDevice", "vector", "camera", "w", "h", "_vector", "_w", "_h", "x", "y", "getCenter", "coordinates", "features", "item", "isContain", "point", "start", "end", "getLongestSideDir", "cds", "maxDistance", "dir", "i", "point_0", "point_1", "distance", "proxyOptions", "target", "master", "p", "receiver", "newValue", "oldValue", "res", "timeoutPromise", "promise", "timeout", "resolve", "reject", "createSvgElement", "tag", "createSvg", "w", "h", "svg", "createCircle", "radius", "fill", "circle", "createLine", "stroke", "line", "createRect", "rect", "setCirclePosition", "x", "y", "setLineStartEnd", "start", "end", "setRectPosition", "sleepOnePromise", "sleepOneRf", "resolve", "strToNumber", "str", "addAlphaToHexColor", "hexColor", "alpha", "r", "g", "b", "newR", "newG", "newB", "darkenColor", "import_GLTFLoader", "createLoader", "loader", "modelMap", "loadModel", "url", "gltf", "p", "resolve", "reject", "disposeLoader", "isMac", "isControl", "key", "isMac", "import_three", "import_tween", "import_three", "import_three", "defaultOptions", "Graphic", "context", "options", "__publicField", "proxyOptions", "__spreadValues", "x", "y", "value", "_a", "center", "box", "size", "shape", "initShape", "material", "material1", "darkenColor", "lineMaterial", "points", "height", "cds", "j", "curCds", "i", "cur", "next", "lineGeometry", "line", "raycaster", "intersects", "position", "distance", "import_three", "Shadow", "__publicField", "directionalLight", "initDirectionalLight", "size", "x", "y", "color", "position", "width", "height", "geometry", "material", "mesh", "target", "opacity", "dispose", "import_three", "import_three", "defaultOptions", "Overlay", "context", "options", "__publicField", "vector", "width", "height", "clientX", "clientY", "x", "y", "vector3ToDevice", "__spreadValues", "div", "element", "visible", "display", "opacity", "_a", "defaultOptions", "Poi", "context", "options", "_a", "_b", "_c", "__publicField", "proxyOptions", "__spreadValues", "Overlay", "x", "y", "height", "value", "__async", "sleepOnePromise", "width", "boxScale", "div", "box", "textDiv", "f", "item", "key", "img", "visible", "import_three", "import_three", "import_three", "Layer", "context", "dispose", "GraphicLayer", "Layer", "context", "__publicField", "options", "graphic", "Graphic", "id", "raycaster", "initData", "data", "res", "item", "pos", "distance", "import_lodash", "PoiLayer", "Layer", "context", "__publicField", "Timer", "force", "item", "options", "poi", "Poi", "index", "id", "i", "x", "y", "range", "left", "right", "top", "bottom", "valid", "box", "import_three", "import_heatmap", "import_turf", "HeatmapElement", "context", "__publicField", "data", "width", "height", "leftTop", "center", "__spreadValues", "geometry", "texture", "material", "x", "y", "matrix", "item", "vector", "features", "box", "getCenter", "import_three", "Model", "context", "options", "__publicField", "__async", "object", "loadModel", "_a", "poi", "dispose", "Floor", "context", "__publicField", "Shadow", "GraphicLayer", "PoiLayer", "options", "ground", "Graphic", "grounds", "model", "Model", "box", "center", "size", "graphicOptions", "poiOptions", "data", "HeatmapElement", "opacity", "visible", "_a", "import_three", "BaseSvg", "context", "__publicField", "width", "height", "createSvg", "enable", "e", "camera", "renderer", "x", "y", "clientWidth", "clientHeight", "nx", "ny", "vector", "container", "vector3ToDevice", "SvgLine", "BaseSvg", "context", "__publicField", "point1", "setCirclePosition", "setLineStartEnd", "point2", "e", "point", "x", "y", "circle", "line", "createCircle", "createLine", "enable", "vector", "distance", "x1", "y1", "x2", "y2", "__pow", "SvgPolygon", "BaseSvg", "context", "__publicField", "point", "index", "devicePoint", "setCirclePosition", "setLineStartEnd", "e", "x", "y", "fill", "radius", "stroke", "circle", "createCircle", "line", "createLine", "enable", "cx", "cy", "__pow", "vector", "area", "cds", "item", "numPoints", "i", "j", "import_three", "SelectBox", "BaseSvg", "context", "__publicField", "box", "camera", "w", "h", "min", "max", "leftBottom", "vector3ToDevice", "rightTop", "setRectPosition", "left", "bottom", "right", "top", "halfWidth", "corners", "i", "centerHalfWidth", "centerX", "centerY", "centers", "line", "createRect", "enable", "graphic", "import_three", "BoxSelection", "BaseSvg", "context", "__publicField", "e", "point", "startPoint", "endPoint", "__spreadValues", "leftTop", "width", "height", "setRectPosition", "fill", "stroke", "createRect", "enable", "camera", "w", "h", "startDevice", "vector3ToDevice", "endDevice", "rightBottom", "list", "_a", "item", "Graphic", "object", "position", "position2d", "isContain", "box", "min", "max", "minDevice", "maxDevice", "Selection", "context", "__publicField", "e", "offsetX", "offsetY", "x", "y", "__pow", "graphics", "graphicIdSet", "item", "_a", "graphic", "isControl", "list", "BoxSelection", "import_three", "HoverHelper", "context", "__publicField", "Timer", "graphics", "pois", "poiGraphics", "item", "_a", "graphic", "time", "allGraphics", "timer", "size", "import_three", "MaterialFactory", "context", "__publicField", "color", "opacity", "key", "lineMaterial", "material", "val", "_", "import_three", "CameraBound", "context", "__publicField", "enable", "box", "camera", "w", "h", "min", "max", "lb", "vector3ToDevice", "rt", "lt", "rb", "left", "right", "top", "bottom", "width", "height", "pt", "pr", "pb", "pl", "Context", "container", "config", "__publicField", "initScene", "initRenderer", "initLight", "Timer", "TweenGroup", "camera", "renderer", "w", "h", "e", "graphics", "position", "pois", "isMultipleSelect", "Selection", "HoverHelper", "MaterialFactory", "x", "y", "width", "height", "initCamera", "initControl", "_a", "polarAngle", "CameraBound", "point1", "point2", "clientWidth", "clientHeight", "device1", "vector3ToDevice", "device2", "__pow", "color", "item", "floor", "point", "raycaster", "polar", "duration", "timeoutPromise", "resolve", "start", "end", "tween", "azimuthal", "zoom", "center", "lookAtVector", "object", "padding", "force2DView", "top", "right", "bottom", "left", "boundingBox", "max", "min", "max2d", "min2d", "size", "xScale", "yScale", "scale", "light", "dispose", "import_lodash", "defaultConfig", "getConfig", "config", "import_lodash", "MapTypePolar", "BMap", "container", "config", "__publicField", "zoom", "e", "polar", "azimuthal", "getConfig", "Context", "_0", "__async", "brand", "project", "phase", "building", "floor", "ts", "resource_type_list", "apiDomain", "floorGraphic", "apiInfo", "url", "res", "item", "key", "floorRange", "data", "floorKey", "buildGround", "center", "getCenter", "cds", "coord", "x", "y", "ground", "markGraphic", "graphic", "i", "curFloor", "Floor", "legacyToGraphicMap", "graphics", "curFloorData", "buildingKey", "createdFloor", "options", "_a", "model", "__spreadProps", "__spreadValues", "angleY", "getLongestSideDir", "Graphic", "position", "ele", "duration", "z", "vector", "clientWidth", "clientHeight", "vector3ToDevice", "type", "time", "cameraZoom", "observe", "keys", "radius", "resolve", "reject", "SvgLine", "dispose", "distance", "SvgPolygon", "area", "nodeId", "id", "clearTextTexture", "clearCanvas", "disposeLoader"]
|
|
7
7
|
}
|