csyjk 1.1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. package/.babelrc +7 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/xx.iml +12 -0
  4. package/dist/app.js +43 -0
  5. package/{index.html → dist/index.html} +0 -0
  6. package/{style.css → dist/style.css} +1 -1
  7. package/package.json +40 -5
  8. package/public/gltf.js +2241 -0
  9. package/public/index.html +10 -0
  10. package/src/index.js +3 -0
  11. package/src/lib/gltf/assets/check.jpg +0 -0
  12. package/src/lib/gltf/assets/iconfont/iconfont.css +358 -0
  13. package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
  14. package/src/lib/gltf/assets/iconfont/iconfont.js +1 -0
  15. package/src/lib/gltf/assets/iconfont/iconfont.json +604 -0
  16. package/src/lib/gltf/assets/iconfont/iconfont.svg +189 -0
  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 +15 -0
  22. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +863 -0
  23. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +1 -0
  24. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +1 -0
  25. package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +3 -0
  26. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +462 -0
  27. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +279 -0
  28. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +262 -0
  29. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +1 -0
  30. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +362 -0
  31. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +575 -0
  32. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +1 -0
  33. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +333 -0
  34. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +1 -0
  35. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +777 -0
  36. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +1 -0
  37. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +525 -0
  38. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +242 -0
  39. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +297 -0
  40. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +1 -0
  41. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +345 -0
  42. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +1 -0
  43. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +122 -0
  44. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +462 -0
  45. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +508 -0
  46. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +922 -0
  47. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +2 -0
  48. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +273 -0
  49. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +687 -0
  50. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +1 -0
  51. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +145 -0
  52. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +777 -0
  53. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +1 -0
  54. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +33 -0
  55. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +273 -0
  56. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +313 -0
  57. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +2 -0
  58. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +1328 -0
  59. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +249 -0
  60. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +169 -0
  61. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +403 -0
  62. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +1 -0
  63. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +134 -0
  64. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +1 -0
  65. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +77 -0
  66. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +61 -0
  67. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +57 -0
  68. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +822 -0
  69. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +1 -0
  70. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +888 -0
  71. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +88 -0
  72. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +624 -0
  73. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +1 -0
  74. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +87 -0
  75. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +295 -0
  76. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +1 -0
  77. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +78 -0
  78. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +847 -0
  79. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +2 -0
  80. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +167 -0
  81. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +228 -0
  82. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +220 -0
  83. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +279 -0
  84. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +244 -0
  85. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +301 -0
  86. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +426 -0
  87. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +479 -0
  88. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +6818 -0
  89. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +238 -0
  90. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +1279 -0
  91. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +1 -0
  92. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +11 -0
  93. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +2060 -0
  94. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +2155 -0
  95. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +1002 -0
  96. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +64 -0
  97. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +153 -0
  98. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +267 -0
  99. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +553 -0
  100. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +991 -0
  101. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +49 -0
  102. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +17 -0
  103. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +205 -0
  104. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +78 -0
  105. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +97 -0
  106. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +95 -0
  107. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +112 -0
  108. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +372 -0
  109. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +3 -0
  110. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +162 -0
  111. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +39 -0
  112. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +145 -0
  113. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +215 -0
  114. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +311 -0
  115. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +1669 -0
  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 +312 -0
  118. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +112 -0
  119. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +193 -0
  120. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +289 -0
  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 +122 -0
  123. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +186 -0
  124. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +68 -0
  125. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +439 -0
  126. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +361 -0
  127. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +258 -0
  128. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +197 -0
  129. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +498 -0
  130. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +908 -0
  131. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +475 -0
  132. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +570 -0
  133. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +1 -0
  134. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +2623 -0
  135. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +1 -0
  136. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +21 -0
  137. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +262 -0
  138. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +697 -0
  139. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +34 -0
  140. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +63 -0
  141. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +183 -0
  142. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +33 -0
  143. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +736 -0
  144. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +68 -0
  145. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +295 -0
  146. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +327 -0
  147. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +698 -0
  148. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +68 -0
  149. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +364 -0
  150. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +356 -0
  151. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +33 -0
  152. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +776 -0
  153. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +113 -0
  154. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +340 -0
  155. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +312 -0
  156. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +343 -0
  157. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +331 -0
  158. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +242 -0
  159. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +348 -0
  160. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +737 -0
  161. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +143 -0
  162. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +373 -0
  163. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +366 -0
  164. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +370 -0
  165. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +386 -0
  166. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +376 -0
  167. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +293 -0
  168. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +382 -0
  169. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +37 -0
  170. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +1017 -0
  171. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +246 -0
  172. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +809 -0
  173. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +504 -0
  174. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +297 -0
  175. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +300 -0
  176. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +322 -0
  177. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +311 -0
  178. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +291 -0
  179. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +319 -0
  180. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +305 -0
  181. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +300 -0
  182. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +242 -0
  183. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +323 -0
  184. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +969 -0
  185. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +246 -0
  186. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +859 -0
  187. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +557 -0
  188. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +341 -0
  189. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +338 -0
  190. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +356 -0
  191. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +354 -0
  192. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +329 -0
  193. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +358 -0
  194. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +349 -0
  195. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +363 -0
  196. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +284 -0
  197. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +354 -0
  198. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +880 -0
  199. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +669 -0
  200. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +194 -0
  201. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +326 -0
  202. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +149 -0
  203. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +316 -0
  204. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +286 -0
  205. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +302 -0
  206. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +2 -0
  207. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +464 -0
  208. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +323 -0
  209. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +234 -0
  210. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +33 -0
  211. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +689 -0
  212. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +327 -0
  213. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +238 -0
  214. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +106 -0
  215. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +271 -0
  216. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +102 -0
  217. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +168 -0
  218. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +161 -0
  219. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +172 -0
  220. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +1721 -0
  221. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +8 -0
  222. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +4 -0
  223. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +2 -0
  224. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +103 -0
  225. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +130 -0
  226. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +18 -0
  227. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +1475 -0
  228. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +218 -0
  229. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +1032 -0
  230. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +175 -0
  231. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +156 -0
  232. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +314 -0
  233. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +29 -0
  234. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +77 -0
  235. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +395 -0
  236. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +79 -0
  237. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +138 -0
  238. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +5 -0
  239. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +382 -0
  240. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +1 -0
  241. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +359 -0
  242. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +577 -0
  243. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +222 -0
  244. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +378 -0
  245. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +169 -0
  246. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +39 -0
  247. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +820 -0
  248. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +860 -0
  249. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +320 -0
  250. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +807 -0
  251. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +522 -0
  252. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +8 -0
  253. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +118 -0
  254. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +162 -0
  255. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +353 -0
  256. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +1 -0
  257. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +5302 -0
  258. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +132 -0
  259. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +200 -0
  260. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +272 -0
  261. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +259 -0
  262. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +3 -0
  263. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +2165 -0
  264. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +978 -0
  265. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +1566 -0
  266. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +249 -0
  267. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +163 -0
  268. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +276 -0
  269. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +269 -0
  270. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +1 -0
  271. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +207 -0
  272. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +156 -0
  273. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +210 -0
  274. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +146 -0
  275. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +186 -0
  276. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +120 -0
  277. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +214 -0
  278. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +96 -0
  279. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +259 -0
  280. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +1356 -0
  281. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +1 -0
  282. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +194 -0
  283. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +183 -0
  284. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +239 -0
  285. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +161 -0
  286. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +133 -0
  287. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +5 -0
  288. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +547 -0
  289. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +2481 -0
  290. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +194 -0
  291. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +1 -0
  292. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +119 -0
  293. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +1 -0
  294. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +45 -0
  295. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +45 -0
  296. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +56 -0
  297. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +2 -0
  298. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +452 -0
  299. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +212 -0
  300. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +121 -0
  301. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +23 -0
  302. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +270 -0
  303. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +259 -0
  304. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +317 -0
  305. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +69 -0
  306. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +179 -0
  307. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +315 -0
  308. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +203 -0
  309. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +40 -0
  310. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +1300 -0
  311. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +18 -0
  312. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +49 -0
  313. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +217 -0
  314. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +214 -0
  315. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +432 -0
  316. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +326 -0
  317. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +375 -0
  318. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +61 -0
  319. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +48 -0
  320. package/src/lib/gltf/gltf.css +392 -0
  321. package/src/lib/gltf/gltf.js +2241 -0
  322. package/webpack.config.js +70 -0
  323. package/app.js +0 -43
@@ -0,0 +1,624 @@
1
+ import {ModelTreeView} from "./ModelTreeView.js";
2
+ import {Plugin} from "../../viewer/Plugin.js";
3
+
4
+ /**
5
+ * @desc A {@link Viewer} plugin that provides an HTML tree view to navigate the IFC elements in models.
6
+ * <br>
7
+ *
8
+ * <a href="https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_WestRiverSideHospital" style="border: 1px solid black;"><img src="http://yjkkit.io/img/docs/TreeViewPlugin/TreeViewPlugin.png"></a>
9
+ *
10
+ * [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_WestRiverSideHospital)]
11
+ *
12
+ * ## Overview
13
+ *
14
+ * * A fast HTML tree view, with zero external dependencies, that works with huge numbers of objects.
15
+ * * Each tree node has a checkbox to control the visibility of its object.
16
+ * * Has three hierarchy modes: "containment", "types" and "storeys".
17
+ * * Automatically contains all models (that have metadata) that are currently in the {@link Scene}.
18
+ * * Sorts tree nodes by default - spatially, from top-to-bottom for ````IfcBuildingStorey```` nodes, and alphanumerically for other nodes.
19
+ * * Allows custom CSS styling.
20
+ * * Use {@link ContextMenu} to create a context menu for the tree nodes.
21
+ *
22
+ * ## Credits
23
+ *
24
+ * TreeViewPlugin is based on techniques described in [*Super Fast Tree View in JavaScript*](https://chrissmith.xyz/super-fast-tree-view-in-javascript/) by [Chris Smith](https://twitter.com/chris22smith).
25
+ *
26
+ * ## Usage
27
+ *
28
+ * In the example below, we'll add a TreeViewPlugin which, by default, will automatically show the structural
29
+ * hierarchy of the IFC elements in each model we load.
30
+ *
31
+ * Then we'll use an {@link XKTLoaderPlugin} to load the Schependomlaan model from an
32
+ * [.xkt file](https://github.com/yjkkit/yjkkit-sdk/tree/master/examples/models/xkt/schependomlaan), along
33
+ * with an accompanying JSON [IFC metadata file](https://github.com/yjkkit/yjkkit-sdk/tree/master/examples/metaModels/schependomlaan).
34
+ *
35
+ * [[Run this example](https://yjkkit.github.io/yjkkit-sdk/examples/#BIMOffline_XKT_Schependomlaan)]
36
+ *
37
+ * ````javascript
38
+ * import {Viewer, XKTLoaderPlugin, TreeViewPlugin} from "yjkkit-sdk.es.js";
39
+ *
40
+ * const viewer = new Viewer({
41
+ * canvasId: "myCanvas",
42
+ * transparent: true
43
+ * });
44
+ *
45
+ * viewer.camera.eye = [-2.56, 8.38, 8.27];
46
+ * viewer.camera.look = [13.44, 3.31, -14.83];
47
+ * viewer.camera.up = [0.10, 0.98, -0.14];
48
+ *
49
+ * const treeView = new TreeViewPlugin(viewer, {
50
+ * containerElement: document.getElementById("myTreeViewContainer")
51
+ * });
52
+ *
53
+ * const xktLoader = new XKTLoaderPlugin(viewer);
54
+ *
55
+ * const model = xktLoader.load({
56
+ * id: "myModel",
57
+ * src: "./models/xkt/Schependomlaan.xkt",
58
+ * edges: true
59
+ * });
60
+ * ````
61
+ *
62
+ * ## Manually Adding Models
63
+ *
64
+ * Instead of adding models automatically, we can control which models appear in our TreeViewPlugin by adding them manually.
65
+ *
66
+ * In the next example, we'll configure the TreeViewPlugin to not add models automatically. Then, once the model
67
+ * has loaded, we'll add it manually using {@link TreeViewPlugin#addModel}.
68
+ *
69
+ * ````javascript
70
+ * const treeView = new TreeViewPlugin(viewer, {
71
+ * containerElement: document.getElementById("myTreeViewContainer"),
72
+ * autoAddModels: false // <<---------------- Don't auto-add models
73
+ * });
74
+ *
75
+ * const xktLoader = new XKTLoaderPlugin(viewer);
76
+ *
77
+ * const model = xktLoader.load({
78
+ * id: "myModel",
79
+ * src: "./models/xkt/Schependomlaan.xkt",
80
+ * edges: true
81
+ * });
82
+ *
83
+ * model.on("loaded", () => {
84
+ * treeView.addModel(model.id);
85
+ * });
86
+ * ````
87
+ *
88
+ * Adding models manually also allows us to set some options for the model. For example, the ````rootName```` option allows us to provide a custom name for
89
+ * the root node, which is sometimes desirable when the model's "IfcProject" element's name is not suitable:
90
+ *
91
+ * ````javascript
92
+ * model.on("loaded", () => {
93
+ * treeView.addModel(model.id, {
94
+ * rootName: "Schependomlaan Model"
95
+ * });
96
+ * });
97
+ * ````
98
+ *
99
+ * ## Initially Expanding the Hierarchy
100
+ *
101
+ * We can also configure TreeViewPlugin to initially expand each model's nodes to a given depth.
102
+ *
103
+ * Let's automatically expand the first three nodes from the root, for every model added:
104
+ *
105
+ * ````javascript
106
+ * const treeView = new TreeViewPlugin(viewer, {
107
+ * containerElement: document.getElementById("myTreeViewContainer"),
108
+ * autoExpandDepth: 3
109
+ * });
110
+ * ````
111
+ *
112
+ * ## Showing a Node by ID
113
+ *
114
+ * We can show a given node using its ID. This causes the TreeViewPlugin to collapse, then expand and scroll the node into view, then highlight the node.
115
+ *
116
+ * See the documentation for the {@link TreeViewPlugin#showNode} method for more information, including how to define a custom highlighted appearance for the node using CSS.
117
+ *
118
+ * Let's make the TreeViewPlugin show the node corresponding to whatever object {@link Entity} that we pick:
119
+ *
120
+ * ````javascript
121
+ * viewer.cameraControl.on("picked", function (e) {
122
+ * var objectId = e.entity.id;
123
+ * treeView.showNode(objectId);
124
+ * });
125
+ * ````
126
+ *
127
+ * This will de-highlight any node that was previously shown by this method.
128
+ *
129
+ * Note that this method only works if the picked {@link Entity} is an object that belongs to a model that's represented in the TreeViewPlugin.
130
+ *
131
+ * ## Customizing Appearance
132
+ *
133
+ * We can customize the appearance of our TreeViewPlugin by defining custom CSS for its HTML
134
+ * elements. See our example's [source code](https://github.com/yjkkit/yjkkit-sdk/blob/master/examples/BIMOffline_XKT_Schependomlaan.html)
135
+ * for an example of custom CSS rules.
136
+ *
137
+ * ## Model Hierarchies
138
+ *
139
+ * TreeViewPlugin has three hierarchies for organizing its nodes:
140
+ *
141
+ * * "containment" - organizes the tree nodes to indicate the containment hierarchy of the {@link MetaObject}s.
142
+ * * "types" - groups nodes by their IFC types.
143
+ * * "storeys" - groups nodes within their ````IfcBuildingStoreys````, and sub-groups them by their IFC types.
144
+ *
145
+ * <br>
146
+ * The table below shows what the hierarchies look like:
147
+ * <br>
148
+ *
149
+ * | 1. Containment Hierarchy | 2. Types Hierarchy | 3. Storeys Hierarchy |
150
+ * |---|---|---|
151
+ * | <img src="http://yjkkit.io/img/docs/TreeViewPlugin/structureMode.png"> | <img src="http://yjkkit.io/img/docs/TreeViewPlugin/typesMode.png"> | <img src="http://yjkkit.io/img/docs/TreeViewPlugin/storeysMode.png"> |
152
+ * <br>
153
+ *
154
+ * Let's create a TreeViewPlugin that groups nodes by their building stories and IFC types:
155
+ *
156
+ * ````javascript
157
+ * const treeView = new TreeViewPlugin(viewer, {
158
+ * containerElement: document.getElementById("myTreeViewContainer"),
159
+ * hierarchy: "stories"
160
+ * });
161
+ * ````
162
+ *
163
+ * ## Sorting Nodes
164
+ *
165
+ * TreeViewPlugin sorts its tree nodes by default. For a "storeys" hierarchy, it orders ````IfcBuildingStorey```` nodes
166
+ * spatially, with the node for the highest story at the top, down to the lowest at the bottom.
167
+ *
168
+ * For all the hierarchy types ("containment", "classes" and "storeys"), TreeViewPlugin sorts the other node types
169
+ * alphanumerically on their titles.
170
+ *
171
+ * If for some reason you need to prevent sorting, create your TreeViewPlugin with the option disabled, like so:
172
+ *
173
+ * ````javascript
174
+ * const treeView = new TreeViewPlugin(viewer, {
175
+ * containerElement: document.getElementById("myTreeViewContainer"),
176
+ * hierarchy: "stories",
177
+ * sortNodes: false // <<------ Disable node sorting
178
+ * });
179
+ * ````
180
+ *
181
+ * Note that, for all hierarchy modes, node sorting is only done for each model at the time that it is added to the TreeViewPlugin, and will not
182
+ * update dynamically if we later transform the {@link Entity}s corresponding to the nodes.
183
+ *
184
+ * ## Pruning empty nodes
185
+ *
186
+ * Sometimes a model contains subtrees of objects that don't have any geometry. These are models whose
187
+ * {@link MetaModel} contains trees of {@link MetaObject}s that don't have any {@link Entity}s in the {@link Scene}.
188
+ *
189
+ * For these models, the tree view would contain nodes that don't do anything in the Scene when we interact with them,
190
+ * which is undesirable.
191
+ *
192
+ * By default, TreeViewPlugin will not create nodes for those objects. However, we can override that behaviour if we want
193
+ * to have nodes for those objects (perhaps for debugging the model):
194
+ *
195
+ * ````javascript
196
+ * const treeView = new TreeViewPlugin(viewer, {
197
+ * containerElement: document.getElementById("myTreeViewContainer"),
198
+ * hierarchy: "stories",
199
+ * pruneEmptyNodes: false // <<------ Create nodes for object subtrees without geometry
200
+ * });
201
+ * ````
202
+ *
203
+ * ## Context Menu
204
+ *
205
+ * TreeViewPlugin fires a "contextmenu" event whenever we right-click on a tree node.
206
+ *
207
+ * The event contains:
208
+ *
209
+ * * ````event```` - the original [contextmenu](https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event) [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent)
210
+ * * ````viewer```` - the {@link Viewer}
211
+ * * ````treeViewPlugin```` - the TreeViewPlugin
212
+ * * ````treeViewNode```` - the {@link TreeViewNode} representing the tree node
213
+ *<br><br>
214
+ *
215
+ * Let's use {@link ContextMenu} to show a simple context menu for the node we clicked.
216
+ *
217
+ * [[Run an example](https://yjkkit.github.io/yjkkit-sdk/examples/#ContextMenu_Canvas_TreeViewPlugin_Custom)]
218
+ *
219
+ * ````javascript
220
+ * import {ContextMenu} from "../src/extras/ContextMenu/ContextMenu.js";
221
+ *
222
+ * const treeViewContextMenu = new ContextMenu({
223
+ * items: [
224
+ * [
225
+ * [
226
+ * {
227
+ * title: "Hide",
228
+ * doAction: function (context) {
229
+ * context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {
230
+ * if (treeViewNode.objectId) {
231
+ * const entity = context.viewer.scene.objects[treeViewNode.objectId];
232
+ * if (entity) {
233
+ * entity.visible = false;
234
+ * }
235
+ * }
236
+ * });
237
+ * }
238
+ * },
239
+ * {
240
+ * title: "Hide all",
241
+ * doAction: function (context) {
242
+ * context.viewer.scene.setObjectsVisible(context.viewer.scene.visibleObjectIds, false);
243
+ * }
244
+ * }
245
+ * ],
246
+ * [
247
+ * {
248
+ * title: "Show",
249
+ * doAction: function (context) {
250
+ * context.treeViewPlugin.withNodeTree(context.treeViewNode, (treeViewNode) => {
251
+ * if (treeViewNode.objectId) {
252
+ * const entity = context.viewer.scene.objects[treeViewNode.objectId];
253
+ * if (entity) {
254
+ * entity.visible = true;
255
+ * entity.xrayed = false;
256
+ * entity.selected = false;
257
+ * }
258
+ * }
259
+ * });
260
+ * }
261
+ * },
262
+ * {
263
+ * title: "Show all",
264
+ * doAction: function (context) {
265
+ * const scene = context.viewer.scene;
266
+ * scene.setObjectsVisible(scene.objectIds, true);
267
+ * scene.setObjectsXRayed(scene.xrayedObjectIds, false);
268
+ * scene.setObjectsSelected(scene.selectedObjectIds, false);
269
+ * }
270
+ * }
271
+ * ]
272
+ * ]
273
+ * ]
274
+ * });
275
+ *
276
+ * treeView.on("contextmenu", (e) => {
277
+ *
278
+ * const event = e.event; // MouseEvent
279
+ * const viewer = e.viewer; // Viewer
280
+ * const treeViewPlugin = e.treeViewPlugin; // TreeViewPlugin
281
+ * const treeViewNode = e.treeViewNode; // TreeViewNode
282
+ *
283
+ * treeViewContextMenu.show(e.event.pageX, e.event.pageY);
284
+ *
285
+ * treeViewContextMenu.context = {
286
+ * viewer: e.viewer,
287
+ * treeViewPlugin: e.treeViewPlugin,
288
+ * treeViewNode: e.treeViewNode
289
+ * };
290
+ * });
291
+ * ````
292
+ *
293
+ * ## Clicking Node Titles
294
+ *
295
+ * TreeViewPlugin fires a "nodeTitleClicked" event whenever we left-click on a tree node.
296
+ *
297
+ * Like the "contextmenu" event, this event contains:
298
+ *
299
+ * * ````event```` - the original [click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent)
300
+ * * ````viewer```` - the {@link Viewer}
301
+ * * ````treeViewPlugin```` - the TreeViewPlugin
302
+ * * ````treeViewNode```` - the {@link TreeViewNode} representing the tree node
303
+ *<br><br>
304
+ *
305
+ * Let's register a callback to isolate and fit-to-view the {@link Entity}(s) represented by the node. This callback is
306
+ * going to X-ray all the other Entitys, fly the camera to fit the Entity(s) for the clicked node, then hide the other Entitys.
307
+ *
308
+ * [[Run an example](https://yjkkit.github.io/yjkkit-sdk/examples/#ContextMenu_Canvas_TreeViewPlugin_Custom)]
309
+ *
310
+ * ````javascript
311
+ * treeView.on("nodeTitleClicked", (e) => {
312
+ * const scene = viewer.scene;
313
+ * const objectIds = [];
314
+ * e.treeViewPlugin.withNodeTree(e.treeViewNode, (treeViewNode) => {
315
+ * if (treeViewNode.objectId) {
316
+ * objectIds.push(treeViewNode.objectId);
317
+ * }
318
+ * });
319
+ * scene.setObjectsXRayed(scene.objectIds, true);
320
+ * scene.setObjectsVisible(scene.objectIds, true);
321
+ * scene.setObjectsXRayed(objectIds, false);
322
+ * viewer.cameraFlight.flyTo({
323
+ * aabb: scene.getAABB(objectIds),
324
+ * duration: 0.5
325
+ * }, () => {
326
+ * setTimeout(function () {
327
+ * scene.setObjectsVisible(scene.xrayedObjectIds, false);
328
+ * scene.setObjectsXRayed(scene.xrayedObjectIds, false);
329
+ * }, 500);
330
+ * });
331
+ * });
332
+ * ````
333
+ *
334
+ * To make the cursor change to a pointer when we hover over the node titles, and also to make the titles change to blue, we'll also define this CSS for the ````<span>```` elements
335
+ * that represent the titles of our TreeViewPlugin nodes:
336
+ *
337
+ * ````css
338
+ * #treeViewContainer ul li span:hover {
339
+ * color: blue;
340
+ * cursor: pointer;
341
+ * }
342
+ * ````
343
+ *
344
+ * @class TreeViewPlugin
345
+ */
346
+ class TreeViewPlugin extends Plugin {
347
+
348
+ /**
349
+ * @constructor
350
+ *
351
+ * @param {Viewer} viewer The Viewer.
352
+ * @param {*} cfg Plugin configuration.
353
+ * @param {HTMLElement} cfg.containerElement DOM element to contain the TreeViewPlugin.
354
+ * @param {Boolean} [cfg.autoAddModels=true] When ````true```` (default), will automatically add each model as it's created. Set this ````false```` if you want to manually add models using {@link TreeViewPlugin#addModel} instead.
355
+ * @param {Number} [cfg.autoExpandDepth] Optional depth to which to initially expand the tree.
356
+ * @param {String} [cfg.hierarchy="containment"] How to organize the tree nodes: "containment", "storeys" or "types". See the class documentation for details.
357
+ * @param {Boolean} [cfg.sortNodes=true] When true, will sort the children of each node. For a "storeys" hierarchy, the
358
+ * ````IfcBuildingStorey```` nodes will be ordered spatially, from the highest storey down to the lowest, on the
359
+ * vertical World axis. For all hierarchy types, other node types will be ordered in the ascending alphanumeric order of their titles.
360
+ * @param {Boolean} [cfg.pruneEmptyNodes=true] When true, will not contain nodes that don't have content in the {@link Scene}. These are nodes whose {@link MetaObject}s don't have {@link Entity}s.
361
+ */
362
+ constructor(viewer, cfg = {}) {
363
+
364
+ super("TreeViewPlugin", viewer);
365
+
366
+ if (!cfg.containerElement) {
367
+ this.error("Config expected: containerElement");
368
+ return;
369
+ }
370
+
371
+ this._containerElement = cfg.containerElement;
372
+ this._modelTreeViews = {};
373
+ this._autoAddModels = (cfg.autoAddModels !== false);
374
+ this._autoExpandDepth = (cfg.autoExpandDepth || 0);
375
+ this._sortNodes = (cfg.sortNodes !== false);
376
+ this._pruneEmptyNodes = (cfg.pruneEmptyNodes !== false);
377
+
378
+ if (this._autoAddModels) {
379
+ const modelIds = Object.keys(this.viewer.metaScene.metaModels);
380
+ for (let i = 0, len = modelIds.length; i < len; i++) {
381
+ const modelId = modelIds[i];
382
+ this.addModel(modelId);
383
+ }
384
+ this.viewer.scene.on("modelLoaded", (modelId) => {
385
+ if (this.viewer.metaScene.metaModels[modelId]) {
386
+ this.addModel(modelId);
387
+ }
388
+ });
389
+ }
390
+
391
+ this.hierarchy = cfg.hierarchy;
392
+ }
393
+
394
+ /**
395
+ * Returns the map of {@link ModelTreeView}s.
396
+ *
397
+ * Each ModelTreeView is mapped to the ID of its model.
398
+ *
399
+ * @return {*|{}}
400
+ */
401
+ get modelTreeViews() {
402
+ return this._modelTreeViews;
403
+ }
404
+
405
+ /**
406
+ * Sets how the nodes are organized within this tree view.
407
+ *
408
+ * Accepted values are:
409
+ *
410
+ * * "containment" - organizes the nodes to indicate the containment hierarchy of the IFC objects.
411
+ * * "types" - groups the nodes within their IFC types.
412
+ * * "storeys" - groups the nodes within ````IfcBuildingStoreys```` and sub-groups them by their IFC types.
413
+ *
414
+ * <br>
415
+ * This can be updated dynamically.
416
+ *
417
+ * Default value is "containment".
418
+ *
419
+ * @type {String}
420
+ */
421
+ set hierarchy(hierarchy) {
422
+ hierarchy = hierarchy || "containment";
423
+ if (hierarchy !== "containment" && hierarchy !== "storeys" && hierarchy !== "types") {
424
+ this.error("Unsupported value for `hierarchy' - defaulting to 'containment'");
425
+ hierarchy = "containment";
426
+ }
427
+ this._hierarchy = hierarchy;
428
+ for (let modelId in this._modelTreeViews) {
429
+ if (this._modelTreeViews.hasOwnProperty(modelId)) {
430
+ this._modelTreeViews[modelId].setHierarchy(this._hierarchy);
431
+ }
432
+ }
433
+ }
434
+
435
+ /**
436
+ * Gets how the nodes are organized within this tree view.
437
+ *
438
+ * @type {String}
439
+ */
440
+ get hierarchy() {
441
+ return this._hierarchy;
442
+ }
443
+
444
+ /**
445
+ * Adds a model to this tree view.
446
+ *
447
+ * The model will be automatically removed when destroyed.
448
+ *
449
+ * To automatically add each model as it's created, instead of manually calling this method each time,
450
+ * provide a ````autoAddModels: true```` to the TreeViewPlugin constructor.
451
+ *
452
+ * @param {String} modelId ID of a model {@link Entity} in {@link Scene#models}.
453
+ * @param {Object} [options] Options for model in the tree view.
454
+ * @param {String} [options.rootName] Optional display name for the root node. Ordinary, for "containment"
455
+ * and "storeys" hierarchy types, the tree would derive the root node name from the model's "IfcProject" element
456
+ * name. This option allows to override that name when it is not suitable as a display name.
457
+ * @returns {ModelTreeView} ModelTreeView for the newly-added model. If this method succeeded in adding the model,
458
+ * then {@link ModelTreeView#valid} will equal ````true````. Otherwise, that property will be ````false````
459
+ * and {@link ModelTreeView#errors} will contain error messages.
460
+ */
461
+ addModel(modelId, options = {}) {
462
+ if (!this._containerElement) {
463
+ return;
464
+ }
465
+ const model = this.viewer.scene.models[modelId];
466
+ if (!model) {
467
+ throw "Model not found: " + modelId;
468
+ }
469
+ const metaModel = this.viewer.metaScene.metaModels[modelId];
470
+ if (!metaModel) {
471
+ this.error("MetaModel not found: " + modelId);
472
+ return;
473
+ }
474
+ if (this._modelTreeViews[modelId]) {
475
+ this.warn("Model already added: " + modelId);
476
+ return;
477
+ }
478
+ const modelTreeView = new ModelTreeView(this.viewer, this, model, metaModel, {
479
+ containerElement: this._containerElement,
480
+ autoExpandDepth: this._autoExpandDepth,
481
+ hierarchy: this._hierarchy,
482
+ sortNodes: this._sortNodes,
483
+ pruneEmptyNodes: this._pruneEmptyNodes,
484
+ rootName: options.rootName
485
+ });
486
+ this._modelTreeViews[modelId] = modelTreeView;
487
+ model.on("destroyed", () => {
488
+ this.removeModel(model.id);
489
+ });
490
+ return modelTreeView;
491
+ }
492
+
493
+ /**
494
+ * Removes a model from this tree view.
495
+ *
496
+ * @param {String} modelId ID of a model {@link Entity} in {@link Scene#models}.
497
+ */
498
+ removeModel(modelId) {
499
+ if (!this._containerElement) {
500
+ return;
501
+ }
502
+ const modelTreeView = this._modelTreeViews[modelId];
503
+ if (!modelTreeView) {
504
+ this.warn("Model not added: " + modelId);
505
+ return;
506
+ }
507
+ modelTreeView.destroy();
508
+ delete this._modelTreeViews[modelId];
509
+ }
510
+
511
+ /**
512
+ * Collapses all trees within this tree view.
513
+ */
514
+ collapse() {
515
+ for (let modelId in this._modelTreeViews) {
516
+ if (this._modelTreeViews.hasOwnProperty(modelId)) {
517
+ const modelTreeView = this._modelTreeViews[modelId];
518
+ modelTreeView.collapse();
519
+ }
520
+ }
521
+ }
522
+
523
+ /**
524
+ * Highlights the tree view node that represents the given object {@link Entity}.
525
+ *
526
+ * This causes the tree view to collapse, then expand to reveal the node, then highlight the node.
527
+ *
528
+ * If a node is previously highlighted, de-highlights that node and collapses the tree first.
529
+ *
530
+ * Note that if the TreeViewPlugin was configured with ````pruneEmptyNodes: true```` (default configuration), then the
531
+ * node won't exist in the tree if it has no Entitys in the {@link Scene}. in that case, nothing will happen.
532
+ *
533
+ * Within the DOM, the node is represented by an ````<li>```` element. This method will add a ````.highlighted-node```` class to
534
+ * the element to make it appear highlighted, removing that class when de-highlighting it again. See the CSS rules
535
+ * in the TreeViewPlugin examples for an example of that class.
536
+ *
537
+ * @param {String} objectId ID of the {@link Entity}.
538
+ */
539
+ showNode(objectId) {
540
+ this.unShowNode();
541
+ const metaObject = this.viewer.metaScene.metaObjects[objectId];
542
+ if (!metaObject) {
543
+ this.error("MetaObject not found: " + objectId);
544
+ return;
545
+ }
546
+ const metaModel = metaObject.metaModel;
547
+ const modelId = metaModel.id;
548
+ const modelTreeView = this._modelTreeViews[modelId];
549
+ if (!modelTreeView) {
550
+ this.error("Object not in this TreeView: " + objectId);
551
+ return;
552
+ }
553
+ modelTreeView.showNode(objectId);
554
+ }
555
+
556
+ /**
557
+ * De-highlights the node previously shown with {@link TreeViewPlugin#showNode}.
558
+ *
559
+ * Does nothing if no node is currently shown.
560
+ *
561
+ * If the node is currently scrolled into view, keeps the node in view.
562
+ */
563
+ unShowNode() {
564
+ for (let modelId in this._modelTreeViews) {
565
+ if (this._modelTreeViews.hasOwnProperty(modelId)) {
566
+ const modelTreeView = this._modelTreeViews[modelId];
567
+ modelTreeView.unShowNode();
568
+ }
569
+ }
570
+ }
571
+
572
+ /**
573
+ * Expands the tree to the given depth.
574
+ *
575
+ * Collapses the tree first.
576
+ *
577
+ * @param {Number} depth Depth to expand to.
578
+ */
579
+ expandToDepth(depth) {
580
+ for (let modelId in this._modelTreeViews) {
581
+ if (this._modelTreeViews.hasOwnProperty(modelId)) {
582
+ const modelTreeView = this._modelTreeViews[modelId];
583
+ modelTreeView.collapse();
584
+ modelTreeView.expandToDepth(depth);
585
+ }
586
+ }
587
+ }
588
+
589
+ /**
590
+ * Iterates over a subtree of the tree view's {@link TreeViewNode}s, calling the given callback for each
591
+ * node in depth-first pre-order.
592
+ *
593
+ * @param {TreeViewNode} node Root of the subtree.
594
+ * @param {Function} callback Callback called at each {@link TreeViewNode}, with the TreeViewNode given as the argument.
595
+ */
596
+ withNodeTree(node, callback) {
597
+ callback(node);
598
+ const children = node.children;
599
+ if (!children) {
600
+ return;
601
+ }
602
+ for (let i = 0, len = children.length; i < len; i++) {
603
+ this.withNodeTree(children[i], callback);
604
+ }
605
+ }
606
+
607
+ /**
608
+ * Destroys this TreeViewPlugin.
609
+ */
610
+ destroy() {
611
+ if (!this._containerElement) {
612
+ return;
613
+ }
614
+ for (let modelId in this._modelTreeViews) {
615
+ if (this._modelTreeViews.hasOwnProperty(modelId)) {
616
+ this._modelTreeViews[modelId].destroy();
617
+ }
618
+ }
619
+ this._modelTreeViews = {};
620
+ super.destroy();
621
+ }
622
+ }
623
+
624
+ export {TreeViewPlugin};
@@ -0,0 +1 @@
1
+ export * from "./TreeViewPlugin.js";