@aibee/owlly 1.0.26 → 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,35 @@
|
|
|
1
|
+
import { CSS2DObject } from '../../external/renderers/css-2d-renderer';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
/**
|
|
4
|
+
* 2D DOM 元素, 可以添加 2D DOM到场景内, 没有透视以及近大远小, 仅进行位置投影
|
|
5
|
+
*/
|
|
6
|
+
declare class DOM2DElement extends Element {
|
|
7
|
+
/** @ignore */
|
|
8
|
+
protected initialzed: boolean;
|
|
9
|
+
/** @ignore */
|
|
10
|
+
protected cssObject: CSS2DObject;
|
|
11
|
+
/** @ignore */
|
|
12
|
+
protected wrapper: HTMLDivElement;
|
|
13
|
+
/** @ignore */
|
|
14
|
+
protected needUpdate: boolean;
|
|
15
|
+
/** 传入的 dom 元素 */
|
|
16
|
+
domElement: HTMLElement;
|
|
17
|
+
/** 可见范围, 默认为 Infinity */
|
|
18
|
+
visibleRadius: number;
|
|
19
|
+
/**
|
|
20
|
+
* @param domElement 要显示的DOM元素
|
|
21
|
+
*/
|
|
22
|
+
constructor(domElement: HTMLElement);
|
|
23
|
+
/**
|
|
24
|
+
* 设置DOM容器的CSS类, 可用来制定CSS样式
|
|
25
|
+
* @param className 类名
|
|
26
|
+
*/
|
|
27
|
+
setWrapperCSSClass(className: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* 设置DOM的ID
|
|
30
|
+
* @param name id名称
|
|
31
|
+
*/
|
|
32
|
+
setWrapperDomID(name: string): void;
|
|
33
|
+
update(): ElementFrameContext;
|
|
34
|
+
}
|
|
35
|
+
export { DOM2DElement };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CSS2DObject } from '../../external/renderers/css-2d-renderer';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
/**
|
|
4
|
+
* 2D DOM 元素, 可以添加 2D DOM到场景内, 没有透视以及近大远小, 仅进行位置投影
|
|
5
|
+
*/
|
|
6
|
+
class DOM2DElement extends Element {
|
|
7
|
+
/**
|
|
8
|
+
* @param domElement 要显示的DOM元素
|
|
9
|
+
*/
|
|
10
|
+
constructor(domElement) {
|
|
11
|
+
super();
|
|
12
|
+
this.domElement = domElement;
|
|
13
|
+
this.wrapper = document.createElement('div');
|
|
14
|
+
this.wrapper.appendChild(this.domElement);
|
|
15
|
+
this.cssObject = new CSS2DObject(this.wrapper);
|
|
16
|
+
this.add(this.cssObject);
|
|
17
|
+
this.up.set(0, 0, 1);
|
|
18
|
+
this.initialzed = true;
|
|
19
|
+
this.visibleRadius = Infinity;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 设置DOM容器的CSS类, 可用来制定CSS样式
|
|
23
|
+
* @param className 类名
|
|
24
|
+
*/
|
|
25
|
+
setWrapperCSSClass(className) {
|
|
26
|
+
this.wrapper.className = className;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 设置DOM的ID
|
|
30
|
+
* @param name id名称
|
|
31
|
+
*/
|
|
32
|
+
setWrapperDomID(name) {
|
|
33
|
+
this.wrapper.id = name;
|
|
34
|
+
}
|
|
35
|
+
update() {
|
|
36
|
+
const frameContext = new ElementFrameContext(this);
|
|
37
|
+
if (this.initialzed) {
|
|
38
|
+
frameContext.shouldPlaceElement = true;
|
|
39
|
+
this.initialzed = false;
|
|
40
|
+
}
|
|
41
|
+
if (this.needUpdate) {
|
|
42
|
+
frameContext.needUpdate = true;
|
|
43
|
+
this.needUpdate = false;
|
|
44
|
+
}
|
|
45
|
+
return frameContext;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export { DOM2DElement };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CSS3DObject } from '../../external/renderers/css-3d-renderer';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
/**
|
|
4
|
+
* 3D DOM 元素, 可以添加 3D DOM到场景内
|
|
5
|
+
*/
|
|
6
|
+
declare class DOM3DElement extends Element {
|
|
7
|
+
/** @ignore */
|
|
8
|
+
protected initialzed: boolean;
|
|
9
|
+
/** @ignore */
|
|
10
|
+
protected cssObject: CSS3DObject;
|
|
11
|
+
/** @ignore */
|
|
12
|
+
protected wrapper: HTMLDivElement;
|
|
13
|
+
/** 传入的 dom 元素 */
|
|
14
|
+
domElement: HTMLElement;
|
|
15
|
+
/** 是否始终面向相机 */
|
|
16
|
+
faceToCamera: boolean;
|
|
17
|
+
/** 是否面向相机时保持z方向不变 */
|
|
18
|
+
keepZOnFaceToCamera: boolean;
|
|
19
|
+
/** 可见范围, 默认为 Infinity */
|
|
20
|
+
visibleRadius: number;
|
|
21
|
+
/**
|
|
22
|
+
* @param domElement 要显示的DOM元素, 注意: 在3D DOM中, 请使用像素(px)作为长度单位, 每个像素对应场景中0.005个单位(正常情况下为5毫米)
|
|
23
|
+
*/
|
|
24
|
+
constructor(domElement: HTMLElement);
|
|
25
|
+
update(): ElementFrameContext;
|
|
26
|
+
}
|
|
27
|
+
export { DOM3DElement };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CSS3DObject } from '../../external/renderers/css-3d-renderer';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
/**
|
|
4
|
+
* 3D DOM 元素, 可以添加 3D DOM到场景内
|
|
5
|
+
*/
|
|
6
|
+
class DOM3DElement extends Element {
|
|
7
|
+
/**
|
|
8
|
+
* @param domElement 要显示的DOM元素, 注意: 在3D DOM中, 请使用像素(px)作为长度单位, 每个像素对应场景中0.005个单位(正常情况下为5毫米)
|
|
9
|
+
*/
|
|
10
|
+
constructor(domElement) {
|
|
11
|
+
super();
|
|
12
|
+
this.domElement = domElement;
|
|
13
|
+
this.wrapper = document.createElement('div');
|
|
14
|
+
this.wrapper.appendChild(this.domElement);
|
|
15
|
+
this.cssObject = new CSS3DObject(this.wrapper);
|
|
16
|
+
this.add(this.cssObject);
|
|
17
|
+
this.up.set(0, 0, 1);
|
|
18
|
+
// this.scale.set(0.005, 0.005, 0.005);
|
|
19
|
+
this.initialzed = true;
|
|
20
|
+
this.visibleRadius = Infinity;
|
|
21
|
+
this.faceToCamera = false;
|
|
22
|
+
this.keepZOnFaceToCamera = false;
|
|
23
|
+
}
|
|
24
|
+
update() {
|
|
25
|
+
const frameContext = new ElementFrameContext(this);
|
|
26
|
+
if (this.initialzed) {
|
|
27
|
+
frameContext.shouldPlaceElement = true;
|
|
28
|
+
this.initialzed = false;
|
|
29
|
+
}
|
|
30
|
+
return frameContext;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export { DOM3DElement };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { DOM2DElement } from './dom-2d-element';
|
|
3
|
+
import { ElementFrameContext } from './element';
|
|
4
|
+
declare type AnchorPosition = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
|
|
5
|
+
declare type TextAttributes = {
|
|
6
|
+
content?: string;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
fontSize?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
padding?: {
|
|
11
|
+
left?: number;
|
|
12
|
+
right?: number;
|
|
13
|
+
top?: number;
|
|
14
|
+
bottom?: number;
|
|
15
|
+
};
|
|
16
|
+
anchor?: AnchorPosition;
|
|
17
|
+
offset?: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
align?: string;
|
|
22
|
+
borderWidth?: number;
|
|
23
|
+
borderColor?: string;
|
|
24
|
+
borderRadius?: number;
|
|
25
|
+
backgroundColor?: string;
|
|
26
|
+
};
|
|
27
|
+
declare type ImageAttributes = {
|
|
28
|
+
src?: string;
|
|
29
|
+
visible?: boolean;
|
|
30
|
+
size?: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
anchor?: AnchorPosition;
|
|
35
|
+
offset?: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
declare type LabelAttributes = {
|
|
41
|
+
position?: NS_THREE.Vector3;
|
|
42
|
+
visible?: boolean;
|
|
43
|
+
bBoxVisible?: boolean;
|
|
44
|
+
bBoxBorderWidth?: number;
|
|
45
|
+
bBoxBorderColor?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 2D DOM 标签, 可展示文字与图片
|
|
49
|
+
*/
|
|
50
|
+
declare class DOMLabel2D extends DOM2DElement {
|
|
51
|
+
private static ANCHOR_MAP;
|
|
52
|
+
private boundingBox;
|
|
53
|
+
private textElement;
|
|
54
|
+
private textPositionInfo;
|
|
55
|
+
private imageElement;
|
|
56
|
+
private imagePositionInfo;
|
|
57
|
+
private calcBBoxNextFrame;
|
|
58
|
+
private needCalcBBox;
|
|
59
|
+
private listeners;
|
|
60
|
+
private status;
|
|
61
|
+
private mouseStart;
|
|
62
|
+
private mouseEnd;
|
|
63
|
+
labelID: number;
|
|
64
|
+
constructor();
|
|
65
|
+
private updateTextTransform;
|
|
66
|
+
private updateImageTransform;
|
|
67
|
+
private calcBBox;
|
|
68
|
+
private registerListeners;
|
|
69
|
+
private unregisterListeners;
|
|
70
|
+
private onImageLoaded;
|
|
71
|
+
private onMouseDown;
|
|
72
|
+
private onMouseMove;
|
|
73
|
+
private onMouseUp;
|
|
74
|
+
private onTouchStart;
|
|
75
|
+
private onTouchMove;
|
|
76
|
+
private onTouchEnd;
|
|
77
|
+
setAttributes({ labelAttrs, imageAttrs, textAttrs }: {
|
|
78
|
+
labelAttrs: LabelAttributes;
|
|
79
|
+
imageAttrs: ImageAttributes;
|
|
80
|
+
textAttrs: TextAttributes;
|
|
81
|
+
}): void;
|
|
82
|
+
setLabelAttrs(attrs: LabelAttributes): void;
|
|
83
|
+
setPosition(position: NS_THREE.Vector3): void;
|
|
84
|
+
setVisible(visible: boolean): void;
|
|
85
|
+
setBBoxVisible(visible: boolean): void;
|
|
86
|
+
setBBoxBorderWidth(width: number): void;
|
|
87
|
+
setBBoxBorderColor(color: string): void;
|
|
88
|
+
setImageAttrs(attrs: ImageAttributes): void;
|
|
89
|
+
setImageVisible(visible: boolean): void;
|
|
90
|
+
setImageSource(src: string): void;
|
|
91
|
+
setImageSize(width: number, height: number): void;
|
|
92
|
+
setImageAnchor(anchor: AnchorPosition): void;
|
|
93
|
+
setImageOffset(offsetX: number, offsetY: number): void;
|
|
94
|
+
setTextAttrs(attrs: TextAttributes): void;
|
|
95
|
+
setTextVisible(visible: boolean): void;
|
|
96
|
+
setTextContent(text: string): void;
|
|
97
|
+
setTextFontSize(size: number): void;
|
|
98
|
+
setTextColor(color: string): void;
|
|
99
|
+
setTextPadding(padding: {
|
|
100
|
+
left?: number;
|
|
101
|
+
right?: number;
|
|
102
|
+
top?: number;
|
|
103
|
+
bottom?: number;
|
|
104
|
+
}): void;
|
|
105
|
+
setTextAnchor(anchor: AnchorPosition): void;
|
|
106
|
+
setTextOffset(offsetX: number, offsetY: number): void;
|
|
107
|
+
setTextBorderWidth(width: number): void;
|
|
108
|
+
setTextAlign(align: string): void;
|
|
109
|
+
setTextBorderColor(color: string): void;
|
|
110
|
+
setTextBorderRadius(radius: number): void;
|
|
111
|
+
setTextBackgroundColor(color: string): void;
|
|
112
|
+
setLabelID(labelID: number): void;
|
|
113
|
+
update(): ElementFrameContext;
|
|
114
|
+
dispose(): void;
|
|
115
|
+
}
|
|
116
|
+
export { DOMLabel2D };
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { Externals } from '../stage/externals';
|
|
2
|
+
import { DOM2DElement } from './dom-2d-element';
|
|
3
|
+
import { ElementFrameContext } from './element';
|
|
4
|
+
import { Events } from '../utils/events';
|
|
5
|
+
/**
|
|
6
|
+
* 2D DOM 标签, 可展示文字与图片
|
|
7
|
+
*/
|
|
8
|
+
class DOMLabel2D extends DOM2DElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(document.createElement('div')); // this.domElement === wrapper
|
|
11
|
+
const { THREE } = Externals.getInstance();
|
|
12
|
+
this.boundingBox = document.createElement('div');
|
|
13
|
+
this.textElement = document.createElement('div');
|
|
14
|
+
this.imageElement = document.createElement('img');
|
|
15
|
+
this.textPositionInfo = { anchor: 'center', offsetX: 0, offsetY: 0 };
|
|
16
|
+
this.imagePositionInfo = { anchor: 'center', offsetX: 0, offsetY: 0 };
|
|
17
|
+
this.imageElement.setAttribute('draggable', 'false');
|
|
18
|
+
this.textElement.style.cssText = `
|
|
19
|
+
position: absolute;
|
|
20
|
+
transform: translate(-50%, -50%);
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
border-style: solid;
|
|
23
|
+
border-width: 0;
|
|
24
|
+
border-color: white;
|
|
25
|
+
line-height: 1.5;
|
|
26
|
+
`;
|
|
27
|
+
this.imageElement.style.cssText = `
|
|
28
|
+
position: absolute;
|
|
29
|
+
transform: translate(-50%, -50%);
|
|
30
|
+
`;
|
|
31
|
+
this.boundingBox.style.cssText = `
|
|
32
|
+
position: absolute;
|
|
33
|
+
transform: translate(-50%, -50%);
|
|
34
|
+
display: none;
|
|
35
|
+
border-style: solid;
|
|
36
|
+
border-width: 2px;
|
|
37
|
+
border-color: red;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
`;
|
|
41
|
+
this.status = 'idle';
|
|
42
|
+
this.mouseStart = new THREE.Vector2();
|
|
43
|
+
this.mouseEnd = new THREE.Vector2();
|
|
44
|
+
this.listeners = {
|
|
45
|
+
onImageLoaded: () => { this.onImageLoaded(); },
|
|
46
|
+
onMouseDown: (e) => { this.onMouseDown(e); },
|
|
47
|
+
onMouseMove: (e) => { this.onMouseMove(e); },
|
|
48
|
+
onMouseUp: (e) => { this.onMouseUp(e); },
|
|
49
|
+
onTouchStart: (e) => { this.onTouchStart(e); },
|
|
50
|
+
onTouchMove: (e) => { this.onTouchMove(e); },
|
|
51
|
+
onTouchEnd: (e) => { this.onTouchEnd(e); },
|
|
52
|
+
};
|
|
53
|
+
this.registerListeners();
|
|
54
|
+
this.domElement.appendChild(this.imageElement);
|
|
55
|
+
this.domElement.appendChild(this.textElement);
|
|
56
|
+
this.domElement.appendChild(this.boundingBox);
|
|
57
|
+
this.calcBBoxNextFrame = true;
|
|
58
|
+
}
|
|
59
|
+
updateTextTransform() {
|
|
60
|
+
const { offsetX, offsetY, anchor } = this.textPositionInfo;
|
|
61
|
+
const { x, y } = DOMLabel2D.ANCHOR_MAP[anchor];
|
|
62
|
+
this.textElement.style.transform = `translate(${x}, ${y}) translate(${offsetX}px, ${offsetY}px)`;
|
|
63
|
+
}
|
|
64
|
+
updateImageTransform() {
|
|
65
|
+
const { offsetX, offsetY, anchor } = this.imagePositionInfo;
|
|
66
|
+
const { x, y } = DOMLabel2D.ANCHOR_MAP[anchor];
|
|
67
|
+
this.imageElement.style.transform = `translate(${x}, ${y}) translate(${offsetX}px, ${offsetY}px)`;
|
|
68
|
+
}
|
|
69
|
+
calcBBox() {
|
|
70
|
+
if (!this.visible || this.boundingBox.style.display === 'none')
|
|
71
|
+
return;
|
|
72
|
+
const wrapperBoundingRect = this.domElement.getBoundingClientRect();
|
|
73
|
+
const textBoundingRect = this.textElement.getBoundingClientRect();
|
|
74
|
+
const imageBoundingRect = this.imageElement.getBoundingClientRect();
|
|
75
|
+
const { left: textMinX, right: textMaxX, top: textMinY, bottom: textMaxY, } = textBoundingRect;
|
|
76
|
+
const { left: imageMinX, right: imageMaxX, top: imageMinY, bottom: imageMaxY, } = imageBoundingRect;
|
|
77
|
+
const points = [];
|
|
78
|
+
const { THREE } = Externals.getInstance();
|
|
79
|
+
if (this.textElement.style.display !== 'none') {
|
|
80
|
+
points.push(new THREE.Vector2(textMinX, textMinY));
|
|
81
|
+
points.push(new THREE.Vector2(textMaxX, textMaxY));
|
|
82
|
+
}
|
|
83
|
+
if (this.imageElement.style.display !== 'none') {
|
|
84
|
+
points.push(new THREE.Vector2(imageMinX, imageMinY));
|
|
85
|
+
points.push(new THREE.Vector2(imageMaxX, imageMaxY));
|
|
86
|
+
}
|
|
87
|
+
let width = 0;
|
|
88
|
+
let height = 0;
|
|
89
|
+
let offsetX = 0;
|
|
90
|
+
let offsetY = 0;
|
|
91
|
+
if (points.length) {
|
|
92
|
+
const box2 = new THREE.Box2().setFromPoints(points);
|
|
93
|
+
const { x, y } = wrapperBoundingRect;
|
|
94
|
+
width = box2.max.x - box2.min.x + 12;
|
|
95
|
+
height = box2.max.y - box2.min.y + 12;
|
|
96
|
+
offsetX = box2.min.x - x - 6;
|
|
97
|
+
offsetY = box2.min.y - y - 6;
|
|
98
|
+
}
|
|
99
|
+
this.boundingBox.style.transform = `translate(${offsetX}px, ${offsetY}px)`;
|
|
100
|
+
this.boundingBox.style.width = `${width}px`;
|
|
101
|
+
this.boundingBox.style.height = `${height}px`;
|
|
102
|
+
}
|
|
103
|
+
/* EventListeners */
|
|
104
|
+
registerListeners() {
|
|
105
|
+
this.imageElement.addEventListener('load', this.listeners.onImageLoaded);
|
|
106
|
+
this.imageElement.addEventListener('pointerdown', this.listeners.onMouseDown);
|
|
107
|
+
this.imageElement.addEventListener('touchstart', this.listeners.onTouchStart);
|
|
108
|
+
this.imageElement.addEventListener('touchmove', this.listeners.onTouchMove);
|
|
109
|
+
this.imageElement.addEventListener('touchend', this.listeners.onTouchEnd);
|
|
110
|
+
this.textElement.addEventListener('pointerdown', this.listeners.onMouseDown);
|
|
111
|
+
this.textElement.addEventListener('touchstart', this.listeners.onTouchStart);
|
|
112
|
+
this.textElement.addEventListener('touchmove', this.listeners.onTouchMove);
|
|
113
|
+
this.textElement.addEventListener('touchend', this.listeners.onTouchEnd);
|
|
114
|
+
}
|
|
115
|
+
unregisterListeners() {
|
|
116
|
+
this.imageElement.removeEventListener('load', this.listeners.onImageLoaded);
|
|
117
|
+
this.imageElement.removeEventListener('pointerdown', this.listeners.onMouseDown);
|
|
118
|
+
this.imageElement.removeEventListener('touchstart', this.listeners.onTouchStart);
|
|
119
|
+
this.imageElement.removeEventListener('touchmove', this.listeners.onTouchMove);
|
|
120
|
+
this.imageElement.removeEventListener('touchend', this.listeners.onTouchEnd);
|
|
121
|
+
this.textElement.removeEventListener('pointerdown', this.listeners.onMouseDown);
|
|
122
|
+
this.textElement.removeEventListener('touchstart', this.listeners.onTouchStart);
|
|
123
|
+
this.textElement.removeEventListener('touchmove', this.listeners.onTouchMove);
|
|
124
|
+
this.textElement.removeEventListener('touchend', this.listeners.onTouchEnd);
|
|
125
|
+
}
|
|
126
|
+
onImageLoaded() {
|
|
127
|
+
if (this.imageElement.style.width === '') {
|
|
128
|
+
this.imageElement.style.width = `${this.imageElement.width}px`;
|
|
129
|
+
}
|
|
130
|
+
if (this.imageElement.style.height === '') {
|
|
131
|
+
this.imageElement.style.height = `${this.imageElement.height}px`;
|
|
132
|
+
}
|
|
133
|
+
this.calcBBoxNextFrame = true;
|
|
134
|
+
}
|
|
135
|
+
onMouseDown(e) {
|
|
136
|
+
if (this.status !== 'idle' || e.pointerType !== 'mouse' || e.button !== 0)
|
|
137
|
+
return;
|
|
138
|
+
this.mouseStart.set(e.clientX, e.clientY);
|
|
139
|
+
this.emit(Events.LABEL_DOWN, this, null, 0);
|
|
140
|
+
this.imageElement.ownerDocument.addEventListener('pointermove', this.listeners.onMouseMove);
|
|
141
|
+
this.imageElement.ownerDocument.addEventListener('pointerup', this.listeners.onMouseUp);
|
|
142
|
+
this.status = 'down';
|
|
143
|
+
}
|
|
144
|
+
onMouseMove(e) {
|
|
145
|
+
if (this.status !== 'down' || e.pointerType !== 'mouse' || e.button !== 0)
|
|
146
|
+
return;
|
|
147
|
+
this.status = 'move';
|
|
148
|
+
}
|
|
149
|
+
onMouseUp(e) {
|
|
150
|
+
if (this.status === 'idle' || e.pointerType !== 'mouse')
|
|
151
|
+
return;
|
|
152
|
+
this.mouseEnd.set(e.clientX, e.clientY);
|
|
153
|
+
if (this.status === 'down' || this.mouseStart.distanceToSquared(this.mouseEnd) < 100) {
|
|
154
|
+
this.emit(Events.ELEMENT_SELECTED, this, null, 0);
|
|
155
|
+
}
|
|
156
|
+
this.imageElement.ownerDocument.removeEventListener('pointermove', this.listeners.onMouseMove);
|
|
157
|
+
this.imageElement.ownerDocument.removeEventListener('pointerup', this.listeners.onMouseUp);
|
|
158
|
+
this.status = 'idle';
|
|
159
|
+
}
|
|
160
|
+
onTouchStart(e) {
|
|
161
|
+
if (this.status !== 'idle' || e.touches.length > 1)
|
|
162
|
+
return;
|
|
163
|
+
this.mouseStart.set(e.touches[0].pageX, e.touches[0].pageY);
|
|
164
|
+
this.emit(Events.LABEL_DOWN, this, null, 0);
|
|
165
|
+
this.status = 'down';
|
|
166
|
+
}
|
|
167
|
+
onTouchMove(e) {
|
|
168
|
+
if (this.status !== 'down' || e.touches.length > 1)
|
|
169
|
+
return;
|
|
170
|
+
this.status = 'move';
|
|
171
|
+
}
|
|
172
|
+
onTouchEnd(e) {
|
|
173
|
+
if (this.status === 'idle')
|
|
174
|
+
return;
|
|
175
|
+
this.mouseEnd.set(e.changedTouches[0].pageX, e.changedTouches[0].pageY);
|
|
176
|
+
if (this.status === 'down' || this.mouseStart.distanceToSquared(this.mouseEnd) < 100) {
|
|
177
|
+
this.emit(Events.ELEMENT_SELECTED, this, null, 0);
|
|
178
|
+
}
|
|
179
|
+
this.status = 'idle';
|
|
180
|
+
}
|
|
181
|
+
/* LABEL WRAPPER */
|
|
182
|
+
setAttributes({ labelAttrs, imageAttrs, textAttrs }) {
|
|
183
|
+
if (labelAttrs !== undefined)
|
|
184
|
+
this.setLabelAttrs(labelAttrs);
|
|
185
|
+
if (imageAttrs !== undefined)
|
|
186
|
+
this.setImageAttrs(imageAttrs);
|
|
187
|
+
if (textAttrs !== undefined)
|
|
188
|
+
this.setTextAttrs(textAttrs);
|
|
189
|
+
}
|
|
190
|
+
setLabelAttrs(attrs) {
|
|
191
|
+
if (attrs.position !== undefined)
|
|
192
|
+
this.setPosition(attrs.position);
|
|
193
|
+
if (attrs.visible !== undefined)
|
|
194
|
+
this.setVisible(attrs.visible);
|
|
195
|
+
if (attrs.bBoxVisible !== undefined)
|
|
196
|
+
this.setBBoxVisible(attrs.bBoxVisible);
|
|
197
|
+
if (attrs.bBoxBorderWidth !== undefined)
|
|
198
|
+
this.setBBoxBorderWidth(attrs.bBoxBorderWidth);
|
|
199
|
+
if (attrs.bBoxBorderColor !== undefined)
|
|
200
|
+
this.setBBoxBorderColor(attrs.bBoxBorderColor);
|
|
201
|
+
}
|
|
202
|
+
setPosition(position) {
|
|
203
|
+
this.position.copy(position);
|
|
204
|
+
this.needUpdate = true;
|
|
205
|
+
}
|
|
206
|
+
setVisible(visible) {
|
|
207
|
+
this.visible = visible;
|
|
208
|
+
this.cssObject.visible = visible;
|
|
209
|
+
this.needUpdate = true;
|
|
210
|
+
}
|
|
211
|
+
setBBoxVisible(visible) {
|
|
212
|
+
this.boundingBox.style.display = visible ? 'block' : 'none';
|
|
213
|
+
if (visible)
|
|
214
|
+
this.calcBBoxNextFrame = true;
|
|
215
|
+
}
|
|
216
|
+
setBBoxBorderWidth(width) {
|
|
217
|
+
this.boundingBox.style.borderWidth = `${width}px`;
|
|
218
|
+
}
|
|
219
|
+
setBBoxBorderColor(color) {
|
|
220
|
+
this.boundingBox.style.borderColor = color;
|
|
221
|
+
}
|
|
222
|
+
/* LABEL IMAGE */
|
|
223
|
+
setImageAttrs(attrs) {
|
|
224
|
+
if (attrs.src !== undefined)
|
|
225
|
+
this.setImageSource(attrs.src);
|
|
226
|
+
if (attrs.visible !== undefined)
|
|
227
|
+
this.setImageVisible(attrs.visible);
|
|
228
|
+
if (attrs.size !== undefined)
|
|
229
|
+
this.setImageSize(attrs.size.width, attrs.size.height);
|
|
230
|
+
if (attrs.anchor !== undefined)
|
|
231
|
+
this.setImageAnchor(attrs.anchor);
|
|
232
|
+
if (attrs.offset !== undefined)
|
|
233
|
+
this.setImageOffset(attrs.offset.x, attrs.offset.y);
|
|
234
|
+
}
|
|
235
|
+
setImageVisible(visible) {
|
|
236
|
+
this.imageElement.style.display = visible ? 'block' : 'none';
|
|
237
|
+
}
|
|
238
|
+
setImageSource(src) {
|
|
239
|
+
this.imageElement.src = src;
|
|
240
|
+
}
|
|
241
|
+
setImageSize(width, height) {
|
|
242
|
+
this.imageElement.style.height = `${height}px`;
|
|
243
|
+
this.imageElement.style.width = `${width}px`;
|
|
244
|
+
this.calcBBoxNextFrame = true;
|
|
245
|
+
}
|
|
246
|
+
setImageAnchor(anchor) {
|
|
247
|
+
this.imagePositionInfo.anchor = anchor;
|
|
248
|
+
this.updateImageTransform();
|
|
249
|
+
this.calcBBoxNextFrame = true;
|
|
250
|
+
}
|
|
251
|
+
setImageOffset(offsetX, offsetY) {
|
|
252
|
+
this.imagePositionInfo.offsetX = offsetX;
|
|
253
|
+
this.imagePositionInfo.offsetY = offsetY;
|
|
254
|
+
this.updateImageTransform();
|
|
255
|
+
this.calcBBoxNextFrame = true;
|
|
256
|
+
}
|
|
257
|
+
/* LABEL TEXT */
|
|
258
|
+
setTextAttrs(attrs) {
|
|
259
|
+
if (attrs.content !== undefined)
|
|
260
|
+
this.setTextContent(attrs.content);
|
|
261
|
+
if (attrs.visible !== undefined)
|
|
262
|
+
this.setTextVisible(attrs.visible);
|
|
263
|
+
if (attrs.fontSize !== undefined)
|
|
264
|
+
this.setTextFontSize(attrs.fontSize);
|
|
265
|
+
if (attrs.color !== undefined)
|
|
266
|
+
this.setTextColor(attrs.color);
|
|
267
|
+
if (attrs.padding !== undefined)
|
|
268
|
+
this.setTextPadding(attrs.padding);
|
|
269
|
+
if (attrs.anchor !== undefined)
|
|
270
|
+
this.setTextAnchor(attrs.anchor);
|
|
271
|
+
if (attrs.offset !== undefined)
|
|
272
|
+
this.setTextOffset(attrs.offset.x, attrs.offset.y);
|
|
273
|
+
if (attrs.align !== undefined)
|
|
274
|
+
this.setTextAlign(attrs.align);
|
|
275
|
+
if (attrs.borderWidth !== undefined)
|
|
276
|
+
this.setTextBorderWidth(attrs.borderWidth);
|
|
277
|
+
if (attrs.borderColor !== undefined)
|
|
278
|
+
this.setTextBorderColor(attrs.borderColor);
|
|
279
|
+
if (attrs.borderRadius !== undefined)
|
|
280
|
+
this.setTextBorderRadius(attrs.borderRadius);
|
|
281
|
+
if (attrs.backgroundColor !== undefined)
|
|
282
|
+
this.setTextBackgroundColor(attrs.backgroundColor);
|
|
283
|
+
}
|
|
284
|
+
setTextVisible(visible) {
|
|
285
|
+
this.textElement.style.display = visible ? 'block' : 'none';
|
|
286
|
+
this.calcBBoxNextFrame = true;
|
|
287
|
+
}
|
|
288
|
+
setTextContent(text) {
|
|
289
|
+
this.textElement.innerText = text;
|
|
290
|
+
this.calcBBoxNextFrame = true;
|
|
291
|
+
}
|
|
292
|
+
setTextFontSize(size) {
|
|
293
|
+
this.textElement.style.fontSize = `${size}px`;
|
|
294
|
+
this.calcBBoxNextFrame = true;
|
|
295
|
+
}
|
|
296
|
+
setTextColor(color) {
|
|
297
|
+
this.textElement.style.color = color;
|
|
298
|
+
}
|
|
299
|
+
setTextPadding(padding) {
|
|
300
|
+
const targetPadding = {
|
|
301
|
+
left: 0, right: 0, top: 0, bottom: 0,
|
|
302
|
+
};
|
|
303
|
+
if (padding.left !== undefined)
|
|
304
|
+
targetPadding.left = padding.left;
|
|
305
|
+
if (padding.right !== undefined)
|
|
306
|
+
targetPadding.right = padding.right;
|
|
307
|
+
if (padding.top !== undefined)
|
|
308
|
+
targetPadding.top = padding.top;
|
|
309
|
+
if (padding.bottom !== undefined)
|
|
310
|
+
targetPadding.bottom = padding.bottom;
|
|
311
|
+
const { left, right, top, bottom, } = targetPadding;
|
|
312
|
+
this.textElement.style.padding = `${top}px ${right}px ${bottom}px ${left}px`;
|
|
313
|
+
this.calcBBoxNextFrame = true;
|
|
314
|
+
}
|
|
315
|
+
setTextAnchor(anchor) {
|
|
316
|
+
this.textPositionInfo.anchor = anchor;
|
|
317
|
+
this.updateTextTransform();
|
|
318
|
+
this.calcBBoxNextFrame = true;
|
|
319
|
+
}
|
|
320
|
+
setTextOffset(offsetX, offsetY) {
|
|
321
|
+
this.textPositionInfo.offsetX = offsetX;
|
|
322
|
+
this.textPositionInfo.offsetY = offsetY;
|
|
323
|
+
this.updateTextTransform();
|
|
324
|
+
this.calcBBoxNextFrame = true;
|
|
325
|
+
}
|
|
326
|
+
setTextBorderWidth(width) {
|
|
327
|
+
this.textElement.style.borderWidth = `${width}px`;
|
|
328
|
+
this.calcBBoxNextFrame = true;
|
|
329
|
+
}
|
|
330
|
+
setTextAlign(align) {
|
|
331
|
+
this.textElement.style.textAlign = align;
|
|
332
|
+
}
|
|
333
|
+
setTextBorderColor(color) {
|
|
334
|
+
this.textElement.style.borderColor = color;
|
|
335
|
+
}
|
|
336
|
+
setTextBorderRadius(radius) {
|
|
337
|
+
this.textElement.style.borderRadius = `${radius}px`;
|
|
338
|
+
}
|
|
339
|
+
setTextBackgroundColor(color) {
|
|
340
|
+
this.textElement.style.backgroundColor = color;
|
|
341
|
+
}
|
|
342
|
+
setLabelID(labelID) {
|
|
343
|
+
this.labelID = labelID;
|
|
344
|
+
}
|
|
345
|
+
update() {
|
|
346
|
+
const frameContext = new ElementFrameContext(this);
|
|
347
|
+
if (this.needCalcBBox)
|
|
348
|
+
this.calcBBox();
|
|
349
|
+
this.needCalcBBox = false;
|
|
350
|
+
if (this.calcBBoxNextFrame)
|
|
351
|
+
this.needCalcBBox = true;
|
|
352
|
+
this.calcBBoxNextFrame = false;
|
|
353
|
+
if (this.initialzed) {
|
|
354
|
+
frameContext.shouldPlaceElement = true;
|
|
355
|
+
this.initialzed = false;
|
|
356
|
+
}
|
|
357
|
+
if (this.needUpdate) {
|
|
358
|
+
frameContext.needUpdate = true;
|
|
359
|
+
this.needUpdate = false;
|
|
360
|
+
}
|
|
361
|
+
return frameContext;
|
|
362
|
+
}
|
|
363
|
+
dispose() {
|
|
364
|
+
this.unregisterListeners();
|
|
365
|
+
this.domElement.removeChild(this.boundingBox);
|
|
366
|
+
this.domElement.removeChild(this.textElement);
|
|
367
|
+
this.domElement.removeChild(this.imageElement);
|
|
368
|
+
super.dispose();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
DOMLabel2D.ANCHOR_MAP = {
|
|
372
|
+
center: { x: '-50%', y: '-50%' },
|
|
373
|
+
left: { x: '0', y: '-50%' },
|
|
374
|
+
right: { x: '-100%', y: '-50%' },
|
|
375
|
+
top: { x: '-50%', y: '0' },
|
|
376
|
+
bottom: { x: '-50%', y: '-100%' },
|
|
377
|
+
topleft: { x: '0', y: '0' },
|
|
378
|
+
topright: { x: '-100%', y: '0' },
|
|
379
|
+
bottomleft: { x: '0', y: '-100%' },
|
|
380
|
+
bottomright: { x: '-100%', y: '-100%' },
|
|
381
|
+
};
|
|
382
|
+
export { DOMLabel2D };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
/** @ignore */
|
|
3
|
+
declare class ElementFrameContext {
|
|
4
|
+
element: Element;
|
|
5
|
+
needUpdate: boolean;
|
|
6
|
+
shouldPlaceElement: boolean;
|
|
7
|
+
constructor(element: Element, needsUpdate?: boolean);
|
|
8
|
+
}
|
|
9
|
+
/** 元素类 */
|
|
10
|
+
declare abstract class Element extends NS_THREE.Object3D {
|
|
11
|
+
/** @ignore */
|
|
12
|
+
abstract update(): ElementFrameContext;
|
|
13
|
+
private universalId?;
|
|
14
|
+
private elementListeners;
|
|
15
|
+
protected eventMap: Map<string, Set<Function>>;
|
|
16
|
+
constructor();
|
|
17
|
+
private onElementSelected;
|
|
18
|
+
/**
|
|
19
|
+
* 获取元素的uuid
|
|
20
|
+
*/
|
|
21
|
+
getUUID(): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* 设置元素的uuid
|
|
24
|
+
* @param uuid 配置的uuid
|
|
25
|
+
*/
|
|
26
|
+
setUUID(uuid: string): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
/**
|
|
29
|
+
* 注册事件监听
|
|
30
|
+
* @param event 事件名
|
|
31
|
+
* @param callback 回调函数
|
|
32
|
+
*/
|
|
33
|
+
on(event: string, callback: Function): void;
|
|
34
|
+
protected emit(event: string, ...args: unknown[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* 注销事件监听
|
|
37
|
+
* @param event 事件名
|
|
38
|
+
* @param callback 回调函数
|
|
39
|
+
*/
|
|
40
|
+
off(event: string, callback: Function): void;
|
|
41
|
+
}
|
|
42
|
+
interface Element {
|
|
43
|
+
/** 可碰撞成员元素 */
|
|
44
|
+
intersectables?: NS_THREE.Object3D[];
|
|
45
|
+
/**
|
|
46
|
+
* 加载数据
|
|
47
|
+
* @param args 加载数据所需要的参数
|
|
48
|
+
*/
|
|
49
|
+
load?(...args: unknown[]): unknown;
|
|
50
|
+
resize?(width: number, height: number): void;
|
|
51
|
+
render?(): void;
|
|
52
|
+
}
|
|
53
|
+
export { Element, ElementFrameContext };
|