@xeokit/xeokit-sdk 2.5.2-beta-13 → 2.5.2-beta-16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. package/dist/xeokit-sdk.cjs.js +30 -9
  2. package/dist/xeokit-sdk.es.js +30 -9
  3. package/dist/xeokit-sdk.es5.js +67 -65
  4. package/dist/xeokit-sdk.min.cjs.js +1 -1
  5. package/dist/xeokit-sdk.min.es.js +1 -1
  6. package/dist/xeokit-sdk.min.es5.js +1 -1
  7. package/package.json +1 -1
  8. package/src/viewer/metadata/MetaModel.js +15 -0
  9. package/src/viewer/metadata/MetaScene.js +15 -9
  10. package/src/plugins/XKTLoaderPlugin/parsers/ParserV11.js +0 -663
  11. package/src/src/extras/ContextMenu/ContextMenu.js +0 -907
  12. package/src/src/extras/ContextMenu/index.js +0 -1
  13. package/src/src/extras/MarqueePicker/MarqueePicker.js +0 -352
  14. package/src/src/extras/MarqueePicker/MarqueePickerMouseControl.js +0 -174
  15. package/src/src/extras/MarqueePicker/index.js +0 -2
  16. package/src/src/extras/PointerLens/PointerLens.js +0 -312
  17. package/src/src/extras/PointerLens/index.js +0 -1
  18. package/src/src/extras/collision/ObjectsKdTree3.js +0 -149
  19. package/src/src/extras/collision/index.js +0 -1
  20. package/src/src/extras/index.js +0 -4
  21. package/src/src/index.js +0 -3
  22. package/src/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -731
  23. package/src/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -84
  24. package/src/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.js +0 -435
  25. package/src/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -406
  26. package/src/src/plugins/AngleMeasurementsPlugin/index.js +0 -3
  27. package/src/src/plugins/AnnotationsPlugin/Annotation.js +0 -368
  28. package/src/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -583
  29. package/src/src/plugins/AnnotationsPlugin/index.js +0 -1
  30. package/src/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
  31. package/src/src/plugins/AxisGizmoPlugin/index.js +0 -1
  32. package/src/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -977
  33. package/src/src/plugins/BCFViewpointsPlugin/index.js +0 -1
  34. package/src/src/plugins/CityJSONLoaderPlugin/CityJSONDefaultDataSource.js +0 -29
  35. package/src/src/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.js +0 -751
  36. package/src/src/plugins/CityJSONLoaderPlugin/index.js +0 -1
  37. package/src/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -963
  38. package/src/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -84
  39. package/src/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +0 -399
  40. package/src/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -505
  41. package/src/src/plugins/DistanceMeasurementsPlugin/index.js +0 -3
  42. package/src/src/plugins/FaceAlignedSectionPlanesPlugin/FaceAlignedSectionPlanesControl.js +0 -639
  43. package/src/src/plugins/FaceAlignedSectionPlanesPlugin/FaceAlignedSectionPlanesPlugin.js +0 -436
  44. package/src/src/plugins/FaceAlignedSectionPlanesPlugin/Overview.js +0 -247
  45. package/src/src/plugins/FaceAlignedSectionPlanesPlugin/Plane.js +0 -167
  46. package/src/src/plugins/FaceAlignedSectionPlanesPlugin/index.js +0 -1
  47. package/src/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -429
  48. package/src/src/plugins/FastNavPlugin/index.js +0 -1
  49. package/src/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -140
  50. package/src/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -421
  51. package/src/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +0 -669
  52. package/src/src/plugins/GLTFLoaderPlugin/index.js +0 -2
  53. package/src/src/plugins/LASLoaderPlugin/LASDefaultDataSource.js +0 -58
  54. package/src/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js +0 -563
  55. package/src/src/plugins/LASLoaderPlugin/index.js +0 -1
  56. package/src/src/plugins/LASLoaderPlugin/loadLASHeader.js +0 -183
  57. package/src/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -290
  58. package/src/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -753
  59. package/src/src/plugins/NavCubePlugin/index.js +0 -1
  60. package/src/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
  61. package/src/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
  62. package/src/src/plugins/OBJLoaderPlugin/index.js +0 -1
  63. package/src/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
  64. package/src/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -274
  65. package/src/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
  66. package/src/src/plugins/STLLoaderPlugin/index.js +0 -2
  67. package/src/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
  68. package/src/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
  69. package/src/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
  70. package/src/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -404
  71. package/src/src/plugins/SectionPlanesPlugin/index.js +0 -1
  72. package/src/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
  73. package/src/src/plugins/SkyboxesPlugin/index.js +0 -1
  74. package/src/src/plugins/StoreyViewsPlugin/Storey.js +0 -84
  75. package/src/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
  76. package/src/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -773
  77. package/src/src/plugins/StoreyViewsPlugin/index.js +0 -1
  78. package/src/src/plugins/TreeViewPlugin/RenderService.js +0 -169
  79. package/src/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -101
  80. package/src/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -1370
  81. package/src/src/plugins/TreeViewPlugin/index.js +0 -1
  82. package/src/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
  83. package/src/src/plugins/ViewCullPlugin/index.js +0 -1
  84. package/src/src/plugins/WebIFCLoaderPlugin/WebIFCDefaultDataSource.js +0 -58
  85. package/src/src/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.js +0 -942
  86. package/src/src/plugins/WebIFCLoaderPlugin/index.js +0 -1
  87. package/src/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -95
  88. package/src/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -1194
  89. package/src/src/plugins/XKTLoaderPlugin/index.js +0 -2
  90. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -169
  91. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV10.js +0 -660
  92. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV11.js +0 -663
  93. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -230
  94. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -223
  95. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -283
  96. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -246
  97. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
  98. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -439
  99. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -563
  100. package/src/src/plugins/XKTLoaderPlugin/parsers/ParserV9.js +0 -518
  101. package/src/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -2
  102. package/src/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
  103. package/src/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
  104. package/src/src/plugins/XML3DLoaderPlugin/index.js +0 -1
  105. package/src/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
  106. package/src/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
  107. package/src/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
  108. package/src/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
  109. package/src/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
  110. package/src/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
  111. package/src/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
  112. package/src/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
  113. package/src/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
  114. package/src/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
  115. package/src/src/plugins/index.js +0 -21
  116. package/src/src/plugins/lib/culling/ObjectCullStates.js +0 -208
  117. package/src/src/plugins/lib/earcut.js +0 -677
  118. package/src/src/plugins/lib/html/Dot.js +0 -179
  119. package/src/src/plugins/lib/html/Label.js +0 -174
  120. package/src/src/plugins/lib/html/Wire.js +0 -220
  121. package/src/src/viewer/Configs.js +0 -127
  122. package/src/src/viewer/Plugin.js +0 -233
  123. package/src/src/viewer/Viewer.js +0 -542
  124. package/src/src/viewer/index.js +0 -5
  125. package/src/src/viewer/localization/LocaleService.js +0 -475
  126. package/src/src/viewer/metadata/IFCObjectDefaultColors.js +0 -163
  127. package/src/src/viewer/metadata/IFCObjectDefaults.js +0 -17
  128. package/src/src/viewer/metadata/MetaModel.js +0 -414
  129. package/src/src/viewer/metadata/MetaObject.js +0 -223
  130. package/src/src/viewer/metadata/MetaScene.js +0 -336
  131. package/src/src/viewer/metadata/Property.js +0 -55
  132. package/src/src/viewer/metadata/PropertySet.js +0 -77
  133. package/src/src/viewer/scene/Bitmap/Bitmap.js +0 -473
  134. package/src/src/viewer/scene/Bitmap/index.js +0 -1
  135. package/src/src/viewer/scene/CameraControl/CameraControl.js +0 -1750
  136. package/src/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
  137. package/src/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
  138. package/src/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -265
  139. package/src/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -384
  140. package/src/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
  141. package/src/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -183
  142. package/src/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
  143. package/src/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -345
  144. package/src/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -376
  145. package/src/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -288
  146. package/src/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -235
  147. package/src/src/viewer/scene/Component.js +0 -915
  148. package/src/src/viewer/scene/Entity.js +0 -502
  149. package/src/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
  150. package/src/src/viewer/scene/ImagePlane/index.js +0 -1
  151. package/src/src/viewer/scene/LineSet/LineSet.js +0 -163
  152. package/src/src/viewer/scene/LineSet/index.js +0 -1
  153. package/src/src/viewer/scene/camera/Camera.js +0 -912
  154. package/src/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
  155. package/src/src/viewer/scene/camera/CameraPath.js +0 -194
  156. package/src/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
  157. package/src/src/viewer/scene/camera/CustomProjection.js +0 -149
  158. package/src/src/viewer/scene/camera/Frustum.js +0 -316
  159. package/src/src/viewer/scene/camera/Ortho.js +0 -286
  160. package/src/src/viewer/scene/camera/Perspective.js +0 -304
  161. package/src/src/viewer/scene/camera/index.js +0 -2
  162. package/src/src/viewer/scene/canvas/Canvas.js +0 -490
  163. package/src/src/viewer/scene/canvas/Spinner.js +0 -323
  164. package/src/src/viewer/scene/constants/constants.js +0 -371
  165. package/src/src/viewer/scene/core.js +0 -268
  166. package/src/src/viewer/scene/geometry/Geometry.js +0 -33
  167. package/src/src/viewer/scene/geometry/ReadableGeometry.js +0 -682
  168. package/src/src/viewer/scene/geometry/VBOGeometry.js +0 -319
  169. package/src/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
  170. package/src/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
  171. package/src/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
  172. package/src/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
  173. package/src/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
  174. package/src/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
  175. package/src/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
  176. package/src/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
  177. package/src/src/viewer/scene/geometry/builders/index.js +0 -8
  178. package/src/src/viewer/scene/geometry/index.js +0 -4
  179. package/src/src/viewer/scene/geometry/loaders/index.js +0 -2
  180. package/src/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
  181. package/src/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
  182. package/src/src/viewer/scene/index.js +0 -21
  183. package/src/src/viewer/scene/input/Input.js +0 -1333
  184. package/src/src/viewer/scene/libs/k3d.js +0 -1032
  185. package/src/src/viewer/scene/lights/AmbientLight.js +0 -175
  186. package/src/src/viewer/scene/lights/CubeTexture.js +0 -156
  187. package/src/src/viewer/scene/lights/DirLight.js +0 -314
  188. package/src/src/viewer/scene/lights/Light.js +0 -29
  189. package/src/src/viewer/scene/lights/LightMap.js +0 -77
  190. package/src/src/viewer/scene/lights/PointLight.js +0 -395
  191. package/src/src/viewer/scene/lights/ReflectionMap.js +0 -79
  192. package/src/src/viewer/scene/lights/Shadow.js +0 -138
  193. package/src/src/viewer/scene/lights/index.js +0 -5
  194. package/src/src/viewer/scene/marker/Marker.js +0 -383
  195. package/src/src/viewer/scene/marker/SpriteMarker.js +0 -356
  196. package/src/src/viewer/scene/marker/index.js +0 -2
  197. package/src/src/viewer/scene/materials/EdgeMaterial.js +0 -359
  198. package/src/src/viewer/scene/materials/EmphasisMaterial.js +0 -613
  199. package/src/src/viewer/scene/materials/Fresnel.js +0 -222
  200. package/src/src/viewer/scene/materials/LambertMaterial.js +0 -378
  201. package/src/src/viewer/scene/materials/LinesMaterial.js +0 -169
  202. package/src/src/viewer/scene/materials/Material.js +0 -39
  203. package/src/src/viewer/scene/materials/MetallicMaterial.js +0 -820
  204. package/src/src/viewer/scene/materials/PhongMaterial.js +0 -860
  205. package/src/src/viewer/scene/materials/PointsMaterial.js +0 -409
  206. package/src/src/viewer/scene/materials/SpecularMaterial.js +0 -807
  207. package/src/src/viewer/scene/materials/Texture.js +0 -513
  208. package/src/src/viewer/scene/materials/index.js +0 -8
  209. package/src/src/viewer/scene/math/Frustum.js +0 -118
  210. package/src/src/viewer/scene/math/buildEdgeIndices.js +0 -162
  211. package/src/src/viewer/scene/math/geometryCompressionUtils.js +0 -365
  212. package/src/src/viewer/scene/math/index.js +0 -3
  213. package/src/src/viewer/scene/math/math.js +0 -5386
  214. package/src/src/viewer/scene/math/rtcCoords.js +0 -139
  215. package/src/src/viewer/scene/mementos/CameraMemento.js +0 -200
  216. package/src/src/viewer/scene/mementos/ModelMemento.js +0 -263
  217. package/src/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
  218. package/src/src/viewer/scene/mementos/index.js +0 -3
  219. package/src/src/viewer/scene/mesh/Mesh.js +0 -2202
  220. package/src/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -996
  221. package/src/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1570
  222. package/src/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -259
  223. package/src/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -159
  224. package/src/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -286
  225. package/src/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -262
  226. package/src/src/viewer/scene/mesh/index.js +0 -1
  227. package/src/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -217
  228. package/src/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -157
  229. package/src/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -223
  230. package/src/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -151
  231. package/src/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -200
  232. package/src/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -124
  233. package/src/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
  234. package/src/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -98
  235. package/src/src/viewer/scene/metriqs/Metriqs.js +0 -259
  236. package/src/src/viewer/scene/model/ENTITY_FLAGS.js +0 -21
  237. package/src/src/viewer/scene/model/PerformanceModel.js +0 -26
  238. package/src/src/viewer/scene/model/RENDER_PASSES.js +0 -34
  239. package/src/src/viewer/scene/model/SceneModel.js +0 -4018
  240. package/src/src/viewer/scene/model/SceneModelEntity.js +0 -715
  241. package/src/src/viewer/scene/model/SceneModelMesh.js +0 -341
  242. package/src/src/viewer/scene/model/SceneModelTexture.js +0 -38
  243. package/src/src/viewer/scene/model/SceneModelTextureSet.js +0 -59
  244. package/src/src/viewer/scene/model/SceneModelTransform.js +0 -404
  245. package/src/src/viewer/scene/model/VBOSceneModel.js +0 -26
  246. package/src/src/viewer/scene/model/calculateUniquePositions.js +0 -126
  247. package/src/src/viewer/scene/model/compression.js +0 -227
  248. package/src/src/viewer/scene/model/dtx/BindableDataTexture.js +0 -31
  249. package/src/src/viewer/scene/model/dtx/lines/DTXLinesBuffer.js +0 -27
  250. package/src/src/viewer/scene/model/dtx/lines/DTXLinesLayer.js +0 -891
  251. package/src/src/viewer/scene/model/dtx/lines/DTXLinesState.js +0 -46
  252. package/src/src/viewer/scene/model/dtx/lines/DTXLinesTextureFactory.js +0 -411
  253. package/src/src/viewer/scene/model/dtx/lines/dataTextureRamStats.js +0 -49
  254. package/src/src/viewer/scene/model/dtx/lines/rebucketPositions.js +0 -208
  255. package/src/src/viewer/scene/model/dtx/lines/renderers/DTXLinesColorRenderer.js +0 -389
  256. package/src/src/viewer/scene/model/dtx/lines/renderers/DTXLinesRenderers.js +0 -65
  257. package/src/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +0 -1322
  258. package/src/src/viewer/scene/model/dtx/triangles/lib/DTXTrianglesBuffer.js +0 -46
  259. package/src/src/viewer/scene/model/dtx/triangles/lib/DTXTrianglesState.js +0 -250
  260. package/src/src/viewer/scene/model/dtx/triangles/lib/DTXTrianglesTextureFactory.js +0 -518
  261. package/src/src/viewer/scene/model/dtx/triangles/lib/dataTextureRamStats.js +0 -54
  262. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesColorRenderer.js +0 -619
  263. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesDepthRenderer.js +0 -464
  264. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesColorRenderer.js +0 -414
  265. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesRenderer.js +0 -422
  266. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesNormalsRenderer.js +0 -345
  267. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesOcclusionRenderer.js +0 -436
  268. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickDepthRenderer.js +0 -462
  269. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickMeshRenderer.js +0 -436
  270. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsFlatRenderer.js +0 -455
  271. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsRenderer.js +0 -440
  272. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesRenderers.js +0 -307
  273. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSilhouetteRenderer.js +0 -465
  274. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +0 -466
  275. package/src/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapRenderer.js +0 -427
  276. package/src/src/viewer/scene/model/index.js +0 -5
  277. package/src/src/viewer/scene/model/rebucketPositions.js +0 -354
  278. package/src/src/viewer/scene/model/vbo/ScratchMemory.js +0 -63
  279. package/src/src/viewer/scene/model/vbo/VBORenderer.js +0 -646
  280. package/src/src/viewer/scene/model/vbo/batching/lines/VBOBatchingLinesLayer.js +0 -699
  281. package/src/src/viewer/scene/model/vbo/batching/lines/lib/VBOBatchingLinesBuffer.js +0 -19
  282. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +0 -316
  283. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesColorRenderer.js +0 -114
  284. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesRenderers.js +0 -99
  285. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSilhouetteRenderer.js +0 -124
  286. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +0 -311
  287. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +0 -309
  288. package/src/src/viewer/scene/model/vbo/batching/lines/renderers/VBOSceneModelLineBatchingRenderer.js +0 -24
  289. package/src/src/viewer/scene/model/vbo/batching/points/VBOBatchingPointsBuffer.js +0 -20
  290. package/src/src/viewer/scene/model/vbo/batching/points/VBOBatchingPointsLayer.js +0 -718
  291. package/src/src/viewer/scene/model/vbo/batching/points/VBOBatchingPointsRenderer.js +0 -24
  292. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsColorRenderer.js +0 -168
  293. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsOcclusionRenderer.js +0 -136
  294. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickDepthRenderer.js +0 -156
  295. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickMeshRenderer.js +0 -148
  296. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsRenderers.js +0 -144
  297. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsShadowRenderer.js +0 -107
  298. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSilhouetteRenderer.js +0 -146
  299. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +0 -309
  300. package/src/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +0 -303
  301. package/src/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesBuffer.js +0 -24
  302. package/src/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesLayer.js +0 -1257
  303. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/EdgesColorRenderer.js +0 -131
  304. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/EdgesEmphasisRenderer.js +0 -135
  305. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/EdgesRenderer.js +0 -12
  306. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/Renderers.js +0 -375
  307. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesBatchingRenderer.js +0 -34
  308. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorRenderer.js +0 -238
  309. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorTextureRenderer.js +0 -270
  310. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesDepthRenderer.js +0 -126
  311. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesFlatColorRenderer.js +0 -235
  312. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesNormalsRenderer.js +0 -139
  313. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesOcclusionRenderer.js +0 -125
  314. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesPBRRenderer.js +0 -561
  315. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesPickDepthRenderer.js +0 -144
  316. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesPickMeshRenderer.js +0 -130
  317. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesPickNormalsFlatRenderer.js +0 -121
  318. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesPickNormalsRenderer.js +0 -131
  319. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesShadowRenderer.js +0 -107
  320. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSilhouetteRenderer.js +0 -136
  321. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapInitRenderer.js +0 -311
  322. package/src/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapRenderer.js +0 -308
  323. package/src/src/viewer/scene/model/vbo/float16.js +0 -760
  324. package/src/src/viewer/scene/model/vbo/instancing/lines/VBOInstancingLinesLayer.js +0 -704
  325. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesColorRenderer.js +0 -148
  326. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesRenderer.js +0 -26
  327. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesRenderers.js +0 -139
  328. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSilhouetteRenderer.js +0 -127
  329. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapInitRenderer.js +0 -331
  330. package/src/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapRenderer.js +0 -316
  331. package/src/src/viewer/scene/model/vbo/instancing/points/VBOInstancingPointsLayer.js +0 -728
  332. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsColorRenderer.js +0 -174
  333. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsDepthRenderer.js +0 -156
  334. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsOcclusionRenderer.js +0 -149
  335. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsPickDepthRenderer.js +0 -170
  336. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsPickMeshRenderer.js +0 -152
  337. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsRenderer.js +0 -26
  338. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsRenderers.js +0 -174
  339. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsShadowRenderer.js +0 -119
  340. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSilhouetteRenderer.js +0 -154
  341. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +0 -330
  342. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapRenderer.js +0 -311
  343. package/src/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingTrianglesRenderer.js +0 -150
  344. package/src/src/viewer/scene/model/vbo/instancing/triangles/VBOInstancingTrianglesLayer.js +0 -1190
  345. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/EdgesColorRenderer.js +0 -136
  346. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/EdgesEmphasisRenderer.js +0 -137
  347. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/EdgesRenderer.js +0 -12
  348. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/Renderers.js +0 -376
  349. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesColorRenderer.js +0 -253
  350. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesColorTextureRenderer.js +0 -278
  351. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesDepthRenderer.js +0 -126
  352. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesFlatColorRenderer.js +0 -244
  353. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesFlatNormalsRenderer.js +0 -130
  354. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesInstancingRenderer.js +0 -29
  355. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesNormalsRenderer.js +0 -138
  356. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesOcclusionRenderer.js +0 -128
  357. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesPBRRenderer.js +0 -561
  358. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesPickDepthRenderer.js +0 -149
  359. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesPickMeshRenderer.js +0 -136
  360. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesPickNormalsFlatRenderer.js +0 -130
  361. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesPickNormalsRenderer.js +0 -145
  362. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesShadowRenderer.js +0 -113
  363. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSilhouetteRenderer.js +0 -139
  364. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapInitRenderer.js +0 -342
  365. package/src/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapRenderer.js +0 -325
  366. package/src/src/viewer/scene/nodes/Node.js +0 -1383
  367. package/src/src/viewer/scene/nodes/index.js +0 -1
  368. package/src/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
  369. package/src/src/viewer/scene/paths/Curve.js +0 -183
  370. package/src/src/viewer/scene/paths/Path.js +0 -239
  371. package/src/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
  372. package/src/src/viewer/scene/paths/SplineCurve.js +0 -133
  373. package/src/src/viewer/scene/paths/index.js +0 -5
  374. package/src/src/viewer/scene/postfx/SAO.js +0 -543
  375. package/src/src/viewer/scene/scene/Scene.js +0 -2802
  376. package/src/src/viewer/scene/sectionPlane/SectionPlane.js +0 -198
  377. package/src/src/viewer/scene/sectionPlane/SectionPlaneCache.js +0 -101
  378. package/src/src/viewer/scene/sectionPlane/index.js +0 -1
  379. package/src/src/viewer/scene/skybox/Skybox.js +0 -123
  380. package/src/src/viewer/scene/skybox/index.js +0 -1
  381. package/src/src/viewer/scene/stats.js +0 -44
  382. package/src/src/viewer/scene/utils/Cache.js +0 -29
  383. package/src/src/viewer/scene/utils/FileLoader.js +0 -161
  384. package/src/src/viewer/scene/utils/Loader.js +0 -55
  385. package/src/src/viewer/scene/utils/LoadingManager.js +0 -86
  386. package/src/src/viewer/scene/utils/Map.js +0 -45
  387. package/src/src/viewer/scene/utils/Queue.js +0 -56
  388. package/src/src/viewer/scene/utils/WorkerPool.js +0 -73
  389. package/src/src/viewer/scene/utils/index.js +0 -6
  390. package/src/src/viewer/scene/utils/textureTranscoders/KTX2TextureTranscoder/KTX2TextureTranscoder.js +0 -650
  391. package/src/src/viewer/scene/utils/textureTranscoders/KTX2TextureTranscoder/index.js +0 -1
  392. package/src/src/viewer/scene/utils/textureTranscoders/TextureTranscoder.js +0 -31
  393. package/src/src/viewer/scene/utils/textureTranscoders/index.js +0 -2
  394. package/src/src/viewer/scene/utils.js +0 -453
  395. package/src/src/viewer/scene/viewport/Viewport.js +0 -212
  396. package/src/src/viewer/scene/webgl/ArrayBuf.js +0 -121
  397. package/src/src/viewer/scene/webgl/Attribute.js +0 -23
  398. package/src/src/viewer/scene/webgl/Drawable.js +0 -270
  399. package/src/src/viewer/scene/webgl/FrameContext.js +0 -313
  400. package/src/src/viewer/scene/webgl/PickResult.js +0 -364
  401. package/src/src/viewer/scene/webgl/Pickable.js +0 -69
  402. package/src/src/viewer/scene/webgl/Program.js +0 -181
  403. package/src/src/viewer/scene/webgl/RenderBuffer.js +0 -378
  404. package/src/src/viewer/scene/webgl/RenderBufferManager.js +0 -34
  405. package/src/src/viewer/scene/webgl/RenderFlags.js +0 -203
  406. package/src/src/viewer/scene/webgl/RenderState.js +0 -40
  407. package/src/src/viewer/scene/webgl/Renderer.js +0 -1781
  408. package/src/src/viewer/scene/webgl/Sampler.js +0 -18
  409. package/src/src/viewer/scene/webgl/Shader.js +0 -49
  410. package/src/src/viewer/scene/webgl/Texture2D.js +0 -442
  411. package/src/src/viewer/scene/webgl/convertConstant.js +0 -244
  412. package/src/src/viewer/scene/webgl/getExtension.js +0 -32
  413. package/src/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
  414. package/src/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -426
  415. package/src/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -324
  416. package/src/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -376
  417. package/src/src/viewer/scene/webgl/webglEnums.js +0 -61
  418. package/src/src/viewer/scene/webglInfo.js +0 -47
@@ -1,583 +0,0 @@
1
- import {Plugin} from "../../viewer/Plugin.js";
2
- import {Annotation} from "./Annotation.js";
3
- import {utils} from "../../viewer/scene/utils.js";
4
- import {math} from "../../viewer/scene/math/math.js";
5
-
6
- const tempVec3a = math.vec3();
7
- const tempVec3b = math.vec3();
8
- const tempVec3c = math.vec3();
9
-
10
- /**
11
- * {@link Viewer} plugin that creates {@link Annotation}s.
12
- *
13
- * [<img src="https://user-images.githubusercontent.com/83100/58403089-26589280-8062-11e9-8652-aed61a4e8c64.gif">](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickFlyToPosition)
14
- *
15
- * * [[Example 1: Create annotations with mouse](https://xeokit.github.io/xeokit-sdk/examples/#annotations_createWithMouse)]
16
- * * [[Example 2: Click annotations to toggle labels](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickShowLabels)]
17
- * * [[Example 3: Hover annotations to show labels](https://xeokit.github.io/xeokit-sdk/examples/#annotations_hoverShowLabels)]
18
- * * [[Example 4: Click annotations to fly to viewpoint](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickFlyToPosition)]
19
- * * [[Example 5: Create Annotations with externally-created elements](https://xeokit.github.io/xeokit-sdk/examples/#annotations_externalElements)]
20
- *
21
- * ## Overview
22
- *
23
- * * An {@link Annotation} is a 3D position with a label attached.
24
- * * Annotations render themselves with HTML elements that float over the canvas; customize the appearance of
25
- * individual Annotations using HTML template; configure default appearance by setting templates on the AnnotationsPlugin.
26
- * * Dynamically insert data values into each Annotation's HTML templates; configure default values on the AnnotationsPlugin.
27
- * * Optionally configure Annotation with externally-created DOM elements for markers and labels; these override templates and data values.
28
- * * Optionally configure Annotations to hide themselves whenever occluded by {@link Entity}s.
29
- * * Optionally configure each Annotation with a position we can jump or fly the {@link Camera} to.
30
- *
31
- * ## Example 1: Loading a model and creating an annotation
32
- *
33
- * In the example below, we'll use an {@link XKTLoaderPlugin} to load a model, and an AnnotationsPlugin
34
- * to create an {@link Annotation} on it.
35
- *
36
- * We'll configure the AnnotationsPlugin with default HTML templates for each Annotation's position (its "marker") and
37
- * label, along with some default data values to insert into them.
38
- *
39
- * When we create our Annotation, we'll give it some specific data values to insert into the templates, overriding some of
40
- * the defaults we configured on the plugin. Note the correspondence between the placeholders in the templates
41
- * and the keys in the values map.
42
- *
43
- * We'll also configure the Annotation to hide itself whenever it's position is occluded by any {@link Entity}s (this is default behavior). The
44
- * {@link Scene} periodically occlusion-tests all Annotations on every 20th "tick" (which represents a rendered frame). We
45
- * can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
46
- *
47
- * Finally, we'll query the Annotation's position occlusion/visibility status, and subscribe to change events on those properties.
48
- *
49
- * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickShowLabels)]
50
- *
51
- * ````JavaScript
52
- * import {Viewer, XKTLoaderPlugin,AnnotationsPlugin} from "xeokit-sdk.es.js";
53
- *
54
- * const viewer = new Viewer({
55
- * canvasId: "myCanvas",
56
- * transparent: true
57
- * });
58
- *
59
- * viewer.scene.camera.eye = [-2.37, 18.97, -26.12];
60
- * viewer.scene.camera.look = [10.97, 5.82, -11.22];
61
- * viewer.scene.camera.up = [0.36, 0.83, 0.40];
62
- *
63
- * const xktLoader = new XKTLoaderPlugin(viewer);
64
- *
65
- * const annotations = new AnnotationsPlugin(viewer, {
66
- *
67
- * // Default HTML template for marker position
68
- * markerHTML: "<div class='annotation-marker' style='background-color: {{markerBGColor}};'>{{glyph}}</div>",
69
- *
70
- * // Default HTML template for label
71
- * labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>" +
72
- * "<div class='annotation-title'>{{title}}</div><div class='annotation-desc'>{{description}}</div></div>",
73
- *
74
- * // Default values to insert into the marker and label templates
75
- * values: {
76
- * markerBGColor: "red",
77
- * labelBGColor: "red",
78
- * glyph: "X",
79
- * title: "Untitled",
80
- * description: "No description"
81
- * }
82
- * });
83
- *
84
- * const model = xktLoader.load({
85
- * src: "./models/xkt/duplex/geometry.xkt"
86
- * });
87
- *
88
- * model.on("loaded", () => {
89
- *
90
- * const entity = viewer.scene.meshes[""];
91
- *
92
- * // Create an annotation
93
- * const myAnnotation1 = annotations.createAnnotation({
94
- *
95
- * id: "myAnnotation",
96
- *
97
- * entity: viewer.scene.objects["2O2Fr$t4X7Zf8NOew3FLOH"], // Optional, associate with an Entity
98
- *
99
- * worldPos: [0, 0, 0], // 3D World-space position
100
- *
101
- * occludable: true, // Optional, default, makes Annotation invisible when occluded by Entities
102
- * markerShown: true, // Optional, default is true, makes position visible (when not occluded)
103
- * labelShown: true // Optional, default is false, makes label visible (when not occluded)
104
- *
105
- * values: { // Optional, overrides AnnotationPlugin's defaults
106
- * glyph: "A",
107
- * title: "My Annotation",
108
- * description: "This is my annotation."
109
- * }
110
- * });
111
- *
112
- * // Listen for change of the Annotation's 3D World-space position
113
- *
114
- * myAnnotation1.on("worldPos", function(worldPos) {
115
- * //...
116
- * });
117
- *
118
- * // Listen for change of the Annotation's 3D View-space position, which happens
119
- * // when either worldPos was updated or the Camera was moved
120
- *
121
- * myAnnotation1.on("viewPos", function(viewPos) {
122
- * //...
123
- * });
124
- *
125
- * // Listen for change of the Annotation's 2D Canvas-space position, which happens
126
- * // when worldPos or viewPos was updated, or Camera's projection was updated
127
- *
128
- * myAnnotation1.on("canvasPos", function(canvasPos) {
129
- * //...
130
- * });
131
- *
132
- * // Listen for change of Annotation visibility. The Annotation becomes invisible when it falls outside the canvas,
133
- * // or its position is occluded by some Entity. Note that, when not occluded, the position is only
134
- * // shown when Annotation#markerShown is true, and the label is only shown when Annotation#labelShown is true.
135
- *
136
- * myAnnotation1.on("visible", function(visible) { // Marker visibility has changed
137
- * if (visible) {
138
- * this.log("Annotation is visible");
139
- * } else {
140
- * this.log("Annotation is invisible");
141
- * }
142
- * });
143
- *
144
- * // Listen for destruction of the Annotation
145
- *
146
- * myAnnotation1.on("destroyed", () => {
147
- * //...
148
- * });
149
- * });
150
- * ````
151
- *
152
- * Let's query our {@link Annotation}'s current position in the World, View and Canvas coordinate systems:
153
- *
154
- * ````javascript
155
- * const worldPos = myAnnotation.worldPos; // [x,y,z]
156
- * const viewPos = myAnnotation.viewPos; // [x,y,z]
157
- * const canvasPos = myAnnotation.canvasPos; // [x,y]
158
- * ````
159
- *
160
- * We can query it's current visibility, which is ````false```` when its position is occluded by some {@link Entity}:
161
- *
162
- * ````
163
- * const visible = myAnnotation1.visible;
164
- * ````
165
- *
166
- * To listen for change events on our Annotation's position and visibility:
167
- *
168
- * ````javascript
169
- * // World-space position changes when we assign a new value to Annotation#worldPos
170
- * myAnnotation1.on("worldPos", (worldPos) => {
171
- * //...
172
- * });
173
- *
174
- * // View-space position changes when either worldPos was updated or the Camera was moved
175
- * myAnnotation1.on("viewPos", (viewPos) => {
176
- * //...
177
- * });
178
- *
179
- * // Canvas-space position changes when worldPos or viewPos was updated, or Camera's projection was updated
180
- * myAnnotation1.on("canvasPos", (canvasPos) => {
181
- * //...
182
- * });
183
- *
184
- * // Annotation is invisible when its position falls off the canvas or is occluded by some Entity
185
- * myAnnotation1.on("visible", (visible) => {
186
- * //...
187
- * });
188
- * ````
189
- *
190
- * Finally, let's dynamically update the values for a couple of placeholders in our Annotation's label:
191
- *
192
- * ```` javascript
193
- * myAnnotation1.setValues({
194
- * title: "Here's a new title",
195
- * description: "Here's a new description"
196
- * });
197
- * ````
198
- *
199
- *
200
- * ## Example 2: Creating an Annotation with a unique appearance
201
- *
202
- * Now let's create a second {@link Annotation}, this time with its own custom HTML label template, which includes
203
- * an image. In the Annotation's values, we'll also provide a new title and description, custom colors for the marker
204
- * and label, plus a URL for the image in the label template. To render its marker, the Annotation will fall back
205
- * on the AnnotationPlugin's default marker template.
206
- *
207
- * ````javascript
208
- * const myAnnotation2 = annotations.createAnnotation({
209
- *
210
- * id: "myAnnotation2",
211
- *
212
- * worldPos: [-0.163, 1.810, 7.977],
213
- *
214
- * occludable: true,
215
- * markerShown: true,
216
- * labelShown: true,
217
- *
218
- * // Custom label template is the same as the Annotation's, with the addition of an image element
219
- * labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>\
220
- * <div class='annotation-title'>{{title}}</div>\
221
- * <div class='annotation-desc'>{{description}}</div>\
222
- * <br><img alt='myImage' width='150px' height='100px' src='{{imageSrc}}'>\
223
- * </div>",
224
- *
225
- * // Custom template values override all the AnnotationPlugin's defaults, and includes an additional value
226
- * // for the image element's URL
227
- * values: {
228
- * glyph: "A3",
229
- * title: "The West wall",
230
- * description: "Annotations can contain<br>custom HTML like this<br>image:",
231
- * markerBGColor: "green",
232
- * labelBGColor: "green",
233
- * imageSrc: "https://xeokit.io/img/docs/BIMServerLoaderPlugin/schependomlaan.png"
234
- * }
235
- * });
236
- * ````
237
- *
238
- * ## Example 3: Creating an Annotation with a camera position
239
- *
240
- * We can optionally configure each {@link Annotation} with a position to fly or jump the {@link Camera} to.
241
- *
242
- * Let's create another Annotation, this time providing it with ````eye````, ````look```` and ````up```` properties
243
- * indicating a viewpoint on whatever it's annotating:
244
- *
245
- * ````javascript
246
- * const myAnnotation3 = annotations.createAnnotation({
247
- *
248
- * id: "myAnnotation3",
249
- *
250
- * worldPos: [-0.163, 3.810, 7.977],
251
- *
252
- * eye: [0,0,-10],
253
- * look: [-0.163, 3.810, 7.977],
254
- * up: [0,1,0];
255
- *
256
- * occludable: true,
257
- * markerShown: true,
258
- * labelShown: true,
259
- *
260
- * labelHTML: "<div class='annotation-label' style='background-color: {{labelBGColor}};'>\
261
- * <div class='annotation-title'>{{title}}</div>\
262
- * <div class='annotation-desc'>{{description}}</div>\
263
- * <br><img alt='myImage' width='150px' height='100px' src='{{imageSrc}}'>\
264
- * </div>",
265
- *
266
- * values: {
267
- * glyph: "A3",
268
- * title: "The West wall",
269
- * description: "Annotations can contain<br>custom HTML like this<br>image:",
270
- * markerBGColor: "green",
271
- * labelBGColor: "green",
272
- * imageSrc: "https://xeokit.io/img/docs/BIMServerLoaderPlugin/schependomlaan.png"
273
- * }
274
- * });
275
- * ````
276
- *
277
- * Now we can fly the {@link Camera} to the Annotation's viewpoint, like this:
278
- *
279
- * ````javascript
280
- * viewer.cameraFlight.flyTo(myAnnotation3);
281
- * ````
282
- *
283
- * Or jump the Camera, like this:
284
- *
285
- * ````javascript
286
- * viewer.cameraFlight.jumpTo(myAnnotation3);
287
- * ````
288
- *
289
- * ## Example 4: Creating an Annotation using externally-created DOM elements
290
- *
291
- * Now let's create another {@link Annotation}, this time providing it with pre-existing DOM elements for its marker
292
- * and label. Note that AnnotationsPlugin will ignore any ````markerHTML````, ````labelHTML````
293
- * or ````values```` properties when provide ````markerElementId```` or ````labelElementId````.
294
- *
295
- * ````javascript
296
- * const myAnnotation2 = annotations.createAnnotation({
297
- *
298
- * id: "myAnnotation2",
299
- *
300
- * worldPos: [-0.163, 1.810, 7.977],
301
- *
302
- * occludable: true,
303
- * markerShown: true,
304
- * labelShown: true,
305
- *
306
- * markerElementId: "myMarkerElement",
307
- * labelElementId: "myLabelElement"
308
- * });
309
- * ````
310
- *
311
- * ## Example 5: Creating annotations by clicking on objects
312
- *
313
- * AnnotationsPlugin makes it easy to create {@link Annotation}s on the surfaces of {@link Entity}s as we click on them.
314
- *
315
- * The {@link AnnotationsPlugin#createAnnotation} method can accept a {@link PickResult} returned
316
- * by {@link Scene#pick}, from which it initializes the {@link Annotation}'s {@link Annotation#worldPos} and
317
- * {@link Annotation#entity}. Note that this only works when {@link Scene#pick} was configured to perform a 3D
318
- * surface-intersection pick (see {@link Scene#pick} for more info).
319
- *
320
- * Let's now extend our example to create an Annotation wherever we click on the surface of of our model:
321
- *
322
- * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#annotations_createWithMouse)]
323
- *
324
- * ````javascript
325
- * var i = 1; // Used to create unique Annotation IDs
326
- *
327
- * viewer.scene.input.on("mouseclicked", (coords) => {
328
- *
329
- * var pickRecord = viewer.scene.pick({
330
- * canvasPos: coords,
331
- * pickSurface: true // <<------ This causes picking to find the intersection point on the entity
332
- * });
333
- *
334
- * if (pickRecord) {
335
- *
336
- * const annotation = annotations.createAnnotation({
337
- * id: "myAnnotationOnClick" + i,
338
- * pickRecord: pickRecord,
339
- * occludable: true, // Optional, default is true
340
- * markerShown: true, // Optional, default is true
341
- * labelShown: true, // Optional, default is true
342
- * values: { // HTML template values
343
- * glyph: "A" + i,
344
- * title: "My annotation " + i,
345
- * description: "My description " + i
346
- * },
347
- });
348
- *
349
- * i++;
350
- * }
351
- * });
352
- * ````
353
- *
354
- * Note that when the Annotation is occludable, there is potential for the {@link Annotation#worldPos} to become
355
- * visually embedded within the surface of its Entity when viewed from a distance. This happens as a result of limited
356
- * GPU accuracy GPU accuracy, especially when the near and far view-space clipping planes, specified by {@link Perspective#near}
357
- * and {@link Perspective#far}, or {@link Ortho#near} and {@link Perspective#far}, are far away from each other.
358
- *
359
- * To prevent this, we can offset Annotations from their Entity surfaces by an amount that we set
360
- * on {@link AnnotationsPlugin#surfaceOffset}:
361
- *
362
- * ````javascript
363
- * annotations.surfaceOffset = 0.3; // Default value
364
- * ````
365
- *
366
- * Annotations subsequently created with {@link AnnotationsPlugin#createAnnotation} using a {@link PickResult} will then
367
- * be offset by that amount.
368
- *
369
- * Another thing we can do to prevent this unwanted occlusion is keep the distance between the view-space clipping
370
- * planes to a minimum, which improves the accuracy of the Annotation occlusion test. In general, a good default
371
- * value for ````Perspective#far```` and ````Ortho#far```` is around ````2.000````.
372
- */
373
- class AnnotationsPlugin extends Plugin {
374
-
375
- /**
376
- * @constructor
377
- * @param {Viewer} viewer The Viewer.
378
- * @param {Object} cfg Plugin configuration.
379
- * @param {String} [cfg.id="Annotations"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
380
- * @param {String} [cfg.markerHTML] HTML text template for Annotation markers. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````markerElementId````.
381
- * @param {String} [cfg.labelHTML] HTML text template for Annotation labels. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````labelElementId````.
382
- * @param {HTMLElement} [cfg.container] Container DOM element for markers and labels. Defaults to ````document.body````.
383
- * @param {{String:(String|Number)}} [cfg.values={}] Map of default values to insert into the HTML templates for the marker and label.
384
- * @param {Number} [cfg.surfaceOffset=0.3] The amount by which each {@link Annotation} is offset from the surface of
385
- * its {@link Entity} when we create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
386
- */
387
- constructor(viewer, cfg) {
388
-
389
- super("Annotations", viewer);
390
-
391
- this._labelHTML = cfg.labelHTML || "<div></div>";
392
- this._markerHTML = cfg.markerHTML || "<div></div>";
393
- this._container = cfg.container || document.body;
394
- this._values = cfg.values || {};
395
-
396
- /**
397
- * The {@link Annotation}s created by {@link AnnotationsPlugin#createAnnotation}, each mapped to its {@link Annotation#id}.
398
- * @type {{String:Annotation}}
399
- */
400
- this.annotations = {};
401
-
402
- this.surfaceOffset = cfg.surfaceOffset;
403
- }
404
-
405
- /**
406
- * Gets the plugin's HTML container element, if any.
407
- * @returns {*|HTMLElement|HTMLElement}
408
- */
409
- getContainerElement() {
410
- return this._container;
411
- }
412
-
413
- /**
414
- * @private
415
- */
416
- send(name, value) {
417
- switch (name) {
418
- case "clearAnnotations":
419
- this.clear();
420
- break;
421
- }
422
- }
423
-
424
- /**
425
- * Sets the amount by which each {@link Annotation} is offset from the surface of its {@link Entity}, when we
426
- * create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
427
- *
428
- * See the class comments for more info.
429
- *
430
- * This is ````0.3```` by default.
431
- *
432
- * @param {Number} surfaceOffset The surface offset.
433
- */
434
- set surfaceOffset(surfaceOffset) {
435
- if (surfaceOffset === undefined || surfaceOffset === null) {
436
- surfaceOffset = 0.3;
437
- }
438
- this._surfaceOffset = surfaceOffset;
439
- }
440
-
441
- /**
442
- * Gets the amount by which an {@link Annotation} is offset from the surface of its {@link Entity} when
443
- * created by {@link AnnotationsPlugin#createAnnotation}, when we
444
- * create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
445
- *
446
- * This is ````0.3```` by default.
447
- *
448
- * @returns {Number} The surface offset.
449
- */
450
- get surfaceOffset() {
451
- return this._surfaceOffset;
452
- }
453
-
454
- /**
455
- * Creates an {@link Annotation}.
456
- *
457
- * The Annotation is then registered by {@link Annotation#id} in {@link AnnotationsPlugin#annotations}.
458
- *
459
- * @param {Object} params Annotation configuration.
460
- * @param {String} params.id Unique ID to assign to {@link Annotation#id}. The Annotation will be registered by this in {@link AnnotationsPlugin#annotations} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
461
- * @param {String} [params.markerElementId] ID of pre-existing DOM element to render the marker. This overrides ````markerHTML```` and does not support ````values```` (data is baked into the label DOM element).
462
- * @param {String} [params.labelElementId] ID of pre-existing DOM element to render the label. This overrides ````labelHTML```` and does not support ````values```` (data is baked into the label DOM element).
463
- * @param {String} [params.markerHTML] HTML text template for the Annotation marker. Defaults to the marker HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````markerElementId````.
464
- * @param {String} [params.labelHTML] HTML text template for the Annotation label. Defaults to the label HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````labelElementId````.
465
- * @param {Number[]} [params.worldPos=[0,0,0]] World-space position of the Annotation marker, assigned to {@link Annotation#worldPos}.
466
- * @param {Entity} [params.entity] Optional {@link Entity} to associate the Annotation with. Causes {@link Annotation#visible} to be ````false```` whenever {@link Entity#visible} is also ````false````.
467
- * @param {PickResult} [params.pickResult] Sets the Annotation's World-space position and direction vector from the given {@link PickResult}'s {@link PickResult#worldPos} and {@link PickResult#worldNormal}, and the Annotation's Entity from {@link PickResult#entity}. Causes ````worldPos```` and ````entity```` parameters to be ignored, if they are also given.
468
- * @param {Boolean} [params.occludable=false] Indicates whether or not the {@link Annotation} marker and label are hidden whenever the marker occluded by {@link Entity}s in the {@link Scene}. The
469
- * {@link Scene} periodically occlusion-tests all Annotations on every 20th "tick" (which represents a rendered frame). We can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
470
- * @param {{String:(String|Number)}} [params.values={}] Map of values to insert into the HTML templates for the marker and label. These will be inserted in addition to any values given to the AnnotationsPlugin constructor.
471
- * @param {Boolean} [params.markerShown=true] Whether to initially show the {@link Annotation} marker.
472
- * @param {Boolean} [params.labelShown=false] Whether to initially show the {@link Annotation} label.
473
- * @param {Number[]} [params.eye] Optional World-space position for {@link Camera#eye}, used when this Annotation is associated with a {@link Camera} position.
474
- * @param {Number[]} [params.look] Optional World-space position for {@link Camera#look}, used when this Annotation is associated with a {@link Camera} position.
475
- * @param {Number[]} [params.up] Optional World-space position for {@link Camera#up}, used when this Annotation is associated with a {@link Camera} position.
476
- * @param {String} [params.projection] Optional projection type for {@link Camera#projection}, used when this Annotation is associated with a {@link Camera} position.
477
- * @returns {Annotation} The new {@link Annotation}.
478
- */
479
- createAnnotation(params) {
480
- if (this.viewer.scene.components[params.id]) {
481
- this.error("Viewer component with this ID already exists: " + params.id);
482
- delete params.id;
483
- }
484
- var worldPos;
485
- var entity;
486
- params.pickResult = params.pickResult || params.pickRecord;
487
- if (params.pickResult) {
488
- const pickResult = params.pickResult;
489
- if (!pickResult.worldPos || !pickResult.worldNormal) {
490
- this.error("Param 'pickResult' does not have both worldPos and worldNormal");
491
- } else {
492
- const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a);
493
- const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b);
494
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c);
495
- worldPos = offsetWorldPos;
496
- entity = pickResult.entity;
497
- }
498
- } else {
499
- worldPos = params.worldPos;
500
- entity = params.entity;
501
- }
502
-
503
- var markerElement = null;
504
- if (params.markerElementId) {
505
- markerElement = document.getElementById(params.markerElementId);
506
- if (!markerElement) {
507
- this.error("Can't find DOM element for 'markerElementId' value '" + params.markerElementId + "' - defaulting to internally-generated empty DIV");
508
- }
509
- }
510
-
511
- var labelElement = null;
512
- if (params.labelElementId) {
513
- labelElement = document.getElementById(params.labelElementId);
514
- if (!labelElement) {
515
- this.error("Can't find DOM element for 'labelElementId' value '" + params.labelElementId + "' - defaulting to internally-generated empty DIV");
516
- }
517
- }
518
-
519
- const annotation = new Annotation(this.viewer.scene, {
520
- id: params.id,
521
- plugin: this,
522
- entity: entity,
523
- worldPos: worldPos,
524
- container: this._container,
525
- markerElement: markerElement,
526
- labelElement: labelElement,
527
- markerHTML: params.markerHTML || this._markerHTML,
528
- labelHTML: params.labelHTML || this._labelHTML,
529
- occludable: params.occludable,
530
- values: utils.apply(params.values, utils.apply(this._values, {})),
531
- markerShown: params.markerShown,
532
- labelShown: params.labelShown,
533
- eye: params.eye,
534
- look: params.look,
535
- up: params.up,
536
- projection: params.projection,
537
- visible: (params.visible !== false)
538
- });
539
- this.annotations[annotation.id] = annotation;
540
- annotation.on("destroyed", () => {
541
- delete this.annotations[annotation.id];
542
- this.fire("annotationDestroyed", annotation.id);
543
- });
544
- this.fire("annotationCreated", annotation.id);
545
- return annotation;
546
- }
547
-
548
- /**
549
- * Destroys an {@link Annotation}.
550
- *
551
- * @param {String} id ID of Annotation to destroy.
552
- */
553
- destroyAnnotation(id) {
554
- var annotation = this.annotations[id];
555
- if (!annotation) {
556
- this.log("Annotation not found: " + id);
557
- return;
558
- }
559
- annotation.destroy();
560
- }
561
-
562
- /**
563
- * Destroys all {@link Annotation}s.
564
- */
565
- clear() {
566
- const ids = Object.keys(this.annotations);
567
- for (var i = 0, len = ids.length; i < len; i++) {
568
- this.destroyAnnotation(ids[i]);
569
- }
570
- }
571
-
572
- /**
573
- * Destroys this AnnotationsPlugin.
574
- *
575
- * Destroys all {@link Annotation}s first.
576
- */
577
- destroy() {
578
- this.clear();
579
- super.destroy();
580
- }
581
- }
582
-
583
- export {AnnotationsPlugin}
@@ -1 +0,0 @@
1
- export * from "./AnnotationsPlugin.js";