csyjk 1.2.2 → 2.2.2
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/{dist/app.js → app.js} +0 -0
- package/{dist/index.html → index.html} +0 -0
- package/package.json +5 -40
- package/{dist/style.css → style.css} +0 -0
- package/.babelrc +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/xx.iml +0 -12
- package/public/gltf.js +0 -2241
- package/public/index.html +0 -10
- package/src/index.js +0 -3
- package/src/lib/gltf/assets/check.jpg +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
- package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
- package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
- package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
- package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/package.json +0 -15
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
- package/src/lib/gltf/gltf.css +0 -392
- package/src/lib/gltf/gltf.js +0 -2241
- package/webpack.config.js +0 -70
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
import {Plugin} from "../../viewer/Plugin.js";
|
|
2
|
-
import {Annotation} from "./Annotation.js";
|
|
3
|
-
import {utils} from "../../viewer/scene/utils.js";
|
|
4
|
-
import {math} from "../../viewer/scene/math/math.js";
|
|
5
|
-
|
|
6
|
-
const tempVec3a = math.vec3();
|
|
7
|
-
const tempVec3b = math.vec3();
|
|
8
|
-
const tempVec3c = math.vec3();
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {@link Viewer} plugin that creates {@link Annotation}s.
|
|
12
|
-
*
|
|
13
|
-
* [<img src="https://user-images.githubusercontent.com/83100/58403089-26589280-8062-11e9-8652-aed61a4e8c64.gif">](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_clickFlyToPosition)
|
|
14
|
-
*
|
|
15
|
-
* * [[Example 1: Create annotations with mouse](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_createWithMouse)]
|
|
16
|
-
* * [[Example 2: Click annotations to toggle labels](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_clickShowLabels)]
|
|
17
|
-
* * [[Example 3: Hover annotations to show labels](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_hoverShowLabels)]
|
|
18
|
-
* * [[Example 4: Click annotations to fly to viewpoint](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_clickFlyToPosition)]
|
|
19
|
-
* * [[Example 5: Create Annotations with externally-created elements](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_externalElements)]
|
|
20
|
-
*
|
|
21
|
-
* ## Overview
|
|
22
|
-
*
|
|
23
|
-
* * An {@link Annotation} is a 3D position with a label attached.
|
|
24
|
-
* * Annotations render themselves with HTML elements that float over the canvas; customize the appearance of
|
|
25
|
-
* individual Annotations using HTML template; configure default appearance by setting templates on the AnnotationsPlugin.
|
|
26
|
-
* * Dynamically insert data values into each Annotation's HTML templates; configure default values on the AnnotationsPlugin.
|
|
27
|
-
* * Optionally configure Annotation with externally-created DOM elements for markers and labels; these override templates and data values.
|
|
28
|
-
* * Optionally configure Annotations to hide themselves whenever occluded by {@link Entity}s.
|
|
29
|
-
* * Optionally configure each Annotation with a position we can jump or fly the {@link Camera} to.
|
|
30
|
-
*
|
|
31
|
-
* ## Example 1: Loading a model and creating an annotation
|
|
32
|
-
*
|
|
33
|
-
* In the example below, we'll use an {@link XKTLoaderPlugin} to load a model, and an AnnotationsPlugin
|
|
34
|
-
* to create an {@link Annotation} on it.
|
|
35
|
-
*
|
|
36
|
-
* We'll configure the AnnotationsPlugin with default HTML templates for each Annotation's position (its "marker") and
|
|
37
|
-
* label, along with some default data values to insert into them.
|
|
38
|
-
*
|
|
39
|
-
* When we create our Annotation, we'll give it some specific data values to insert into the templates, overriding some of
|
|
40
|
-
* the defaults we configured on the plugin. Note the correspondence between the placeholders in the templates
|
|
41
|
-
* and the keys in the values map.
|
|
42
|
-
*
|
|
43
|
-
* We'll also configure the Annotation to hide itself whenever it's position is occluded by any {@link Entity}s (this is default behavior). The
|
|
44
|
-
* {@link Scene} periodically occlusion-tests all Annotations on every 20th "tick" (which represents a rendered frame). We
|
|
45
|
-
* can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
|
|
46
|
-
*
|
|
47
|
-
* Finally, we'll query the Annotation's position occlusion/visibility status, and subscribe to change events on those properties.
|
|
48
|
-
*
|
|
49
|
-
* [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_clickShowLabels)]
|
|
50
|
-
*
|
|
51
|
-
* ````JavaScript
|
|
52
|
-
* import {Viewer, XKTLoaderPlugin,AnnotationsPlugin} from "yjkkit-sdk.es.js";
|
|
53
|
-
*
|
|
54
|
-
* const viewer = new Viewer({
|
|
55
|
-
* canvasId: "myCanvas",
|
|
56
|
-
* transparent: true
|
|
57
|
-
* });
|
|
58
|
-
*
|
|
59
|
-
* viewer.scene.camera.eye = [-2.37, 18.97, -26.12];
|
|
60
|
-
* viewer.scene.camera.look = [10.97, 5.82, -11.22];
|
|
61
|
-
* viewer.scene.camera.up = [0.36, 0.83, 0.40];
|
|
62
|
-
*
|
|
63
|
-
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
64
|
-
*
|
|
65
|
-
* const annotations = new AnnotationsPlugin(viewer, {
|
|
66
|
-
*
|
|
67
|
-
* // Default HTML template for marker position
|
|
68
|
-
* markerHTML: "<div class='annotation-marker' style='background-color: {{markerBGColor}};'>{{glyph}}</div>",
|
|
69
|
-
*
|
|
70
|
-
* // Default HTML template for label
|
|
71
|
-
* labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>" +
|
|
72
|
-
* "<div class='annotation-title'>{{title}}</div><div class='annotation-desc'>{{description}}</div></div>",
|
|
73
|
-
*
|
|
74
|
-
* // Default values to insert into the marker and label templates
|
|
75
|
-
* values: {
|
|
76
|
-
* markerBGColor: "red",
|
|
77
|
-
* labelBGColor: "red",
|
|
78
|
-
* glyph: "X",
|
|
79
|
-
* title: "Untitled",
|
|
80
|
-
* description: "No description"
|
|
81
|
-
* }
|
|
82
|
-
* });
|
|
83
|
-
*
|
|
84
|
-
* const model = xktLoader.load({
|
|
85
|
-
* src: "./models/xkt/duplex/geometry.xkt"
|
|
86
|
-
* });
|
|
87
|
-
*
|
|
88
|
-
* model.on("loaded", () => {
|
|
89
|
-
*
|
|
90
|
-
* const entity = viewer.scene.meshes[""];
|
|
91
|
-
*
|
|
92
|
-
* // Create an annotation
|
|
93
|
-
* const myAnnotation1 = annotations.createAnnotation({
|
|
94
|
-
*
|
|
95
|
-
* id: "myAnnotation",
|
|
96
|
-
*
|
|
97
|
-
* entity: viewer.scene.objects["2O2Fr$t4X7Zf8NOew3FLOH"], // Optional, associate with an Entity
|
|
98
|
-
*
|
|
99
|
-
* worldPos: [0, 0, 0], // 3D World-space position
|
|
100
|
-
*
|
|
101
|
-
* occludable: true, // Optional, default, makes Annotation invisible when occluded by Entities
|
|
102
|
-
* markerShown: true, // Optional, default is true, makes position visible (when not occluded)
|
|
103
|
-
* labelShown: true // Optional, default is false, makes label visible (when not occluded)
|
|
104
|
-
*
|
|
105
|
-
* values: { // Optional, overrides AnnotationPlugin's defaults
|
|
106
|
-
* glyph: "A",
|
|
107
|
-
* title: "My Annotation",
|
|
108
|
-
* description: "This is my annotation."
|
|
109
|
-
* }
|
|
110
|
-
* });
|
|
111
|
-
*
|
|
112
|
-
* // Listen for change of the Annotation's 3D World-space position
|
|
113
|
-
*
|
|
114
|
-
* myAnnotation1.on("worldPos", function(worldPos) {
|
|
115
|
-
* //...
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* // Listen for change of the Annotation's 3D View-space position, which happens
|
|
119
|
-
* // when either worldPos was updated or the Camera was moved
|
|
120
|
-
*
|
|
121
|
-
* myAnnotation1.on("viewPos", function(viewPos) {
|
|
122
|
-
* //...
|
|
123
|
-
* });
|
|
124
|
-
*
|
|
125
|
-
* // Listen for change of the Annotation's 2D Canvas-space position, which happens
|
|
126
|
-
* // when worldPos or viewPos was updated, or Camera's projection was updated
|
|
127
|
-
*
|
|
128
|
-
* myAnnotation1.on("canvasPos", function(canvasPos) {
|
|
129
|
-
* //...
|
|
130
|
-
* });
|
|
131
|
-
*
|
|
132
|
-
* // Listen for change of Annotation visibility. The Annotation becomes invisible when it falls outside the canvas,
|
|
133
|
-
* // or its position is occluded by some Entity. Note that, when not occluded, the position is only
|
|
134
|
-
* // shown when Annotation#markerShown is true, and the label is only shown when Annotation#labelShown is true.
|
|
135
|
-
*
|
|
136
|
-
* myAnnotation1.on("visible", function(visible) { // Marker visibility has changed
|
|
137
|
-
* if (visible) {
|
|
138
|
-
* this.log("Annotation is visible");
|
|
139
|
-
* } else {
|
|
140
|
-
* this.log("Annotation is invisible");
|
|
141
|
-
* }
|
|
142
|
-
* });
|
|
143
|
-
*
|
|
144
|
-
* // Listen for destruction of the Annotation
|
|
145
|
-
*
|
|
146
|
-
* myAnnotation1.on("destroyed", () => {
|
|
147
|
-
* //...
|
|
148
|
-
* });
|
|
149
|
-
* });
|
|
150
|
-
* ````
|
|
151
|
-
*
|
|
152
|
-
* Let's query our {@link Annotation}'s current position in the World, View and Canvas coordinate systems:
|
|
153
|
-
*
|
|
154
|
-
* ````javascript
|
|
155
|
-
* const worldPos = myAnnotation.worldPos; // [x,y,z]
|
|
156
|
-
* const viewPos = myAnnotation.viewPos; // [x,y,z]
|
|
157
|
-
* const canvasPos = myAnnotation.canvasPos; // [x,y]
|
|
158
|
-
* ````
|
|
159
|
-
*
|
|
160
|
-
* We can query it's current visibility, which is ````false```` when its position is occluded by some {@link Entity}:
|
|
161
|
-
*
|
|
162
|
-
* ````
|
|
163
|
-
* const visible = myAnnotation1.visible;
|
|
164
|
-
* ````
|
|
165
|
-
*
|
|
166
|
-
* To listen for change events on our Annotation's position and visibility:
|
|
167
|
-
*
|
|
168
|
-
* ````javascript
|
|
169
|
-
* // World-space position changes when we assign a new value to Annotation#worldPos
|
|
170
|
-
* myAnnotation1.on("worldPos", (worldPos) => {
|
|
171
|
-
* //...
|
|
172
|
-
* });
|
|
173
|
-
*
|
|
174
|
-
* // View-space position changes when either worldPos was updated or the Camera was moved
|
|
175
|
-
* myAnnotation1.on("viewPos", (viewPos) => {
|
|
176
|
-
* //...
|
|
177
|
-
* });
|
|
178
|
-
*
|
|
179
|
-
* // Canvas-space position changes when worldPos or viewPos was updated, or Camera's projection was updated
|
|
180
|
-
* myAnnotation1.on("canvasPos", (canvasPos) => {
|
|
181
|
-
* //...
|
|
182
|
-
* });
|
|
183
|
-
*
|
|
184
|
-
* // Annotation is invisible when its position falls off the canvas or is occluded by some Entity
|
|
185
|
-
* myAnnotation1.on("visible", (visible) => {
|
|
186
|
-
* //...
|
|
187
|
-
* });
|
|
188
|
-
* ````
|
|
189
|
-
*
|
|
190
|
-
* Finally, let's dynamically update the values for a couple of placeholders in our Annotation's label:
|
|
191
|
-
*
|
|
192
|
-
* ```` javascript
|
|
193
|
-
* myAnnotation1.setValues({
|
|
194
|
-
* title: "Here's a new title",
|
|
195
|
-
* description: "Here's a new description"
|
|
196
|
-
* });
|
|
197
|
-
* ````
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* ## Example 2: Creating an Annotation with a unique appearance
|
|
201
|
-
*
|
|
202
|
-
* Now let's create a second {@link Annotation}, this time with its own custom HTML label template, which includes
|
|
203
|
-
* an image. In the Annotation's values, we'll also provide a new title and description, custom colors for the marker
|
|
204
|
-
* and label, plus a URL for the image in the label template. To render its marker, the Annotation will fall back
|
|
205
|
-
* on the AnnotationPlugin's default marker template.
|
|
206
|
-
*
|
|
207
|
-
* ````javascript
|
|
208
|
-
* const myAnnotation2 = annotations.createAnnotation({
|
|
209
|
-
*
|
|
210
|
-
* id: "myAnnotation2",
|
|
211
|
-
*
|
|
212
|
-
* worldPos: [-0.163, 1.810, 7.977],
|
|
213
|
-
*
|
|
214
|
-
* occludable: true,
|
|
215
|
-
* markerShown: true,
|
|
216
|
-
* labelShown: true,
|
|
217
|
-
*
|
|
218
|
-
* // Custom label template is the same as the Annotation's, with the addition of an image element
|
|
219
|
-
* labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>\
|
|
220
|
-
* <div class='annotation-title'>{{title}}</div>\
|
|
221
|
-
* <div class='annotation-desc'>{{description}}</div>\
|
|
222
|
-
* <br><img alt='myImage' width='150px' height='100px' src='{{imageSrc}}'>\
|
|
223
|
-
* </div>",
|
|
224
|
-
*
|
|
225
|
-
* // Custom template values override all the AnnotationPlugin's defaults, and includes an additional value
|
|
226
|
-
* // for the image element's URL
|
|
227
|
-
* values: {
|
|
228
|
-
* glyph: "A3",
|
|
229
|
-
* title: "The West wall",
|
|
230
|
-
* description: "Annotations can contain<br>custom HTML like this<br>image:",
|
|
231
|
-
* markerBGColor: "green",
|
|
232
|
-
* labelBGColor: "green",
|
|
233
|
-
* imageSrc: "https://yjkkit.io/img/docs/BIMServerLoaderPlugin/schependomlaan.png"
|
|
234
|
-
* }
|
|
235
|
-
* });
|
|
236
|
-
* ````
|
|
237
|
-
*
|
|
238
|
-
* ## Example 3: Creating an Annotation with a camera position
|
|
239
|
-
*
|
|
240
|
-
* We can optionally configure each {@link Annotation} with a position to fly or jump the {@link Camera} to.
|
|
241
|
-
*
|
|
242
|
-
* Let's create another Annotation, this time providing it with ````eye````, ````look```` and ````up```` properties
|
|
243
|
-
* indicating a viewpoint on whatever it's annotating:
|
|
244
|
-
*
|
|
245
|
-
* ````javascript
|
|
246
|
-
* const myAnnotation3 = annotations.createAnnotation({
|
|
247
|
-
*
|
|
248
|
-
* id: "myAnnotation3",
|
|
249
|
-
*
|
|
250
|
-
* worldPos: [-0.163, 3.810, 7.977],
|
|
251
|
-
*
|
|
252
|
-
* eye: [0,0,-10],
|
|
253
|
-
* look: [-0.163, 3.810, 7.977],
|
|
254
|
-
* up: [0,1,0];
|
|
255
|
-
*
|
|
256
|
-
* occludable: true,
|
|
257
|
-
* markerShown: true,
|
|
258
|
-
* labelShown: true,
|
|
259
|
-
*
|
|
260
|
-
* labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>\
|
|
261
|
-
* <div class='annotation-title'>{{title}}</div>\
|
|
262
|
-
* <div class='annotation-desc'>{{description}}</div>\
|
|
263
|
-
* <br><img alt='myImage' width='150px' height='100px' src='{{imageSrc}}'>\
|
|
264
|
-
* </div>",
|
|
265
|
-
*
|
|
266
|
-
* values: {
|
|
267
|
-
* glyph: "A3",
|
|
268
|
-
* title: "The West wall",
|
|
269
|
-
* description: "Annotations can contain<br>custom HTML like this<br>image:",
|
|
270
|
-
* markerBGColor: "green",
|
|
271
|
-
* labelBGColor: "green",
|
|
272
|
-
* imageSrc: "https://yjkkit.io/img/docs/BIMServerLoaderPlugin/schependomlaan.png"
|
|
273
|
-
* }
|
|
274
|
-
* });
|
|
275
|
-
* ````
|
|
276
|
-
*
|
|
277
|
-
* Now we can fly the {@link Camera} to the Annotation's viewpoint, like this:
|
|
278
|
-
*
|
|
279
|
-
* ````javascript
|
|
280
|
-
* viewer.cameraFlight.flyTo(myAnnotation3);
|
|
281
|
-
* ````
|
|
282
|
-
*
|
|
283
|
-
* Or jump the Camera, like this:
|
|
284
|
-
*
|
|
285
|
-
* ````javascript
|
|
286
|
-
* viewer.cameraFlight.jumpTo(myAnnotation3);
|
|
287
|
-
* ````
|
|
288
|
-
*
|
|
289
|
-
* ## Example 4: Creating an Annotation using externally-created DOM elements
|
|
290
|
-
*
|
|
291
|
-
* Now let's create another {@link Annotation}, this time providing it with pre-existing DOM elements for its marker
|
|
292
|
-
* and label. Note that AnnotationsPlugin will ignore any ````markerHTML````, ````labelHTML````
|
|
293
|
-
* or ````values```` properties when provide ````markerElementId```` or ````labelElementId````.
|
|
294
|
-
*
|
|
295
|
-
* ````javascript
|
|
296
|
-
* const myAnnotation2 = annotations.createAnnotation({
|
|
297
|
-
*
|
|
298
|
-
* id: "myAnnotation2",
|
|
299
|
-
*
|
|
300
|
-
* worldPos: [-0.163, 1.810, 7.977],
|
|
301
|
-
*
|
|
302
|
-
* occludable: true,
|
|
303
|
-
* markerShown: true,
|
|
304
|
-
* labelShown: true,
|
|
305
|
-
*
|
|
306
|
-
* markerElementId: "myMarkerElement",
|
|
307
|
-
* labelElementId: "myLabelElement"
|
|
308
|
-
* });
|
|
309
|
-
* ````
|
|
310
|
-
*
|
|
311
|
-
* ## Example 5: Creating annotations by clicking on objects
|
|
312
|
-
*
|
|
313
|
-
* AnnotationsPlugin makes it easy to create {@link Annotation}s on the surfaces of {@link Entity}s as we click on them.
|
|
314
|
-
*
|
|
315
|
-
* The {@link AnnotationsPlugin#createAnnotation} method can accept a {@link PickResult} returned
|
|
316
|
-
* by {@link Scene#pick}, from which it initializes the {@link Annotation}'s {@link Annotation#worldPos} and
|
|
317
|
-
* {@link Annotation#entity}. Note that this only works when {@link Scene#pick} was configured to perform a 3D
|
|
318
|
-
* surface-intersection pick (see {@link Scene#pick} for more info).
|
|
319
|
-
*
|
|
320
|
-
* Let's now extend our example to create an Annotation wherever we click on the surface of of our model:
|
|
321
|
-
*
|
|
322
|
-
* [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#annotations_createWithMouse)]
|
|
323
|
-
*
|
|
324
|
-
* ````javascript
|
|
325
|
-
* var i = 1; // Used to create unique Annotation IDs
|
|
326
|
-
*
|
|
327
|
-
* viewer.scene.input.on("mouseclicked", (coords) => {
|
|
328
|
-
*
|
|
329
|
-
* var pickRecord = viewer.scene.pick({
|
|
330
|
-
* canvasPos: coords,
|
|
331
|
-
* pickSurface: true // <<------ This causes picking to find the intersection point on the entity
|
|
332
|
-
* });
|
|
333
|
-
*
|
|
334
|
-
* if (pickRecord) {
|
|
335
|
-
*
|
|
336
|
-
* const annotation = annotations.createAnnotation({
|
|
337
|
-
* id: "myAnnotationOnClick" + i,
|
|
338
|
-
* pickRecord: pickRecord,
|
|
339
|
-
* occludable: true, // Optional, default is true
|
|
340
|
-
* markerShown: true, // Optional, default is true
|
|
341
|
-
* labelShown: true, // Optional, default is true
|
|
342
|
-
* values: { // HTML template values
|
|
343
|
-
* glyph: "A" + i,
|
|
344
|
-
* title: "My annotation " + i,
|
|
345
|
-
* description: "My description " + i
|
|
346
|
-
* },
|
|
347
|
-
});
|
|
348
|
-
*
|
|
349
|
-
* i++;
|
|
350
|
-
* }
|
|
351
|
-
* });
|
|
352
|
-
* ````
|
|
353
|
-
*
|
|
354
|
-
* Note that when the Annotation is occludable, there is potential for the {@link Annotation#worldPos} to become
|
|
355
|
-
* visually embedded within the surface of its Entity when viewed from a distance. This happens as a result of limited
|
|
356
|
-
* GPU accuracy GPU accuracy, especially when the near and far view-space clipping planes, specified by {@link Perspective#near}
|
|
357
|
-
* and {@link Perspective#far}, or {@link Ortho#near} and {@link Perspective#far}, are far away from each other.
|
|
358
|
-
*
|
|
359
|
-
* To prevent this, we can offset Annotations from their Entity surfaces by an amount that we set
|
|
360
|
-
* on {@link AnnotationsPlugin#surfaceOffset}:
|
|
361
|
-
*
|
|
362
|
-
* ````javascript
|
|
363
|
-
* annotations.surfaceOffset = 0.3; // Default value
|
|
364
|
-
* ````
|
|
365
|
-
*
|
|
366
|
-
* Annotations subsequently created with {@link AnnotationsPlugin#createAnnotation} using a {@link PickResult} will then
|
|
367
|
-
* be offset by that amount.
|
|
368
|
-
*
|
|
369
|
-
* Another thing we can do to prevent this unwanted occlusion is keep the distance between the view-space clipping
|
|
370
|
-
* planes to a minimum, which improves the accuracy of the Annotation occlusion test. In general, a good default
|
|
371
|
-
* value for ````Perspective#far```` and ````Ortho#far```` is around ````2.000````.
|
|
372
|
-
*/
|
|
373
|
-
class AnnotationsPlugin extends Plugin {
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* @constructor
|
|
377
|
-
* @param {Viewer} viewer The Viewer.
|
|
378
|
-
* @param {Object} cfg Plugin configuration.
|
|
379
|
-
* @param {String} [cfg.id="Annotations"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
380
|
-
* @param {String} [cfg.markerHTML] HTML text template for Annotation markers. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````markerElementId````.
|
|
381
|
-
* @param {String} [cfg.labelHTML] HTML text template for Annotation labels. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````labelElementId````.
|
|
382
|
-
* @param {HTMLElement} [cfg.container] Container DOM element for markers and labels. Defaults to ````document.body````.
|
|
383
|
-
* @param {{String:(String|Number)}} [cfg.values={}] Map of default values to insert into the HTML templates for the marker and label.
|
|
384
|
-
* @param {Number} [cfg.surfaceOffset=0.3] The amount by which each {@link Annotation} is offset from the surface of
|
|
385
|
-
* its {@link Entity} when we create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
|
|
386
|
-
*/
|
|
387
|
-
constructor(viewer, cfg) {
|
|
388
|
-
|
|
389
|
-
super("Annotations", viewer);
|
|
390
|
-
|
|
391
|
-
this._labelHTML = cfg.labelHTML || "<div></div>";
|
|
392
|
-
this._markerHTML = cfg.markerHTML || "<div></div>";
|
|
393
|
-
this._container = cfg.container || document.body;
|
|
394
|
-
this._values = cfg.values || {};
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* The {@link Annotation}s created by {@link AnnotationsPlugin#createAnnotation}, each mapped to its {@link Annotation#id}.
|
|
398
|
-
* @type {{String:Annotation}}
|
|
399
|
-
*/
|
|
400
|
-
this.annotations = {};
|
|
401
|
-
|
|
402
|
-
this.surfaceOffset = cfg.surfaceOffset;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* @private
|
|
407
|
-
*/
|
|
408
|
-
send(name, value) {
|
|
409
|
-
switch (name) {
|
|
410
|
-
case "clearAnnotations":
|
|
411
|
-
this.clear();
|
|
412
|
-
break;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Sets the amount by which each {@link Annotation} is offset from the surface of its {@link Entity}, when we
|
|
418
|
-
* create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
|
|
419
|
-
*
|
|
420
|
-
* See the class comments for more info.
|
|
421
|
-
*
|
|
422
|
-
* This is ````0.3```` by default.
|
|
423
|
-
*
|
|
424
|
-
* @param {Number} surfaceOffset The surface offset.
|
|
425
|
-
*/
|
|
426
|
-
set surfaceOffset(surfaceOffset) {
|
|
427
|
-
if (surfaceOffset === undefined || surfaceOffset === null) {
|
|
428
|
-
surfaceOffset = 0.3;
|
|
429
|
-
}
|
|
430
|
-
this._surfaceOffset = surfaceOffset;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Gets the amount by which an {@link Annotation} is offset from the surface of its {@link Entity} when
|
|
435
|
-
* created by {@link AnnotationsPlugin#createAnnotation}, when we
|
|
436
|
-
* create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
|
|
437
|
-
*
|
|
438
|
-
* This is ````0.3```` by default.
|
|
439
|
-
*
|
|
440
|
-
* @returns {Number} The surface offset.
|
|
441
|
-
*/
|
|
442
|
-
get surfaceOffset() {
|
|
443
|
-
return this._surfaceOffset;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Creates an {@link Annotation}.
|
|
448
|
-
*
|
|
449
|
-
* The Annotation is then registered by {@link Annotation#id} in {@link AnnotationsPlugin#annotations}.
|
|
450
|
-
*
|
|
451
|
-
* @param {Object} params Annotation configuration.
|
|
452
|
-
* @param {String} params.id Unique ID to assign to {@link Annotation#id}. The Annotation will be registered by this in {@link AnnotationsPlugin#annotations} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
|
|
453
|
-
* @param {String} [params.markerElementId] ID of pre-existing DOM element to render the marker. This overrides ````markerHTML```` and does not support ````values```` (data is baked into the label DOM element).
|
|
454
|
-
* @param {String} [params.labelElementId] ID of pre-existing DOM element to render the label. This overrides ````labelHTML```` and does not support ````values```` (data is baked into the label DOM element).
|
|
455
|
-
* @param {String} [params.markerHTML] HTML text template for the Annotation marker. Defaults to the marker HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````markerElementId````.
|
|
456
|
-
* @param {String} [params.labelHTML] HTML text template for the Annotation label. Defaults to the label HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````labelElementId````.
|
|
457
|
-
* @param {Number[]} [params.worldPos=[0,0,0]] World-space position of the Annotation marker, assigned to {@link Annotation#worldPos}.
|
|
458
|
-
* @param {Entity} [params.entity] Optional {@link Entity} to associate the Annotation with. Causes {@link Annotation#visible} to be ````false```` whenever {@link Entity#visible} is also ````false````.
|
|
459
|
-
* @param {PickResult} [params.pickResult] Sets the Annotation's World-space position and direction vector from the given {@link PickResult}'s {@link PickResult#worldPos} and {@link PickResult#worldNormal}, and the Annotation's Entity from {@link PickResult#entity}. Causes ````worldPos```` and ````entity```` parameters to be ignored, if they are also given.
|
|
460
|
-
* @param {Boolean} [params.occludable=false] Indicates whether or not the {@link Annotation} marker and label are hidden whenever the marker occluded by {@link Entity}s in the {@link Scene}. The
|
|
461
|
-
* {@link Scene} periodically occlusion-tests all Annotations on every 20th "tick" (which represents a rendered frame). We can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
|
|
462
|
-
* @param {{String:(String|Number)}} [params.values={}] Map of values to insert into the HTML templates for the marker and label. These will be inserted in addition to any values given to the AnnotationsPlugin constructor.
|
|
463
|
-
* @param {Boolean} [params.markerShown=true] Whether to initially show the {@link Annotation} marker.
|
|
464
|
-
* @param {Boolean} [params.labelShown=false] Whether to initially show the {@link Annotation} label.
|
|
465
|
-
* @param {Number[]} [params.eye] Optional World-space position for {@link Camera#eye}, used when this Annotation is associated with a {@link Camera} position.
|
|
466
|
-
* @param {Number[]} [params.look] Optional World-space position for {@link Camera#look}, used when this Annotation is associated with a {@link Camera} position.
|
|
467
|
-
* @param {Number[]} [params.up] Optional World-space position for {@link Camera#up}, used when this Annotation is associated with a {@link Camera} position.
|
|
468
|
-
* @param {String} [params.projection] Optional projection type for {@link Camera#projection}, used when this Annotation is associated with a {@link Camera} position.
|
|
469
|
-
* @returns {Annotation} The new {@link Annotation}.
|
|
470
|
-
*/
|
|
471
|
-
createAnnotation(params) {
|
|
472
|
-
if (this.viewer.scene.components[params.id]) {
|
|
473
|
-
this.error("Viewer component with this ID already exists: " + params.id);
|
|
474
|
-
delete params.id;
|
|
475
|
-
}
|
|
476
|
-
var worldPos;
|
|
477
|
-
var entity;
|
|
478
|
-
params.pickResult = params.pickResult || params.pickRecord;
|
|
479
|
-
if (params.pickResult) {
|
|
480
|
-
const pickResult = params.pickResult;
|
|
481
|
-
if (!pickResult.worldPos || !pickResult.worldNormal) {
|
|
482
|
-
this.error("Param 'pickResult' does not have both worldPos and worldNormal");
|
|
483
|
-
} else {
|
|
484
|
-
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a);
|
|
485
|
-
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b);
|
|
486
|
-
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c);
|
|
487
|
-
worldPos = offsetWorldPos;
|
|
488
|
-
entity = pickResult.entity;
|
|
489
|
-
}
|
|
490
|
-
} else {
|
|
491
|
-
worldPos = params.worldPos;
|
|
492
|
-
entity = params.entity;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
var markerElement = null;
|
|
496
|
-
if (params.markerElementId) {
|
|
497
|
-
markerElement = document.getElementById(params.markerElementId);
|
|
498
|
-
if (!markerElement) {
|
|
499
|
-
this.error("Can't find DOM element for 'markerElementId' value '" + params.markerElementId + "' - defaulting to internally-generated empty DIV");
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
var labelElement = null;
|
|
504
|
-
if (params.labelElementId) {
|
|
505
|
-
labelElement = document.getElementById(params.labelElementId);
|
|
506
|
-
if (!labelElement) {
|
|
507
|
-
this.error("Can't find DOM element for 'labelElementId' value '" + params.labelElementId + "' - defaulting to internally-generated empty DIV");
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
const annotation = new Annotation(this.viewer.scene, {
|
|
512
|
-
id: params.id,
|
|
513
|
-
plugin: this,
|
|
514
|
-
entity: entity,
|
|
515
|
-
worldPos: worldPos,
|
|
516
|
-
container: this._container,
|
|
517
|
-
markerElement: markerElement,
|
|
518
|
-
labelElement: labelElement,
|
|
519
|
-
markerHTML: params.markerHTML || this._markerHTML,
|
|
520
|
-
labelHTML: params.labelHTML || this._labelHTML,
|
|
521
|
-
occludable: params.occludable,
|
|
522
|
-
values: utils.apply(params.values, utils.apply(this._values, {})),
|
|
523
|
-
markerShown: params.markerShown,
|
|
524
|
-
labelShown: params.labelShown,
|
|
525
|
-
eye: params.eye,
|
|
526
|
-
look: params.look,
|
|
527
|
-
up: params.up,
|
|
528
|
-
projection: params.projection,
|
|
529
|
-
visible: (params.visible !== false)
|
|
530
|
-
});
|
|
531
|
-
this.annotations[annotation.id] = annotation;
|
|
532
|
-
annotation.on("destroyed", () => {
|
|
533
|
-
delete this.annotations[annotation.id];
|
|
534
|
-
this.fire("annotationDestroyed", annotation.id);
|
|
535
|
-
});
|
|
536
|
-
this.fire("annotationCreated", annotation.id);
|
|
537
|
-
return annotation;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Destroys an {@link Annotation}.
|
|
542
|
-
*
|
|
543
|
-
* @param {String} id ID of Annotation to destroy.
|
|
544
|
-
*/
|
|
545
|
-
destroyAnnotation(id) {
|
|
546
|
-
var annotation = this.annotations[id];
|
|
547
|
-
if (!annotation) {
|
|
548
|
-
this.log("Annotation not found: " + id);
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
annotation.destroy();
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* Destroys all {@link Annotation}s.
|
|
556
|
-
*/
|
|
557
|
-
clear() {
|
|
558
|
-
const ids = Object.keys(this.annotations);
|
|
559
|
-
for (var i = 0, len = ids.length; i < len; i++) {
|
|
560
|
-
this.destroyAnnotation(ids[i]);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Destroys this AnnotationsPlugin.
|
|
566
|
-
*
|
|
567
|
-
* Destroys all {@link Annotation}s first.
|
|
568
|
-
*/
|
|
569
|
-
destroy() {
|
|
570
|
-
this.clear();
|
|
571
|
-
super.destroy();
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
export {AnnotationsPlugin}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./AnnotationsPlugin.js";
|