@aibee/owlly 1.0.25 → 1.0.29
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/lib/external/lines/line-geometry.d.ts +9 -0
- package/lib/external/lines/line-geometry.js +51 -0
- package/lib/external/lines/line-material.d.ts +10 -0
- package/lib/external/lines/line-material.js +376 -0
- package/lib/external/lines/line-segments-2.d.ts +7 -0
- package/lib/external/lines/line-segments-2.js +143 -0
- package/lib/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/external/lines/line-segments-geometry.js +140 -0
- package/lib/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/external/loaders/gltf-loader.js +2318 -0
- package/lib/external/orbit-controls.d.ts +44 -0
- package/lib/external/orbit-controls.js +745 -0
- package/lib/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/external/renderers/css-2d-renderer.js +121 -0
- package/lib/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/external/renderers/css-3d-renderer.js +138 -0
- package/lib/external/transform-controls.d.ts +106 -0
- package/lib/external/transform-controls.js +1112 -0
- package/lib/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/owlly/controller/aerial-element-controller.js +235 -0
- package/lib/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/owlly/controller/basic-controller.js +1238 -0
- package/lib/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/owlly/controller/camera-controller.js +137 -0
- package/lib/owlly/controller/controller.d.ts +61 -0
- package/lib/owlly/controller/controller.js +23 -0
- package/lib/owlly/controller/index.d.ts +2 -0
- package/lib/owlly/controller/index.js +13 -0
- package/lib/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/owlly/controller/mouse-indicator-controller.js +118 -0
- package/lib/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/owlly/controller/orbit-control.js +264 -0
- package/lib/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/owlly/controller/panorama-adjust-controller.js +157 -0
- package/lib/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/owlly/controller/panorama-controller.js +1943 -0
- package/lib/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/owlly/controller/panorama-transform-controller.js +136 -0
- package/lib/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/owlly/controller/plane-controller.js +173 -0
- package/lib/owlly/controller/texture-controller.d.ts +181 -0
- package/lib/owlly/controller/texture-controller.js +875 -0
- package/lib/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/owlly/controller/tile-panorama-controller.js +1353 -0
- package/lib/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/owlly/controller/transform-controller.js +545 -0
- package/lib/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/owlly/element/bottom-nav-element.js +257 -0
- package/lib/owlly/element/camera.d.ts +82 -0
- package/lib/owlly/element/camera.js +283 -0
- package/lib/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/owlly/element/dom-2d-element.js +48 -0
- package/lib/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/owlly/element/dom-3d-element.js +33 -0
- package/lib/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/owlly/element/dom-label-2d.js +382 -0
- package/lib/owlly/element/element.d.ts +53 -0
- package/lib/owlly/element/element.js +75 -0
- package/lib/owlly/element/floor-model.d.ts +83 -0
- package/lib/owlly/element/floor-model.js +227 -0
- package/lib/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/owlly/element/gif-kit/Gif.js +432 -0
- package/lib/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/owlly/element/gif-kit/GifColor.js +37 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js +50 -0
- package/lib/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/owlly/element/gif-kit/GifFrame.js +96 -0
- package/lib/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/owlly/element/gif-kit/GifImage.js +7 -0
- package/lib/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/owlly/element/gif-kit/GifParser.js +196 -0
- package/lib/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifPresenter.js +43 -0
- package/lib/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/owlly/element/gif-kit/GifVersion.js +12 -0
- package/lib/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/owlly/element/gltf-mesh-element.js +136 -0
- package/lib/owlly/element/index.d.ts +20 -0
- package/lib/owlly/element/index.js +24 -0
- package/lib/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/owlly/element/map-kit/shape.js +189 -0
- package/lib/owlly/element/mesh-element.d.ts +22 -0
- package/lib/owlly/element/mesh-element.js +63 -0
- package/lib/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/owlly/element/mesh-line-2d.js +887 -0
- package/lib/owlly/element/meshline-o.d.ts +64 -0
- package/lib/owlly/element/meshline-o.js +678 -0
- package/lib/owlly/element/panorama-group.d.ts +241 -0
- package/lib/owlly/element/panorama-group.js +966 -0
- package/lib/owlly/element/panorama.d.ts +132 -0
- package/lib/owlly/element/panorama.js +812 -0
- package/lib/owlly/element/path-group.d.ts +69 -0
- package/lib/owlly/element/path-group.js +171 -0
- package/lib/owlly/element/path.d.ts +99 -0
- package/lib/owlly/element/path.js +531 -0
- package/lib/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/owlly/element/placeable-2d.js +470 -0
- package/lib/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/owlly/element/polygon-mesh.js +307 -0
- package/lib/owlly/element/ring-element.d.ts +79 -0
- package/lib/owlly/element/ring-element.js +383 -0
- package/lib/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/owlly/element/sphere-mesh.js +69 -0
- package/lib/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/owlly/element/svg-floor-model.js +184 -0
- package/lib/owlly/element/svg-floors.d.ts +27 -0
- package/lib/owlly/element/svg-floors.js +109 -0
- package/lib/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/owlly/element/tile-panorama-group.js +1006 -0
- package/lib/owlly/element/tile-panorama.d.ts +161 -0
- package/lib/owlly/element/tile-panorama.js +509 -0
- package/lib/owlly/element/tile-plane.d.ts +105 -0
- package/lib/owlly/element/tile-plane.js +360 -0
- package/lib/owlly/element/video-element.d.ts +33 -0
- package/lib/owlly/element/video-element.js +159 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.js +210 -0
- package/lib/owlly/index.d.ts +13 -0
- package/lib/owlly/index.js +16 -0
- package/lib/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/owlly/overlay/canvas-overlay.js +510 -0
- package/lib/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/owlly/overlay/css-2d-overlay.js +35 -0
- package/lib/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/owlly/overlay/css-3d-overlay.js +36 -0
- package/lib/owlly/overlay/index.d.ts +6 -0
- package/lib/owlly/overlay/index.js +11 -0
- package/lib/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/owlly/overlay/label-overlay.js +328 -0
- package/lib/owlly/overlay/overlay.d.ts +14 -0
- package/lib/owlly/overlay/overlay.js +4 -0
- package/lib/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/owlly/overlay/path-overlay.js +124 -0
- package/lib/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/owlly/overlay/path-overlay2.js +118 -0
- package/lib/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/owlly/overlay/poi-overlay-3d.js +1432 -0
- package/lib/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/owlly/overlay/poi-overlay.js +1411 -0
- package/lib/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/owlly/owlly-2d/index.js +92 -0
- package/lib/owlly/screen/index.d.ts +1 -0
- package/lib/owlly/screen/index.js +1 -0
- package/lib/owlly/screen/screen.d.ts +73 -0
- package/lib/owlly/screen/screen.js +236 -0
- package/lib/owlly/stage/externals.d.ts +19 -0
- package/lib/owlly/stage/externals.js +24 -0
- package/lib/owlly/stage/index.d.ts +4 -0
- package/lib/owlly/stage/index.js +6 -0
- package/lib/owlly/stage/owlly.d.ts +38 -0
- package/lib/owlly/stage/owlly.js +168 -0
- package/lib/owlly/stage/stage.d.ts +108 -0
- package/lib/owlly/stage/stage.js +234 -0
- package/lib/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/owlly/utils/alignment-utils.js +63 -0
- package/lib/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/owlly/utils/basic-calc.js +129 -0
- package/lib/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/owlly/utils/basic-tools.js +235 -0
- package/lib/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/owlly/utils/bvh-tree.js +539 -0
- package/lib/owlly/utils/camera.d.ts +37 -0
- package/lib/owlly/utils/camera.js +50 -0
- package/lib/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/owlly/utils/cube-texture-cache.js +143 -0
- package/lib/owlly/utils/device-utils.d.ts +18 -0
- package/lib/owlly/utils/device-utils.js +41 -0
- package/lib/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/owlly/utils/environment-utils.js +73 -0
- package/lib/owlly/utils/event-hub.d.ts +50 -0
- package/lib/owlly/utils/event-hub.js +106 -0
- package/lib/owlly/utils/events.d.ts +219 -0
- package/lib/owlly/utils/events.js +219 -0
- package/lib/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/owlly/utils/geometry-utils.js +622 -0
- package/lib/owlly/utils/helper.d.ts +6 -0
- package/lib/owlly/utils/helper.js +24 -0
- package/lib/owlly/utils/index.d.ts +14 -0
- package/lib/owlly/utils/index.js +17 -0
- package/lib/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/owlly/utils/lru-cache.js +109 -0
- package/lib/owlly/utils/map-utils.d.ts +7 -0
- package/lib/owlly/utils/map-utils.js +52 -0
- package/lib/owlly/utils/number-utils.d.ts +8 -0
- package/lib/owlly/utils/number-utils.js +72 -0
- package/lib/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/owlly/utils/panorama-model-util.js +245 -0
- package/lib/owlly/utils/path-utils.d.ts +80 -0
- package/lib/owlly/utils/path-utils.js +728 -0
- package/lib/owlly/utils/svgutils.d.ts +138 -0
- package/lib/owlly/utils/svgutils.js +561 -0
- package/lib/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/owlly/utils/texture-cache.js +115 -0
- package/lib/owlly/utils/tile-util.d.ts +187 -0
- package/lib/owlly/utils/tile-util.js +456 -0
- package/lib/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/owlly/utils/time-profiler.js +48 -0
- package/lib/owlly/view/camera-view.d.ts +35 -0
- package/lib/owlly/view/camera-view.js +101 -0
- package/lib/owlly/view/index.d.ts +3 -0
- package/lib/owlly/view/index.js +5 -0
- package/lib/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/owlly/view/orthographic-view.js +94 -0
- package/lib/owlly/view/perspective-view.d.ts +40 -0
- package/lib/owlly/view/perspective-view.js +95 -0
- package/lib/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/owlly/view/svg-map-view.js +144 -0
- package/lib/owlly/view/view.d.ts +146 -0
- package/lib/owlly/view/view.js +317 -0
- package/lib/prod/owlly.esm.js +93462 -0
- package/lib/prod/owlly.esm.js.map +1 -0
- package/lib/prod/owlly.esm.min.js +54 -0
- package/lib/prod/owlly.iife.js +93560 -0
- package/lib/prod/owlly.iife.js.map +1 -0
- package/lib/prod/owlly.iife.min.js +69 -0
- package/lib/prod/owlly.miniapp.js +73845 -0
- package/lib/prod/owlly.miniapp.js.map +1 -0
- package/lib/prod/owlly.miniapp.min.js +63 -0
- package/lib/prod/src/external/lines/line-geometry.d.ts +9 -0
- package/lib/prod/src/external/lines/line-material.d.ts +10 -0
- package/lib/prod/src/external/lines/line-segments-2.d.ts +7 -0
- package/lib/prod/src/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/prod/src/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/prod/src/external/orbit-controls.d.ts +44 -0
- package/lib/prod/src/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/prod/src/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/prod/src/external/transform-controls.d.ts +106 -0
- package/lib/prod/src/external/util/buffer-geometry-utils.d.ts +45 -0
- package/lib/prod/src/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/prod/src/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/prod/src/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/prod/src/owlly/controller/controller.d.ts +61 -0
- package/lib/prod/src/owlly/controller/index.d.ts +2 -0
- package/lib/prod/src/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/prod/src/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/prod/src/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/prod/src/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/prod/src/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/prod/src/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/prod/src/owlly/controller/texture-controller.d.ts +183 -0
- package/lib/prod/src/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/prod/src/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/prod/src/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/prod/src/owlly/element/camera.d.ts +82 -0
- package/lib/prod/src/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/prod/src/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/prod/src/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/prod/src/owlly/element/element.d.ts +53 -0
- package/lib/prod/src/owlly/element/floor-model.d.ts +83 -0
- package/lib/prod/src/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/prod/src/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/prod/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/prod/src/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/prod/src/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/prod/src/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/prod/src/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/prod/src/owlly/element/index.d.ts +6 -0
- package/lib/prod/src/owlly/element/map-kit/area.d.ts +24 -0
- package/lib/prod/src/owlly/element/map-kit/block-set.d.ts +39 -0
- package/lib/prod/src/owlly/element/map-kit/block.d.ts +77 -0
- package/lib/prod/src/owlly/element/map-kit/index.d.ts +3 -0
- package/lib/prod/src/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/prod/src/owlly/element/mesh-element.d.ts +22 -0
- package/lib/prod/src/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/prod/src/owlly/element/meshline-o.d.ts +64 -0
- package/lib/prod/src/owlly/element/panorama-group.d.ts +241 -0
- package/lib/prod/src/owlly/element/panorama.d.ts +132 -0
- package/lib/prod/src/owlly/element/path-group.d.ts +69 -0
- package/lib/prod/src/owlly/element/path.d.ts +99 -0
- package/lib/prod/src/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/prod/src/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/prod/src/owlly/element/ring-element.d.ts +79 -0
- package/lib/prod/src/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/prod/src/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/prod/src/owlly/element/svg-floors.d.ts +27 -0
- package/lib/prod/src/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/prod/src/owlly/element/tile-panorama.d.ts +162 -0
- package/lib/prod/src/owlly/element/tile-plane.d.ts +114 -0
- package/lib/prod/src/owlly/element/video-element.d.ts +33 -0
- package/lib/prod/src/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/prod/src/owlly/index.d.ts +13 -0
- package/lib/prod/src/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/prod/src/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/prod/src/owlly/overlay/index.d.ts +5 -0
- package/lib/prod/src/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/prod/src/owlly/overlay/overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/prod/src/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/prod/src/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/prod/src/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/prod/src/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/prod/src/owlly/screen/index.d.ts +1 -0
- package/lib/prod/src/owlly/screen/screen.d.ts +73 -0
- package/lib/prod/src/owlly/stage/__test__/stage.spec.d.ts +1 -0
- package/lib/prod/src/owlly/stage/externals.d.ts +19 -0
- package/lib/prod/src/owlly/stage/index.d.ts +3 -0
- package/lib/prod/src/owlly/stage/owlly.d.ts +38 -0
- package/lib/prod/src/owlly/stage/stage.d.ts +108 -0
- package/lib/prod/src/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/prod/src/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/prod/src/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/prod/src/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/prod/src/owlly/utils/camera.d.ts +37 -0
- package/lib/prod/src/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/prod/src/owlly/utils/device-utils.d.ts +18 -0
- package/lib/prod/src/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/prod/src/owlly/utils/event-hub.d.ts +50 -0
- package/lib/prod/src/owlly/utils/events.d.ts +219 -0
- package/lib/prod/src/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/prod/src/owlly/utils/helper.d.ts +6 -0
- package/lib/prod/src/owlly/utils/index.d.ts +13 -0
- package/lib/prod/src/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/prod/src/owlly/utils/map-utils.d.ts +7 -0
- package/lib/prod/src/owlly/utils/number-utils.d.ts +8 -0
- package/lib/prod/src/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/prod/src/owlly/utils/path-utils.d.ts +80 -0
- package/lib/prod/src/owlly/utils/svgutils.d.ts +138 -0
- package/lib/prod/src/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/prod/src/owlly/utils/tile-util.d.ts +187 -0
- package/lib/prod/src/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/prod/src/owlly/view/__test__/perspective-view.spec.d.ts +0 -0
- package/lib/prod/src/owlly/view/camera-view.d.ts +35 -0
- package/lib/prod/src/owlly/view/index.d.ts +3 -0
- package/lib/prod/src/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/perspective-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/prod/src/owlly/view/view.d.ts +146 -0
- package/lib/src/owlly/controller/texture-controller.d.ts +3 -1
- package/lib/src/owlly/controller/texture-controller.js +16 -1
- package/lib/src/owlly/controller/texture-controller.js.map +1 -1
- package/lib/src/owlly/controller/tile-panorama-controller.js +4 -0
- package/lib/src/owlly/controller/tile-panorama-controller.js.map +1 -1
- package/lib/src/owlly/element/tile-panorama.d.ts +1 -0
- package/lib/src/owlly/element/tile-panorama.js +16 -3
- package/lib/src/owlly/element/tile-panorama.js.map +1 -1
- package/lib/src/owlly/element/tile-plane.d.ts +9 -0
- package/lib/src/owlly/element/tile-plane.js +27 -0
- package/lib/src/owlly/element/tile-plane.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay-3d.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay.js.map +1 -1
- package/lib/src/owlly/stage/owlly.js +7 -1
- package/lib/src/owlly/stage/owlly.js.map +1 -1
- package/lib/src/owlly/stage/stage.js +2 -0
- package/lib/src/owlly/stage/stage.js.map +1 -1
- package/lib/src/web/main.rpeng.mes.plane.js.map +1 -1
- package/package.json +16 -7
- package/src/owlly/controller/texture-controller.ts +18 -1
- package/src/owlly/controller/tile-panorama-controller.ts +3 -1
- package/src/owlly/element/tile-panorama.ts +14 -0
- package/src/owlly/element/tile-plane.ts +26 -0
- package/src/owlly/overlay/poi-overlay-3d.ts +0 -4
- package/src/owlly/overlay/poi-overlay.ts +0 -4
- package/src/owlly/stage/owlly.ts +6 -1
- package/src/owlly/stage/stage.ts +2 -0
- package/src/web/main.rpeng.mes.plane.ts +0 -6
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Overlay } from './overlay';
|
|
3
|
+
import { View } from '../view/view';
|
|
4
|
+
/**
|
|
5
|
+
* 该文件应被舍弃, 不再使用
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
declare class LabelOverlay extends Overlay {
|
|
9
|
+
private container;
|
|
10
|
+
private parent;
|
|
11
|
+
private overlay;
|
|
12
|
+
private iconPoints;
|
|
13
|
+
private labelPoints;
|
|
14
|
+
private bubblePoint;
|
|
15
|
+
private renderThisFrame;
|
|
16
|
+
init(parent: View, container?: HTMLElement): void;
|
|
17
|
+
update(): boolean;
|
|
18
|
+
render(): void;
|
|
19
|
+
setRenderOrder(order: number): void;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
static getBiggerPos(arr: number[][], target: number, index: number): number;
|
|
22
|
+
static getSmallerPos(arr: number[][], target: number, index: number): number;
|
|
23
|
+
setBubble({ position, message, imageStyle, messageStyle, fontSize, }: {
|
|
24
|
+
position: NS_THREE.Vector3;
|
|
25
|
+
message: string | null;
|
|
26
|
+
fontSize: number;
|
|
27
|
+
imageStyle: {
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
messageStyle: {
|
|
34
|
+
left: number;
|
|
35
|
+
top: number;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
};
|
|
39
|
+
}): void;
|
|
40
|
+
setIconPoints(points: {
|
|
41
|
+
position: NS_THREE.Vector3;
|
|
42
|
+
src: string;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
offsetX: number;
|
|
46
|
+
offsetY: number;
|
|
47
|
+
}[]): void;
|
|
48
|
+
setLabelPoints(points: {
|
|
49
|
+
position: NS_THREE.Vector3;
|
|
50
|
+
name: string;
|
|
51
|
+
nodeId: string;
|
|
52
|
+
color?: string;
|
|
53
|
+
pointSize?: number;
|
|
54
|
+
offsetX?: number;
|
|
55
|
+
offsetY?: number;
|
|
56
|
+
showGuideline?: boolean;
|
|
57
|
+
fontSize?: number;
|
|
58
|
+
alwaysShow?: boolean;
|
|
59
|
+
}[]): void;
|
|
60
|
+
setPriorLabelPoints(ids: string[]): void;
|
|
61
|
+
}
|
|
62
|
+
export { LabelOverlay };
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { Overlay } from './overlay';
|
|
2
|
+
import { Events } from '../utils/events';
|
|
3
|
+
/**
|
|
4
|
+
* 该文件应被舍弃, 不再使用
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
7
|
+
class LabelOverlay extends Overlay {
|
|
8
|
+
init(parent, container = new HTMLElement()) {
|
|
9
|
+
this.container = container;
|
|
10
|
+
this.parent = parent;
|
|
11
|
+
if (!this.parent.camera) {
|
|
12
|
+
throw new Error('Parent view should have a camera to rely on');
|
|
13
|
+
}
|
|
14
|
+
this.iconPoints = [];
|
|
15
|
+
this.labelPoints = [];
|
|
16
|
+
this.renderThisFrame = false;
|
|
17
|
+
this.overlay = document.createElement('div');
|
|
18
|
+
this.overlay.style.cssText = `
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
`;
|
|
26
|
+
this.container.appendChild(this.overlay);
|
|
27
|
+
}
|
|
28
|
+
update() {
|
|
29
|
+
this.labelPoints.forEach(({ labelElement, ready }, i) => {
|
|
30
|
+
if (ready)
|
|
31
|
+
return;
|
|
32
|
+
const { width, height } = labelElement.getBoundingClientRect();
|
|
33
|
+
labelElement.style.setProperty('left', `${-width * 0.5}px`);
|
|
34
|
+
labelElement.style.setProperty('top', `${-height - 4}px`);
|
|
35
|
+
this.labelPoints[i].ready = true;
|
|
36
|
+
});
|
|
37
|
+
if (this.renderThisFrame) {
|
|
38
|
+
this.renderThisFrame = false;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
const { clientWidth, clientHeight } = this.container;
|
|
45
|
+
const widthHalf = clientWidth / 2;
|
|
46
|
+
const heightHalf = clientHeight / 2;
|
|
47
|
+
this.iconPoints.forEach(({ element, position, offsetX, offsetY, }) => {
|
|
48
|
+
if (!this.parent.camera)
|
|
49
|
+
return;
|
|
50
|
+
const p = position.clone();
|
|
51
|
+
p.project(this.parent.camera);
|
|
52
|
+
element.style.setProperty('left', `${(p.x + 1) * widthHalf - 20 + offsetX}px`);
|
|
53
|
+
element.style.setProperty('top', `${(1 - p.y) * heightHalf - 40 + offsetY}px`);
|
|
54
|
+
});
|
|
55
|
+
this.emit(Events.LABEL_ICONS_POSITION_UPDATED, this.iconPoints.map((p) => (p.element)));
|
|
56
|
+
if (this.bubblePoint
|
|
57
|
+
&& this.bubblePoint.message
|
|
58
|
+
&& this.bubblePoint.message.length
|
|
59
|
+
&& this.parent.camera) {
|
|
60
|
+
const p = this.bubblePoint.position.clone();
|
|
61
|
+
p.project(this.parent.camera);
|
|
62
|
+
this.bubblePoint.element.style.setProperty('left', `${(p.x + 1) * widthHalf}px`);
|
|
63
|
+
this.bubblePoint.element.style.setProperty('top', `${(1 - p.y) * heightHalf}px`);
|
|
64
|
+
}
|
|
65
|
+
const range = [];
|
|
66
|
+
this.labelPoints.forEach(({ element, labelElement, position, pointElement, alwaysShow, }, i) => {
|
|
67
|
+
if (!this.parent.camera)
|
|
68
|
+
return;
|
|
69
|
+
const p = position.clone();
|
|
70
|
+
p.project(this.parent.camera);
|
|
71
|
+
if (!Number.isFinite(p.x) || !Number.isFinite(p.y))
|
|
72
|
+
return;
|
|
73
|
+
const posX = (p.x + 1) * widthHalf;
|
|
74
|
+
const posY = (1 - p.y) * heightHalf;
|
|
75
|
+
element.style.setProperty('left', `${posX}px`);
|
|
76
|
+
element.style.setProperty('top', `${posY}px`);
|
|
77
|
+
const { width, height } = labelElement.getBoundingClientRect();
|
|
78
|
+
const leftX = posX - width / 2 - 8;
|
|
79
|
+
const rightX = posX + width / 2 + 8;
|
|
80
|
+
const topY = posY - height - 4 - 8;
|
|
81
|
+
const bottomY = posY - 4 + 8;
|
|
82
|
+
if (i === 0) {
|
|
83
|
+
range.push([leftX, rightX, topY, bottomY]);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const valid = alwaysShow || !range.some(([lx, rx, ty, by]) => {
|
|
87
|
+
if (leftX >= lx && leftX >= rx)
|
|
88
|
+
return false;
|
|
89
|
+
if (leftX <= rx && rightX <= lx)
|
|
90
|
+
return false;
|
|
91
|
+
if (topY >= ty && topY >= by)
|
|
92
|
+
return false;
|
|
93
|
+
if (topY <= by && bottomY <= ty)
|
|
94
|
+
return false;
|
|
95
|
+
return true;
|
|
96
|
+
});
|
|
97
|
+
if (valid) {
|
|
98
|
+
range.push([leftX, rightX, topY, bottomY]);
|
|
99
|
+
labelElement.style.setProperty('opacity', '1');
|
|
100
|
+
pointElement.style.setProperty('opacity', '1');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
labelElement.style.setProperty('opacity', '0');
|
|
104
|
+
pointElement.style.setProperty('opacity', '0');
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
setRenderOrder(order) {
|
|
109
|
+
this.overlay.style.setProperty('z-index', `${order}`);
|
|
110
|
+
}
|
|
111
|
+
dispose() {
|
|
112
|
+
if (this.container)
|
|
113
|
+
this.container.removeChild(this.overlay);
|
|
114
|
+
delete this.overlay; // eslint-disable-line
|
|
115
|
+
}
|
|
116
|
+
static getBiggerPos(arr, target, index) {
|
|
117
|
+
let i = 0;
|
|
118
|
+
let j = arr.length - 1;
|
|
119
|
+
while (i !== j) {
|
|
120
|
+
const p = Math.ceil((i + j) / 2);
|
|
121
|
+
const v = arr[p][index];
|
|
122
|
+
if (target >= v) {
|
|
123
|
+
i = p;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
j = p - 1;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
static getSmallerPos(arr, target, index) {
|
|
132
|
+
let i = 0;
|
|
133
|
+
let j = arr.length - 1;
|
|
134
|
+
while (i !== j) {
|
|
135
|
+
const p = Math.floor((i + j) / 2);
|
|
136
|
+
const v = arr[p][index];
|
|
137
|
+
if (target >= v) {
|
|
138
|
+
i = p + 1;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
j = p;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return i;
|
|
145
|
+
}
|
|
146
|
+
setBubble({ position, message, imageStyle, messageStyle, fontSize, }) {
|
|
147
|
+
if (this.bubblePoint
|
|
148
|
+
&& this.bubblePoint.message
|
|
149
|
+
&& this.bubblePoint.message.length) {
|
|
150
|
+
this.overlay.removeChild(this.bubblePoint.element);
|
|
151
|
+
this.bubblePoint.message = '';
|
|
152
|
+
}
|
|
153
|
+
if (!message || !message.length)
|
|
154
|
+
return;
|
|
155
|
+
this.bubblePoint = {
|
|
156
|
+
element: document.createElement('div'),
|
|
157
|
+
imageElement: document.createElement('img'),
|
|
158
|
+
messageElement: document.createElement('div'),
|
|
159
|
+
position,
|
|
160
|
+
message,
|
|
161
|
+
};
|
|
162
|
+
this.bubblePoint.element.style.cssText = `
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 0;
|
|
166
|
+
left: 0;
|
|
167
|
+
width: 0;
|
|
168
|
+
height: 0;
|
|
169
|
+
z-index: 2;
|
|
170
|
+
`;
|
|
171
|
+
this.bubblePoint.imageElement.src = 'imgs/bubble.png';
|
|
172
|
+
this.bubblePoint.imageElement.style.cssText = `
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: ${imageStyle.top || -110}px;
|
|
176
|
+
left: ${imageStyle.left || -103.5}px;
|
|
177
|
+
width: ${imageStyle.width || 207}px;
|
|
178
|
+
height: ${imageStyle.height || 85}px;
|
|
179
|
+
object-fit: contain;
|
|
180
|
+
z-index: 2;
|
|
181
|
+
`;
|
|
182
|
+
this.bubblePoint.messageElement.innerHTML = `
|
|
183
|
+
<span style="text-align: center;">
|
|
184
|
+
${message}
|
|
185
|
+
</span>
|
|
186
|
+
`;
|
|
187
|
+
this.bubblePoint.messageElement.style.cssText = `
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: ${messageStyle.top || -104}px;
|
|
193
|
+
left: ${messageStyle.left || -82}px;
|
|
194
|
+
width: ${messageStyle.width || 164}px;
|
|
195
|
+
height: ${messageStyle.height || 42}px;
|
|
196
|
+
color: #000;
|
|
197
|
+
font-size: ${fontSize}px;
|
|
198
|
+
z-index: 3;
|
|
199
|
+
`;
|
|
200
|
+
this.bubblePoint.element.appendChild(this.bubblePoint.imageElement);
|
|
201
|
+
this.bubblePoint.element.appendChild(this.bubblePoint.messageElement);
|
|
202
|
+
this.overlay.appendChild(this.bubblePoint.element);
|
|
203
|
+
this.renderThisFrame = true;
|
|
204
|
+
}
|
|
205
|
+
setIconPoints(points) {
|
|
206
|
+
const srcSet = new Set();
|
|
207
|
+
const srcMap = new Map();
|
|
208
|
+
points.forEach(({ src }) => { srcSet.add(src); });
|
|
209
|
+
while (this.iconPoints.length) {
|
|
210
|
+
const p = this.iconPoints.pop();
|
|
211
|
+
if (p) {
|
|
212
|
+
const s = p.element.src;
|
|
213
|
+
if (srcSet.has(s))
|
|
214
|
+
srcMap.set(s, p);
|
|
215
|
+
else
|
|
216
|
+
this.overlay.removeChild(p.element);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
this.iconPoints.push(...srcMap.values());
|
|
220
|
+
points.forEach(({ position, src, width, height, offsetX, offsetY, }) => {
|
|
221
|
+
if (srcMap.has(src)) {
|
|
222
|
+
srcMap.get(src).position = position;
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const point = {
|
|
226
|
+
element: document.createElement('img'), position, offsetX, offsetY,
|
|
227
|
+
};
|
|
228
|
+
point.element.src = src;
|
|
229
|
+
point.element.style.cssText = `
|
|
230
|
+
pointer-events: none;
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: 0;
|
|
233
|
+
left: 0;
|
|
234
|
+
width: ${width || 40}px;
|
|
235
|
+
height: ${height || 40}px;
|
|
236
|
+
object-fit: contain;
|
|
237
|
+
z-index: 2;
|
|
238
|
+
`;
|
|
239
|
+
this.iconPoints.push(point);
|
|
240
|
+
this.overlay.appendChild(point.element);
|
|
241
|
+
});
|
|
242
|
+
this.renderThisFrame = true;
|
|
243
|
+
}
|
|
244
|
+
setLabelPoints(points) {
|
|
245
|
+
while (this.labelPoints.length) {
|
|
246
|
+
const p = this.labelPoints.pop();
|
|
247
|
+
if (p)
|
|
248
|
+
this.overlay.removeChild(p.element);
|
|
249
|
+
}
|
|
250
|
+
points.forEach(({ position, name, nodeId, color, pointSize, offsetX, offsetY, showGuideline, fontSize, alwaysShow, }) => {
|
|
251
|
+
const pSize = pointSize || 4;
|
|
252
|
+
const offX = offsetX || 0;
|
|
253
|
+
const offY = offsetY || 0;
|
|
254
|
+
const point = {
|
|
255
|
+
element: document.createElement('div'),
|
|
256
|
+
labelElement: document.createElement('div'),
|
|
257
|
+
pointElement: document.createElement('div'),
|
|
258
|
+
position,
|
|
259
|
+
name,
|
|
260
|
+
size: [0, 0],
|
|
261
|
+
ready: false,
|
|
262
|
+
id: nodeId,
|
|
263
|
+
priority: 0,
|
|
264
|
+
alwaysShow: !!alwaysShow,
|
|
265
|
+
};
|
|
266
|
+
point.element.style.cssText = `
|
|
267
|
+
pointer-events: none;
|
|
268
|
+
position: absolute;
|
|
269
|
+
top: 0;
|
|
270
|
+
left: 0;
|
|
271
|
+
width: auto;
|
|
272
|
+
height: auto;
|
|
273
|
+
z-index: 1;
|
|
274
|
+
`;
|
|
275
|
+
point.labelElement.innerHTML = name;
|
|
276
|
+
// TODO(jyfang): Free color settings.
|
|
277
|
+
point.labelElement.style.cssText = `
|
|
278
|
+
position: absolute;
|
|
279
|
+
font-size: ${fontSize || 16}px;
|
|
280
|
+
white-space: nowrap;
|
|
281
|
+
color: ${color || '#A57D50'};
|
|
282
|
+
font-weight: 500;
|
|
283
|
+
text-shadow: 0 1px white, 1px 0 white, -1px 0 white, 0 -1px white;
|
|
284
|
+
transform: translate(${offX}px, ${offY}px);
|
|
285
|
+
`;
|
|
286
|
+
point.pointElement.style.cssText = `
|
|
287
|
+
display: inline-block;
|
|
288
|
+
position: absolute;
|
|
289
|
+
top: -${pSize / 2}px;
|
|
290
|
+
left: -${pSize / 2}px;
|
|
291
|
+
height: ${pSize}px;
|
|
292
|
+
width: ${pSize}px;
|
|
293
|
+
background-color: ${color || '#A57D50'};
|
|
294
|
+
border-radius: 50%;
|
|
295
|
+
box-shadow: 0 0 1px 2px #fff;
|
|
296
|
+
`;
|
|
297
|
+
point.element.appendChild(point.labelElement);
|
|
298
|
+
point.element.appendChild(point.pointElement);
|
|
299
|
+
if (showGuideline) {
|
|
300
|
+
point.guidelineElement = document.createElement('div');
|
|
301
|
+
point.guidelineElement.style.cssText = `
|
|
302
|
+
position: absolute;
|
|
303
|
+
width: 2px;
|
|
304
|
+
height: ${Math.abs(offY) - 20}px;
|
|
305
|
+
top: ${Math.sign(offY) * (Math.abs(offY) - 20)}px;
|
|
306
|
+
left: -1px;
|
|
307
|
+
background-color: #fff;
|
|
308
|
+
`;
|
|
309
|
+
point.element.appendChild(point.guidelineElement);
|
|
310
|
+
}
|
|
311
|
+
this.labelPoints.push(point);
|
|
312
|
+
this.overlay.appendChild(point.element);
|
|
313
|
+
});
|
|
314
|
+
this.renderThisFrame = true;
|
|
315
|
+
}
|
|
316
|
+
setPriorLabelPoints(ids) {
|
|
317
|
+
const idSet = new Set();
|
|
318
|
+
ids.forEach((id) => { idSet.add(id); });
|
|
319
|
+
this.labelPoints.forEach((p) => {
|
|
320
|
+
if (idSet.has(p.id))
|
|
321
|
+
p.priority = 999;
|
|
322
|
+
else
|
|
323
|
+
p.priority = 0;
|
|
324
|
+
});
|
|
325
|
+
this.labelPoints.sort((a, b) => b.priority - a.priority);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
export { LabelOverlay };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { View } from '../view/view';
|
|
3
|
+
import { EventHubClassic } from '../utils/event-hub';
|
|
4
|
+
declare class Overlay extends EventHubClassic {
|
|
5
|
+
}
|
|
6
|
+
interface Overlay {
|
|
7
|
+
init(parent: View): void;
|
|
8
|
+
update(): boolean;
|
|
9
|
+
render(scene?: NS_THREE.Scene): void;
|
|
10
|
+
setRenderOrder(order: number): void;
|
|
11
|
+
resize?(containerWidth: number, containerHeight: number): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
14
|
+
export { Overlay };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Overlay } from './overlay';
|
|
3
|
+
import { View } from '../view/view';
|
|
4
|
+
/**
|
|
5
|
+
* 该类应该被舍弃, 不再使用
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
declare class PathOverlay extends Overlay {
|
|
9
|
+
private container;
|
|
10
|
+
private parent;
|
|
11
|
+
private canvas;
|
|
12
|
+
private context;
|
|
13
|
+
private devicePixelRatio;
|
|
14
|
+
private path;
|
|
15
|
+
private showEndPoints;
|
|
16
|
+
private startColor;
|
|
17
|
+
private endColor;
|
|
18
|
+
private lineWidth;
|
|
19
|
+
private setCanvasHeight;
|
|
20
|
+
init(parent: View, container?: HTMLElement): void;
|
|
21
|
+
resize(containerWidth: number, containerHeight: number): void;
|
|
22
|
+
update(): boolean;
|
|
23
|
+
render(): void;
|
|
24
|
+
setRenderOrder(order: number): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
setPath3D(path: NS_THREE.Vector3[]): void;
|
|
27
|
+
setEndPointsVisible(value: boolean): void;
|
|
28
|
+
setColors(start: {
|
|
29
|
+
r: number;
|
|
30
|
+
g: number;
|
|
31
|
+
b: number;
|
|
32
|
+
}, end: {
|
|
33
|
+
r: number;
|
|
34
|
+
g: number;
|
|
35
|
+
b: number;
|
|
36
|
+
}): void;
|
|
37
|
+
setLineWidth(lineWidth: number): void;
|
|
38
|
+
}
|
|
39
|
+
export { PathOverlay };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Overlay } from './overlay';
|
|
2
|
+
/**
|
|
3
|
+
* 该类应该被舍弃, 不再使用
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
class PathOverlay extends Overlay {
|
|
7
|
+
setCanvasHeight(containerWidth, containerHeight) {
|
|
8
|
+
this.canvas.width = containerWidth * this.devicePixelRatio;
|
|
9
|
+
this.canvas.height = containerHeight * this.devicePixelRatio;
|
|
10
|
+
this.canvas.style.width = `${containerWidth}px`;
|
|
11
|
+
this.canvas.style.height = `${containerHeight}px`;
|
|
12
|
+
}
|
|
13
|
+
init(parent, container = new HTMLElement()) {
|
|
14
|
+
this.container = container;
|
|
15
|
+
this.parent = parent;
|
|
16
|
+
this.devicePixelRatio = window.devicePixelRatio;
|
|
17
|
+
this.canvas = document.createElement('canvas');
|
|
18
|
+
this.path = [];
|
|
19
|
+
this.context = this.canvas.getContext('2d');
|
|
20
|
+
this.showEndPoints = true;
|
|
21
|
+
// this.forceRender = false;
|
|
22
|
+
this.canvas.style.cssText = `
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
`;
|
|
28
|
+
const { clientWidth, clientHeight } = this.container;
|
|
29
|
+
this.setCanvasHeight(clientWidth, clientHeight);
|
|
30
|
+
this.container.appendChild(this.canvas);
|
|
31
|
+
this.startColor = { r: 109, g: 150, b: 253 };
|
|
32
|
+
this.endColor = { r: 109, g: 150, b: 253 };
|
|
33
|
+
this.lineWidth = 9;
|
|
34
|
+
}
|
|
35
|
+
resize(containerWidth, containerHeight) {
|
|
36
|
+
this.setCanvasHeight(containerWidth, containerHeight);
|
|
37
|
+
}
|
|
38
|
+
update() {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
if (!this.context)
|
|
43
|
+
return;
|
|
44
|
+
const widthHalf = this.canvas.width / 2;
|
|
45
|
+
const heightHalf = this.canvas.height / 2;
|
|
46
|
+
const renderPath = [];
|
|
47
|
+
this.path.forEach((v) => {
|
|
48
|
+
if (!this.parent.camera)
|
|
49
|
+
return;
|
|
50
|
+
const p = v.clone();
|
|
51
|
+
p.project(this.parent.camera);
|
|
52
|
+
renderPath.push([(p.x + 1) * widthHalf, (1 - p.y) * heightHalf]);
|
|
53
|
+
});
|
|
54
|
+
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
55
|
+
if (!renderPath.length)
|
|
56
|
+
return;
|
|
57
|
+
this.context.lineCap = 'round';
|
|
58
|
+
this.context.lineJoin = 'round';
|
|
59
|
+
const diff = {
|
|
60
|
+
r: this.endColor.r - this.startColor.r,
|
|
61
|
+
g: this.endColor.g - this.startColor.g,
|
|
62
|
+
b: this.endColor.b - this.startColor.b,
|
|
63
|
+
};
|
|
64
|
+
diff.r /= (renderPath.length - 1);
|
|
65
|
+
diff.g /= (renderPath.length - 1);
|
|
66
|
+
diff.b /= (renderPath.length - 1);
|
|
67
|
+
const currentColor = Object.assign({}, this.startColor);
|
|
68
|
+
this.context.lineWidth = this.lineWidth;
|
|
69
|
+
this.context.beginPath();
|
|
70
|
+
renderPath.forEach((p, i) => {
|
|
71
|
+
if (!this.context)
|
|
72
|
+
return;
|
|
73
|
+
if (i === 0) {
|
|
74
|
+
this.context.moveTo(...p);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.context.lineTo(...p);
|
|
78
|
+
currentColor.r += diff.r;
|
|
79
|
+
currentColor.g += diff.g;
|
|
80
|
+
currentColor.b += diff.b;
|
|
81
|
+
this.context.strokeStyle = `rgb(${currentColor.r}, ${currentColor.g}, ${currentColor.b})`;
|
|
82
|
+
this.context.stroke();
|
|
83
|
+
this.context.beginPath();
|
|
84
|
+
this.context.moveTo(...p);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (!this.showEndPoints)
|
|
88
|
+
return;
|
|
89
|
+
this.context.fillStyle = '#6F8DFF';
|
|
90
|
+
this.context.beginPath();
|
|
91
|
+
this.context.arc(renderPath[0][0], renderPath[0][1], 16, 0, Math.PI * 2);
|
|
92
|
+
this.context.arc(renderPath[renderPath.length - 1][0], renderPath[renderPath.length - 1][1], 16, 0, Math.PI * 2);
|
|
93
|
+
this.context.fill();
|
|
94
|
+
this.context.fillStyle = '#FFFFFF';
|
|
95
|
+
this.context.strokeStyle = 'none';
|
|
96
|
+
this.context.beginPath();
|
|
97
|
+
this.context.arc(renderPath[0][0], renderPath[0][1], 8, 0, Math.PI * 2);
|
|
98
|
+
this.context.arc(renderPath[renderPath.length - 1][0], renderPath[renderPath.length - 1][1], 8, 0, Math.PI * 2);
|
|
99
|
+
this.context.fill();
|
|
100
|
+
}
|
|
101
|
+
setRenderOrder(order) {
|
|
102
|
+
this.canvas.style.setProperty('z-index', `${order}`);
|
|
103
|
+
}
|
|
104
|
+
dispose() {
|
|
105
|
+
if (this.container)
|
|
106
|
+
this.container.removeChild(this.canvas);
|
|
107
|
+
delete this.canvas; // eslint-disable-line
|
|
108
|
+
}
|
|
109
|
+
setPath3D(path) {
|
|
110
|
+
this.path = path;
|
|
111
|
+
this.render();
|
|
112
|
+
}
|
|
113
|
+
setEndPointsVisible(value) {
|
|
114
|
+
this.showEndPoints = value;
|
|
115
|
+
}
|
|
116
|
+
setColors(start, end) {
|
|
117
|
+
this.startColor = start;
|
|
118
|
+
this.endColor = end;
|
|
119
|
+
}
|
|
120
|
+
setLineWidth(lineWidth) {
|
|
121
|
+
this.lineWidth = lineWidth;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export { PathOverlay };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Overlay } from './overlay';
|
|
3
|
+
import { View } from '../view/view';
|
|
4
|
+
import { MeshLine2D } from '../element';
|
|
5
|
+
/**
|
|
6
|
+
* POI覆盖层, 画线用
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const PathOverlay2 = new PathOverlay2();
|
|
10
|
+
* // 任意View
|
|
11
|
+
* view.addOverlay(PathOverlay2);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class PathOverlay2 extends Overlay {
|
|
15
|
+
private parent;
|
|
16
|
+
private renderThisFrame;
|
|
17
|
+
private pathMap;
|
|
18
|
+
private enabled;
|
|
19
|
+
static instanceId: number;
|
|
20
|
+
camera: NS_THREE.Camera;
|
|
21
|
+
scene: NS_THREE.Scene;
|
|
22
|
+
renderer: NS_THREE.Renderer;
|
|
23
|
+
constructor();
|
|
24
|
+
init(parent: View): void;
|
|
25
|
+
update(): boolean;
|
|
26
|
+
private handleElementUpdate;
|
|
27
|
+
render(): void;
|
|
28
|
+
resize(containerWidth: number, containerHeight: number): void;
|
|
29
|
+
setEnabled(value: boolean): void;
|
|
30
|
+
createPath(points: [number, number, number][], options: any, ifClear?: boolean): Set<MeshLine2D>;
|
|
31
|
+
removePath(path: MeshLine2D): void;
|
|
32
|
+
clearPaths(): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
export { PathOverlay2 };
|