csyjk 1.2.2 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
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,777 +0,0 @@
1
- import {Plugin} from "../../viewer/Plugin.js";
2
- import {SectionPlane} from "../../viewer/scene/sectionPlane/SectionPlane.js";
3
- import {math} from "../../viewer/scene/math/math.js";
4
-
5
- const tempVec3 = math.vec3();
6
-
7
- /**
8
- * {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
9
- *
10
- * BCF is a format for managing issues on a BIM project. This plugin's viewpoints conform to
11
- * the <a href="https://github.com/buildingSMART/BCF-API">BCF Version 2.1</a> specification.
12
- *
13
- * ## Saving a BCF Viewpoint
14
- *
15
- * In the example below we'll create a {@link Viewer}, load an ````.XKT```` model into it using an {@link XKTLoaderPlugin},
16
- * slice the model in half using a {@link SectionPlanesPlugin}, then use a {@link BCFViewpointsPlugin#getViewpoint}
17
- * to save a viewpoint to JSON, which we'll log to the JavaScript developer console.
18
- *
19
- * * [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#BCF_SaveViewpoint)]
20
- *
21
- * ````javascript
22
- * import {Viewer, XKTLoaderPlugin, SectionPlanesPlugin, BCFViewpointsPlugin} from "yjkkit-sdk.es.js";
23
- *
24
- * // Create a Viewer
25
- * const viewer = new Viewer({
26
- * canvasId: "myCanvas",
27
- * transparent: true
28
- * });
29
- *
30
- * // Add a XKTLoaderPlugin
31
- * const xktLoader = new XKTLoaderPlugin(viewer);
32
- *
33
- * // Add a SectionPlanesPlugin
34
- * const sectionPlanes = new SectionPlanesPlugin(viewer);
35
- *
36
- * // Add a BCFViewpointsPlugin
37
- * const bcfViewpoints = new BCFViewpointsPlugin(viewer);
38
- *
39
- * // Load an .XKT model
40
- * const modelNode = xktLoader.load({
41
- * id: "myModel",
42
- * src: "./models/xkt/Schependomlaan.xkt",
43
- * edges: true // Emphasise edges
44
- * });
45
- *
46
- * // Slice it in half
47
- * sectionPlanes.createSectionPlane({
48
- * id: "myClip",
49
- * pos: [0, 0, 0],
50
- * dir: [0.5, 0.0, 0.5]
51
- * });
52
- *
53
- * // When model is loaded, set camera, select some objects and capture a BCF viewpoint to the console
54
- * modelNode.on("loaded", () => {
55
- *
56
- * const scene = viewer.scene;
57
- * const camera = scene.camera;
58
- *
59
- * camera.eye = [-2.37, 18.97, -26.12];
60
- * camera.look = [10.97, 5.82, -11.22];
61
- * camera.up = [0.36, 0.83, 0.40];
62
- *
63
- * scene.setObjectsSelected([
64
- * "3b2U496P5Ebhz5FROhTwFH",
65
- * "2MGtJUm9nD$Re1_MDIv0g2",
66
- * "3IbuwYOm5EV9Q6cXmwVWqd",
67
- * "3lhisrBxL8xgLCRdxNG$2v",
68
- * "1uDn0xT8LBkP15zQc9MVDW"
69
- * ], true);
70
- *
71
- * const viewpoint = bcfViewpoints.getViewpoint();
72
- * const viewpointStr = JSON.stringify(viewpoint, null, 4);
73
- *
74
- * console.log(viewpointStr);
75
- * });
76
- * ````
77
- *
78
- * ## Saving View Setup Hints
79
- *
80
- * BCFViewpointsPlugin can optionally save hints in the viewpoint, which indicate how to set up the view when
81
- * loading it again.
82
- *
83
- * Here's the {@link BCFViewpointsPlugin#getViewpoint} call again, this time saving some hints:
84
- *
85
- * ````javascript
86
- * const viewpoint = bcfViewpoints.getViewpoint({ // Options
87
- * spacesVisible: true, // Force IfcSpace types visible in the viewpoint (default is false)
88
- * spaceBoundariesVisible: false, // Show IfcSpace boundaries in the viewpoint (default is false)
89
- * openingsVisible: true // Force IfcOpening types visible in the viewpoint (default is false)
90
- * });
91
- * ````
92
- *
93
- * ## Loading a BCF Viewpoint
94
- *
95
- * Assuming that we have our BCF viewpoint in a JSON object, let's now restore it with {@link BCFViewpointsPlugin#setViewpoint}:
96
- *
97
- * ````javascript
98
- * bcfViewpoints.setViewpoint(viewpoint);
99
- * ````
100
- *
101
- * ## Handling BCF Incompatibility with yjkkit's Camera
102
- *
103
- * yjkkit's {@link Camera#look} is the current 3D *point-of-interest* (POI).
104
- *
105
- * A BCF viewpoint, however, has a direction vector instead of a POI, and so {@link BCFViewpointsPlugin#getViewpoint} saves
106
- * yjkkit's POI as a normalized vector from {@link Camera#eye} to {@link Camera#look}, which unfortunately loses
107
- * that positional information. Loading the viewpoint with {@link BCFViewpointsPlugin#setViewpoint} will restore {@link Camera#look} to
108
- * the viewpoint's camera position, offset by the normalized vector.
109
- *
110
- * As shown below, providing a ````rayCast```` option to ````setViewpoint```` will set {@link Camera#look} to the closest
111
- * surface intersection on the direction vector. Internally, ````setViewpoint```` supports this option by firing a ray
112
- * along the vector, and if that hits an {@link Entity}, sets {@link Camera#look} to ray's intersection point with the
113
- * Entity's surface.
114
- *
115
- * ````javascript
116
- * bcfViewpoints.setViewpoint(viewpoint, {
117
- * rayCast: true // <<--------------- Attempt to set Camera#look to surface intersection point (default)
118
- * });
119
- * ````
120
- *
121
- * ## Dealing With Loaded Models That Are Not in the Viewpoint
122
- *
123
- * If, for example, we load model "duplex", hide some objects, then save a BCF viewpoint with
124
- * ````BCFViewpointsPlugin#getViewpoint````, then load another model, "schependomlaan", then load the viewpoint again
125
- * with ````BCFViewpointsPlugin#setViewpoint````, then sometimes all of the objects in model "schependomlaan" become
126
- * visible, along with the visible objects in the viewpoint, which belong to model "duplex".
127
- *
128
- * The reason is that, when saving a BCF viewpoint, BCF logic works like the following pseudo code:
129
- *
130
- * ````
131
- * If numVisibleObjects < numInvisibleObjects
132
- * save IDs of visible objects in BCF
133
- * exceptions = "visible objects"
134
- * else
135
- * save IDS of invisible objects in BCF
136
- * exceptions = "invisible objects"
137
- * ````
138
- *
139
- * When loading the viewpoint again:
140
- *
141
- * ````
142
- * If exceptions = "visible objects"
143
- * hide all objects
144
- * show visible objects in BCF
145
- * else
146
- * show all objects
147
- * hide invisible objects in BCF
148
- * ````
149
- *
150
- * When the exception is "visible objects", loading the viewpoint shows all the objects in the first, which includes
151
- * objects in "schependomlaan", which can be confusing, because those were not even loaded when we first
152
- * saved the viewpoint..
153
- *
154
- * To solve this, we can supply a ````defaultInvisible```` option to {@link BCFViewpointsPlugin#getViewpoint}, which
155
- * will force the plugin to save the IDs of all visible objects while making invisible objects the exception.
156
- *
157
- * That way, when we load the viewpoint again, after loading model "schependomlaan", the plugin will hide all objects
158
- * in the scene first (which will include objects belonging to model "schependomlaan"), then make the objects in the
159
- * viewpoint visible (which will only be those of object "duplex").
160
- *
161
- * ````javascript
162
- * const viewpoint = bcfViewpoints.getViewpoint({ // Options
163
- * //..
164
- * defaultInvisible: true
165
- * });
166
- * ````
167
- *
168
- * [[Run an example](http://yjkkit.github.io/yjkkit-sdk/examples/#BCF_LoadViewpoint_defaultInvisible)]
169
- *
170
- * ## Behaviour with XKTLoaderPlugin globalizeObjectIds
171
- *
172
- * Whenever we use {@link XKTLoaderPlugin} to load duplicate copies of the same model, after configuring
173
- * {@link XKTLoaderPlugin#globalizeObjectIds} ````true```` to avoid ````Entity```` ID clashes, this has consequences
174
- * for BCF viewpoints created by {@link BCFViewpointsPlugin#getViewpoint}.
175
- *
176
- * When no duplicate copies of a model are loaded like this, viewpoints created by {@link BCFViewpointsPlugin#getViewpoint} will
177
- * continue to load as usual in other BIM viewers. Conversely, a viewpoint created for a single model in other BIM viewers
178
- * will continue to load as usual with ````BCFViewpointsPlugin````.
179
- *
180
- * When duplicate copies of a model are loaded, however, viewpoints created by {@link BCFViewpointsPlugin#getViewpoint}
181
- * will contain certain changes that will affect the viewpoint's portability, however. Such viewpoints will
182
- * use ````authoring_tool_id```` fields to save the globalized ````Entity#id```` values, which enables the viewpoints to
183
- * capture the states of the individual ````Entitys```` that represent the duplicate IFC elements. Take a look at the
184
- * following two examples to learn more.
185
- *
186
- * * [Example: Saving a BCF viewpoint containing duplicate models](https://yjkkit.github.io/yjkkit-sdk/examples/#BCF_SaveViewpoint_MultipleModels)
187
- * * [Example: Loading a BCF viewpoint containing duplicate models](https://yjkkit.github.io/yjkkit-sdk/examples/#BCF_LoadViewpoint_MultipleModels)
188
- *
189
- * **Caveat:** when loading a BCF viewpoint, we always assume that we have loaded in our target BIM viewer the same models that were
190
- * loaded in the viewpoint's original authoring application when the viewpoint was created. In the case of multi-model
191
- * viewpoints, the target BIM viewer, whether it be yjkkit or another BIM viewer, will need to first have those exact
192
- * models loaded, with their objects having globalized IDs, following the same prefixing scheme we're using in
193
- * yjkkit. Then, the viewpoint's ````authoring_tool_id```` fields will be able to resolve to their objects within the
194
- * target viewer.
195
- *
196
- * @class BCFViewpointsPlugin
197
- */
198
- class BCFViewpointsPlugin extends Plugin {
199
-
200
- /**
201
- * @constructor
202
- * @param {Viewer} viewer The Viewer.
203
- * @param {Object} cfg Plugin configuration.
204
- * @param {String} [cfg.id="BCFViewpoints"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
205
- * @param {String} [cfg.originatingSystem] Identifies the originating system for BCF records.
206
- * @param {String} [cfg.authoringTool] Identifies the authoring tool for BCF records.
207
- */
208
- constructor(viewer, cfg = {}) {
209
-
210
- super("BCFViewpoints", viewer, cfg);
211
-
212
- /**
213
- * Identifies the originating system to include in BCF viewpoints saved by this plugin.
214
- * @property originatingSystem
215
- * @type {string}
216
- */
217
- this.originatingSystem = cfg.originatingSystem || "yjkkit.io";
218
-
219
- /**
220
- * Identifies the authoring tool to include in BCF viewpoints saved by this plugin.
221
- * @property authoringTool
222
- * @type {string}
223
- */
224
- this.authoringTool = cfg.authoringTool || "yjkkit.io";
225
- }
226
-
227
- /**
228
- * Saves viewer state to a BCF viewpoint.
229
- *
230
- * Note that yjkkit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a
231
- * direction vector. Therefore, we save ````camera_direction```` as the vector from {@link Camera#eye} to {@link Camera#look}.
232
- *
233
- * @param {*} [options] Options for getting the viewpoint.
234
- * @param {Boolean} [options.spacesVisible=false] Indicates whether ````IfcSpace```` types should be forced visible in the viewpoint.
235
- * @param {Boolean} [options.openingsVisible=false] Indicates whether ````IfcOpening```` types should be forced visible in the viewpoint.
236
- * @param {Boolean} [options.spaceBoundariesVisible=false] Indicates whether the boundaries of ````IfcSpace```` types should be visible in the viewpoint.
237
- * @param {Boolean} [options.snapshot=true] Indicates whether the snapshot should be included in the viewpoint.
238
- * @param {Boolean} [options.defaultInvisible=false] When ````true````, will save the default visibility of all objects
239
- * as ````false````. This means that when we load the viewpoint again, and there are additional models loaded that
240
- * were not saved in the viewpoint, those models will be hidden when we load the viewpoint, and that only the
241
- * objects in the viewpoint will be visible.
242
- * @param {Boolean} [options.reverseClippingPlanes=false] When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)
243
- * @returns {*} BCF JSON viewpoint object
244
- * @example
245
- *
246
- * const viewer = new Viewer();
247
- *
248
- * const bcfPlugin = new BCFPlugin(viewer, {
249
- * //...
250
- * });
251
- *
252
- * const viewpoint = bcfPlugin.getViewpoint({ // Options - see constructor
253
- * spacesVisible: false, // Default
254
- * spaceBoundariesVisible: false, // Default
255
- * openingsVisible: false // Default
256
- * });
257
- *
258
- * // viewpoint will resemble the following:
259
- *
260
- * {
261
- * perspective_camera: {
262
- * camera_view_point: {
263
- * x: 0.0,
264
- * y: 0.0,
265
- * z: 0.0
266
- * },
267
- * camera_direction: {
268
- * x: 1.0,
269
- * y: 1.0,
270
- * z: 2.0
271
- * },
272
- * camera_up_vector: {
273
- * x: 0.0,
274
- * y: 0.0,
275
- * z: 1.0
276
- * },
277
- * field_of_view: 90.0
278
- * },
279
- * lines: [],
280
- * clipping_planes: [{
281
- * location: {
282
- * x: 0.5,
283
- * y: 0.5,
284
- * z: 0.5
285
- * },
286
- * direction: {
287
- * x: 1.0,
288
- * y: 0.0,
289
- * z: 0.0
290
- * }
291
- * }],
292
- * bitmaps: [],
293
- * snapshot: {
294
- * snapshot_type: png,
295
- * snapshot_data: "data:image/png;base64,......"
296
- * },
297
- * components: {
298
- * visibility: {
299
- * default_visibility: false,
300
- * exceptions: [{
301
- * ifc_guid: 4$cshxZO9AJBebsni$z9Yk,
302
- * originating_system: yjkkit.io,
303
- * authoring_tool_id: yjkkit/v1.0
304
- * }]
305
- * },
306
- * selection: [{
307
- * ifc_guid: "4$cshxZO9AJBebsni$z9Yk",
308
- * }]
309
- * }
310
- * }
311
- */
312
- getViewpoint(options = {}) {
313
- const scene = this.viewer.scene;
314
- const camera = scene.camera;
315
- const realWorldOffset = scene.realWorldOffset;
316
- const reverseClippingPlanes = (options.reverseClippingPlanes === true);
317
- let bcfViewpoint = {};
318
-
319
- // Camera
320
- let lookDirection = math.normalizeVec3(math.subVec3(camera.look, camera.eye, math.vec3()));
321
- let eye = camera.eye;
322
- let up = camera.up;
323
-
324
- if (camera.yUp) {
325
- // BCF is Z up
326
- lookDirection = YToZ(lookDirection);
327
- eye = YToZ(eye);
328
- up = YToZ(up);
329
- }
330
-
331
- const camera_view_point = xyzArrayToObject(math.addVec3(eye, realWorldOffset));
332
-
333
- if (camera.projection === "ortho") {
334
- bcfViewpoint.orthogonal_camera = {
335
- camera_view_point: camera_view_point,
336
- camera_direction: xyzArrayToObject(lookDirection),
337
- camera_up_vector: xyzArrayToObject(up),
338
- view_to_world_scale: camera.ortho.scale,
339
- };
340
- } else {
341
- bcfViewpoint.perspective_camera = {
342
- camera_view_point: camera_view_point,
343
- camera_direction: xyzArrayToObject(lookDirection),
344
- camera_up_vector: xyzArrayToObject(up),
345
- field_of_view: camera.perspective.fov,
346
- };
347
- }
348
-
349
- // Clipping planes
350
-
351
- const sectionPlanes = scene.sectionPlanes;
352
- for (let id in sectionPlanes) {
353
- if (sectionPlanes.hasOwnProperty(id)) {
354
- let sectionPlane = sectionPlanes[id];
355
-
356
- let location = sectionPlane.pos;
357
-
358
- let direction;
359
- if (reverseClippingPlanes) {
360
- direction = math.negateVec3(sectionPlane.dir, math.vec3());
361
- } else {
362
- direction = sectionPlane.dir;
363
- }
364
-
365
- if (camera.yUp) {
366
- // BCF is Z up
367
- location = YToZ(location);
368
- direction = YToZ(direction);
369
- }
370
- math.addVec3(location, realWorldOffset);
371
-
372
- location = xyzArrayToObject(location);
373
- direction = xyzArrayToObject(direction);
374
- if (!bcfViewpoint.clipping_planes) {
375
- bcfViewpoint.clipping_planes = [];
376
- }
377
- bcfViewpoint.clipping_planes.push({location, direction});
378
- }
379
- }
380
-
381
- // Entity states
382
-
383
- bcfViewpoint.components = {
384
- visibility: {
385
- view_setup_hints: {
386
- spaces_visible: !!options.spacesVisible,
387
- space_boundaries_visible: !!options.spaceBoundariesVisible,
388
- openings_visible: !!options.openingsVisible
389
- }
390
- }
391
- };
392
-
393
- const opacityObjectIds = new Set(scene.opacityObjectIds);
394
- const xrayedObjectIds = new Set(scene.xrayedObjectIds);
395
- const colorizedObjectIds = new Set(scene.colorizedObjectIds);
396
-
397
- const originalSystemColoringMap = {};
398
-
399
- const coloringMap = Object.values(scene.objects)
400
- .filter(entity => opacityObjectIds.has(entity.id) || colorizedObjectIds.has(entity.id) || xrayedObjectIds.has(entity.id))
401
- .reduce((coloringMap, entity) => {
402
-
403
- let color = colorizeToRGB(entity.colorize);
404
- let alpha;
405
-
406
- if (entity.xrayed) {
407
- if (scene.xrayMaterial.fillAlpha === 0.0 && scene.xrayMaterial.edgeAlpha !== 0.0) {
408
- // BCF can't deal with edges. If xRay is implemented only with edges, set an arbitrary opacity
409
- alpha = 0.1;
410
- } else {
411
- alpha = scene.xrayMaterial.fillAlpha;
412
- }
413
- alpha = Math.round(alpha * 255).toString(16).padStart(2, "0");
414
- color = alpha + color;
415
- } else if (opacityObjectIds.has(entity.id)) {
416
- alpha = Math.round(entity.opacity * 255).toString(16).padStart(2, "0");
417
- color = alpha + color;
418
- }
419
-
420
- if (!coloringMap[color]) {
421
- coloringMap[color] = [];
422
- }
423
-
424
- const objectId = entity.id;
425
- const originalSystemId = entity.originalSystemId;
426
- const component = {
427
- ifc_guid: originalSystemId,
428
- originating_system: this.originatingSystem
429
- };
430
- if (originalSystemId !== objectId) {
431
- component.authoring_tool_id = objectId;
432
- }
433
-
434
- coloringMap[color].push(component);
435
-
436
- return coloringMap;
437
-
438
- }, {});
439
-
440
- const coloringArray = Object.entries(coloringMap).map(([color, components]) => {
441
- return {color, components};
442
- });
443
-
444
- bcfViewpoint.components.coloring = coloringArray;
445
-
446
- const objectIds = scene.objectIds;
447
- const visibleObjects = scene.visibleObjects;
448
- const visibleObjectIds = scene.visibleObjectIds;
449
- const invisibleObjectIds = objectIds.filter(id => !visibleObjects[id]);
450
- const selectedObjectIds = scene.selectedObjectIds;
451
-
452
- if (options.defaultInvisible || visibleObjectIds.length < invisibleObjectIds.length) {
453
- bcfViewpoint.components.visibility.exceptions = this._createBCFComponents(visibleObjectIds);
454
- bcfViewpoint.components.visibility.default_visibility = false;
455
- } else {
456
- bcfViewpoint.components.visibility.exceptions = this._createBCFComponents(invisibleObjectIds);
457
- bcfViewpoint.components.visibility.default_visibility = true;
458
- }
459
-
460
- bcfViewpoint.components.selection = this._createBCFComponents(selectedObjectIds);
461
-
462
- if (options.snapshot !== false) {
463
- bcfViewpoint.snapshot = {
464
- snapshot_type: "png",
465
- snapshot_data: this.viewer.getSnapshot({format: "png"})
466
- };
467
- }
468
-
469
- return bcfViewpoint;
470
- }
471
-
472
- _createBCFComponents(objectIds) {
473
- const scene = this.viewer.scene;
474
- const components = [];
475
- for (let i = 0, len = objectIds.length; i < len; i++) {
476
- const objectId = objectIds[i];
477
- const entity = scene.objects[objectId];
478
- if (entity) {
479
- const component = {
480
- ifc_guid: entity.originalSystemId,
481
- originating_system: this.originatingSystem
482
- };
483
- if (entity.originalSystemId !== objectId) {
484
- component.authoring_tool_id = objectId;
485
- }
486
- components.push(component);
487
- }
488
- }
489
- return components;
490
- }
491
-
492
- /**
493
- * Sets viewer state to the given BCF viewpoint.
494
- *
495
- * Note that yjkkit's {@link Camera#look} is the **point-of-interest**, whereas the BCF ````camera_direction```` is a
496
- * direction vector. Therefore, when loading a BCF viewpoint, we set {@link Camera#look} to the absolute position
497
- * obtained by offsetting the BCF ````camera_view_point```` along ````camera_direction````.
498
- *
499
- * When loading a viewpoint, we also have the option to find {@link Camera#look} as the closest point of intersection
500
- * (on the surface of any visible and pickable {@link Entity}) with a 3D ray fired from ````camera_view_point```` in
501
- * the direction of ````camera_direction````.
502
- *
503
- * @param {*} bcfViewpoint BCF JSON viewpoint object,
504
- * shows default visible entities and restores camera to initial default position.
505
- * @param {*} [options] Options for setting the viewpoint.
506
- * @param {Boolean} [options.rayCast=true] When ````true```` (default), will attempt to set {@link Camera#look} to the closest
507
- * point of surface intersection with a ray fired from the BCF ````camera_view_point```` in the direction of ````camera_direction````.
508
- * @param {Boolean} [options.immediate=true] When ````true```` (default), immediately set camera position.
509
- * @param {Boolean} [options.duration] Flight duration in seconds. Overrides {@link CameraFlightAnimation#duration}. Only applies when ````immediate```` is ````false````.
510
- * @param {Boolean} [options.reset=true] When ````true```` (default), set {@link Entity#xrayed} and {@link Entity#highlighted} ````false```` on all scene objects.
511
- * @param {Boolean} [options.reverseClippingPlanes=false] When ````true````, clipping planes are reversed (https://github.com/buildingSMART/BCF-XML/issues/193)
512
- * @param {Boolean} [options.updateCompositeObjects=false] When ````true````, then when visibility and selection updates refer to composite objects (eg. an IfcBuildingStorey),
513
- * then this method will apply the updates to objects within those composites.
514
- */
515
- setViewpoint(bcfViewpoint, options = {}) {
516
- if (!bcfViewpoint) {
517
- return;
518
- }
519
-
520
- const viewer = this.viewer;
521
- const scene = viewer.scene;
522
- const camera = scene.camera;
523
- const rayCast = (options.rayCast !== false);
524
- const immediate = (options.immediate !== false);
525
- const reset = (options.reset !== false);
526
- const realWorldOffset = scene.realWorldOffset;
527
- const reverseClippingPlanes = (options.reverseClippingPlanes === true);
528
-
529
- scene.clearSectionPlanes();
530
-
531
- if (bcfViewpoint.clipping_planes) {
532
- bcfViewpoint.clipping_planes.forEach(function (e) {
533
- let pos = xyzObjectToArray(e.location, tempVec3);
534
- let dir = xyzObjectToArray(e.direction, tempVec3);
535
-
536
- if (reverseClippingPlanes) {
537
- math.negateVec3(dir);
538
- }
539
- math.subVec3(pos, realWorldOffset);
540
-
541
- if (camera.yUp) {
542
- pos = ZToY(pos);
543
- dir = ZToY(dir);
544
- }
545
- new SectionPlane(scene, {pos, dir});
546
- });
547
- }
548
-
549
- if (reset) {
550
- scene.setObjectsXRayed(scene.xrayedObjectIds, false);
551
- scene.setObjectsHighlighted(scene.highlightedObjectIds, false);
552
- scene.setObjectsSelected(scene.selectedObjectIds, false);
553
- }
554
-
555
- if (bcfViewpoint.components) {
556
-
557
- if (bcfViewpoint.components.visibility) {
558
-
559
- if (!bcfViewpoint.components.visibility.default_visibility) {
560
- scene.setObjectsVisible(scene.objectIds, false);
561
- if (bcfViewpoint.components.visibility.exceptions) {
562
- bcfViewpoint.components.visibility.exceptions.forEach((component) => this._withBCFComponent(options, component, entity => entity.visible = true));
563
- }
564
- } else {
565
- scene.setObjectsVisible(scene.objectIds, true);
566
- if (bcfViewpoint.components.visibility.exceptions) {
567
- bcfViewpoint.components.visibility.exceptions.forEach((component) => this._withBCFComponent(options, component, entity => entity.visible = false));
568
- }
569
- }
570
-
571
- const view_setup_hints = bcfViewpoint.components.visibility.view_setup_hints;
572
- if (view_setup_hints) {
573
- if (view_setup_hints.spaces_visible === false) {
574
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcSpace"), false);
575
- }
576
- if (view_setup_hints.openings_visible === false) {
577
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcOpening"), false);
578
- }
579
- if (view_setup_hints.space_boundaries_visible !== undefined) {
580
- // TODO: Ability to show boundaries
581
- }
582
- }
583
- }
584
-
585
- if (bcfViewpoint.components.selection) {
586
- scene.setObjectsSelected(scene.selectedObjectIds, false);
587
- bcfViewpoint.components.selection.forEach(component => this._withBCFComponent(options, component, entity => entity.selected = true));
588
-
589
- }
590
-
591
- if (bcfViewpoint.components.coloring) {
592
- bcfViewpoint.components.coloring.forEach(coloring => {
593
-
594
- let color = coloring.color;
595
- let alpha = 0;
596
- let alphaDefined = false;
597
-
598
- if (color.length === 8) {
599
- alpha = parseInt(color.substring(0, 2), 16) / 256;
600
- if (alpha <= 1.0 && alpha >= 0.95) {
601
- alpha = 1.0;
602
- }
603
- color = color.substring(2);
604
- alphaDefined = true;
605
- }
606
-
607
- const colorize = [
608
- parseInt(color.substring(0, 2), 16) / 256,
609
- parseInt(color.substring(2, 4), 16) / 256,
610
- parseInt(color.substring(4, 6), 16) / 256
611
- ];
612
-
613
- coloring.components.map(component =>
614
- this._withBCFComponent(options, component, entity => {
615
- entity.colorize = colorize;
616
- if (alphaDefined) {
617
- entity.opacity = alpha;
618
- }
619
- }));
620
- });
621
- }
622
- }
623
-
624
- if (bcfViewpoint.perspective_camera || bcfViewpoint.orthogonal_camera) {
625
- let eye;
626
- let look;
627
- let up;
628
- let projection;
629
-
630
- if (bcfViewpoint.perspective_camera) {
631
- eye = xyzObjectToArray(bcfViewpoint.perspective_camera.camera_view_point, tempVec3);
632
- look = xyzObjectToArray(bcfViewpoint.perspective_camera.camera_direction, tempVec3);
633
- up = xyzObjectToArray(bcfViewpoint.perspective_camera.camera_up_vector, tempVec3);
634
-
635
- camera.perspective.fov = bcfViewpoint.perspective_camera.field_of_view;
636
-
637
- projection = "perspective";
638
- } else {
639
- eye = xyzObjectToArray(bcfViewpoint.orthogonal_camera.camera_view_point, tempVec3);
640
- look = xyzObjectToArray(bcfViewpoint.orthogonal_camera.camera_direction, tempVec3);
641
- up = xyzObjectToArray(bcfViewpoint.orthogonal_camera.camera_up_vector, tempVec3);
642
-
643
- camera.ortho.scale = bcfViewpoint.orthogonal_camera.view_to_world_scale;
644
-
645
- projection = "ortho";
646
- }
647
-
648
- math.subVec3(eye, realWorldOffset);
649
-
650
- if (camera.yUp) {
651
- eye = ZToY(eye);
652
- look = ZToY(look);
653
- up = ZToY(up);
654
- }
655
-
656
- if (rayCast) {
657
- const hit = scene.pick({
658
- pickSurface: true, // <<------ This causes picking to find the intersection point on the entity
659
- origin: eye,
660
- direction: look
661
- });
662
- look = (hit ? hit.worldPos : math.addVec3(eye, look, tempVec3));
663
- } else {
664
- look = math.addVec3(eye, look, tempVec3);
665
- }
666
-
667
- if (immediate) {
668
- camera.eye = eye;
669
- camera.look = look;
670
- camera.up = up;
671
- camera.projection = projection;
672
- } else {
673
- viewer.cameraFlight.flyTo({eye, look, up, duration: options.duration, projection});
674
- }
675
- }
676
- }
677
-
678
- _withBCFComponent(options, component, callback) {
679
-
680
- const viewer = this.viewer;
681
- const scene = viewer.scene;
682
-
683
- if (component.authoring_tool_id && component.originating_system === this.originatingSystem) {
684
-
685
- const id = component.authoring_tool_id;
686
- const entity = scene.objects[id];
687
-
688
- if (entity) {
689
- callback(entity);
690
- return
691
- }
692
-
693
- if (options.updateCompositeObjects) {
694
- const metaObject = viewer.metaScene.metaObjects[id];
695
- if (metaObject) {
696
- scene.withObjects(viewer.metaScene.getObjectIDsInSubtree(id), callback);
697
- return;
698
- }
699
- }
700
- }
701
-
702
- if (component.ifc_guid) {
703
-
704
- const originalSystemId = component.ifc_guid;
705
- const entity = scene.objects[originalSystemId];
706
-
707
- if (entity) {
708
- callback(entity);
709
- return;
710
- }
711
-
712
- if (options.updateCompositeObjects) {
713
- const metaObject = viewer.metaScene.metaObjects[originalSystemId];
714
- if (metaObject) {
715
- scene.withObjects(viewer.metaScene.getObjectIDsInSubtree(originalSystemId), callback);
716
- return;
717
- }
718
- }
719
-
720
- Object.keys(scene.models).forEach((modelId) => {
721
-
722
- const id = math.globalizeObjectId(modelId, originalSystemId);
723
- const entity = scene.objects[id];
724
-
725
- if (entity) {
726
- callback(entity);
727
- return;
728
- }
729
-
730
- if (options.updateCompositeObjects) {
731
- const metaObject = viewer.metaScene.metaObjects[id];
732
- if (metaObject) {
733
- scene.withObjects(viewer.metaScene.getObjectIDsInSubtree(id), callback);
734
- return;
735
- }
736
- }
737
- });
738
- }
739
- }
740
-
741
- /**
742
- * Destroys this BCFViewpointsPlugin.
743
- */
744
- destroy() {
745
- super.destroy();
746
- }
747
- }
748
-
749
- function xyzArrayToObject(arr) {
750
- return {"x": arr[0], "y": arr[1], "z": arr[2]};
751
- }
752
-
753
- function xyzObjectToArray(xyz, arry) {
754
- arry = new Float64Array(3);
755
- arry[0] = xyz.x;
756
- arry[1] = xyz.y;
757
- arry[2] = xyz.z;
758
- return arry;
759
- }
760
-
761
- function YToZ(vec) {
762
- return new Float64Array([vec[0], -vec[2], vec[1]]);
763
- }
764
-
765
- function ZToY(vec) {
766
- return new Float64Array([vec[0], vec[2], -vec[1]]);
767
- }
768
-
769
- function colorizeToRGB(color) {
770
- let rgb = "";
771
- rgb += Math.round(color[0] * 255).toString(16).padStart(2, "0");
772
- rgb += Math.round(color[1] * 255).toString(16).padStart(2, "0");
773
- rgb += Math.round(color[2] * 255).toString(16).padStart(2, "0");
774
- return rgb;
775
- }
776
-
777
- export {BCFViewpointsPlugin};