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,145 @@
1
+ /**
2
+ * @desc Metadata corresponding to an {@link Entity} that represents a model.
3
+ *
4
+ * An {@link Entity} represents a model when {@link Entity#isModel} is ````true````
5
+ *
6
+ * A MetaModel corresponds to an {@link Entity} by having the same {@link MetaModel#id} as the {@link Entity#id}.
7
+ *
8
+ * A MetaModel is created by {@link MetaScene#createMetaModel} and belongs to a {@link MetaScene}.
9
+ *
10
+ * Each MetaModel is registered by {@link MetaModel#id} in {@link MetaScene#metaModels}.
11
+ *
12
+ * A {@link MetaModel} represents its object structure with a tree of {@link MetaObject}s, with {@link MetaModel#rootMetaObject} referencing the root {@link MetaObject}.
13
+ *
14
+ * @class MetaModel
15
+ */
16
+ class MetaModel {
17
+
18
+ /**
19
+ * @private
20
+ */
21
+ constructor(metaScene, id, projectId, revisionId, author, createdAt, creatingApplication, schema, rootMetaObject) {
22
+
23
+ /**
24
+ * Globally-unique ID.
25
+ *
26
+ * MetaModels are registered by ID in {@link MetaScene#metaModels}.
27
+ *
28
+ * When this MetaModel corresponds to an {@link Entity} then this ID will match the {@link Entity#id}.
29
+ *
30
+ * @property id
31
+ * @type {String|Number}
32
+ */
33
+ this.id = id;
34
+
35
+ /**
36
+ * The project ID
37
+ * @property projectId
38
+ * @type {String|Number}
39
+ */
40
+ this.projectId = projectId;
41
+
42
+ /**
43
+ * The revision ID, if available.
44
+ *
45
+ * Will be undefined if not available.
46
+ *
47
+ * @property revisionId
48
+ * @type {String|Number}
49
+ */
50
+ this.revisionId = revisionId;
51
+
52
+ /**
53
+ * The model author, if available.
54
+ *
55
+ * Will be undefined if not available.
56
+ *
57
+ * @property author
58
+ * @type {String}
59
+ */
60
+ this.author = author;
61
+
62
+ /**
63
+ * The date the model was created, if available.
64
+ *
65
+ * Will be undefined if not available.
66
+ *
67
+ * @property createdAt
68
+ * @type {String}
69
+ */
70
+ this.createdAt = createdAt;
71
+
72
+ /**
73
+ * The application that created the model, if available.
74
+ *
75
+ * Will be undefined if not available.
76
+ *
77
+ * @property creatingApplication
78
+ * @type {String}
79
+ */
80
+ this.creatingApplication = creatingApplication;
81
+
82
+ /**
83
+ * The model schema version, if available.
84
+ *
85
+ * Will be undefined if not available.
86
+ *
87
+ * @property schema
88
+ * @type {String}
89
+ */
90
+ this.schema = schema;
91
+
92
+ /**
93
+ * Metadata on the {@link Scene}.
94
+ *
95
+ * @property metaScene
96
+ * @type {MetaScene}
97
+ */
98
+ this.metaScene = metaScene;
99
+
100
+ /**
101
+ * The root {@link MetaObject} in this MetaModel's composition structure hierarchy.
102
+ *
103
+ * @property rootMetaObject
104
+ * @type {MetaObject}
105
+ */
106
+ this.rootMetaObject = rootMetaObject;
107
+ }
108
+
109
+ getJSON() {
110
+
111
+ var metaObjects = [];
112
+
113
+ function visit(metaObject) {
114
+ var metaObjectCfg = {
115
+ id: metaObject.id,
116
+ extId: metaObject.extId,
117
+ type: metaObject.type,
118
+ name: metaObject.name
119
+ };
120
+ if (metaObject.parent) {
121
+ metaObjectCfg.parent = metaObject.parent.id;
122
+ }
123
+ metaObjects.push(metaObjectCfg);
124
+ var children = metaObject.children;
125
+ if (children) {
126
+ for (var i = 0, len = children.length; i < len; i++) {
127
+ visit(children[i]);
128
+ }
129
+ }
130
+ }
131
+
132
+ visit(this.rootMetaObject);
133
+
134
+ var json = {
135
+ id: this.id,
136
+ projectId: this.projectId,
137
+ revisionId: this.revisionId,
138
+ metaObjects: metaObjects
139
+ };
140
+ return json;
141
+ }
142
+ }
143
+
144
+
145
+ export {MetaModel};
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @desc Metadata corresponding to an {@link Entity} that represents an object.
3
+ *
4
+ * An {@link Entity} represents an object when {@link Entity#isObject} is ````true````
5
+ *
6
+ * A MetaObject corresponds to an {@link Entity} by having the same {@link MetaObject#id} as the {@link Entity#id}.
7
+ *
8
+ * A MetaObject is created within {@link MetaScene#createMetaModel} and belongs to a {@link MetaModel}.
9
+ *
10
+ * Each MetaObject is registered by {@link MetaObject#id} in {@link MetaScene#metaObjects}.
11
+ *
12
+ * A {@link MetaModel} represents its object structure with a tree of MetaObjects, with {@link MetaModel#rootMetaObject} referencing
13
+ * the root MetaObject.
14
+ *
15
+ * @class MetaObject
16
+ */
17
+ class MetaObject {
18
+
19
+ constructor(metaModel, id, originalSystemId, name, type, properties, parent, children, external) {
20
+
21
+ /**
22
+ * Model metadata.
23
+ *
24
+ * @property metaModel
25
+ * @type {MetaModel}
26
+ */
27
+ this.metaModel = metaModel;
28
+
29
+ /**
30
+ * Globally-unique ID.
31
+ *
32
+ * MetaObject instances are registered by this ID in {@link MetaScene#metaObjects}.
33
+ *
34
+ * @property id
35
+ * @type {String|Number}
36
+ */
37
+ this.id = id;
38
+
39
+ /**
40
+ * ID of the corresponding object within the originating system, if any.
41
+ *
42
+ * @type {String}
43
+ * @abstract
44
+ */
45
+ this.originalSystemId = originalSystemId;
46
+
47
+ /**
48
+ * Human-readable name.
49
+ *
50
+ * @property name
51
+ * @type {String}
52
+ */
53
+ this.name = name;
54
+
55
+ /**
56
+ * Type - often an IFC product type.
57
+ *
58
+ * @property type
59
+ * @type {String}
60
+ */
61
+ this.type = type;
62
+
63
+ if (properties) {
64
+
65
+ /**
66
+ * Arbitrary metadata properties.
67
+ *
68
+ * Undefined when no metadata properties are represented.
69
+ *
70
+ * @property properties
71
+ * @type {*}
72
+ */
73
+ this.properties = properties;
74
+ }
75
+
76
+ if (parent !== undefined && parent !== null) {
77
+
78
+ /**
79
+ * The parent MetaObject within the structure hierarchy.
80
+ *
81
+ * Undefined when this is the root of its structure.
82
+ *
83
+ * @property parent
84
+ * @type {MetaObject}
85
+ */
86
+ this.parent = parent;
87
+ }
88
+
89
+ if (children !== undefined && children !== null) {
90
+
91
+ /**
92
+ * Child ObjectMeta instances within the structure hierarchy.
93
+ *
94
+ * Undefined when there are no children.
95
+ *
96
+ * @property children
97
+ * @type {Array}
98
+ */
99
+ this.children = children;
100
+ }
101
+
102
+ if (external !== undefined && external !== null) {
103
+
104
+ /**
105
+ * External application-specific metadata
106
+ *
107
+ * Undefined when there are is no external application-specific metadata.
108
+ *
109
+ * @property external
110
+ * @type {*}
111
+ */
112
+ this.external = external;
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Gets the {@link MetaObject#id}s of the {@link MetaObject}s within the subtree.
118
+ *
119
+ * @returns {String[]} Array of {@link MetaObject#id}s.
120
+ */
121
+ getObjectIDsInSubtree() {
122
+ const objectIds = [];
123
+
124
+ function visit(metaObject) {
125
+ if (!metaObject) {
126
+ return;
127
+ }
128
+ objectIds.push(metaObject.id);
129
+ const children = metaObject.children;
130
+ if (children) {
131
+ for (var i = 0, len = children.length; i < len; i++) {
132
+ visit(children[i]);
133
+ }
134
+ }
135
+ }
136
+
137
+ visit(this);
138
+ return objectIds;
139
+ }
140
+
141
+
142
+ /**
143
+ * Iterates over the {@link MetaObject}s within the subtree.
144
+ *
145
+ * @param {Function} callback Callback fired at each {@link MetaObject}.
146
+ */
147
+ withMetaObjectsInSubtree(callback) {
148
+
149
+ function visit(metaObject) {
150
+ if (!metaObject) {
151
+ return;
152
+ }
153
+ callback(metaObject);
154
+ const children = metaObject.children;
155
+ if (children) {
156
+ for (var i = 0, len = children.length; i < len; i++) {
157
+ visit(children[i]);
158
+ }
159
+ }
160
+ }
161
+
162
+ visit(this);
163
+ }
164
+
165
+ /**
166
+ * Gets the {@link MetaObject#id}s of the {@link MetaObject}s within the subtree that have the given {@link MetaObject#type}s.
167
+ *
168
+ * @param {String[]} types {@link MetaObject#type} values.
169
+ * @returns {String[]} Array of {@link MetaObject#id}s.
170
+ */
171
+ getObjectIDsInSubtreeByType(types) {
172
+ const mask = {};
173
+ for (var i = 0, len = types.length; i < len; i++) {
174
+ mask[types[i]] = types[i];
175
+ }
176
+ const objectIds = [];
177
+
178
+ function visit(metaObject) {
179
+ if (!metaObject) {
180
+ return;
181
+ }
182
+ if (mask[metaObject.type]) {
183
+ objectIds.push(metaObject.id);
184
+ }
185
+ const children = metaObject.children;
186
+ if (children) {
187
+ for (var i = 0, len = children.length; i < len; i++) {
188
+ visit(children[i]);
189
+ }
190
+ }
191
+ }
192
+
193
+ visit(this);
194
+ return objectIds;
195
+ }
196
+
197
+ /**
198
+ * Returns properties of this MeteObject as JSON.
199
+ *
200
+ * @returns {{id: (String|Number), type: String, name: String, parent: (String|Number|Undefined)}}
201
+ */
202
+ getJSON() {
203
+ var json = {
204
+ id: this.id,
205
+ type: this.type,
206
+ name: this.name
207
+ };
208
+ if (this.parent) {
209
+ json.parent = this.parent.id
210
+ }
211
+ return json;
212
+ }
213
+ }
214
+
215
+ export {MetaObject};
@@ -0,0 +1,311 @@
1
+ import {MetaModel} from "./MetaModel.js";
2
+ import {MetaObject} from "./MetaObject.js";
3
+ import {math} from "../scene/math/math.js";
4
+
5
+ /**
6
+ * @desc Metadata corresponding to a {@link Scene}.
7
+ *
8
+ * * Located in {@link Viewer#metaScene}.
9
+ * * Contains {@link MetaModel}s and {@link MetaObject}s.
10
+ * * [Scene Graphs user guide](https://github.com/yjkkit/yjkkit-sdk/wiki/Scene-Graphs)
11
+ * * [Scene graph example with metadata](http://yjkkit.github.io/yjkkit-sdk/examples/#sceneRepresentation_SceneGraph_metadata)
12
+ */
13
+ class MetaScene {
14
+
15
+ /**
16
+ * @private
17
+ */
18
+ constructor(viewer, scene) {
19
+
20
+ /**
21
+ * The {@link Viewer}.
22
+ * @property viewer
23
+ * @type {Viewer}
24
+ */
25
+ this.viewer = viewer;
26
+
27
+ /**
28
+ * The {@link Scene}.
29
+ * @property scene
30
+ * @type {Scene}
31
+ */
32
+ this.scene = scene;
33
+
34
+ /**
35
+ * The {@link MetaModel}s belonging to this MetaScene, each mapped to its {@link MetaModel#modelId}.
36
+ *
37
+ * @type {{String:MetaModel}}
38
+ */
39
+ this.metaModels = {};
40
+
41
+ /**
42
+ * The {@link MetaObject}s belonging to this MetaScene, each mapped to its {@link MetaObject#id}.
43
+ *
44
+ * @type {{String:MetaObject}}
45
+ */
46
+ this.metaObjects = {};
47
+
48
+ /**
49
+ * The {@link MetaObject}s belonging to this MetaScene, each mapped to its {@link MetaObject#type}.
50
+ *
51
+ * @type {{String:MetaObject}}
52
+ */
53
+ this.metaObjectsByType = {};
54
+
55
+ /**
56
+ * Tracks number of MetaObjects of each type.
57
+ * @private
58
+ */
59
+ this._typeCounts = {};
60
+
61
+ /**
62
+ * Subscriptions to events sent with {@link fire}.
63
+ * @private
64
+ */
65
+ this._eventSubs = {};
66
+ }
67
+
68
+ /**
69
+ * Subscribes to an event fired at this Viewer.
70
+ *
71
+ * @param {String} event The event
72
+ * @param {Function} callback Callback fired on the event
73
+ */
74
+ on(event, callback) {
75
+ let subs = this._eventSubs[event];
76
+ if (!subs) {
77
+ subs = [];
78
+ this._eventSubs[event] = subs;
79
+ }
80
+ subs.push(callback);
81
+ }
82
+
83
+ /**
84
+ * Fires an event at this Viewer.
85
+ *
86
+ * @param {String} event Event name
87
+ * @param {Object} value Event parameters
88
+ */
89
+ fire(event, value) {
90
+ const subs = this._eventSubs[event];
91
+ if (subs) {
92
+ for (let i = 0, len = subs.length; i < len; i++) {
93
+ subs[i](value);
94
+ }
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Unsubscribes from an event fired at this Viewer.
100
+ * @param event
101
+ */
102
+ off(event) { // TODO
103
+
104
+ }
105
+
106
+ /**
107
+ * Creates a {@link MetaModel} in this MetaScene.
108
+ *
109
+ * @param {String} modelId ID for the new {@link MetaModel}, which will have {@link MetaModel#id} set to this value.
110
+ * @param {Object} metaModelData Data for the {@link MetaModel}.
111
+ * @param {Object} [options] Options for creating the {@link MetaModel}.
112
+ * @param {Object} [options.includeTypes] When provided, only create {@link MetaObject}s with types in this list.
113
+ * @param {Object} [options.excludeTypes] When provided, never create {@link MetaObject}s with types in this list.
114
+ * @param {Boolean} [options.globalizeObjectIds=false] Whether to globalize each {@link MetaObject#id}. Set this ````true```` when you need to load multiple instances of the same meta model, to avoid ID clashes between the meta objects in the different instances.
115
+ * @returns {MetaModel} The new MetaModel.
116
+ */
117
+ createMetaModel(modelId, metaModelData, options = {}) {
118
+
119
+ const projectId = metaModelData.projectId || "none";
120
+ const revisionId = metaModelData.revisionId || "none";
121
+ const newObjects = metaModelData.metaObjects;
122
+ const author = metaModelData.author;
123
+ const createdAt = metaModelData.createdAt;
124
+ const creatingApplication = metaModelData.creatingApplication;
125
+ const schema = metaModelData.schema;
126
+
127
+ var includeTypes;
128
+ // if (options.includeTypes) {
129
+ // includeTypes = {};
130
+ // for (let i = 0, len = options.includeTypes.length; i < len; i++) {
131
+ // includeTypes[options.includeTypes[i]] = true;
132
+ // }
133
+ // }
134
+ //
135
+ var excludeTypes;
136
+ // if (options.excludeTypes) {
137
+ // excludeTypes = {};
138
+ // for (let i = 0, len = options.excludeTypes.length; i < len; i++) {
139
+ // includeTypes[options.excludeTypes[i]] = true;
140
+ // }
141
+ // }
142
+
143
+ const metaModel = new MetaModel(this, modelId, projectId, revisionId, author, createdAt, creatingApplication, schema, null);
144
+
145
+ this.metaModels[modelId] = metaModel;
146
+
147
+ for (let i = 0, len = newObjects.length; i < len; i++) {
148
+ const newObject = newObjects[i];
149
+ const type = newObject.type;
150
+ if (excludeTypes && excludeTypes[type]) {
151
+ continue;
152
+ }
153
+ if (includeTypes && !includeTypes[type]) {
154
+ continue;
155
+ }
156
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, newObject.id) : newObject.id;
157
+ const originalSystemId = newObject.id;
158
+ const name = newObject.name;
159
+ const properties = newObject.properties;
160
+ const parent = null;
161
+ const children = null;
162
+ const external = newObject.external;
163
+ const metaObject = new MetaObject(metaModel, objectId, originalSystemId, name, type, properties, parent, children, external);
164
+ this.metaObjects[objectId] = metaObject;
165
+ (this.metaObjectsByType[type] || (this.metaObjectsByType[type] = {}))[objectId] = metaObject;
166
+ if (this._typeCounts[type] === undefined) {
167
+ this._typeCounts[type] = 1;
168
+ } else {
169
+ this._typeCounts[type]++;
170
+ }
171
+ }
172
+
173
+ for (let i = 0, len = newObjects.length; i < len; i++) {
174
+ const newObject = newObjects[i];
175
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, newObject.id) : newObject.id;
176
+ const metaObject = this.metaObjects[objectId];
177
+ if (!metaObject) {
178
+ continue;
179
+ }
180
+ if (newObject.parent === undefined || newObject.parent === null) {
181
+ metaModel.rootMetaObject = metaObject;
182
+ } else if (newObject.parent) {
183
+ const parentId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, newObject.parent) : newObject.parent;
184
+ let parentMetaObject = this.metaObjects[parentId];
185
+ if (parentMetaObject) {
186
+ metaObject.parent = parentMetaObject;
187
+ parentMetaObject.children = parentMetaObject.children || [];
188
+ parentMetaObject.children.push(metaObject);
189
+ }
190
+ }
191
+ }
192
+
193
+ this.fire("metaModelCreated", modelId);
194
+ return metaModel;
195
+ }
196
+
197
+ /**
198
+ * Removes a {@link MetaModel} from this MetaScene.
199
+ *
200
+ * Fires a "metaModelDestroyed" event with the value of the {@link MetaModel#id}.
201
+ *
202
+ * @param {String} id ID of the target {@link MetaModel}.
203
+ */
204
+ destroyMetaModel(id) {
205
+ const metaModel = this.metaModels[id];
206
+ if (!metaModel) {
207
+ return;
208
+ }
209
+ this._removeMetaModel(metaModel);
210
+ this.fire("metaModelDestroyed", id);
211
+ }
212
+
213
+ _removeMetaModel(metaModel) {
214
+ const metaObjects = this.metaObjects;
215
+ const metaObjectsByType = this.metaObjectsByType;
216
+ let visit = (metaObject) => {
217
+ delete metaObjects[metaObject.id];
218
+ const types = metaObjectsByType[metaObject.type];
219
+ if (types && types[metaObject.id]) {
220
+ delete types[metaObject.id];
221
+ if (--this._typeCounts[metaObject.type] === 0) {
222
+ delete this._typeCounts[metaObject.type];
223
+ delete metaObjectsByType[metaObject.type];
224
+ }
225
+ }
226
+ const children = metaObject.children;
227
+ if (children) {
228
+ for (let i = 0, len = children.length; i < len; i++) {
229
+ const childMetaObject = children[i];
230
+ visit(childMetaObject);
231
+ }
232
+ }
233
+ };
234
+ visit(metaModel.rootMetaObject);
235
+ delete this.metaModels[metaModel.id];
236
+ }
237
+
238
+ /**
239
+ * Gets the {@link MetaObject#id}s of the {@link MetaObject}s that have the given {@link MetaObject#type}.
240
+ *
241
+ * @param {String} type The type.
242
+ * @returns {String[]} Array of {@link MetaObject#id}s.
243
+ */
244
+ getObjectIDsByType(type) {
245
+ const metaObjects = this.metaObjectsByType[type];
246
+ return metaObjects ? Object.keys(metaObjects) : [];
247
+ }
248
+
249
+ /**
250
+ * Gets the {@link MetaObject#id}s of the {@link MetaObject}s within the given subtree.
251
+ *
252
+ * @param {String} id ID of the root {@link MetaObject} of the given subtree.
253
+ * @param {String[]} [includeTypes] Optional list of types to include.
254
+ * @param {String[]} [excludeTypes] Optional list of types to exclude.
255
+ * @returns {String[]} Array of {@link MetaObject#id}s.
256
+ */
257
+ getObjectIDsInSubtree(id, includeTypes, excludeTypes) {
258
+ const list = [];
259
+ const metaObject = this.metaObjects[id];
260
+ const includeMask = (includeTypes && includeTypes.length > 0) ? arrayToMap(includeTypes) : null;
261
+ const excludeMask = (excludeTypes && excludeTypes.length > 0) ? arrayToMap(excludeTypes) : null;
262
+
263
+ function visit(metaObject) {
264
+ if (!metaObject) {
265
+ return;
266
+ }
267
+ var include = true;
268
+ if (excludeMask && excludeMask[metaObject.type]) {
269
+ include = false;
270
+ } else if (includeMask && (!includeMask[metaObject.type])) {
271
+ include = false;
272
+ }
273
+ if (include) {
274
+ list.push(metaObject.id);
275
+ }
276
+ const children = metaObject.children;
277
+ if (children) {
278
+ for (var i = 0, len = children.length; i < len; i++) {
279
+ visit(children[i]);
280
+ }
281
+ }
282
+ }
283
+
284
+ visit(metaObject);
285
+ return list;
286
+ }
287
+
288
+ /**
289
+ * Iterates over the {@link MetaObject}s within the subtree.
290
+ *
291
+ * @param {String} id ID of root {@link MetaObject}.
292
+ * @param {Function} callback Callback fired at each {@link MetaObject}.
293
+ */
294
+ withMetaObjectsInSubtree(id, callback) {
295
+ const metaObject = this.metaObjects[id];
296
+ if (!metaObject) {
297
+ return;
298
+ }
299
+ metaObject.withMetaObjectsInSubtree(callback);
300
+ }
301
+ }
302
+
303
+ function arrayToMap(array) {
304
+ const map = {};
305
+ for (var i = 0, len = array.length; i < len; i++) {
306
+ map[array[i]] = true;
307
+ }
308
+ return map;
309
+ }
310
+
311
+ export {MetaScene};