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.
Files changed (322) hide show
  1. package/{dist/app.js → app.js} +0 -0
  2. package/{dist/index.html → index.html} +0 -0
  3. package/package.json +5 -40
  4. package/{dist/style.css → style.css} +0 -0
  5. package/.babelrc +0 -7
  6. package/.idea/modules.xml +0 -8
  7. package/.idea/xx.iml +0 -12
  8. package/public/gltf.js +0 -2241
  9. package/public/index.html +0 -10
  10. package/src/index.js +0 -3
  11. package/src/lib/gltf/assets/check.jpg +0 -0
  12. package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
  13. package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
  14. package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
  15. package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
  16. package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
  17. package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
  18. package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
  19. package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
  20. package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
  21. package/src/lib/gltf/assets/yjkkit-sdk/package.json +0 -15
  22. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
  23. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
  24. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
  25. package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
  26. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
  27. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
  28. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
  29. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
  30. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
  31. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
  32. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
  33. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
  34. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
  35. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
  36. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
  37. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
  38. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
  39. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
  40. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
  41. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
  42. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
  43. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
  44. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
  45. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
  46. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
  47. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
  48. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
  49. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
  50. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
  51. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
  52. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
  53. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
  54. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
  55. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
  56. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
  57. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
  58. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
  59. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
  60. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
  61. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
  62. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
  63. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
  64. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
  65. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
  66. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
  67. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
  68. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
  69. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
  70. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
  71. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
  72. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
  73. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
  74. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
  75. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
  76. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
  77. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
  78. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
  79. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
  80. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
  81. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
  82. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
  83. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
  84. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
  85. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
  86. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
  87. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
  88. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
  89. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
  90. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
  91. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
  92. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
  93. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
  94. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
  95. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
  96. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
  97. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
  98. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
  99. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
  100. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
  101. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
  102. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
  103. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
  104. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
  105. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
  106. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
  107. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
  108. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
  109. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
  110. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
  111. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
  112. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
  113. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
  114. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
  115. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
  116. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
  117. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
  118. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
  119. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
  120. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
  121. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
  122. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
  123. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
  124. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
  125. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
  126. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
  127. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
  128. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
  129. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
  130. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
  131. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
  132. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
  133. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
  134. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
  135. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
  136. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
  137. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
  138. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
  139. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
  140. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
  141. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
  142. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
  143. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
  144. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
  145. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
  146. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
  147. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
  148. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
  149. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
  150. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
  151. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
  152. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
  153. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
  154. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
  155. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
  156. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
  157. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
  158. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
  159. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
  160. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
  161. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
  162. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
  163. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
  164. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
  165. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
  166. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
  167. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
  168. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
  169. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
  170. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
  171. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
  172. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
  173. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
  174. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
  175. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
  176. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
  177. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
  178. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
  179. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
  180. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
  181. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
  182. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
  183. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
  184. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
  185. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
  186. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
  187. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
  188. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
  189. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
  190. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
  191. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
  192. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
  193. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
  194. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
  195. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
  196. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
  197. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
  198. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
  199. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
  200. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
  201. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
  202. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
  203. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
  204. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
  205. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
  206. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
  207. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
  208. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
  209. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
  210. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
  211. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
  212. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
  213. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
  214. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
  215. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
  216. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
  217. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
  218. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
  219. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
  220. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
  221. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
  222. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
  223. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
  224. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
  225. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
  226. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
  227. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
  228. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
  229. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
  230. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
  231. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
  232. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
  233. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
  234. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
  235. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
  236. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
  237. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
  238. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
  239. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
  240. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
  241. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
  242. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
  243. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
  244. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
  245. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
  246. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
  247. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
  248. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
  249. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
  250. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
  251. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
  252. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
  253. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
  254. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
  255. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
  256. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
  257. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
  258. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
  259. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
  260. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
  261. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
  262. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
  263. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
  264. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
  265. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
  266. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
  267. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
  268. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
  269. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
  270. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
  271. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
  272. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
  273. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
  274. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
  275. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
  276. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
  277. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
  278. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
  279. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
  280. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
  281. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
  282. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
  283. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
  284. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
  285. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
  286. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
  287. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
  288. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
  289. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
  290. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
  291. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
  292. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
  293. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
  294. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
  295. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
  296. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
  297. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
  298. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
  299. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
  300. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
  301. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
  302. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
  303. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
  304. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
  305. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
  306. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
  307. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
  308. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
  309. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
  310. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
  311. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
  312. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
  313. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
  314. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
  315. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
  316. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
  317. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
  318. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
  319. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
  320. package/src/lib/gltf/gltf.css +0 -392
  321. package/src/lib/gltf/gltf.js +0 -2241
  322. package/webpack.config.js +0 -70
@@ -1,847 +0,0 @@
1
- import {utils} from "../../viewer/scene/utils.js"
2
- import {PerformanceModel} from "../../viewer/scene/PerformanceModel/PerformanceModel.js";
3
- import {Plugin} from "../../viewer/Plugin.js";
4
- import {XKTDefaultDataSource} from "./XKTDefaultDataSource.js";
5
- import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults.js";
6
-
7
- import {ParserV1} from "./parsers/ParserV1.js";
8
- import {ParserV2} from "./parsers/ParserV2.js";
9
- import {ParserV3} from "./parsers/ParserV3.js";
10
- import {ParserV4} from "./parsers/ParserV4.js";
11
- import {ParserV5} from "./parsers/ParserV5.js";
12
- import {ParserV6} from "./parsers/ParserV6.js";
13
- import {ParserV7} from "./parsers/ParserV7.js";
14
- import {ParserV8} from "./parsers/ParserV8.js";
15
-
16
- const parsers = {};
17
-
18
- parsers[ParserV1.version] = ParserV1;
19
- parsers[ParserV2.version] = ParserV2;
20
- parsers[ParserV3.version] = ParserV3;
21
- parsers[ParserV4.version] = ParserV4;
22
- parsers[ParserV5.version] = ParserV5;
23
- parsers[ParserV6.version] = ParserV6;
24
- parsers[ParserV7.version] = ParserV7;
25
- parsers[ParserV8.version] = ParserV8;
26
-
27
- /**
28
- * {@link Viewer} plugin that loads models from yjkkit's optimized *````.XKT````* format.
29
- *
30
- * <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#loading_XKT_OTCConferenceCenter"><img src="http://yjkkit.io/img/docs/XKTLoaderPlugin/XKTLoaderPlugin.png"></a>
31
- *
32
- * [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#loading_XKT_OTCConferenceCenter)]
33
- *
34
- * ## Overview
35
- *
36
- * * XKTLoaderPlugin is the most efficient way to load high-detail models into yjkkit.
37
- * * An *````.XKT````* file is a single BLOB containing a model, compressed using geometry quantization
38
- * and [pako](https://nodeca.github.io/pako/).
39
- * * Supports double-precision coordinates, via ````.XKT```` format version 6.
40
- * * Set the position, scale and rotation of each model as you load it.
41
- * * Filter which IFC types get loaded.
42
- * * Configure initial default appearances for IFC types.
43
- * * Set a custom data source for *````.XKT````* and IFC metadata files.
44
- * * Option to load multiple copies of the same model, without object ID clashes.
45
- * * Does not (yet) support textures or physically-based materials.
46
- *
47
- * ## Credits
48
- *
49
- * XKTLoaderPlugin and the ````yjkkit-gltf-to-xkt```` tool (see below) are based on prototypes
50
- * by [Toni Marti](https://github.com/tmarti) at [uniZite](https://www.unizite.com/login).
51
- *
52
- * ## Creating *````.XKT````* Files and Metadata
53
- *
54
- * See [Creating Files for Offline BIM](https://github.com/yjkkit/yjkkit-sdk/wiki/Creating-Files-for-Offline-BIM).
55
- *
56
- * ## Scene representation
57
- *
58
- * When loading a model, XKTLoaderPlugin creates an {@link Entity} that represents the model, which
59
- * will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id}
60
- * in {@link Scene#models}. The XKTLoaderPlugin also creates an {@link Entity} for each object within the
61
- * model. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered
62
- * by {@link Entity#id} in {@link Scene#objects}.
63
- *
64
- * ## Metadata
65
- *
66
- * Since XKT V8, model metadata is included in the XKT file. If the XKT file has metadata, then loading it creates
67
- * model metadata components within the Viewer, namely a {@link MetaModel} corresponding to the model {@link Entity},
68
- * and a {@link MetaObject} for each object {@link Entity}.
69
- *
70
- * Each {@link MetaObject} has a {@link MetaObject#type}, which indicates the classification of its corresponding
71
- * {@link Entity}. When loading metadata, we can also configure XKTLoaderPlugin with a custom lookup table of initial
72
- * values to set on the properties of each type of {@link Entity}. By default, XKTLoaderPlugin uses its own map of
73
- * default colors and visibilities for IFC element types.
74
- *
75
- * For XKT versions prior to V8, we provided the metadata to XKTLoaderPlugin as an accompanying JSON file to load. We can
76
- * still do that for all XKT versions, and for XKT V8+ it will override any metadata provided within the XKT file.
77
- *
78
- * ## Usage
79
- *
80
- * In the example below we'll load the Schependomlaan model from a [.XKT file](https://github.com/yjkkit/yjkkit-sdk/tree/master/examples/models/xkt/schependomlaan).
81
- *
82
- * This will create a bunch of {@link Entity}s that represents the model and its objects, along with a {@link MetaModel} and {@link MetaObject}s
83
- * that hold their metadata.
84
- *
85
- * Since this model contains IFC types, the XKTLoaderPlugin will set the initial appearance of each object
86
- * {@link Entity} according to its IFC type in {@link XKTLoaderPlugin#objectDefaults}.
87
- *
88
- * Read more about this example in the user guide on [Viewing BIM Models Offline](https://www.notion.so/yjkkit/Viewing-an-IFC-Model-with-yjkkit-c373e48bc4094ff5b6e5c5700ff580ee).
89
- *
90
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_metadata_Schependomlaan)]
91
- *
92
- * ````javascript
93
- * import {Viewer, XKTLoaderPlugin} from "yjkkit-sdk.es.js";
94
- *
95
- * //------------------------------------------------------------------------------------------------------------------
96
- * // 1. Create a Viewer,
97
- * // 2. Arrange the camera
98
- * //------------------------------------------------------------------------------------------------------------------
99
- *
100
- * // 1
101
- * const viewer = new Viewer({
102
- * canvasId: "myCanvas",
103
- * transparent: true
104
- * });
105
- *
106
- * // 2
107
- * viewer.camera.eye = [-2.56, 8.38, 8.27];
108
- * viewer.camera.look = [13.44, 3.31, -14.83];
109
- * viewer.camera.up = [0.10, 0.98, -0.14];
110
- *
111
- * //------------------------------------------------------------------------------------------------------------------
112
- * // 1. Create a XKTLoaderPlugin,
113
- * // 2. Load a building model and JSON IFC metadata
114
- * //------------------------------------------------------------------------------------------------------------------
115
- *
116
- * // 1
117
- * const xktLoader = new XKTLoaderPlugin(viewer);
118
- *
119
- * // 2
120
- * const model = xktLoader.load({ // Returns an Entity that represents the model
121
- * id: "myModel",
122
- * src: "./models/xkt/Schependomlaan.xkt",
123
- * edges: true
124
- * });
125
- *
126
- * model.on("loaded", () => {
127
- *
128
- * //--------------------------------------------------------------------------------------------------------------
129
- * // 1. Find metadata on the third storey
130
- * // 2. Select all the objects in the building's third storey
131
- * // 3. Fit the camera to all the objects on the third storey
132
- * //--------------------------------------------------------------------------------------------------------------
133
- *
134
- * // 1
135
- * const metaModel = viewer.metaScene.metaModels["myModel"]; // MetaModel with ID "myModel"
136
- * const metaObject
137
- * = viewer.metaScene.metaObjects["0u4wgLe6n0ABVaiXyikbkA"]; // MetaObject with ID "0u4wgLe6n0ABVaiXyikbkA"
138
- *
139
- * const name = metaObject.name; // "01 eerste verdieping"
140
- * const type = metaObject.type; // "IfcBuildingStorey"
141
- * const parent = metaObject.parent; // MetaObject with type "IfcBuilding"
142
- * const children = metaObject.children; // Array of child MetaObjects
143
- * const objectId = metaObject.id; // "0u4wgLe6n0ABVaiXyikbkA"
144
- * const objectIds = viewer.metaScene.getObjectIDsInSubtree(objectId); // IDs of leaf sub-objects
145
- * const aabb = viewer.scene.getAABB(objectIds); // Axis-aligned boundary of the leaf sub-objects
146
- *
147
- * // 2
148
- * viewer.scene.setObjectsSelected(objectIds, true);
149
- *
150
- * // 3
151
- * viewer.cameraFlight.flyTo(aabb);
152
- * });
153
- *
154
- * // Find the model Entity by ID
155
- * model = viewer.scene.models["myModel"];
156
- *
157
- * // Destroy the model
158
- * model.destroy();
159
- * ````
160
- *
161
- * ## Transforming
162
- *
163
- * We have the option to rotate, scale and translate each *````.XKT````* model as we load it.
164
- *
165
- * This lets us load multiple models, or even multiple copies of the same model, and position them apart from each other.
166
- *
167
- * In the example below, we'll scale our model to half its size, rotate it 90 degrees about its local X-axis, then
168
- * translate it 100 units along its X axis.
169
- *
170
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#loading_XKT_Duplex_transform)]
171
- *
172
- * ````javascript
173
- * xktLoader.load({
174
- * src: "./models/xkt/Duplex.xkt",
175
- * rotation: [90,0,0],
176
- * scale: [0.5, 0.5, 0.5],
177
- * position: [100, 0, 0]
178
- * });
179
- * ````
180
- *
181
- * ## Including and excluding IFC types
182
- *
183
- * We can also load only those objects that have the specified IFC types.
184
- *
185
- * In the example below, we'll load only the objects that represent walls.
186
- *
187
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_includeTypes)]
188
- *
189
- * ````javascript
190
- * const model2 = xktLoader.load({
191
- * id: "myModel2",
192
- * src: "./models/xkt/OTCConferenceCenter.xkt",
193
- * includeTypes: ["IfcWallStandardCase"]
194
- * });
195
- * ````
196
- *
197
- * We can also load only those objects that **don't** have the specified IFC types.
198
- *
199
- * In the example below, we'll load only the objects that do not represent empty space.
200
- *
201
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_excludeTypes)]
202
- *
203
- * ````javascript
204
- * const model3 = xktLoader.load({
205
- * id: "myModel3",
206
- * src: "./models/xkt/OTCConferenceCenter.xkt",
207
- * excludeTypes: ["IfcSpace"]
208
- * });
209
- * ````
210
- *
211
- * ## Configuring initial IFC object appearances
212
- *
213
- * We can specify the custom initial appearance of loaded objects according to their IFC types.
214
- *
215
- * This is useful for things like:
216
- *
217
- * * setting the colors to our objects according to their IFC types,
218
- * * automatically hiding ````IfcSpace```` objects, and
219
- * * ensuring that ````IfcWindow```` objects are always transparent.
220
- * <br>
221
- * In the example below, we'll load a model, while configuring ````IfcSpace```` elements to be always initially invisible,
222
- * and ````IfcWindow```` types to be always translucent blue.
223
- *
224
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_objectDefaults)]
225
- *
226
- * ````javascript
227
- * const myObjectDefaults = {
228
- *
229
- * IfcSpace: {
230
- * visible: false
231
- * },
232
- * IfcWindow: {
233
- * colorize: [0.337255, 0.303922, 0.870588], // Blue
234
- * opacity: 0.3
235
- * },
236
- *
237
- * //...
238
- *
239
- * DEFAULT: {
240
- * colorize: [0.5, 0.5, 0.5]
241
- * }
242
- * };
243
- *
244
- * const model4 = xktLoader.load({
245
- * id: "myModel4",
246
- * src: "./models/xkt/Duplex.xkt",
247
- * objectDefaults: myObjectDefaults // Use our custom initial default states for object Entities
248
- * });
249
- * ````
250
- *
251
- * When we don't customize the appearance of IFC types, as just above, then IfcSpace elements tend to obscure other
252
- * elements, which can be confusing.
253
- *
254
- * It's often helpful to make IfcSpaces transparent and unpickable, like this:
255
- *
256
- * ````javascript
257
- * const xktLoader = new XKTLoaderPlugin(viewer, {
258
- * objectDefaults: {
259
- * IfcSpace: {
260
- * pickable: false,
261
- * opacity: 0.2
262
- * }
263
- * }
264
- * });
265
- * ````
266
- *
267
- * Alternatively, we could just make IfcSpaces invisible, which also makes them unpickable:
268
- *
269
- * ````javascript
270
- * const xktLoader = new XKTLoaderPlugin(viewer, {
271
- * objectDefaults: {
272
- * IfcSpace: {
273
- * visible: false
274
- * }
275
- * }
276
- * });
277
- * ````
278
- *
279
- * ## Configuring a custom data source
280
- *
281
- * By default, XKTLoaderPlugin will load *````.XKT````* files and metadata JSON over HTTP.
282
- *
283
- * In the example below, we'll customize the way XKTLoaderPlugin loads the files by configuring it with our own data source
284
- * object. For simplicity, our custom data source example also uses HTTP, using a couple of yjkkit utility functions.
285
- *
286
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#loading_XKT_dataSource)]
287
- *
288
- * ````javascript
289
- * import {utils} from "yjkkit-sdk.es.js";
290
- *
291
- * class MyDataSource {
292
- *
293
- * constructor() {
294
- * }
295
- *
296
- * // Gets metamodel JSON
297
- * getMetaModel(metaModelSrc, ok, error) {
298
- * console.log("MyDataSource#getMetaModel(" + metaModelSrc + ", ... )");
299
- * utils.loadJSON(metaModelSrc,
300
- * (json) => {
301
- * ok(json);
302
- * },
303
- * function (errMsg) {
304
- * error(errMsg);
305
- * });
306
- * }
307
- *
308
- * // Gets the contents of the given .XKT file in an arraybuffer
309
- * getXKT(src, ok, error) {
310
- * console.log("MyDataSource#getXKT(" + xKTSrc + ", ... )");
311
- * utils.loadArraybuffer(src,
312
- * (arraybuffer) => {
313
- * ok(arraybuffer);
314
- * },
315
- * function (errMsg) {
316
- * error(errMsg);
317
- * });
318
- * }
319
- * }
320
- *
321
- * const xktLoader2 = new XKTLoaderPlugin(viewer, {
322
- * dataSource: new MyDataSource()
323
- * });
324
- *
325
- * const model5 = xktLoader2.load({
326
- * id: "myModel5",
327
- * src: "./models/xkt/Duplex.xkt"
328
- * });
329
- * ````
330
- *
331
- * ## Loading multiple copies of a model, without object ID clashes
332
- *
333
- * Sometimes we need to load two or more instances of the same model, without having clashes
334
- * between the IDs of the equivalent objects in the model instances.
335
- *
336
- * As shown in the example below, we do this by setting {@link XKTLoaderPlugin#globalizeObjectIds} ````true```` before we load our models.
337
- *
338
- * * [[Run example](https://yjkkit.github.io/yjkkit-sdk/examples/#TreeViewPlugin_Containment_MultipleModels)]
339
- *
340
- * ````javascript
341
- * xktLoader.globalizeObjectIds = true;
342
- *
343
- * const model = xktLoader.load({
344
- * id: "model1",
345
- * src: "./models/xkt/Schependomlaan.xkt"
346
- * });
347
- *
348
- * const model2 = xktLoader.load({
349
- * id: "model2",
350
- * src: "./models/xkt/Schependomlaan.xkt"
351
- * });
352
- * ````
353
- *
354
- * For each {@link Entity} loaded by these two calls, {@link Entity#id} and {@link MetaObject#id} will get prefixed by
355
- * the ID of their model, in order to avoid ID clashes between the two models.
356
- *
357
- * An Entity belonging to the first model will get an ID like this:
358
- *
359
- * ````
360
- * myModel1#0BTBFw6f90Nfh9rP1dlXrb
361
- * ````
362
- *
363
- * The equivalent Entity in the second model will get an ID like this:
364
- *
365
- * ````
366
- * myModel2#0BTBFw6f90Nfh9rP1dlXrb
367
- * ````
368
- *
369
- * Now, to update the visibility of both of those Entities collectively, using {@link Scene#setObjectsVisible}, we can
370
- * supply just the IFC product ID part to that method:
371
- *
372
- * ````javascript
373
- * myViewer.scene.setObjectVisibilities("0BTBFw6f90Nfh9rP1dlXrb", true);
374
- * ````
375
- *
376
- * The method, along with {@link Scene#setObjectsXRayed}, {@link Scene#setObjectsHighlighted} etc, will internally expand
377
- * the given ID to refer to the instances of that Entity in both models.
378
- *
379
- * We can also, of course, reference each Entity directly, using its globalized ID:
380
- *
381
- * ````javascript
382
- * myViewer.scene.setObjectVisibilities("myModel1#0BTBFw6f90Nfh9rP1dlXrb", true);
383
- *````
384
- *
385
- * @class XKTLoaderPlugin
386
- */
387
- class XKTLoaderPlugin extends Plugin {
388
-
389
- /**
390
- * @constructor
391
- *
392
- * @param {Viewer} viewer The Viewer.
393
- * @param {Object} cfg Plugin configuration.
394
- * @param {String} [cfg.id="XKTLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
395
- * @param {Object} [cfg.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
396
- * @param {Object} [cfg.dataSource] A custom data source through which the XKTLoaderPlugin can load model and metadata files. Defaults to an instance of {@link XKTDefaultDataSource}, which loads uover HTTP.
397
- * @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
398
- * @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
399
- * @param {Boolean} [cfg.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
400
- * @param {Number} [cfg.maxGeometryBatchSize=50000000] Maximum geometry batch size, as number of vertices. This is optionally supplied
401
- * to limit the size of the batched geometry arrays that {@link PerformanceModel} internally creates for batched geometries.
402
- * A low value means less heap allocation/de-allocation while loading batched geometries, but more draw calls and
403
- * slower rendering speed. A high value means larger heap allocation/de-allocation while loading, but less draw calls
404
- * and faster rendering speed. It's recommended to keep this somewhere roughly between ````50000```` and ````50000000```.
405
- */
406
- constructor(viewer, cfg = {}) {
407
-
408
- super("XKTLoader", viewer, cfg);
409
-
410
- this._maxGeometryBatchSize = cfg.maxGeometryBatchSize;
411
-
412
- this.dataSource = cfg.dataSource;
413
- this.objectDefaults = cfg.objectDefaults;
414
- this.includeTypes = cfg.includeTypes;
415
- this.excludeTypes = cfg.excludeTypes;
416
- this.excludeUnclassifiedObjects = cfg.excludeUnclassifiedObjects;
417
- }
418
-
419
- /**
420
- * Gets the ````.xkt```` format versions supported by this XKTLoaderPlugin/
421
- * @returns {string[]}
422
- */
423
- get supportedVersions() {
424
- return Object.keys(parsers);
425
- }
426
-
427
- /**
428
- * Sets a custom data source through which the XKTLoaderPlugin can load models and metadata.
429
- *
430
- * Default value is {@link XKTDefaultDataSource}, which loads via HTTP.
431
- *
432
- * @type {Object}
433
- */
434
- set dataSource(value) {
435
- this._dataSource = value || new XKTDefaultDataSource();
436
- }
437
-
438
- /**
439
- * Gets the custom data source through which the XKTLoaderPlugin can load models and metadata.
440
- *
441
- * Default value is {@link XKTDefaultDataSource}, which loads via HTTP.
442
- *
443
- * @type {Object}
444
- */
445
- get dataSource() {
446
- return this._dataSource;
447
- }
448
-
449
- /**
450
- * Sets map of initial default states for each loaded {@link Entity} that represents an object.
451
- *
452
- * Default value is {@link IFCObjectDefaults}.
453
- *
454
- * @type {{String: Object}}
455
- */
456
- set objectDefaults(value) {
457
- this._objectDefaults = value || IFCObjectDefaults;
458
- }
459
-
460
- /**
461
- * Gets map of initial default states for each loaded {@link Entity} that represents an object.
462
- *
463
- * Default value is {@link IFCObjectDefaults}.
464
- *
465
- * @type {{String: Object}}
466
- */
467
- get objectDefaults() {
468
- return this._objectDefaults;
469
- }
470
-
471
- /**
472
- * Sets the whitelist of the IFC types loaded by this XKTLoaderPlugin.
473
- *
474
- * When loading models with metadata, causes this XKTLoaderPlugin to only load objects whose types are in this
475
- * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
476
- *
477
- * Default value is ````undefined````.
478
- *
479
- * @type {String[]}
480
- */
481
- set includeTypes(value) {
482
- this._includeTypes = value;
483
- }
484
-
485
- /**
486
- * Gets the whitelist of the IFC types loaded by this XKTLoaderPlugin.
487
- *
488
- * When loading models with metadata, causes this XKTLoaderPlugin to only load objects whose types are in this
489
- * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
490
- *
491
- * Default value is ````undefined````.
492
- *
493
- * @type {String[]}
494
- */
495
- get includeTypes() {
496
- return this._includeTypes;
497
- }
498
-
499
- /**
500
- * Sets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.
501
- *
502
- * When loading models with metadata, causes this XKTLoaderPlugin to **not** load objects whose types are in this
503
- * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
504
- *
505
- * Default value is ````undefined````.
506
- *
507
- * @type {String[]}
508
- */
509
- set excludeTypes(value) {
510
- this._excludeTypes = value;
511
- }
512
-
513
- /**
514
- * Gets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.
515
- *
516
- * When loading models with metadata, causes this XKTLoaderPlugin to **not** load objects whose types are in this
517
- * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
518
- *
519
- * Default value is ````undefined````.
520
- *
521
- * @type {String[]}
522
- */
523
- get excludeTypes() {
524
- return this._excludeTypes;
525
- }
526
-
527
-
528
- /**
529
- * Sets whether we load objects that don't have IFC types.
530
- *
531
- * When loading models with metadata and this is ````true````, XKTLoaderPlugin will not load objects
532
- * that don't have IFC types.
533
- *
534
- * Default value is ````false````.
535
- *
536
- * @type {Boolean}
537
- */
538
- set excludeUnclassifiedObjects(value) {
539
- this._excludeUnclassifiedObjects = !!value;
540
- }
541
-
542
- /**
543
- * Gets whether we load objects that don't have IFC types.
544
- *
545
- * When loading models with metadata and this is ````true````, XKTLoaderPlugin will not load objects
546
- * that don't have IFC types.
547
- *
548
- * Default value is ````false````.
549
- *
550
- * @type {Boolean}
551
- */
552
- get excludeUnclassifiedObjects() {
553
- return this._excludeUnclassifiedObjects;
554
- }
555
-
556
- /**
557
- * Sets whether XKTLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
558
- *
559
- * Set this ````true```` when you need to load multiple instances of the same model, to avoid ID clashes
560
- * between the objects in the different instances.
561
- *
562
- * When we load a model with this set ````true````, then each {@link Entity#id} and {@link MetaObject#id} will be
563
- * prefixed by the ID of the model, ie. ````<modelId>#<objectId>````.
564
- *
565
- * {@link Entity#originalSystemId} and {@link MetaObject#originalSystemId} will always hold the original, un-prefixed, ID values.
566
- *
567
- * Default value is ````false````.
568
- *
569
- * See the main {@link XKTLoaderPlugin} class documentation for usage info.
570
- *
571
- * @type {Boolean}
572
- */
573
- set globalizeObjectIds(value) {
574
- this._globalizeObjectIds = !!value;
575
- }
576
-
577
- /**
578
- * Gets whether XKTLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
579
- *
580
- * Default value is ````false````.
581
- *
582
- * @type {Boolean}
583
- */
584
- get globalizeObjectIds() {
585
- return this._globalizeObjectIds;
586
- }
587
-
588
- /**
589
- * Loads an ````.xkt```` model into this XKTLoaderPlugin's {@link Viewer}.
590
- *
591
- * Since yjkkit/yjkkit-sdk 1.9.0, XKTLoaderPlugin has supported XKT 8, which bundles the metamodel
592
- * data (eg. an IFC element hierarchy) in the XKT file itself. For XKT 8, we therefore no longer need to
593
- * load the metamodel data from a separate accompanying JSON file, as we did with previous XKT versions.
594
- * However, if we do choose to specify a separate metamodel JSON file to load (eg. for backward compatibility
595
- * in data pipelines), then that metamodel will be loaded and the metamodel in the XKT 8 file will be ignored.
596
- *
597
- * @param {*} params Loading parameters.
598
- * @param {String} [params.id] ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default.
599
- * @param {String} [params.src] Path to a *````.xkt````* file, as an alternative to the ````xkt```` parameter.
600
- * @param {ArrayBuffer} [params.xkt] The *````.xkt````* file data, as an alternative to the ````src```` parameter.
601
- * @param {String} [params.metaModelSrc] Path to an optional metadata file, as an alternative to the ````metaModelData```` parameter.
602
- * @param {*} [params.metaModelData] JSON model metadata, as an alternative to the ````metaModelSrc```` parameter.
603
- * @param {{String:Object}} [params.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
604
- * @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
605
- * @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
606
- * @param {Boolean} [params.edges=false] Whether or not yjkkit renders the model with edges emphasized.
607
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
608
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
609
- * @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
610
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
611
- * @param {Boolean} [params.edges=false] Indicates if the model's edges are initially emphasized.
612
- * @param {Boolean} [params.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true````
613
- * @param {Boolean} [params.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene#pbrEnabled} is also ````true````.
614
- * @param {Number} [params.backfaces=false] When we set this ````true````, then we force rendering of backfaces for the model. When
615
- * we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the
616
- * Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
617
- * @param {Boolean} [params.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
618
- * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. See {@link XKTLoaderPlugin#globalizeObjectIds} for more info.
619
- * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
620
- */
621
- load(params = {}) {
622
-
623
- if (params.id && this.viewer.scene.components[params.id]) {
624
- this.error("Component with this ID already exists in viewer: " + params.id + " - will autogenerate this ID");
625
- delete params.id;
626
- }
627
-
628
- const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
629
- isModel: true,
630
- maxGeometryBatchSize: this._maxGeometryBatchSize
631
- }));
632
-
633
- const modelId = performanceModel.id; // In case ID was auto-generated
634
-
635
- if (!params.src && !params.xkt) {
636
- this.error("load() param expected: src or xkt");
637
- return performanceModel; // Return new empty model
638
- }
639
-
640
- const options = {};
641
- const includeTypes = params.includeTypes || this._includeTypes;
642
- const excludeTypes = params.excludeTypes || this._excludeTypes;
643
- const objectDefaults = params.objectDefaults || this._objectDefaults;
644
-
645
- if (includeTypes) {
646
- options.includeTypesMap = {};
647
- for (let i = 0, len = includeTypes.length; i < len; i++) {
648
- options.includeTypesMap[includeTypes[i]] = true;
649
- }
650
- }
651
-
652
- if (excludeTypes) {
653
- options.excludeTypesMap = {};
654
- for (let i = 0, len = excludeTypes.length; i < len; i++) {
655
- options.excludeTypesMap[excludeTypes[i]] = true;
656
- }
657
- }
658
-
659
- if (objectDefaults) {
660
- options.objectDefaults = objectDefaults;
661
- }
662
-
663
- options.excludeUnclassifiedObjects = (params.excludeUnclassifiedObjects !== undefined) ? (!!params.excludeUnclassifiedObjects) : this._excludeUnclassifiedObjects;
664
- options.globalizeObjectIds = (params.globalizeObjectIds !== undefined) ? (!!params.globalizeObjectIds) : this._globalizeObjectIds;
665
-
666
- if (params.metaModelSrc || params.metaModelData) {
667
-
668
- const processMetaModelData = (metaModelData) => {
669
-
670
- const metaModel = this.viewer.metaScene.createMetaModel(modelId, metaModelData, {
671
- includeTypes: includeTypes,
672
- excludeTypes: excludeTypes,
673
- globalizeObjectIds: this.globalizeObjectIds
674
- });
675
-
676
- if (!metaModel) {
677
- return false;
678
- }
679
-
680
- if (params.src) {
681
- this._loadModel(params.src, params, options, performanceModel);
682
- } else {
683
- this._parseModel(params.xkt, params, options, performanceModel);
684
- }
685
-
686
- performanceModel.once("destroyed", () => {
687
- this.viewer.metaScene.destroyMetaModel(performanceModel.id);
688
- });
689
-
690
- return true;
691
- };
692
-
693
- if (params.metaModelSrc) {
694
-
695
- const metaModelSrc = params.metaModelSrc;
696
-
697
- this.viewer.scene.canvas.spinner.processes++;
698
-
699
- this._dataSource.getMetaModel(metaModelSrc, (metaModelData) => {
700
-
701
- if (performanceModel.destroyed) {
702
- return;
703
- }
704
-
705
- if (!processMetaModelData(metaModelData)) {
706
-
707
- this.error(`load(): Failed to load model metadata for model '${modelId} from '${metaModelSrc}' - metadata not valid`);
708
-
709
- performanceModel.fire("error", "Metadata not valid");
710
- }
711
-
712
- this.viewer.scene.canvas.spinner.processes--;
713
-
714
- }, (errMsg) => {
715
-
716
- this.error(`load(): Failed to load model metadata for model '${modelId} from '${metaModelSrc}' - ${errMsg}`);
717
-
718
- performanceModel.fire("error", `Failed to load model metadata from '${metaModelSrc}' - ${errMsg}`);
719
-
720
- this.viewer.scene.canvas.spinner.processes--;
721
- });
722
-
723
- } else if (params.metaModelData) {
724
-
725
- if (!processMetaModelData(params.metaModelData)) {
726
-
727
- this.error(`load(): Failed to load model metadata for model '${modelId} from '${metaModelSrc}' - metadata not valid`);
728
-
729
- performanceModel.fire("error", "Metadata not valid");
730
- }
731
- }
732
-
733
- } else {
734
- if (params.src) {
735
- this._loadModel(params.src, params, options, performanceModel);
736
- } else {
737
- this._parseModel(params.xkt, params, options, performanceModel);
738
- }
739
- }
740
-
741
- return performanceModel;
742
- }
743
-
744
- _loadModel(src, params, options, performanceModel) {
745
-
746
- const spinner = this.viewer.scene.canvas.spinner;
747
-
748
- spinner.processes++;
749
-
750
- this._dataSource.getXKT(params.src, (arrayBuffer) => {
751
- this._parseModel(arrayBuffer, params, options, performanceModel);
752
- spinner.processes--;
753
- },
754
- (errMsg) => {
755
- spinner.processes--;
756
- this.error(errMsg);
757
- performanceModel.fire("error", errMsg);
758
- });
759
- }
760
-
761
- _parseModel(arrayBuffer, params, options, performanceModel) {
762
-
763
- if (performanceModel.destroyed) {
764
- return;
765
- }
766
-
767
- const dataView = new DataView(arrayBuffer);
768
- const dataArray = new Uint8Array(arrayBuffer);
769
- const xktVersion = dataView.getUint32(0, true);
770
- const parser = parsers[xktVersion];
771
-
772
- if (!parser) {
773
- this.error("Unsupported .XKT file version: " + xktVersion + " - this XKTLoaderPlugin supports versions " + Object.keys(parsers));
774
- return;
775
- }
776
-
777
- this.log("Loading .xkt V" + xktVersion);
778
-
779
- const numElements = dataView.getUint32(4, true);
780
- const elements = [];
781
- let byteOffset = (numElements + 2) * 4;
782
- for (let i = 0; i < numElements; i++) {
783
- const elementSize = dataView.getUint32((i + 2) * 4, true);
784
- elements.push(dataArray.subarray(byteOffset, byteOffset + elementSize));
785
- byteOffset += elementSize;
786
- }
787
-
788
- parser.parse(this.viewer, options, elements, performanceModel);
789
-
790
- performanceModel.finalize();
791
-
792
- this._createDefaultMetaModelIfNeeded(performanceModel, options);
793
-
794
- performanceModel.scene.once("tick", () => {
795
- if (performanceModel.destroyed) {
796
- return;
797
- }
798
- performanceModel.scene.fire("modelLoaded", performanceModel.id); // FIXME: Assumes listeners know order of these two events
799
- performanceModel.fire("loaded", true, false); // Don't forget the event, for late subscribers
800
- });
801
- }
802
-
803
- _createDefaultMetaModelIfNeeded(performanceModel, options) {
804
-
805
- const metaModelId = performanceModel.id;
806
-
807
- if (!this.viewer.metaScene.metaModels[metaModelId]) {
808
-
809
- const metaModelData = {
810
- metaObjects: []
811
- };
812
-
813
- metaModelData.metaObjects.push({
814
- id: metaModelId,
815
- type: "default",
816
- name: metaModelId,
817
- parent: null
818
- });
819
-
820
- const entityList = performanceModel.entityList;
821
-
822
- for (let i = 0, len = entityList.length; i < len; i++) {
823
- const entity = entityList[i];
824
- if (entity.isObject) {
825
- metaModelData.metaObjects.push({
826
- id: entity.id,
827
- type: "default",
828
- name: entity.id,
829
- parent: metaModelId
830
- });
831
- }
832
- }
833
-
834
- this.viewer.metaScene.createMetaModel(metaModelId, metaModelData, {
835
- includeTypes: options.includeTypes,
836
- excludeTypes: options.excludeTypes,
837
- globalizeObjectIds: options.globalizeObjectIds
838
- });
839
-
840
- performanceModel.once("destroyed", () => {
841
- this.viewer.metaScene.destroyMetaModel(metaModelId);
842
- });
843
- }
844
- }
845
- }
846
-
847
- export {XKTLoaderPlugin}