csyjk 1.2.2 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- 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,822 +0,0 @@
|
|
1
|
-
import {Plugin} from "../../viewer/Plugin.js";
|
2
|
-
import {Storey} from "./Storey.js";
|
3
|
-
import {IFCStoreyPlanObjectStates} from "./IFCStoreyPlanObjectStates.js";
|
4
|
-
import {math} from "../../viewer/scene/math/math.js";
|
5
|
-
import {ObjectsMemento} from "../../viewer/scene/mementos/ObjectsMemento.js";
|
6
|
-
import {CameraMemento} from "../../viewer/scene/mementos/CameraMemento.js";
|
7
|
-
import {StoreyMap} from "./StoreyMap.js";
|
8
|
-
import {utils} from "../../viewer/scene/utils.js";
|
9
|
-
|
10
|
-
const tempVec3a = math.vec3();
|
11
|
-
const tempMat4 = math.mat4();
|
12
|
-
|
13
|
-
const EMPTY_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
|
14
|
-
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @desc A {@link Viewer} plugin that provides methods for visualizing IfcBuildingStoreys.
|
18
|
-
*
|
19
|
-
* <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_recipe2"><img src="http://yjkkit.io/img/docs/StoreyViewsPlugin/minimap.gif"></a>
|
20
|
-
*
|
21
|
-
* [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_recipe2)]
|
22
|
-
*
|
23
|
-
* ## Overview
|
24
|
-
*
|
25
|
-
* StoreyViewsPlugin provides a flexible set of methods for visualizing building storeys in 3D and 2D.
|
26
|
-
*
|
27
|
-
* Use the first two methods to set up 3D views of storeys:
|
28
|
-
*
|
29
|
-
* * [showStoreyObjects](#instance-method-showStoreyObjects) - shows the {@link Entity}s within a storey, and
|
30
|
-
* * [gotoStoreyCamera](#instance-method-gotoStoreyCamera) - positions the {@link Camera} for a plan view of the Entitys within a storey.
|
31
|
-
* <br> <br>
|
32
|
-
*
|
33
|
-
* Use the second two methods to create 2D plan view mini-map images:
|
34
|
-
*
|
35
|
-
* * [createStoreyMap](#instance-method-createStoreyMap) - creates a 2D plan view image of a storey, and
|
36
|
-
* * [pickStoreyMap](#instance-method-pickStoreyMap) - picks the {@link Entity} at the given 2D pixel coordinates within a plan view image.
|
37
|
-
*
|
38
|
-
* ## Usage
|
39
|
-
*
|
40
|
-
* Let's start by creating a {@link Viewer} with a StoreyViewsPlugin and an {@link XKTLoaderPlugin}.
|
41
|
-
*
|
42
|
-
* Then we'll load a BIM building model from an ```.xkt``` file.
|
43
|
-
*
|
44
|
-
* ````javascript
|
45
|
-
* import {Viewer, XKTLoaderPlugin, StoreyViewsPlugin} from "yjkkit-sdk.es.js";
|
46
|
-
*
|
47
|
-
* // Create a Viewer, arrange the camera
|
48
|
-
*
|
49
|
-
* const viewer = new Viewer({
|
50
|
-
* canvasId: "myCanvas",
|
51
|
-
* transparent: true
|
52
|
-
* });
|
53
|
-
*
|
54
|
-
* viewer.camera.eye = [-2.56, 8.38, 8.27];
|
55
|
-
* viewer.camera.look = [13.44, 3.31, -14.83];
|
56
|
-
* viewer.camera.up = [0.10, 0.98, -0.14];
|
57
|
-
*
|
58
|
-
* // Add an XKTLoaderPlugin
|
59
|
-
*
|
60
|
-
* const xktLoader = new XKTLoaderPlugin(viewer);
|
61
|
-
*
|
62
|
-
* // Add a StoreyViewsPlugin
|
63
|
-
*
|
64
|
-
* const storeyViewsPlugin = new StoreyViewsPlugin(viewer);
|
65
|
-
*
|
66
|
-
* // Load a BIM model from .xkt format
|
67
|
-
*
|
68
|
-
* const model = xktLoader.load({
|
69
|
-
* id: "myModel",
|
70
|
-
* src: "./models/xkt/Schependomlaan.xkt",
|
71
|
-
* edges: true
|
72
|
-
* });
|
73
|
-
* ````
|
74
|
-
*
|
75
|
-
* ## Finding Storeys
|
76
|
-
*
|
77
|
-
* Getting information on a storey in our model:
|
78
|
-
*
|
79
|
-
* ````javascript
|
80
|
-
* const storey = storeyViewsPlugin.storeys["2SWZMQPyD9pfT9q87pgXa1"]; // ID of the IfcBuildingStorey
|
81
|
-
*
|
82
|
-
* const modelId = storey.modelId; // "myModel"
|
83
|
-
* const storeyId = storey.storeyId; // "2SWZMQPyD9pfT9q87pgXa1"
|
84
|
-
* const aabb = storey.aabb; // Axis-aligned 3D World-space boundary of the IfcBuildingStorey
|
85
|
-
* ````
|
86
|
-
*
|
87
|
-
* We can also get a "storeys" event every time the set of storeys changes, ie. every time a storey is created or destroyed:
|
88
|
-
*
|
89
|
-
* ````javascript
|
90
|
-
* storeyViewsPlugin.on("storeys", ()=> {
|
91
|
-
* const storey = storeyViewsPlugin.storeys["2SWZMQPyD9pfT9q87pgXa1"];
|
92
|
-
* //...
|
93
|
-
* });
|
94
|
-
* ````
|
95
|
-
*
|
96
|
-
* ## Showing Entitys within Storeys
|
97
|
-
*
|
98
|
-
* Showing the {@link Entity}s within a storey:
|
99
|
-
*
|
100
|
-
* ````javascript
|
101
|
-
* storeyViewsPlugin.showStoreyObjects("2SWZMQPyD9pfT9q87pgXa1");
|
102
|
-
* ````
|
103
|
-
*
|
104
|
-
* Showing **only** the Entitys in a storey, hiding all others:
|
105
|
-
*
|
106
|
-
* ````javascript
|
107
|
-
* storeyViewsPlugin.showStoreyObjects("2SWZMQPyD9pfT9q87pgXa1", {
|
108
|
-
* hideOthers: true
|
109
|
-
* });
|
110
|
-
* ````
|
111
|
-
* Showing only the storey Entitys, applying custom appearances configured on {@link StoreyViewsPlugin#objectStates}:
|
112
|
-
*
|
113
|
-
* ````javascript
|
114
|
-
* storeyViewsPlugin.showStoreyObjects("2SWZMQPyD9pfT9q87pgXa1", {
|
115
|
-
* hideOthers: true,
|
116
|
-
* useObjectStates: true
|
117
|
-
* });
|
118
|
-
* ````
|
119
|
-
*
|
120
|
-
* <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_showStoreyObjects"><img src="http://yjkkit.io/img/docs/StoreyViewsPlugin/showStoreyObjects.gif"></a>
|
121
|
-
*
|
122
|
-
* [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_showStoreyObjects)]
|
123
|
-
*
|
124
|
-
* When using this option, at some point later you'll probably want to restore all Entitys to their original visibilities and
|
125
|
-
* appearances.
|
126
|
-
*
|
127
|
-
* To do that, save their visibility and appearance states in an {@link ObjectsMemento} beforehand, from
|
128
|
-
* which you can restore them later:
|
129
|
-
*
|
130
|
-
* ````javascript
|
131
|
-
* const objectsMemento = new ObjectsMemento();
|
132
|
-
*
|
133
|
-
* // Save all Entity visibility and appearance states
|
134
|
-
*
|
135
|
-
* objectsMemento.saveObjects(viewer.scene);
|
136
|
-
*
|
137
|
-
* // Show storey view Entitys, with custom appearances as configured for IFC types
|
138
|
-
*
|
139
|
-
* storeyViewsPlugin.showStoreyObjects("2SWZMQPyD9pfT9q87pgXa1", {
|
140
|
-
* useObjectStates: true // <<--------- Apply custom appearances
|
141
|
-
* });
|
142
|
-
*
|
143
|
-
* //...
|
144
|
-
*
|
145
|
-
* // Later, restore all Entitys to their saved visibility and appearance states
|
146
|
-
* objectsMemento.restoreObjects(viewer.scene);
|
147
|
-
* ````
|
148
|
-
*
|
149
|
-
* ## Arranging the Camera for Storey Plan Views
|
150
|
-
*
|
151
|
-
* The {@link StoreyViewsPlugin#gotoStoreyCamera} method positions the {@link Camera} for a plan view of
|
152
|
-
* the {@link Entity}s within the given storey.
|
153
|
-
*
|
154
|
-
* <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_gotoStoreyCamera"><img src="http://yjkkit.io/img/docs/StoreyViewsPlugin/gotoStoreyCamera.gif"></a>
|
155
|
-
*
|
156
|
-
* [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_gotoStoreyCamera)]
|
157
|
-
*
|
158
|
-
* Let's fly the {@link Camera} to a downward-looking orthographic view of the Entitys within our storey.
|
159
|
-
*
|
160
|
-
* ````javascript
|
161
|
-
* storeyViewsPlugin.gotoStoreyCamera("2SWZMQPyD9pfT9q87pgXa1", {
|
162
|
-
* projection: "ortho", // Orthographic projection
|
163
|
-
* duration: 2.5, // 2.5 second transition
|
164
|
-
* done: () => {
|
165
|
-
* viewer.cameraControl.planView = true; // Disable rotation
|
166
|
-
* }
|
167
|
-
* });
|
168
|
-
* ````
|
169
|
-
*
|
170
|
-
* Note that we also set {@link CameraControl#planView} ````true````, which prevents the CameraControl from rotating
|
171
|
-
* or orbiting. In orthographic mode, this effectively makes the {@link Viewer} behave as if it were a 2D viewer, with
|
172
|
-
* picking, panning and zooming still enabled.
|
173
|
-
*
|
174
|
-
* If you need to be able to restore the Camera to its previous state, you can save it to a {@link CameraMemento}
|
175
|
-
* beforehand, from which you can restore it later:
|
176
|
-
*
|
177
|
-
* ````javascript
|
178
|
-
* const cameraMemento = new CameraMemento();
|
179
|
-
*
|
180
|
-
* // Save camera state
|
181
|
-
*
|
182
|
-
* cameraMemento.saveCamera(viewer.scene);
|
183
|
-
*
|
184
|
-
* // Position camera for a downward-looking orthographic view of our storey
|
185
|
-
*
|
186
|
-
* storeyViewsPlugin.gotoStoreyCamera("2SWZMQPyD9pfT9q87pgXa1", {
|
187
|
-
* projection: "ortho",
|
188
|
-
* duration: 2.5,
|
189
|
-
* done: () => {
|
190
|
-
* viewer.cameraControl.planView = true; // Disable rotation
|
191
|
-
* }
|
192
|
-
* });
|
193
|
-
*
|
194
|
-
* //...
|
195
|
-
*
|
196
|
-
* // Later, restore the Camera to its saved state
|
197
|
-
* cameraMemento.restoreCamera(viewer.scene);
|
198
|
-
* ````
|
199
|
-
*
|
200
|
-
* ## Creating StoreyMaps
|
201
|
-
*
|
202
|
-
* The {@link StoreyViewsPlugin#createStoreyMap} method creates a 2D orthographic plan image of the given storey.
|
203
|
-
*
|
204
|
-
* <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_createStoreyMap"><img src="http://yjkkit.io/img/docs/StoreyViewsPlugin/createStoreyMap.png"></a>
|
205
|
-
*
|
206
|
-
* [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_createStoreyMap)]
|
207
|
-
*
|
208
|
-
* This method creates a {@link StoreyMap}, which provides the plan image as a Base64-encoded string.
|
209
|
-
*
|
210
|
-
* Let's create a 2D plan image of our building storey:
|
211
|
-
*
|
212
|
-
* ````javascript
|
213
|
-
* const storeyMap = storeyViewsPlugin.createStoreyMap("2SWZMQPyD9pfT9q87pgXa1", {
|
214
|
-
* width: 300,
|
215
|
-
* format: "png"
|
216
|
-
* });
|
217
|
-
*
|
218
|
-
* const imageData = storeyMap.imageData; // Base64-encoded image data string
|
219
|
-
* const width = storeyMap.width; // 300
|
220
|
-
* const height = storeyMap.height; // Automatically derived from width
|
221
|
-
* const format = storeyMap.format; // "png"
|
222
|
-
* ````
|
223
|
-
*
|
224
|
-
* As with ````showStoreyEntitys````, We also have the option to customize the appearance of the Entitys in our plan
|
225
|
-
* images according to their IFC types, using the lookup table configured on {@link StoreyViewsPlugin#objectStates}.
|
226
|
-
*
|
227
|
-
* For example, we usually want to show only element types like ````IfcWall````, ````IfcDoor```` and
|
228
|
-
* ````IfcFloor```` in our plan images.
|
229
|
-
*
|
230
|
-
* Let's create another StoreyMap, this time applying the custom appearances:
|
231
|
-
*
|
232
|
-
* ````javascript
|
233
|
-
* const storeyMap = storeyViewsPlugin.createStoreyMap("2SWZMQPyD9pfT9q87pgXa1", {
|
234
|
-
* width: 300,
|
235
|
-
* format: "png",
|
236
|
-
* useObjectStates: true // <<--------- Apply custom appearances
|
237
|
-
* });
|
238
|
-
*````
|
239
|
-
*
|
240
|
-
* We can also specify a ````height```` for the plan image, as an alternative to ````width````:
|
241
|
-
*
|
242
|
-
* ````javascript
|
243
|
-
* const storeyMap = storeyViewsPlugin.createStoreyMap("2SWZMQPyD9pfT9q87pgXa1", {
|
244
|
-
* height: 200,
|
245
|
-
* format: "png",
|
246
|
-
* useObjectStates: true
|
247
|
-
* });
|
248
|
-
* ````
|
249
|
-
*
|
250
|
-
* ## Picking Entities in StoreyMaps
|
251
|
-
*
|
252
|
-
* We can use {@link StoreyViewsPlugin#pickStoreyMap} to pick Entities in our building storey, using 2D coordinates from mouse or touch events on our {@link StoreyMap}'s 2D plan image.
|
253
|
-
*
|
254
|
-
* <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_recipe2"><img src="http://yjkkit.io/img/docs/StoreyViewsPlugin/recipe2.gif"></a>
|
255
|
-
*
|
256
|
-
* [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#storeyViews_StoreyViewsPlugin_recipe2)]
|
257
|
-
*
|
258
|
-
* Let's programmatically pick the Entity at the given 2D pixel coordinates within our image:
|
259
|
-
*
|
260
|
-
* ````javascript
|
261
|
-
* const mouseCoords = [65, 120]; // Mouse coords within the image extents
|
262
|
-
*
|
263
|
-
* const pickResult = storeyViewsPlugin.pickStoreyMap(storeyMap, mouseCoords);
|
264
|
-
*
|
265
|
-
* if (pickResult && pickResult.entity) {
|
266
|
-
* pickResult.entity.highlighted = true;
|
267
|
-
* }
|
268
|
-
* ````
|
269
|
-
*/
|
270
|
-
class StoreyViewsPlugin extends Plugin {
|
271
|
-
|
272
|
-
/**
|
273
|
-
* @constructor
|
274
|
-
*
|
275
|
-
* @param {Viewer} viewer The Viewer.
|
276
|
-
* @param {Object} cfg Plugin configuration.
|
277
|
-
* @param {String} [cfg.id="StoreyViews"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
278
|
-
* @param {Object} [cfg.objectStates] Map of visual states for the {@link Entity}s as rendered within each {@link Storey}. Default value is {@link IFCStoreyPlanObjectStates}.
|
279
|
-
*/
|
280
|
-
constructor(viewer, cfg = {}) {
|
281
|
-
|
282
|
-
super("StoreyViews", viewer);
|
283
|
-
|
284
|
-
this._objectsMemento = new ObjectsMemento();
|
285
|
-
this._cameraMemento = new CameraMemento();
|
286
|
-
|
287
|
-
/**
|
288
|
-
* A {@link Storey} for each ````IfcBuildingStorey```.
|
289
|
-
*
|
290
|
-
* There will be a {@link Storey} for every existing {@link MetaObject} whose {@link MetaObject#type} equals "IfcBuildingStorey".
|
291
|
-
*
|
292
|
-
* These are created and destroyed automatically as models are loaded and destroyed.
|
293
|
-
*
|
294
|
-
* @type {{String:Storey}}
|
295
|
-
*/
|
296
|
-
this.storeys = {};
|
297
|
-
|
298
|
-
/**
|
299
|
-
* A set of {@link Storey}s for each {@link MetaModel}.
|
300
|
-
*
|
301
|
-
* These are created and destroyed automatically as models are loaded and destroyed.
|
302
|
-
*
|
303
|
-
* @type {{String: {String:Storey}}}
|
304
|
-
*/
|
305
|
-
this.modelStoreys = {};
|
306
|
-
|
307
|
-
this.objectStates = cfg.objectStates;
|
308
|
-
|
309
|
-
this._onModelLoaded = this.viewer.scene.on("modelLoaded", (modelId) => {
|
310
|
-
this._registerModelStoreys(modelId);
|
311
|
-
this.fire("storeys", this.storeys);
|
312
|
-
});
|
313
|
-
}
|
314
|
-
|
315
|
-
_registerModelStoreys(modelId) {
|
316
|
-
const viewer = this.viewer;
|
317
|
-
const scene = viewer.scene;
|
318
|
-
const metaScene = viewer.metaScene;
|
319
|
-
const metaModel = metaScene.metaModels[modelId];
|
320
|
-
const model = scene.models[modelId];
|
321
|
-
if (!metaModel || !metaModel.rootMetaObject) {
|
322
|
-
return;
|
323
|
-
}
|
324
|
-
const storeyIds = metaModel.rootMetaObject.getObjectIDsInSubtreeByType(["IfcBuildingStorey"]);
|
325
|
-
for (let i = 0, len = storeyIds.length; i < len; i++) {
|
326
|
-
const storeyId = storeyIds[i];
|
327
|
-
const metaObject = metaScene.metaObjects[storeyId];
|
328
|
-
const childObjectIds = metaObject.getObjectIDsInSubtree();
|
329
|
-
const aabb = scene.getAABB(childObjectIds);
|
330
|
-
const numObjects = (Math.random() > 0.5) ? childObjectIds.length : 0;
|
331
|
-
const storey = new Storey(this, aabb, modelId, storeyId, numObjects);
|
332
|
-
storey._onModelDestroyed = model.once("destroyed", () => {
|
333
|
-
this._deregisterModelStoreys(modelId);
|
334
|
-
this.fire("storeys", this.storeys);
|
335
|
-
});
|
336
|
-
this.storeys[storeyId] = storey;
|
337
|
-
if (!this.modelStoreys[modelId]) {
|
338
|
-
this.modelStoreys[modelId] = {};
|
339
|
-
}
|
340
|
-
this.modelStoreys[modelId][storeyId] = storey;
|
341
|
-
}
|
342
|
-
}
|
343
|
-
|
344
|
-
_deregisterModelStoreys(modelId) {
|
345
|
-
const storeys = this.modelStoreys[modelId];
|
346
|
-
if (storeys) {
|
347
|
-
const scene = this.viewer.scene;
|
348
|
-
for (let storyObjectId in storeys) {
|
349
|
-
if (storeys.hasOwnProperty(storyObjectId)) {
|
350
|
-
const storey = storeys[storyObjectId];
|
351
|
-
const model = scene.models[storey.modelId];
|
352
|
-
if (model) {
|
353
|
-
model.off(storey._onModelDestroyed);
|
354
|
-
}
|
355
|
-
delete this.storeys[storyObjectId];
|
356
|
-
}
|
357
|
-
}
|
358
|
-
delete this.modelStoreys[modelId];
|
359
|
-
}
|
360
|
-
}
|
361
|
-
|
362
|
-
/**
|
363
|
-
* Sets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
|
364
|
-
*
|
365
|
-
* Default value is {@link IFCStoreyPlanObjectStates}.
|
366
|
-
*
|
367
|
-
* @type {{String: Object}}
|
368
|
-
*/
|
369
|
-
set objectStates(value) {
|
370
|
-
this._objectStates = value || IFCStoreyPlanObjectStates;
|
371
|
-
}
|
372
|
-
|
373
|
-
/**
|
374
|
-
* Gets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
|
375
|
-
*
|
376
|
-
* Default value is {@link IFCStoreyPlanObjectStates}.
|
377
|
-
*
|
378
|
-
* @type {{String: Object}}
|
379
|
-
*/
|
380
|
-
get objectStates() {
|
381
|
-
return this._objectStates;
|
382
|
-
}
|
383
|
-
|
384
|
-
/**
|
385
|
-
* Arranges the {@link Camera} for a 3D orthographic view of the {@link Entity}s within the given storey.
|
386
|
-
*
|
387
|
-
* See also: {@link CameraMemento}, which saves and restores the state of the {@link Scene}'s {@link Camera}
|
388
|
-
*
|
389
|
-
* @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
|
390
|
-
* @param {*} [options] Options for arranging the Camera.
|
391
|
-
* @param {String} [options.projection] Projection type to transition the Camera to. Accepted values are "perspective" and "ortho".
|
392
|
-
* @param {Function} [options.done] Callback to fire when the Camera has arrived. When provided, causes an animated flight to the saved state. Otherwise jumps to the saved state.
|
393
|
-
*/
|
394
|
-
gotoStoreyCamera(storeyId, options = {}) {
|
395
|
-
|
396
|
-
const storey = this.storeys[storeyId];
|
397
|
-
|
398
|
-
if (!storey) {
|
399
|
-
this.error("IfcBuildingStorey not found with this ID: " + storeyId);
|
400
|
-
if (options.done) {
|
401
|
-
options.done();
|
402
|
-
}
|
403
|
-
return;
|
404
|
-
}
|
405
|
-
|
406
|
-
const viewer = this.viewer;
|
407
|
-
const scene = viewer.scene;
|
408
|
-
const camera = scene.camera;
|
409
|
-
const aabb = storey.aabb;
|
410
|
-
|
411
|
-
if (aabb[3] < aabb[0] || aabb[4] < aabb[1] || aabb[5] < aabb[2]) { // Don't fly to an inverted boundary
|
412
|
-
if (options.done) {
|
413
|
-
options.done();
|
414
|
-
}
|
415
|
-
return;
|
416
|
-
}
|
417
|
-
if (aabb[3] === aabb[0] && aabb[4] === aabb[1] && aabb[5] === aabb[2]) { // Don't fly to an empty boundary
|
418
|
-
if (options.done) {
|
419
|
-
options.done();
|
420
|
-
}
|
421
|
-
return;
|
422
|
-
}
|
423
|
-
const look2 = math.getAABB3Center(aabb);
|
424
|
-
const diag = math.getAABB3Diag(aabb);
|
425
|
-
const fitFOV = 45; // fitFOV;
|
426
|
-
const sca = Math.abs(diag / Math.tan(fitFOV * math.DEGTORAD));
|
427
|
-
|
428
|
-
const orthoScale2 = diag * 1.3;
|
429
|
-
|
430
|
-
const eye2 = tempVec3a;
|
431
|
-
|
432
|
-
eye2[0] = look2[0] + (camera.worldUp[0] * sca);
|
433
|
-
eye2[1] = look2[1] + (camera.worldUp[1] * sca);
|
434
|
-
eye2[2] = look2[2] + (camera.worldUp[2] * sca);
|
435
|
-
|
436
|
-
const up2 = camera.worldForward;
|
437
|
-
|
438
|
-
if (options.done) {
|
439
|
-
|
440
|
-
viewer.cameraFlight.flyTo(utils.apply(options, {
|
441
|
-
eye: eye2,
|
442
|
-
look: look2,
|
443
|
-
up: up2,
|
444
|
-
orthoScale: orthoScale2
|
445
|
-
}), () => {
|
446
|
-
options.done();
|
447
|
-
});
|
448
|
-
|
449
|
-
} else {
|
450
|
-
|
451
|
-
viewer.cameraFlight.jumpTo(utils.apply(options, {
|
452
|
-
eye: eye2,
|
453
|
-
look: look2,
|
454
|
-
up: up2,
|
455
|
-
orthoScale: orthoScale2
|
456
|
-
}));
|
457
|
-
|
458
|
-
viewer.camera.ortho.scale = orthoScale2;
|
459
|
-
}
|
460
|
-
}
|
461
|
-
|
462
|
-
/**
|
463
|
-
* Shows the {@link Entity}s within the given storey.
|
464
|
-
*
|
465
|
-
* Optionally hides all other Entitys.
|
466
|
-
*
|
467
|
-
* Optionally sets the visual appearance of each of the Entitys according to its IFC type. The appearance of
|
468
|
-
* IFC types in plan views is configured by {@link StoreyViewsPlugin#objectStates}.
|
469
|
-
*
|
470
|
-
* See also: {@link ObjectsMemento}, which saves and restores a memento of the visual state
|
471
|
-
* of the {@link Entity}'s that represent objects within a {@link Scene}.
|
472
|
-
*
|
473
|
-
* @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
|
474
|
-
* @param {*} [options] Options for showing the Entitys within the storey.
|
475
|
-
* @param {Boolean} [options.hideOthers=false] When ````true````, hide all other {@link Entity}s.
|
476
|
-
* @param {Boolean} [options.useObjectStates=false] When ````true````, apply the custom visibilities and appearances configured for IFC types in {@link StoreyViewsPlugin#objectStates}.
|
477
|
-
*/
|
478
|
-
showStoreyObjects(storeyId, options = {}) {
|
479
|
-
|
480
|
-
const storey = this.storeys[storeyId];
|
481
|
-
|
482
|
-
if (!storey) {
|
483
|
-
this.error("IfcBuildingStorey not found with this ID: " + storeyId);
|
484
|
-
return;
|
485
|
-
}
|
486
|
-
|
487
|
-
const viewer = this.viewer;
|
488
|
-
const scene = viewer.scene;
|
489
|
-
const metaScene = viewer.metaScene;
|
490
|
-
const storeyMetaObject = metaScene.metaObjects[storeyId];
|
491
|
-
|
492
|
-
if (!storeyMetaObject) {
|
493
|
-
return;
|
494
|
-
}
|
495
|
-
|
496
|
-
if (options.hideOthers) {
|
497
|
-
scene.setObjectsVisible(viewer.scene.visibleObjectIds, false);
|
498
|
-
}
|
499
|
-
|
500
|
-
this.withStoreyObjects(storeyId, (entity, metaObject) => {
|
501
|
-
if (entity) {
|
502
|
-
if (options.useObjectStates) {
|
503
|
-
const props = this._objectStates[metaObject.type] || this._objectStates["DEFAULT"];
|
504
|
-
if (props) {
|
505
|
-
entity.visible = props.visible;
|
506
|
-
entity.edges = props.edges;
|
507
|
-
// entity.xrayed = props.xrayed; // FIXME: Buggy
|
508
|
-
// entity.highlighted = props.highlighted;
|
509
|
-
// entity.selected = props.selected;
|
510
|
-
if (props.colorize) {
|
511
|
-
entity.colorize = props.colorize;
|
512
|
-
}
|
513
|
-
if (props.opacity !== null && props.opacity !== undefined) {
|
514
|
-
entity.opacity = props.opacity;
|
515
|
-
}
|
516
|
-
}
|
517
|
-
} else {
|
518
|
-
entity.visible = true;
|
519
|
-
}
|
520
|
-
}
|
521
|
-
});
|
522
|
-
}
|
523
|
-
|
524
|
-
/**
|
525
|
-
* Executes a callback on each of the objects within the given storey.
|
526
|
-
*
|
527
|
-
* ## Usage
|
528
|
-
*
|
529
|
-
* In the example below, we'll show all the {@link Entity}s, within the given ````IfcBuildingStorey````,
|
530
|
-
* that have {@link MetaObject}s with type ````IfcSpace````. Note that the callback will only be given
|
531
|
-
* an {@link Entity} when one exists for the given {@link MetaObject}.
|
532
|
-
*
|
533
|
-
* ````JavaScript
|
534
|
-
* myStoreyViewsPlugin.withStoreyObjects(storeyId, (entity, metaObject) => {
|
535
|
-
* if (entity && metaObject && metaObject.type === "IfcSpace") {
|
536
|
-
* entity.visible = true;
|
537
|
-
* }
|
538
|
-
* });
|
539
|
-
* ````
|
540
|
-
*
|
541
|
-
* @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
|
542
|
-
* @param {Function} callback The callback.
|
543
|
-
*/
|
544
|
-
withStoreyObjects(storeyId, callback) {
|
545
|
-
const viewer = this.viewer;
|
546
|
-
const scene = viewer.scene;
|
547
|
-
const metaScene = viewer.metaScene;
|
548
|
-
const rootMetaObject = metaScene.metaObjects[storeyId];
|
549
|
-
if (!rootMetaObject) {
|
550
|
-
return;
|
551
|
-
}
|
552
|
-
const storeySubObjects = rootMetaObject.getObjectIDsInSubtree();
|
553
|
-
for (var i = 0, len = storeySubObjects.length; i < len; i++) {
|
554
|
-
const objectId = storeySubObjects[i];
|
555
|
-
const metaObject = metaScene.metaObjects[objectId];
|
556
|
-
const entity = scene.objects[objectId];
|
557
|
-
if (entity) {
|
558
|
-
callback(entity, metaObject);
|
559
|
-
}
|
560
|
-
}
|
561
|
-
}
|
562
|
-
|
563
|
-
/**
|
564
|
-
* Creates a 2D map of the given storey.
|
565
|
-
*
|
566
|
-
* @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
|
567
|
-
* @param {*} [options] Options for creating the image.
|
568
|
-
* @param {Number} [options.width=300] Image width in pixels. Height will be automatically determined from this, if not given.
|
569
|
-
* @param {Number} [options.height=300] Image height in pixels, as an alternative to width. Width will be automatically determined from this, if not given.
|
570
|
-
* @param {String} [options.format="png"] Image format. Accepted values are "png" and "jpeg".
|
571
|
-
* @returns {StoreyMap} The StoreyMap.
|
572
|
-
*/
|
573
|
-
createStoreyMap(storeyId, options = {}) {
|
574
|
-
|
575
|
-
const storey = this.storeys[storeyId];
|
576
|
-
if (!storey) {
|
577
|
-
this.error("IfcBuildingStorey not found with this ID: " + storeyId);
|
578
|
-
return EMPTY_IMAGE;
|
579
|
-
}
|
580
|
-
|
581
|
-
const viewer = this.viewer;
|
582
|
-
const scene = viewer.scene;
|
583
|
-
const format = options.format || "png";
|
584
|
-
const aabb = storey.aabb;
|
585
|
-
const aspect = (aabb[5] - aabb[2]) / (aabb[3] - aabb[0]);
|
586
|
-
const padding = options.padding || 0;
|
587
|
-
|
588
|
-
let width;
|
589
|
-
let height;
|
590
|
-
|
591
|
-
if (options.width && options.height) {
|
592
|
-
width = options.width;
|
593
|
-
height = options.height;
|
594
|
-
|
595
|
-
} else if (options.height) {
|
596
|
-
height = options.height;
|
597
|
-
width = height / aspect;
|
598
|
-
|
599
|
-
} else if (options.width) {
|
600
|
-
width = options.width;
|
601
|
-
height = width * aspect;
|
602
|
-
|
603
|
-
} else {
|
604
|
-
width = 300;
|
605
|
-
height = width * aspect;
|
606
|
-
}
|
607
|
-
|
608
|
-
this._objectsMemento.saveObjects(scene);
|
609
|
-
this._cameraMemento.saveCamera(scene);
|
610
|
-
|
611
|
-
viewer.beginSnapshot();
|
612
|
-
|
613
|
-
this.showStoreyObjects(storeyId, utils.apply(options, {
|
614
|
-
useObjectStates: true,
|
615
|
-
hideOthers: true
|
616
|
-
}));
|
617
|
-
|
618
|
-
this._arrangeStoreyMapCamera(storey);
|
619
|
-
|
620
|
-
const src = viewer.getSnapshot({
|
621
|
-
width: width,
|
622
|
-
height: height,
|
623
|
-
format: format,
|
624
|
-
});
|
625
|
-
|
626
|
-
this._objectsMemento.restoreObjects(scene);
|
627
|
-
this._cameraMemento.restoreCamera(scene);
|
628
|
-
|
629
|
-
viewer.endSnapshot();
|
630
|
-
|
631
|
-
return new StoreyMap(storeyId, src, format, width, height, padding);
|
632
|
-
}
|
633
|
-
|
634
|
-
_arrangeStoreyMapCamera(storey) {
|
635
|
-
const viewer = this.viewer;
|
636
|
-
const scene = viewer.scene;
|
637
|
-
const camera = scene.camera;
|
638
|
-
const aabb = storey.aabb;
|
639
|
-
const look = math.getAABB3Center(aabb);
|
640
|
-
const sca = 0.5;
|
641
|
-
const eye = tempVec3a;
|
642
|
-
eye[0] = look[0] + (camera.worldUp[0] * sca);
|
643
|
-
eye[1] = look[1] + (camera.worldUp[1] * sca);
|
644
|
-
eye[2] = look[2] + (camera.worldUp[2] * sca);
|
645
|
-
const up = camera.worldForward;
|
646
|
-
viewer.cameraFlight.jumpTo({eye: eye, look: look, up: up});
|
647
|
-
const xHalfSize = (aabb[3] - aabb[0]) / 2;
|
648
|
-
const yHalfSize = (aabb[4] - aabb[1]) / 2;
|
649
|
-
const zHalfSize = (aabb[5] - aabb[2]) / 2;
|
650
|
-
const xmin = -xHalfSize;
|
651
|
-
const xmax = +xHalfSize;
|
652
|
-
const ymin = -yHalfSize;
|
653
|
-
const ymax = +yHalfSize;
|
654
|
-
const zmin = -zHalfSize;
|
655
|
-
const zmax = +zHalfSize;
|
656
|
-
viewer.camera.customProjection.matrix = math.orthoMat4c(xmin, xmax, zmin, zmax, ymin, ymax, tempMat4);
|
657
|
-
viewer.camera.projection = "customProjection";
|
658
|
-
}
|
659
|
-
|
660
|
-
/**
|
661
|
-
* Attempts to pick an {@link Entity} at the given pixel coordinates within a StoreyMap image.
|
662
|
-
*
|
663
|
-
* @param {StoreyMap} storeyMap The StoreyMap.
|
664
|
-
* @param {Number[]} imagePos 2D pixel coordinates within the bounds of {@link StoreyMap#imageData}.
|
665
|
-
* @param {*} [options] Picking options.
|
666
|
-
* @param {Boolean} [options.pickSurface=false] Whether to return the picked position on the surface of the Entity.
|
667
|
-
* @returns {PickResult} The pick result, if an Entity was successfully picked, else null.
|
668
|
-
*/
|
669
|
-
pickStoreyMap(storeyMap, imagePos, options = {}) {
|
670
|
-
|
671
|
-
const storeyId = storeyMap.storeyId;
|
672
|
-
const storey = this.storeys[storeyId];
|
673
|
-
|
674
|
-
if (!storey) {
|
675
|
-
this.error("IfcBuildingStorey not found with this ID: " + storeyId);
|
676
|
-
return null
|
677
|
-
}
|
678
|
-
|
679
|
-
const normX = 1.0 - (imagePos[0] / storeyMap.width);
|
680
|
-
const normZ = 1.0 - (imagePos[1] / storeyMap.height);
|
681
|
-
|
682
|
-
const aabb = storey.aabb;
|
683
|
-
|
684
|
-
const xmin = aabb[0];
|
685
|
-
const ymin = aabb[1];
|
686
|
-
const zmin = aabb[2];
|
687
|
-
const xmax = aabb[3];
|
688
|
-
const ymax = aabb[4];
|
689
|
-
const zmax = aabb[5];
|
690
|
-
|
691
|
-
const xWorldSize = xmax - xmin;
|
692
|
-
const yWorldSize = ymax - ymin;
|
693
|
-
const zWorldSize = zmax - zmin;
|
694
|
-
|
695
|
-
const origin = math.vec3([xmin + (xWorldSize * normX), ymin + (yWorldSize * 0.5), zmin + (zWorldSize * normZ)]);
|
696
|
-
const direction = math.vec3([0, -1, 0]);
|
697
|
-
const look = math.addVec3(origin, direction, tempVec3a);
|
698
|
-
const worldForward = this.viewer.camera.worldForward;
|
699
|
-
const matrix = math.lookAtMat4v(origin, look, worldForward, tempMat4);
|
700
|
-
|
701
|
-
const pickResult = this.viewer.scene.pick({ // Picking with arbitrarily-positioned ray
|
702
|
-
pickSurface: options.pickSurface,
|
703
|
-
pickInvisible: true,
|
704
|
-
matrix: matrix
|
705
|
-
});
|
706
|
-
|
707
|
-
if (pickResult) {
|
708
|
-
const metaObject = this.viewer.metaScene.metaObjects[pickResult.entity.id];
|
709
|
-
const objectState = this.objectStates[metaObject.type];
|
710
|
-
if (!objectState || !objectState.visible) {
|
711
|
-
return null;
|
712
|
-
}
|
713
|
-
}
|
714
|
-
|
715
|
-
return pickResult;
|
716
|
-
}
|
717
|
-
|
718
|
-
/**
|
719
|
-
* Gets the ID of the storey that contains the given 3D World-space position.
|
720
|
-
*.
|
721
|
-
* @param {Number[]} worldPos 3D World-space position.
|
722
|
-
* @returns {String} ID of the storey containing the position, or null if the position falls outside all the storeys.
|
723
|
-
*/
|
724
|
-
getStoreyContainingWorldPos(worldPos) {
|
725
|
-
for (var storeyId in this.storeys) {
|
726
|
-
const storey = this.storeys[storeyId];
|
727
|
-
if (math.point3AABB3Intersect(storey.aabb, worldPos)) {
|
728
|
-
return storeyId;
|
729
|
-
}
|
730
|
-
}
|
731
|
-
return null;
|
732
|
-
}
|
733
|
-
|
734
|
-
/**
|
735
|
-
* Converts a 3D World-space position to a 2D position within a StoreyMap image.
|
736
|
-
*
|
737
|
-
* Use {@link StoreyViewsPlugin#pickStoreyMap} to convert 2D image positions to 3D world-space.
|
738
|
-
*
|
739
|
-
* @param {StoreyMap} storeyMap The StoreyMap.
|
740
|
-
* @param {Number[]} worldPos 3D World-space position within the storey.
|
741
|
-
* @param {Number[]} imagePos 2D pixel position within the {@link StoreyMap#imageData}.
|
742
|
-
* @returns {Boolean} True if ````imagePos```` is within the bounds of the {@link StoreyMap#imageData}, else ````false```` if it falls outside.
|
743
|
-
*/
|
744
|
-
worldPosToStoreyMap(storeyMap, worldPos, imagePos) {
|
745
|
-
|
746
|
-
const storeyId = storeyMap.storeyId;
|
747
|
-
const storey = this.storeys[storeyId];
|
748
|
-
|
749
|
-
if (!storey) {
|
750
|
-
this.error("IfcBuildingStorey not found with this ID: " + storeyId);
|
751
|
-
return false
|
752
|
-
}
|
753
|
-
|
754
|
-
const aabb = storey.aabb;
|
755
|
-
|
756
|
-
const xmin = aabb[0];
|
757
|
-
const ymin = aabb[1];
|
758
|
-
const zmin = aabb[2];
|
759
|
-
|
760
|
-
const xmax = aabb[3];
|
761
|
-
const ymax = aabb[4];
|
762
|
-
const zmax = aabb[5];
|
763
|
-
|
764
|
-
const xWorldSize = xmax - xmin;
|
765
|
-
const yWorldSize = ymax - ymin;
|
766
|
-
const zWorldSize = zmax - zmin;
|
767
|
-
|
768
|
-
const camera = this.viewer.camera;
|
769
|
-
const worldUp = camera.worldUp;
|
770
|
-
|
771
|
-
const xUp = worldUp[0] > worldUp[1] && worldUp[0] > worldUp[2];
|
772
|
-
const yUp = !xUp && worldUp[1] > worldUp[0] && worldUp[1] > worldUp[2];
|
773
|
-
const zUp = !xUp && !yUp && worldUp[2] > worldUp[0] && worldUp[2] > worldUp[1];
|
774
|
-
|
775
|
-
const ratioX = (storeyMap.width / xWorldSize);
|
776
|
-
const ratioY = yUp ? (storeyMap.height / zWorldSize) : (storeyMap.height / yWorldSize); // Assuming either Y or Z is "up", but never X
|
777
|
-
|
778
|
-
imagePos[0] = Math.floor(storeyMap.width - ((worldPos[0] - xmin) * ratioX));
|
779
|
-
imagePos[1] = Math.floor(storeyMap.height - ((worldPos[2] - zmin) * ratioY));
|
780
|
-
|
781
|
-
return (imagePos[0] >= 0 && imagePos[0] < storeyMap.width && imagePos[1] >= 0 && imagePos[1] <= storeyMap.height);
|
782
|
-
}
|
783
|
-
|
784
|
-
/**
|
785
|
-
* Converts a 3D World-space direction vector to a 2D vector within a StoreyMap image.
|
786
|
-
*
|
787
|
-
* @param {StoreyMap} storeyMap The StoreyMap.
|
788
|
-
* @param {Number[]} worldDir 3D World-space direction vector.
|
789
|
-
* @param {Number[]} imageDir Normalized 2D direction vector.
|
790
|
-
*/
|
791
|
-
worldDirToStoreyMap(storeyMap, worldDir, imageDir) {
|
792
|
-
const camera = this.viewer.camera;
|
793
|
-
const eye = camera.eye;
|
794
|
-
const look = camera.look;
|
795
|
-
const eyeLookDir = math.subVec3(look, eye, tempVec3a);
|
796
|
-
const worldUp = camera.worldUp;
|
797
|
-
const xUp = worldUp[0] > worldUp[1] && worldUp[0] > worldUp[2];
|
798
|
-
const yUp = !xUp && worldUp[1] > worldUp[0] && worldUp[1] > worldUp[2];
|
799
|
-
const zUp = !xUp && !yUp && worldUp[2] > worldUp[0] && worldUp[2] > worldUp[1];
|
800
|
-
if (xUp) {
|
801
|
-
imageDir[0] = eyeLookDir[1];
|
802
|
-
imageDir[1] = eyeLookDir[2];
|
803
|
-
} else if (yUp) {
|
804
|
-
imageDir[0] = eyeLookDir[0];
|
805
|
-
imageDir[1] = eyeLookDir[2];
|
806
|
-
} else {
|
807
|
-
imageDir[0] = eyeLookDir[0];
|
808
|
-
imageDir[1] = eyeLookDir[1];
|
809
|
-
}
|
810
|
-
math.normalizeVec2(imageDir);
|
811
|
-
}
|
812
|
-
|
813
|
-
/**
|
814
|
-
* Destroys this StoreyViewsPlugin.
|
815
|
-
*/
|
816
|
-
destroy() {
|
817
|
-
this.viewer.scene.off(this._onModelLoaded);
|
818
|
-
super.destroy();
|
819
|
-
}
|
820
|
-
}
|
821
|
-
|
822
|
-
export {StoreyViewsPlugin}
|