x_ite 4.7.12 → 5.0.0

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 (759) hide show
  1. package/.vscode/settings.json +9 -2
  2. package/Makefile +27 -24
  3. package/build/bin/version-number.pl +1 -1
  4. package/build/bin/version.pl +3 -3
  5. package/build/parts/default.start.frag.js +2 -2
  6. package/build/parts/x_ite.end.frag.js +1 -2
  7. package/build/parts/x_ite.start.frag.js +4 -7
  8. package/dist/assets/components/annotation.js +312 -312
  9. package/dist/assets/components/annotation.min.js +1 -1
  10. package/dist/assets/components/cad-geometry.js +536 -538
  11. package/dist/assets/components/cad-geometry.min.js +1 -1
  12. package/dist/assets/components/cube-map-texturing.js +797 -796
  13. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  14. package/dist/assets/components/dis.js +487 -472
  15. package/dist/assets/components/dis.min.js +1 -1
  16. package/dist/assets/components/event-utilities.js +486 -505
  17. package/dist/assets/components/event-utilities.min.js +1 -1
  18. package/dist/assets/components/geometry2d.js +1221 -1271
  19. package/dist/assets/components/geometry2d.min.js +1 -1
  20. package/dist/assets/components/geospatial.js +2657 -2653
  21. package/dist/assets/components/geospatial.min.js +1 -2
  22. package/dist/assets/components/h-anim.js +640 -640
  23. package/dist/assets/components/h-anim.min.js +1 -1
  24. package/dist/assets/components/key-device-sensor.js +547 -549
  25. package/dist/assets/components/key-device-sensor.min.js +1 -1
  26. package/dist/assets/components/layout.js +1435 -1433
  27. package/dist/assets/components/layout.min.js +1 -1
  28. package/dist/assets/components/nurbs.js +3942 -3964
  29. package/dist/assets/components/nurbs.min.js +1 -2
  30. package/dist/assets/components/particle-systems.js +3227 -3238
  31. package/dist/assets/components/particle-systems.min.js +1 -2
  32. package/dist/assets/components/picking.js +1704 -1712
  33. package/dist/assets/components/picking.min.js +1 -1
  34. package/dist/assets/components/projective-texture-mapping.js +553 -553
  35. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  36. package/dist/assets/components/rigid-body-physics.js +3255 -3265
  37. package/dist/assets/components/rigid-body-physics.min.js +1 -59
  38. package/dist/assets/components/scripting.js +544 -549
  39. package/dist/assets/components/scripting.min.js +1 -1
  40. package/dist/assets/components/texturing-3d.js +2716 -2651
  41. package/dist/assets/components/texturing-3d.min.js +131 -48
  42. package/dist/assets/components/volume-rendering.js +2815 -2804
  43. package/dist/assets/components/volume-rendering.min.js +1 -3
  44. package/dist/assets/components/x_ite.js +142 -144
  45. package/dist/assets/components/x_ite.min.js +1 -1
  46. package/dist/assets/shaders/webgl1/Gouraud.fs +52 -15
  47. package/dist/assets/shaders/webgl1/Gouraud.vs +8 -9
  48. package/dist/assets/shaders/webgl1/{Wireframe.fs → Line.fs} +0 -0
  49. package/dist/assets/shaders/webgl1/{Wireframe.vs → Line.vs} +1 -1
  50. package/dist/assets/shaders/webgl1/PBR.fs +785 -0
  51. package/dist/assets/shaders/webgl1/PBR.vs +37 -0
  52. package/dist/assets/shaders/webgl1/Phong.fs +204 -32
  53. package/dist/assets/shaders/webgl1/Phong.vs +2 -3
  54. package/dist/assets/shaders/webgl1/{PointSet.fs → Point.fs} +59 -33
  55. package/dist/assets/shaders/webgl1/{PointSet.vs → Point.vs} +2 -2
  56. package/dist/assets/shaders/webgl1/Unlit.fs +73 -18
  57. package/dist/assets/shaders/webgl1/Unlit.vs +2 -3
  58. package/dist/assets/shaders/webgl2/Gouraud.fs +31 -19
  59. package/dist/assets/shaders/webgl2/Gouraud.vs +8 -9
  60. package/dist/assets/shaders/webgl2/{Wireframe.fs → Line.fs} +0 -0
  61. package/dist/assets/shaders/webgl2/{Wireframe.vs → Line.vs} +1 -1
  62. package/dist/assets/shaders/webgl2/PBR.fs +913 -0
  63. package/dist/assets/shaders/webgl2/PBR.vs +37 -0
  64. package/dist/assets/shaders/webgl2/Phong.fs +196 -35
  65. package/dist/assets/shaders/webgl2/Phong.vs +2 -3
  66. package/dist/assets/shaders/webgl2/{PointSet.fs → Point.fs} +87 -86
  67. package/dist/assets/shaders/webgl2/{PointSet.vs → Point.vs} +2 -2
  68. package/dist/assets/shaders/webgl2/Unlit.fs +55 -22
  69. package/dist/assets/shaders/webgl2/Unlit.vs +2 -3
  70. package/dist/example.html +2 -2
  71. package/dist/x_ite.css +316 -328
  72. package/dist/x_ite.js +55663 -52034
  73. package/dist/x_ite.min.js +79 -41
  74. package/dist/x_ite.zip +0 -0
  75. package/docs/Custom-Shaders.md +4 -3
  76. package/docs/_config.yml +1 -1
  77. package/docs/index.md +60 -7
  78. package/package.json +20 -20
  79. package/src/assets/components/annotation.js +24 -24
  80. package/src/assets/components/cad-geometry.js +24 -25
  81. package/src/assets/components/cube-map-texturing.js +18 -19
  82. package/src/assets/components/dis.js +22 -23
  83. package/src/assets/components/event-utilities.js +28 -29
  84. package/src/assets/components/geometry2d.js +28 -29
  85. package/src/assets/components/geospatial.js +34 -35
  86. package/src/assets/components/h-anim.js +22 -22
  87. package/src/assets/components/key-device-sensor.js +18 -19
  88. package/src/assets/components/layout.js +24 -25
  89. package/src/assets/components/nurbs.js +44 -45
  90. package/src/assets/components/particle-systems.js +36 -37
  91. package/src/assets/components/picking.js +25 -25
  92. package/src/assets/components/projective-texture-mapping.js +16 -16
  93. package/src/assets/components/rigid-body-physics.js +48 -48
  94. package/src/assets/components/scripting.js +14 -15
  95. package/src/assets/components/texturing-3d.js +26 -27
  96. package/src/assets/components/volume-rendering.js +46 -46
  97. package/src/assets/components/x_ite.js +12 -12
  98. package/src/assets/shaders/Types.glsl +230 -51
  99. package/src/assets/shaders/webgl1/Background.fs +2 -2
  100. package/src/assets/shaders/webgl1/Background.vs +4 -4
  101. package/src/assets/shaders/webgl1/Depth.fs +2 -2
  102. package/src/assets/shaders/webgl1/Depth.vs +3 -3
  103. package/src/assets/shaders/webgl1/Fallback.fs +15 -15
  104. package/src/assets/shaders/webgl1/Fallback.vs +5 -5
  105. package/src/assets/shaders/webgl1/FallbackUnlit.fs +4 -4
  106. package/src/assets/shaders/webgl1/FallbackUnlit.vs +3 -3
  107. package/src/assets/shaders/webgl1/Gouraud.fs +14 -14
  108. package/src/assets/shaders/webgl1/Gouraud.vs +54 -69
  109. package/src/assets/shaders/webgl1/Line.fs +74 -0
  110. package/src/assets/shaders/webgl1/Line.vs +63 -0
  111. package/src/assets/shaders/webgl1/PBR.fs +364 -0
  112. package/src/assets/shaders/webgl1/PBR.vs +46 -0
  113. package/src/assets/shaders/webgl1/Phong.fs +207 -84
  114. package/src/assets/shaders/webgl1/Phong.vs +17 -18
  115. package/src/assets/shaders/webgl1/Point.fs +88 -0
  116. package/src/assets/shaders/webgl1/Point.vs +70 -0
  117. package/src/assets/shaders/webgl1/Unlit.fs +53 -28
  118. package/src/assets/shaders/webgl1/Unlit.vs +17 -18
  119. package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +7 -7
  120. package/src/assets/shaders/webgl1/include/Colors.glsl +27 -0
  121. package/src/assets/shaders/webgl1/include/Fog.glsl +17 -17
  122. package/src/assets/shaders/webgl1/include/Hatch.glsl +8 -8
  123. package/src/assets/shaders/webgl1/include/Normal.glsl +44 -0
  124. package/src/assets/shaders/webgl1/include/Pack.glsl +11 -11
  125. package/src/assets/shaders/webgl1/include/Perlin.glsl +19 -19
  126. package/src/assets/shaders/webgl1/include/Shadow.glsl +212 -212
  127. package/src/assets/shaders/webgl1/include/SpotFactor.glsl +12 -0
  128. package/src/assets/shaders/webgl1/include/Texture.glsl +444 -393
  129. package/src/assets/shaders/webgl2/Background.fs +2 -2
  130. package/src/assets/shaders/webgl2/Background.vs +4 -4
  131. package/src/assets/shaders/webgl2/Depth.fs +2 -2
  132. package/src/assets/shaders/webgl2/Depth.vs +3 -3
  133. package/src/assets/shaders/webgl2/Gouraud.fs +14 -14
  134. package/src/assets/shaders/webgl2/Gouraud.vs +54 -69
  135. package/src/assets/shaders/webgl2/Line.fs +73 -0
  136. package/src/assets/shaders/webgl2/Line.vs +64 -0
  137. package/src/assets/shaders/webgl2/PBR.fs +370 -0
  138. package/src/assets/shaders/webgl2/PBR.vs +48 -0
  139. package/src/assets/shaders/webgl2/Phong.fs +219 -84
  140. package/src/assets/shaders/webgl2/Phong.vs +17 -18
  141. package/src/assets/shaders/webgl2/Point.fs +87 -0
  142. package/src/assets/shaders/webgl2/Point.vs +71 -0
  143. package/src/assets/shaders/webgl2/Unlit.fs +56 -28
  144. package/src/assets/shaders/webgl2/Unlit.vs +17 -18
  145. package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +7 -7
  146. package/src/assets/shaders/webgl2/include/Colors.glsl +27 -0
  147. package/src/assets/shaders/webgl2/include/Fog.glsl +34 -34
  148. package/src/assets/shaders/webgl2/include/Hatch.glsl +8 -8
  149. package/src/assets/shaders/webgl2/include/Normal.glsl +46 -0
  150. package/src/assets/shaders/webgl2/include/Pack.glsl +11 -11
  151. package/src/assets/shaders/webgl2/include/Perlin.glsl +19 -20
  152. package/src/assets/shaders/webgl2/include/Shadow.glsl +226 -226
  153. package/src/assets/shaders/webgl2/include/SpotFactor.glsl +12 -0
  154. package/src/assets/shaders/webgl2/include/Texture.glsl +557 -537
  155. package/src/bookmarks.js +92 -92
  156. package/src/examples.js +147 -147
  157. package/src/lib/ammojs/AmmoJS.js +2 -2
  158. package/src/lib/ammojs/Makefile +14 -15
  159. package/src/lib/jquery.fullscreen-min.js +2 -2
  160. package/src/lib/nurbs/extras/sample.js +215 -215
  161. package/src/lib/nurbs/nurbs.js +326 -326
  162. package/src/lib/nurbs/src/evaluate.js +405 -405
  163. package/src/lib/nurbs/src/numerical-derivative.js +48 -48
  164. package/src/lib/nurbs/src/support.js +143 -143
  165. package/src/lib/nurbs/src/transform.js +70 -70
  166. package/src/lib/nurbs/src/utils/accessor-preamble.js +23 -23
  167. package/src/lib/nurbs/src/utils/bisection-search.js +18 -18
  168. package/src/lib/nurbs/src/utils/cache-key.js +49 -50
  169. package/src/lib/nurbs/src/utils/create-accessors.js +101 -101
  170. package/src/lib/nurbs/src/utils/infer-type.js +43 -43
  171. package/src/lib/nurbs/src/utils/is-array-like.js +5 -5
  172. package/src/lib/nurbs/src/utils/is-ndarray-like.js +11 -11
  173. package/src/lib/nurbs/src/utils/is-ndarray.js +13 -13
  174. package/src/lib/nurbs/src/utils/ndloop.js +18 -18
  175. package/src/lib/nurbs/src/utils/size-getter.js +15 -15
  176. package/src/lib/nurbs/src/utils/variable.js +25 -25
  177. package/src/lib/opentype.js/bin/ot +27 -27
  178. package/src/lib/opentype.js/dist/opentype.js +5 -5
  179. package/src/lib/opentype.js/font-inspector.html +1 -1
  180. package/src/lib/opentype.js/site.css +1 -3
  181. package/src/locale/gettext.js +73 -73
  182. package/src/spinner.css +40 -43
  183. package/src/standard/Geospatial/Geodetic.js +195 -195
  184. package/src/standard/Geospatial/ReferenceEllipsoids.js +43 -43
  185. package/src/standard/Geospatial/UniversalTransverseMercator.js +159 -159
  186. package/src/standard/Math/Algorithm.js +199 -187
  187. package/src/standard/Math/Algorithms/Bezier.js +80 -80
  188. package/src/standard/Math/Algorithms/MergeSort.js +49 -49
  189. package/src/standard/Math/Algorithms/PartialSort.js +36 -36
  190. package/src/standard/Math/Algorithms/QuickSort.js +51 -51
  191. package/src/standard/Math/Algorithms/SAT.js +62 -62
  192. package/src/standard/Math/Algorithms/eigendecomposition.js +141 -141
  193. package/src/standard/Math/Geometry/Box2.js +205 -205
  194. package/src/standard/Math/Geometry/Box3.js +624 -624
  195. package/src/standard/Math/Geometry/Camera.js +68 -68
  196. package/src/standard/Math/Geometry/Cylinder3.js +112 -112
  197. package/src/standard/Math/Geometry/Line3.js +188 -153
  198. package/src/standard/Math/Geometry/Plane3.js +120 -120
  199. package/src/standard/Math/Geometry/Sphere3.js +148 -148
  200. package/src/standard/Math/Geometry/Spheroid3.js +38 -38
  201. package/src/standard/Math/Geometry/Triangle2.js +19 -19
  202. package/src/standard/Math/Geometry/Triangle3.js +148 -148
  203. package/src/standard/Math/Geometry/ViewVolume.js +359 -359
  204. package/src/standard/Math/Numbers/Color3.js +219 -214
  205. package/src/standard/Math/Numbers/Color4.js +148 -142
  206. package/src/standard/Math/Numbers/Complex.js +139 -139
  207. package/src/standard/Math/Numbers/Matrix2.js +193 -193
  208. package/src/standard/Math/Numbers/Matrix3.js +679 -679
  209. package/src/standard/Math/Numbers/Matrix4.js +883 -883
  210. package/src/standard/Math/Numbers/Quaternion.js +496 -496
  211. package/src/standard/Math/Numbers/Rotation4.js +421 -415
  212. package/src/standard/Math/Numbers/Vector2.js +220 -220
  213. package/src/standard/Math/Numbers/Vector3.js +280 -280
  214. package/src/standard/Math/Numbers/Vector4.js +296 -296
  215. package/src/standard/Math/Utility/BVH.js +303 -303
  216. package/src/standard/Math/Utility/MatrixStack.js +64 -64
  217. package/src/standard/Networking/BinaryTransport.js +67 -67
  218. package/src/standard/Time/MicroTime.js +22 -22
  219. package/src/standard/Utility/DataStorage.js +85 -81
  220. package/src/standard/Utility/MapUtilities.js +14 -1
  221. package/src/standard/Utility/ObjectCache.js +24 -24
  222. package/src/standard/Utility/Shuffle.js +13 -13
  223. package/src/tests.js +355 -384
  224. package/src/x_ite/Base/Events.js +64 -55
  225. package/src/x_ite/{Basic/X3DArrayField.js → Base/FieldArray.js} +19 -12
  226. package/src/x_ite/Base/FieldDefinitionArray.js +75 -0
  227. package/src/x_ite/{Basic/FieldDefinitionArray.js → Base/X3DArrayField.js} +35 -59
  228. package/src/x_ite/Base/X3DBaseNode.js +588 -0
  229. package/src/x_ite/{Bits → Base}/X3DCast.js +23 -22
  230. package/src/x_ite/Base/X3DChildObject.js +68 -62
  231. package/src/x_ite/{Bits → Base}/X3DConstants.js +85 -85
  232. package/src/x_ite/Base/X3DEventObject.js +73 -68
  233. package/src/x_ite/Base/X3DField.js +450 -0
  234. package/src/x_ite/Base/X3DFieldDefinition.js +78 -0
  235. package/src/x_ite/Base/X3DInfoArray.js +291 -0
  236. package/src/x_ite/Base/X3DObject.js +152 -109
  237. package/src/x_ite/Base/X3DObjectArrayField.js +573 -0
  238. package/src/x_ite/Base/X3DTypedArrayField.js +866 -0
  239. package/src/x_ite/Browser/Core/BrowserOptions.js +376 -394
  240. package/src/x_ite/Browser/Core/BrowserProperties.js +38 -38
  241. package/src/x_ite/Browser/Core/BrowserTimings.js +173 -172
  242. package/src/x_ite/Browser/Core/ContextMenu.js +547 -551
  243. package/src/x_ite/Browser/Core/Notification.js +57 -56
  244. package/src/x_ite/Browser/Core/PrimitiveQuality.js +8 -8
  245. package/src/x_ite/Browser/Core/RenderingProperties.js +55 -55
  246. package/src/x_ite/Browser/Core/Shading.js +10 -10
  247. package/src/x_ite/Browser/Core/TextureQuality.js +8 -8
  248. package/src/x_ite/Browser/Core/X3DCoreContext.js +746 -724
  249. package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +33 -25
  250. package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +23 -23
  251. package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +127 -127
  252. package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +25 -25
  253. package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +25 -25
  254. package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +56 -55
  255. package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +116 -116
  256. package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +59 -59
  257. package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +80 -77
  258. package/src/x_ite/Browser/Geometry3D/BoxOptions.js +70 -70
  259. package/src/x_ite/Browser/Geometry3D/ConeOptions.js +26 -26
  260. package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +27 -27
  261. package/src/x_ite/Browser/Geometry3D/IcoSphere.js +357 -357
  262. package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +61 -61
  263. package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +243 -241
  264. package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +37 -34
  265. package/src/x_ite/Browser/Geospatial/Geocentric.js +27 -27
  266. package/src/x_ite/Browser/Geospatial/Geospatial.js +157 -156
  267. package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +38 -33
  268. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +128 -130
  269. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +39 -41
  270. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2.js +3 -3
  271. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3.js +3 -3
  272. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +54 -56
  273. package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +54 -56
  274. package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +44 -41
  275. package/src/x_ite/Browser/Layering/X3DLayeringContext.js +20 -18
  276. package/src/x_ite/Browser/Layout/ScreenText.js +406 -405
  277. package/src/x_ite/Browser/Layout/X3DLayoutContext.js +36 -30
  278. package/src/x_ite/Browser/Lighting/X3DLightingContext.js +54 -50
  279. package/src/x_ite/Browser/NURBS/NURBS.js +417 -417
  280. package/src/x_ite/Browser/Navigation/ExamineViewer.js +753 -753
  281. package/src/x_ite/Browser/Navigation/FlyViewer.js +39 -39
  282. package/src/x_ite/Browser/Navigation/LookAtViewer.js +461 -461
  283. package/src/x_ite/Browser/Navigation/NoneViewer.js +18 -18
  284. package/src/x_ite/Browser/Navigation/PlaneViewer.js +193 -193
  285. package/src/x_ite/Browser/Navigation/WalkViewer.js +61 -61
  286. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +709 -710
  287. package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +188 -182
  288. package/src/x_ite/Browser/Navigation/X3DViewer.js +160 -160
  289. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +152 -143
  290. package/src/x_ite/Browser/Networking/urls.js +31 -31
  291. package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +17 -13
  292. package/src/x_ite/Browser/Picking/IntersectionType.js +7 -7
  293. package/src/x_ite/Browser/Picking/MatchCriterion.js +8 -8
  294. package/src/x_ite/Browser/Picking/SortOrder.js +9 -9
  295. package/src/x_ite/Browser/Picking/VolumePicker.js +138 -138
  296. package/src/x_ite/Browser/Picking/X3DPickingContext.js +80 -69
  297. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +208 -209
  298. package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +34 -34
  299. package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +269 -263
  300. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +132 -119
  301. package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +14 -14
  302. package/src/x_ite/Browser/Scripting/X3DScriptingContext.js +20 -19
  303. package/src/x_ite/Browser/Scripting/evaluate.js +7 -7
  304. package/src/x_ite/Browser/Shaders/Shader.js +152 -159
  305. package/src/x_ite/Browser/Shaders/ShaderSource.js +81 -63
  306. package/src/x_ite/Browser/Shaders/ShaderTest.js +97 -98
  307. package/src/x_ite/Browser/Shaders/X3DShadersContext.js +256 -249
  308. package/src/x_ite/Browser/Shape/AlphaMode.js +9 -9
  309. package/src/x_ite/Browser/Shape/X3DShapeContext.js +111 -89
  310. package/src/x_ite/Browser/Sound/X3DSoundContext.js +11 -11
  311. package/src/x_ite/Browser/Text/PolygonText.js +319 -319
  312. package/src/x_ite/Browser/Text/TextAlignment.js +9 -9
  313. package/src/x_ite/Browser/Text/X3DTextContext.js +72 -65
  314. package/src/x_ite/Browser/Text/X3DTextGeometry.js +506 -506
  315. package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +8 -8
  316. package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +25 -25
  317. package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +9 -9
  318. package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +17 -17
  319. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +259 -224
  320. package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1066 -1066
  321. package/src/x_ite/Browser/Texturing3D/NRRDParser.js +641 -630
  322. package/src/x_ite/Browser/Time/X3DTimeContext.js +54 -37
  323. package/src/x_ite/Browser/VERSION.js +1 -1
  324. package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +55 -55
  325. package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +5 -5
  326. package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +52 -41
  327. package/src/x_ite/Browser/X3DBrowser.js +819 -755
  328. package/src/x_ite/Browser/X3DBrowserContext.js +253 -220
  329. package/src/x_ite/Components/Annotation/AnnotationLayer.js +43 -43
  330. package/src/x_ite/Components/Annotation/AnnotationTarget.js +38 -38
  331. package/src/x_ite/Components/Annotation/GroupAnnotation.js +48 -48
  332. package/src/x_ite/Components/Annotation/IconAnnotation.js +46 -46
  333. package/src/x_ite/Components/Annotation/TextAnnotation.js +39 -39
  334. package/src/x_ite/Components/Annotation/URLAnnotation.js +38 -38
  335. package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +16 -16
  336. package/src/x_ite/Components/CADGeometry/CADAssembly.js +41 -41
  337. package/src/x_ite/Components/CADGeometry/CADFace.js +189 -189
  338. package/src/x_ite/Components/CADGeometry/CADLayer.js +38 -38
  339. package/src/x_ite/Components/CADGeometry/CADPart.js +46 -46
  340. package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +67 -67
  341. package/src/x_ite/Components/CADGeometry/QuadSet.js +64 -63
  342. package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +13 -15
  343. package/src/x_ite/Components/Core/MetadataBoolean.js +38 -40
  344. package/src/x_ite/Components/Core/MetadataDouble.js +38 -40
  345. package/src/x_ite/Components/Core/MetadataFloat.js +38 -40
  346. package/src/x_ite/Components/Core/MetadataInteger.js +38 -40
  347. package/src/x_ite/Components/Core/MetadataSet.js +38 -40
  348. package/src/x_ite/Components/Core/MetadataString.js +38 -40
  349. package/src/x_ite/Components/Core/WorldInfo.js +42 -42
  350. package/src/x_ite/Components/Core/X3DBindableNode.js +20 -20
  351. package/src/x_ite/Components/Core/X3DChildNode.js +38 -40
  352. package/src/x_ite/Components/Core/X3DInfoNode.js +13 -15
  353. package/src/x_ite/Components/Core/X3DMetadataObject.js +11 -13
  354. package/src/x_ite/Components/Core/X3DNode.js +795 -14
  355. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +585 -479
  356. package/src/x_ite/Components/Core/X3DSensorNode.js +13 -15
  357. package/src/x_ite/Components/Core.js +39 -39
  358. package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +193 -200
  359. package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +209 -206
  360. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +213 -219
  361. package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +69 -60
  362. package/src/x_ite/Components/DIS/DISEntityManager.js +38 -40
  363. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +59 -41
  364. package/src/x_ite/Components/DIS/EspduTransform.js +128 -128
  365. package/src/x_ite/Components/DIS/ReceiverPdu.js +68 -68
  366. package/src/x_ite/Components/DIS/SignalPdu.js +68 -68
  367. package/src/x_ite/Components/DIS/TransmitterPdu.js +84 -84
  368. package/src/x_ite/Components/EnvironmentalEffects/Background.js +87 -89
  369. package/src/x_ite/Components/EnvironmentalEffects/Fog.js +59 -59
  370. package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +78 -78
  371. package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +56 -56
  372. package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +86 -88
  373. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +582 -589
  374. package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +105 -105
  375. package/src/x_ite/Components/EnvironmentalEffects.js +25 -25
  376. package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +229 -229
  377. package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +256 -256
  378. package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +114 -114
  379. package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +71 -71
  380. package/src/x_ite/Components/EnvironmentalSensor.js +19 -19
  381. package/src/x_ite/Components/EventUtilities/BooleanFilter.js +50 -52
  382. package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +50 -52
  383. package/src/x_ite/Components/EventUtilities/BooleanToggle.js +43 -45
  384. package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +42 -44
  385. package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +50 -52
  386. package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +43 -45
  387. package/src/x_ite/Components/EventUtilities/TimeTrigger.js +43 -45
  388. package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +92 -94
  389. package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +13 -15
  390. package/src/x_ite/Components/Followers/ColorChaser.js +78 -78
  391. package/src/x_ite/Components/Followers/ColorDamper.js +78 -78
  392. package/src/x_ite/Components/Followers/CoordinateChaser.js +46 -46
  393. package/src/x_ite/Components/Followers/CoordinateDamper.js +48 -48
  394. package/src/x_ite/Components/Followers/OrientationChaser.js +64 -64
  395. package/src/x_ite/Components/Followers/OrientationDamper.js +61 -61
  396. package/src/x_ite/Components/Followers/PositionChaser.js +42 -42
  397. package/src/x_ite/Components/Followers/PositionChaser2D.js +42 -42
  398. package/src/x_ite/Components/Followers/PositionDamper.js +44 -44
  399. package/src/x_ite/Components/Followers/PositionDamper2D.js +44 -44
  400. package/src/x_ite/Components/Followers/ScalarChaser.js +70 -70
  401. package/src/x_ite/Components/Followers/ScalarDamper.js +60 -60
  402. package/src/x_ite/Components/Followers/TexCoordChaser2D.js +46 -46
  403. package/src/x_ite/Components/Followers/TexCoordDamper2D.js +48 -48
  404. package/src/x_ite/Components/Followers/X3DChaserNode.js +194 -194
  405. package/src/x_ite/Components/Followers/X3DDamperNode.js +120 -120
  406. package/src/x_ite/Components/Followers/X3DFollowerNode.js +83 -83
  407. package/src/x_ite/Components/Followers.js +45 -45
  408. package/src/x_ite/Components/Geometry2D/Arc2D.js +99 -113
  409. package/src/x_ite/Components/Geometry2D/ArcClose2D.js +164 -166
  410. package/src/x_ite/Components/Geometry2D/Circle2D.js +59 -67
  411. package/src/x_ite/Components/Geometry2D/Disk2D.js +207 -211
  412. package/src/x_ite/Components/Geometry2D/Polyline2D.js +43 -52
  413. package/src/x_ite/Components/Geometry2D/Polypoint2D.js +43 -60
  414. package/src/x_ite/Components/Geometry2D/Rectangle2D.js +76 -73
  415. package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +69 -71
  416. package/src/x_ite/Components/Geometry3D/Box.js +90 -86
  417. package/src/x_ite/Components/Geometry3D/Cone.js +185 -187
  418. package/src/x_ite/Components/Geometry3D/Cylinder.js +246 -246
  419. package/src/x_ite/Components/Geometry3D/ElevationGrid.js +383 -384
  420. package/src/x_ite/Components/Geometry3D/Extrusion.js +653 -647
  421. package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +437 -445
  422. package/src/x_ite/Components/Geometry3D/Sphere.js +72 -74
  423. package/src/x_ite/Components/Geometry3D.js +25 -25
  424. package/src/x_ite/Components/Geospatial/GeoCoordinate.js +189 -191
  425. package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +381 -383
  426. package/src/x_ite/Components/Geospatial/GeoLOD.js +397 -397
  427. package/src/x_ite/Components/Geospatial/GeoLocation.js +56 -56
  428. package/src/x_ite/Components/Geospatial/GeoMetadata.js +54 -36
  429. package/src/x_ite/Components/Geospatial/GeoOrigin.js +50 -52
  430. package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +81 -83
  431. package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +95 -97
  432. package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +77 -79
  433. package/src/x_ite/Components/Geospatial/GeoTransform.js +79 -79
  434. package/src/x_ite/Components/Geospatial/GeoViewpoint.js +278 -278
  435. package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +216 -218
  436. package/src/x_ite/Components/Grouping/Group.js +37 -37
  437. package/src/x_ite/Components/Grouping/StaticGroup.js +245 -245
  438. package/src/x_ite/Components/Grouping/Switch.js +234 -234
  439. package/src/x_ite/Components/Grouping/Transform.js +42 -42
  440. package/src/x_ite/Components/Grouping/X3DBoundedObject.js +93 -93
  441. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +654 -649
  442. package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +99 -99
  443. package/src/x_ite/Components/Grouping/X3DTransformNode.js +31 -31
  444. package/src/x_ite/Components/Grouping.js +27 -27
  445. package/src/x_ite/Components/HAnim/HAnimDisplacer.js +35 -35
  446. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +293 -293
  447. package/src/x_ite/Components/HAnim/HAnimJoint.js +137 -137
  448. package/src/x_ite/Components/HAnim/HAnimMotion.js +50 -50
  449. package/src/x_ite/Components/HAnim/HAnimSegment.js +44 -44
  450. package/src/x_ite/Components/HAnim/HAnimSite.js +43 -43
  451. package/src/x_ite/Components/Interpolation/ColorInterpolator.js +61 -63
  452. package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +60 -62
  453. package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +57 -59
  454. package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +79 -80
  455. package/src/x_ite/Components/Interpolation/NormalInterpolator.js +96 -93
  456. package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +70 -70
  457. package/src/x_ite/Components/Interpolation/PositionInterpolator.js +57 -59
  458. package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +57 -59
  459. package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +53 -55
  460. package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +78 -80
  461. package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +77 -79
  462. package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +78 -80
  463. package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +66 -66
  464. package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +67 -69
  465. package/src/x_ite/Components/Interpolation.js +39 -39
  466. package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +304 -306
  467. package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +102 -104
  468. package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +51 -51
  469. package/src/x_ite/Components/Layering/Layer.js +50 -50
  470. package/src/x_ite/Components/Layering/LayerSet.js +160 -161
  471. package/src/x_ite/Components/Layering/Viewport.js +118 -118
  472. package/src/x_ite/Components/Layering/X3DLayerNode.js +322 -322
  473. package/src/x_ite/Components/Layering/X3DViewportNode.js +13 -13
  474. package/src/x_ite/Components/Layering.js +21 -21
  475. package/src/x_ite/Components/Layout/Layout.js +576 -578
  476. package/src/x_ite/Components/Layout/LayoutGroup.js +126 -126
  477. package/src/x_ite/Components/Layout/LayoutLayer.js +53 -53
  478. package/src/x_ite/Components/Layout/ScreenFontStyle.js +48 -48
  479. package/src/x_ite/Components/Layout/ScreenGroup.js +136 -136
  480. package/src/x_ite/Components/Layout/X3DLayoutNode.js +12 -14
  481. package/src/x_ite/Components/Lighting/DirectionalLight.js +239 -246
  482. package/src/x_ite/Components/Lighting/PointLight.js +296 -303
  483. package/src/x_ite/Components/Lighting/SpotLight.js +321 -316
  484. package/src/x_ite/Components/Lighting/X3DLightNode.js +153 -153
  485. package/src/x_ite/Components/Lighting.js +19 -19
  486. package/src/x_ite/Components/NURBS/Contour2D.js +81 -83
  487. package/src/x_ite/Components/NURBS/ContourPolyline2D.js +100 -102
  488. package/src/x_ite/Components/NURBS/CoordinateDouble.js +32 -34
  489. package/src/x_ite/Components/NURBS/NurbsCurve.js +167 -169
  490. package/src/x_ite/Components/NURBS/NurbsCurve2D.js +149 -149
  491. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +166 -166
  492. package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +45 -47
  493. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +154 -154
  494. package/src/x_ite/Components/NURBS/NurbsSet.js +125 -125
  495. package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +128 -130
  496. package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +120 -122
  497. package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +120 -122
  498. package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +93 -93
  499. package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +88 -90
  500. package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +13 -15
  501. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +339 -339
  502. package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +18 -20
  503. package/src/x_ite/Components/Navigation/Billboard.js +132 -132
  504. package/src/x_ite/Components/Navigation/Collision.js +116 -116
  505. package/src/x_ite/Components/Navigation/LOD.js +308 -308
  506. package/src/x_ite/Components/Navigation/NavigationInfo.js +279 -285
  507. package/src/x_ite/Components/Navigation/OrthoViewpoint.js +258 -258
  508. package/src/x_ite/Components/Navigation/Viewpoint.js +137 -137
  509. package/src/x_ite/Components/Navigation/ViewpointGroup.js +169 -171
  510. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +450 -453
  511. package/src/x_ite/Components/Navigation.js +27 -27
  512. package/src/x_ite/Components/Networking/Anchor.js +140 -128
  513. package/src/x_ite/Components/Networking/Inline.js +156 -197
  514. package/src/x_ite/Components/Networking/LoadSensor.js +193 -195
  515. package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +13 -15
  516. package/src/x_ite/Components/Networking/X3DUrlObject.js +170 -116
  517. package/src/x_ite/Components/Networking.js +21 -21
  518. package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +62 -64
  519. package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +81 -83
  520. package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +59 -61
  521. package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +42 -44
  522. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +1433 -1433
  523. package/src/x_ite/Components/ParticleSystems/PointEmitter.js +77 -79
  524. package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +196 -196
  525. package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +195 -195
  526. package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +250 -250
  527. package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +69 -71
  528. package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +346 -346
  529. package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +15 -17
  530. package/src/x_ite/Components/Picking/LinePickSensor.js +284 -286
  531. package/src/x_ite/Components/Picking/PickableGroup.js +155 -155
  532. package/src/x_ite/Components/Picking/PointPickSensor.js +272 -272
  533. package/src/x_ite/Components/Picking/PrimitivePickSensor.js +207 -209
  534. package/src/x_ite/Components/Picking/VolumePickSensor.js +182 -184
  535. package/src/x_ite/Components/Picking/X3DPickSensorNode.js +382 -382
  536. package/src/x_ite/Components/Picking/X3DPickableObject.js +28 -30
  537. package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +257 -259
  538. package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +245 -247
  539. package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +173 -175
  540. package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +61 -63
  541. package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +14 -16
  542. package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +57 -59
  543. package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +19 -21
  544. package/src/x_ite/Components/PointingDeviceSensor.js +25 -25
  545. package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +191 -191
  546. package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +162 -162
  547. package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +156 -156
  548. package/src/x_ite/Components/Rendering/ClipPlane.js +120 -120
  549. package/src/x_ite/Components/Rendering/Color.js +112 -112
  550. package/src/x_ite/Components/Rendering/ColorRGBA.js +114 -114
  551. package/src/x_ite/Components/Rendering/Coordinate.js +33 -35
  552. package/src/x_ite/Components/Rendering/IndexedLineSet.js +236 -243
  553. package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +102 -102
  554. package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +55 -55
  555. package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +110 -110
  556. package/src/x_ite/Components/Rendering/LineSet.js +172 -179
  557. package/src/x_ite/Components/Rendering/Normal.js +100 -100
  558. package/src/x_ite/Components/Rendering/PointSet.js +142 -154
  559. package/src/x_ite/Components/Rendering/TriangleFanSet.js +73 -73
  560. package/src/x_ite/Components/Rendering/TriangleSet.js +51 -53
  561. package/src/x_ite/Components/Rendering/TriangleStripSet.js +76 -76
  562. package/src/x_ite/Components/Rendering/X3DColorNode.js +25 -27
  563. package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +318 -321
  564. package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +132 -132
  565. package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +13 -15
  566. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1190 -1171
  567. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +231 -189
  568. package/src/x_ite/Components/Rendering/X3DNormalNode.js +13 -15
  569. package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +267 -0
  570. package/src/x_ite/Components/Rendering.js +53 -53
  571. package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +149 -149
  572. package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +229 -229
  573. package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +465 -465
  574. package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +152 -154
  575. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +223 -223
  576. package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +117 -117
  577. package/src/x_ite/Components/RigidBodyPhysics/Contact.js +54 -56
  578. package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +245 -245
  579. package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +68 -70
  580. package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +453 -453
  581. package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +326 -326
  582. package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +171 -171
  583. package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +169 -169
  584. package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +50 -52
  585. package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +101 -101
  586. package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +15 -15
  587. package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +161 -163
  588. package/src/x_ite/Components/Scripting/Script.js +506 -510
  589. package/src/x_ite/Components/Scripting/X3DScriptNode.js +15 -15
  590. package/src/x_ite/Components/Shaders/ComposedShader.js +215 -178
  591. package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +84 -83
  592. package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +74 -74
  593. package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +73 -73
  594. package/src/x_ite/Components/Shaders/PackagedShader.js +52 -49
  595. package/src/x_ite/Components/Shaders/ProgramShader.js +36 -38
  596. package/src/x_ite/Components/Shaders/ShaderPart.js +135 -147
  597. package/src/x_ite/Components/Shaders/ShaderProgram.js +49 -46
  598. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1259 -1255
  599. package/src/x_ite/Components/Shaders/X3DShaderNode.js +83 -93
  600. package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +13 -15
  601. package/src/x_ite/Components/Shaders.js +33 -33
  602. package/src/x_ite/{Execution/ExportedNode.js → Components/Shape/AcousticProperties.js} +41 -71
  603. package/src/x_ite/Components/Shape/Appearance.js +331 -318
  604. package/src/x_ite/Components/Shape/FillProperties.js +101 -98
  605. package/src/x_ite/Components/Shape/LineProperties.js +71 -69
  606. package/src/x_ite/Components/Shape/Material.js +344 -116
  607. package/src/x_ite/Components/Shape/PhysicalMaterial.js +310 -0
  608. package/src/x_ite/Components/Shape/PointProperties.js +79 -95
  609. package/src/x_ite/Components/Shape/Shape.js +178 -181
  610. package/src/x_ite/Components/Shape/TwoSidedMaterial.js +200 -200
  611. package/src/x_ite/Components/Shape/UnlitMaterial.js +93 -46
  612. package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +13 -15
  613. package/src/x_ite/Components/Shape/X3DAppearanceNode.js +24 -24
  614. package/src/x_ite/Components/Shape/X3DMaterialNode.js +24 -24
  615. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +158 -54
  616. package/src/x_ite/Components/Shape/X3DShapeNode.js +147 -147
  617. package/src/x_ite/Components/Shape.js +43 -37
  618. package/src/x_ite/Components/Sound/AudioClip.js +135 -140
  619. package/src/x_ite/Components/Sound/Sound.js +246 -246
  620. package/src/x_ite/Components/Sound/X3DSoundNode.js +13 -15
  621. package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +165 -179
  622. package/src/x_ite/Components/Sound.js +19 -19
  623. package/src/x_ite/Components/Text/FontStyle.js +49 -49
  624. package/src/x_ite/Components/Text/Text.js +135 -135
  625. package/src/x_ite/Components/Text/X3DFontStyleNode.js +207 -205
  626. package/src/x_ite/Components/Text.js +17 -17
  627. package/src/x_ite/Components/Texturing/ImageTexture.js +181 -194
  628. package/src/x_ite/Components/Texturing/MovieTexture.js +180 -190
  629. package/src/x_ite/Components/Texturing/MultiTexture.js +255 -262
  630. package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +124 -118
  631. package/src/x_ite/Components/Texturing/MultiTextureTransform.js +82 -76
  632. package/src/x_ite/Components/Texturing/PixelTexture.js +222 -221
  633. package/src/x_ite/Components/Texturing/TextureCoordinate.js +116 -116
  634. package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +90 -90
  635. package/src/x_ite/Components/Texturing/TextureProperties.js +158 -160
  636. package/src/x_ite/Components/Texturing/TextureTransform.js +99 -99
  637. package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +33 -28
  638. package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +54 -54
  639. package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +22 -17
  640. package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +135 -124
  641. package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +16 -16
  642. package/src/x_ite/Components/Texturing/X3DTextureNode.js +24 -24
  643. package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +22 -22
  644. package/src/x_ite/Components/Texturing.js +45 -45
  645. package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +125 -123
  646. package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +115 -131
  647. package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +158 -160
  648. package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +116 -116
  649. package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +116 -116
  650. package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +88 -88
  651. package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +46 -46
  652. package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +135 -121
  653. package/src/x_ite/Components/Time/TimeSensor.js +155 -152
  654. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +299 -302
  655. package/src/x_ite/Components/Time.js +15 -15
  656. package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +338 -338
  657. package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +80 -80
  658. package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +228 -228
  659. package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +163 -163
  660. package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +117 -117
  661. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +334 -334
  662. package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +116 -116
  663. package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +167 -167
  664. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +247 -247
  665. package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +198 -198
  666. package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +116 -116
  667. package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +126 -126
  668. package/src/x_ite/Components/VolumeRendering/VolumeData.js +173 -173
  669. package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +12 -12
  670. package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +167 -167
  671. package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +70 -70
  672. package/src/x_ite/Components/X_ITE/BlendMode.js +143 -145
  673. package/src/x_ite/Components.js +47 -47
  674. package/src/x_ite/Configuration/ComponentInfo.js +47 -42
  675. package/src/x_ite/Configuration/ComponentInfoArray.js +21 -19
  676. package/src/x_ite/Configuration/ProfileInfo.js +33 -23
  677. package/src/x_ite/Configuration/ProfileInfoArray.js +26 -16
  678. package/src/x_ite/Configuration/SupportedComponents.js +311 -311
  679. package/src/x_ite/Configuration/SupportedNodes.js +53 -38
  680. package/src/x_ite/Configuration/SupportedProfiles.js +190 -190
  681. package/src/x_ite/Configuration/UnitInfo.js +60 -51
  682. package/src/x_ite/Configuration/UnitInfoArray.js +17 -10
  683. package/src/x_ite/DEBUG.js +2 -2
  684. package/src/x_ite/Execution/BindableList.js +146 -149
  685. package/src/x_ite/Execution/BindableStack.js +130 -123
  686. package/src/x_ite/Execution/ExportedNodesArray.js +75 -0
  687. package/src/x_ite/Execution/ImportedNodesArray.js +75 -0
  688. package/src/x_ite/{Basic/X3DFieldDefinition.js → Execution/NamedNodesArray.js} +20 -10
  689. package/src/x_ite/Execution/Scene.js +93 -90
  690. package/src/x_ite/Execution/X3DExecutionContext.js +957 -781
  691. package/src/x_ite/Execution/X3DExportedNode.js +152 -0
  692. package/src/x_ite/Execution/X3DImportedNode.js +393 -0
  693. package/src/x_ite/Execution/X3DScene.js +546 -493
  694. package/src/x_ite/Execution/X3DWorld.js +171 -0
  695. package/src/x_ite/Fallback.js +31 -31
  696. package/src/x_ite/Fields/ArrayFields.js +463 -443
  697. package/src/x_ite/Fields/SFBool.js +50 -47
  698. package/src/x_ite/Fields/SFColor.js +163 -160
  699. package/src/x_ite/Fields/SFColorRGBA.js +155 -152
  700. package/src/x_ite/Fields/SFDouble.js +51 -48
  701. package/src/x_ite/Fields/SFFloat.js +51 -48
  702. package/src/x_ite/Fields/SFImage.js +216 -213
  703. package/src/x_ite/Fields/SFInt32.js +47 -44
  704. package/src/x_ite/Fields/SFMatrix3.js +74 -71
  705. package/src/x_ite/Fields/SFMatrix4.js +68 -65
  706. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +98 -98
  707. package/src/x_ite/Fields/SFNode.js +392 -299
  708. package/src/x_ite/Fields/SFNodeCache.js +22 -33
  709. package/src/x_ite/Fields/SFRotation.js +178 -175
  710. package/src/x_ite/Fields/SFString.js +71 -68
  711. package/src/x_ite/Fields/SFTime.js +47 -44
  712. package/src/x_ite/Fields/SFVec2.js +73 -70
  713. package/src/x_ite/Fields/SFVec3.js +105 -102
  714. package/src/x_ite/Fields/SFVec4.js +118 -115
  715. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +94 -94
  716. package/src/x_ite/Fields.js +44 -44
  717. package/src/x_ite/InputOutput/FileLoader.js +426 -531
  718. package/src/x_ite/InputOutput/Generator.js +379 -376
  719. package/src/x_ite/{Configuration/X3DInfoArray.js → Parser/GoldenGate.js} +54 -86
  720. package/src/x_ite/Parser/HTMLSupport.js +28 -6
  721. package/src/x_ite/Parser/JSONParser.js +414 -388
  722. package/src/x_ite/Parser/VRMLParser.js +2964 -0
  723. package/src/x_ite/Parser/X3DParser.js +128 -128
  724. package/src/x_ite/Parser/XMLParser.js +1231 -1178
  725. package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -27
  726. package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -27
  727. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +279 -297
  728. package/src/x_ite/Prototype/X3DProtoDeclaration.js +264 -263
  729. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +58 -35
  730. package/src/x_ite/Rendering/DependentRenderer.js +83 -80
  731. package/src/x_ite/Rendering/TextureBuffer.js +171 -168
  732. package/src/x_ite/{Bits → Rendering}/TraverseType.js +11 -11
  733. package/src/x_ite/Rendering/X3DRenderObject.js +895 -906
  734. package/src/x_ite/Routing/RouteArray.js +19 -71
  735. package/src/x_ite/Routing/X3DRoute.js +185 -179
  736. package/src/x_ite/Routing/X3DRoutingContext.js +60 -54
  737. package/src/x_ite/X3D.js +191 -175
  738. package/src/x_ite.config.js +83 -83
  739. package/src/x_ite.css +279 -288
  740. package/src/x_ite.html +226 -193
  741. package/src/x_ite.js +100 -127
  742. package/x_ite.min.html +220 -187
  743. package/src/assets/shaders/webgl1/PointSet.fs +0 -100
  744. package/src/assets/shaders/webgl1/PointSet.vs +0 -70
  745. package/src/assets/shaders/webgl1/Wireframe.fs +0 -74
  746. package/src/assets/shaders/webgl1/Wireframe.vs +0 -63
  747. package/src/assets/shaders/webgl2/PointSet.fs +0 -99
  748. package/src/assets/shaders/webgl2/PointSet.vs +0 -71
  749. package/src/assets/shaders/webgl2/Wireframe.fs +0 -73
  750. package/src/assets/shaders/webgl2/Wireframe.vs +0 -64
  751. package/src/x_ite/Basic/X3DBaseNode.js +0 -1253
  752. package/src/x_ite/Basic/X3DField.js +0 -370
  753. package/src/x_ite/Basic/X3DObjectArrayField.js +0 -545
  754. package/src/x_ite/Basic/X3DTypedArrayField.js +0 -839
  755. package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +0 -714
  756. package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +0 -209
  757. package/src/x_ite/Execution/ImportedNode.js +0 -375
  758. package/src/x_ite/Execution/World.js +0 -162
  759. package/src/x_ite/Parser/Parser.js +0 -2944
@@ -4,8 +4,8 @@
4
4
  var module = { }, exports, process;
5
5
 
6
6
  const
7
- define = X3D .define,
8
- require = X3D .require;
7
+ define = window [Symbol .for ("X_ITE.X3D-5.0.0")] .define,
8
+ require = window [Symbol .for ("X_ITE.X3D-5.0.0")] .require;
9
9
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
10
10
  *******************************************************************************
11
11
  *
@@ -56,49 +56,55 @@ const
56
56
 
57
57
 
58
58
  define ('x_ite/Browser/Layout/X3DLayoutContext',[
59
- "jquery",
60
- "x_ite/Components/Texturing/TextureProperties",
59
+ "jquery",
60
+ "x_ite/Components/Texturing/TextureProperties",
61
61
  ],
62
62
  function ($,
63
63
  TextureProperties)
64
64
  {
65
65
  "use strict";
66
66
 
67
- function X3DLayoutContext () { }
68
-
69
- X3DLayoutContext .prototype =
70
- {
71
- getScreenTextureProperties: function ()
72
- {
73
- this .screenTextureProperties = new TextureProperties (this .getPrivateScene ());
74
-
75
- this .screenTextureProperties .boundaryModeS_ = "CLAMP";
76
- this .screenTextureProperties .boundaryModeT_ = "CLAMP";
77
- this .screenTextureProperties .boundaryModeR_ = "CLAMP";
78
- this .screenTextureProperties .minificationFilter_ = "NEAREST";
79
- this .screenTextureProperties .magnificationFilter_ = "NEAREST";
80
- this .screenTextureProperties .generateMipMaps_ = false;
81
-
82
- this .screenTextureProperties .setup ();
83
-
84
- this .getScreenTextureProperties = function () { return this .screenTextureProperties; };
85
-
86
- return this .screenTextureProperties;
87
- },
88
- getPointSize: function ()
89
- {
90
- if (this .pointSize === undefined)
91
- {
92
- var div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
93
- this .pointSize = div .appendTo ($("body")) .height () / 72;
94
- div .remove ();
95
- }
96
-
97
- return this .pointSize;
98
- },
99
- };
100
-
101
- return X3DLayoutContext;
67
+ const
68
+ _pointSize = Symbol (),
69
+ _screenTextureProperties = Symbol ();
70
+
71
+ function X3DLayoutContext () { }
72
+
73
+ X3DLayoutContext .prototype =
74
+ {
75
+ getPointSize: function ()
76
+ {
77
+ if (this [_pointSize] === undefined)
78
+ {
79
+ const div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
80
+ this [_pointSize] = div .appendTo ($("body")) .height () / 72;
81
+ div .remove ();
82
+ }
83
+
84
+ return this [_pointSize];
85
+ },
86
+ getScreenTextureProperties: function ()
87
+ {
88
+ this [_screenTextureProperties] = new TextureProperties (this .getPrivateScene ());
89
+
90
+ this [_screenTextureProperties] ._boundaryModeS = "CLAMP";
91
+ this [_screenTextureProperties] ._boundaryModeT = "CLAMP";
92
+ this [_screenTextureProperties] ._boundaryModeR = "CLAMP";
93
+ this [_screenTextureProperties] ._minificationFilter = "NEAREST";
94
+ this [_screenTextureProperties] ._magnificationFilter = "NEAREST";
95
+ this [_screenTextureProperties] ._generateMipMaps = false;
96
+
97
+ this [_screenTextureProperties] .setup ();
98
+
99
+ this .getScreenTextureProperties = function () { return this [_screenTextureProperties]; };
100
+
101
+ Object .defineProperty (this, "getScreenTextureProperties", { enumerable: false });
102
+
103
+ return this [_screenTextureProperties];
104
+ },
105
+ };
106
+
107
+ return X3DLayoutContext;
102
108
  });
103
109
 
104
110
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -151,31 +157,29 @@ function ($,
151
157
 
152
158
 
153
159
  define ('x_ite/Components/Layout/X3DLayoutNode',[
154
- "x_ite/Components/Core/X3DChildNode",
155
- "x_ite/Bits/X3DConstants",
160
+ "x_ite/Components/Core/X3DChildNode",
161
+ "x_ite/Base/X3DConstants",
156
162
  ],
157
163
  function (X3DChildNode,
158
164
  X3DConstants)
159
165
  {
160
166
  "use strict";
161
167
 
162
- function X3DLayoutNode (executionContext)
163
- {
164
- X3DChildNode .call (this, executionContext);
168
+ function X3DLayoutNode (executionContext)
169
+ {
170
+ X3DChildNode .call (this, executionContext);
165
171
 
166
- this .addType (X3DConstants .X3DLayoutNode);
167
- }
172
+ this .addType (X3DConstants .X3DLayoutNode);
173
+ }
168
174
 
169
- X3DLayoutNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
170
- {
171
- constructor: X3DLayoutNode,
172
- });
175
+ X3DLayoutNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
176
+ {
177
+ constructor: X3DLayoutNode,
178
+ });
173
179
 
174
- return X3DLayoutNode;
180
+ return X3DLayoutNode;
175
181
  });
176
182
 
177
-
178
-
179
183
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
180
184
  *******************************************************************************
181
185
  *
@@ -226,21 +230,21 @@ function (X3DChildNode,
226
230
 
227
231
 
228
232
  define ('x_ite/Components/Layout/Layout',[
229
- "x_ite/Fields",
230
- "x_ite/Basic/X3DFieldDefinition",
231
- "x_ite/Basic/FieldDefinitionArray",
232
- "x_ite/Components/Layout/X3DLayoutNode",
233
- "x_ite/Bits/X3DCast",
234
- "x_ite/Bits/X3DConstants",
235
- "standard/Math/Numbers/Vector2",
236
- "standard/Math/Numbers/Vector3",
237
- "standard/Math/Numbers/Rotation4",
238
- "standard/Math/Numbers/Matrix4",
233
+ "x_ite/Fields",
234
+ "x_ite/Base/X3DFieldDefinition",
235
+ "x_ite/Base/FieldDefinitionArray",
236
+ "x_ite/Components/Layout/X3DLayoutNode",
237
+ "x_ite/Base/X3DCast",
238
+ "x_ite/Base/X3DConstants",
239
+ "standard/Math/Numbers/Vector2",
240
+ "standard/Math/Numbers/Vector3",
241
+ "standard/Math/Numbers/Rotation4",
242
+ "standard/Math/Numbers/Matrix4",
239
243
  ],
240
244
  function (Fields,
241
245
  X3DFieldDefinition,
242
246
  FieldDefinitionArray,
243
- X3DLayoutNode,
247
+ X3DLayoutNode,
244
248
  X3DCast,
245
249
  X3DConstants,
246
250
  Vector2,
@@ -250,575 +254,573 @@ function (Fields,
250
254
  {
251
255
  "use strict";
252
256
 
253
- var
254
- i = 0,
255
- LEFT = i++,
256
- CENTER = i++,
257
- RIGHT = i++,
258
- BOTTOM = i++,
259
- TOP = i++,
260
- WORLD = i++,
261
- FRACTION = i++,
262
- PIXEL = i++,
263
- NONE = i++,
264
- STRETCH = i++;
265
-
266
- function Layout (executionContext)
267
- {
268
- X3DLayoutNode .call (this, executionContext);
269
-
270
- this .addType (X3DConstants .Layout);
271
-
272
- this .alignX = CENTER;
273
- this .alignY = CENTER;
274
- this .offsetUnitX = WORLD;
275
- this .offsetUnitY = WORLD;
276
- this .offsetX = 0;
277
- this .offsetY = 0;
278
- this .sizeUnitX = WORLD;
279
- this .sizeUnitY = WORLD;
280
- this .sizeX = 1;
281
- this .sizeY = 1;
282
- this .scaleModeX = NONE;
283
- this .scaleModeY = NONE;
284
- this .parent = null;
285
- this .rectangleCenter = new Vector2 (0, 0);
286
- this .rectangleSize = new Vector2 (0, 0);
287
- this .matrix = new Matrix4 ();
288
- }
289
-
290
- Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
291
- {
292
- constructor: Layout,
293
- viewportPixel: new Vector2 (0, 0),
294
- pixelSize: new Vector2 (0, 0),
295
- translation: new Vector3 (0, 0, 0),
296
- offset: new Vector3 (0, 0, 0),
297
- scale: new Vector3 (1, 1, 1),
298
- currentTranslation: new Vector3 (0, 0, 0),
299
- currentRotation: new Rotation4 (0, 0, 1, 0),
300
- currentScale: new Vector3 (0, 0, 0),
301
- modelViewMatrix: new Matrix4 (),
302
- fieldDefinitions: new FieldDefinitionArray ([
303
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
304
- new X3DFieldDefinition (X3DConstants .inputOutput, "align", new Fields .MFString ("CENTER", "CENTER")),
305
- new X3DFieldDefinition (X3DConstants .inputOutput, "offsetUnits", new Fields .MFString ("WORLD", "WORLD")),
306
- new X3DFieldDefinition (X3DConstants .inputOutput, "offset", new Fields .MFFloat (0, 0)),
307
- new X3DFieldDefinition (X3DConstants .inputOutput, "sizeUnits", new Fields .MFString ("WORLD", "WORLD")),
308
- new X3DFieldDefinition (X3DConstants .inputOutput, "size", new Fields .MFFloat (1, 1)),
309
- new X3DFieldDefinition (X3DConstants .inputOutput, "scaleMode", new Fields .MFString ("NONE", "NONE")),
310
- ]),
311
- getTypeName: function ()
312
- {
313
- return "Layout";
314
- },
315
- getComponentName: function ()
316
- {
317
- return "Layout";
318
- },
319
- getContainerField: function ()
320
- {
321
- return "layout";
322
- },
323
- initialize: function ()
324
- {
325
- X3DLayoutNode .prototype .initialize .call (this);
326
-
327
- this .align_ .addInterest ("set_align__", this);
328
- this .offsetUnits_ .addInterest ("set_offsetUnits__", this);
329
- this .offset_ .addInterest ("set_offset__", this);
330
- this .sizeUnits_ .addInterest ("set_sizeUnits__", this);
331
- this .size_ .addInterest ("set_size__", this);
332
- this .scaleMode_ .addInterest ("set_scaleMode__", this);
333
-
334
- this .set_align__ ();
335
- this .set_offsetUnits__ ();
336
- this .set_offset__ ();
337
- this .set_sizeUnits__ ();
338
- this .set_size__ ();
339
- this .set_scaleMode__ ();
340
- },
341
- set_align__: function ()
342
- {
343
- // X
344
-
345
- if (this .align_ .length > 0)
346
- {
347
- if (this .align_ [0] === "LEFT")
348
- this .alignX = LEFT;
349
-
350
- else if (this .align_ [0] === "RIGHT")
351
- this .alignX = RIGHT;
352
-
353
- else
354
- this .alignX = CENTER;
355
- }
356
- else
357
- this .alignX = CENTER;
358
-
359
- // Y
360
-
361
- if (this .align_ .length > 1)
362
- {
363
- if (this .align_ [1] === "BOTTOM")
364
- this .alignY = BOTTOM;
365
-
366
- else if (this .align_ [1] === "TOP")
367
- this .alignY = TOP;
368
-
369
- else
370
- this .alignY = CENTER;
371
- }
372
- else
373
- this .alignY = CENTER;
374
- },
375
- set_offsetUnits__: function ()
376
- {
377
- if (this .offsetUnits_ .length > 0)
378
- {
379
- // X
380
-
381
- if (this .offsetUnits_ [0] === "FRACTION")
382
- this .offsetUnitX = FRACTION;
383
-
384
- else if (this .offsetUnits_ [0] === "PIXEL")
385
- this .offsetUnitX = PIXEL;
386
-
387
- else
388
- this .offsetUnitX = WORLD;
389
-
390
- // Y
391
-
392
- if (this .offsetUnits_ .length > 1)
393
- {
394
- if (this .offsetUnits_ [1] === "FRACTION")
395
- this .offsetUnitY = FRACTION;
396
-
397
- else if (this .offsetUnits_ [1] === "PIXEL")
398
- this .offsetUnitY = PIXEL;
399
-
400
- else
401
- this .offsetUnitY = WORLD;
402
- }
403
- else
404
- this .offsetUnitY = this .offsetUnitX;
405
- }
406
- else
407
- {
408
- this .offsetUnitX = WORLD;
409
- this .offsetUnitY = WORLD;
410
- }
411
- },
412
- set_offset__: function ()
413
- {
414
- if (this .offset_ .length > 0)
415
- {
416
- // X
417
-
418
- this .offsetX = this .offset_ [0];
419
-
420
- // Y
421
-
422
- if (this .offset_ .length > 1)
423
- this .offsetY = this .offset_ [1];
424
-
425
- else
426
- this .offsetY = offsetX;
427
- }
428
- else
429
- {
430
- this .offsetX = 0;
431
- this .offsetY = 0;
432
- }
433
- },
434
- set_sizeUnits__: function ()
435
- {
436
- if (this .sizeUnits_ .length > 0)
437
- {
438
- // X
439
-
440
- if (this .sizeUnits_ [0] === "FRACTION")
441
- this .sizeUnitX = FRACTION;
442
-
443
- else if (this .sizeUnits_ [0] === "PIXEL")
444
- this .sizeUnitX = PIXEL;
445
-
446
- else
447
- this .sizeUnitX = WORLD;
448
-
449
- // Y
450
-
451
- if (this .sizeUnits_ .length > 1)
452
- {
453
- if (this .sizeUnits_ [1] === "FRACTION")
454
- this .sizeUnitY = FRACTION;
455
-
456
- else if (this .sizeUnits_ [1] === "PIXEL")
457
- this .sizeUnitY = PIXEL;
458
-
459
- else
460
- this .sizeUnitY = WORLD;
461
- }
462
- else
463
- this .sizeUnitY = this .sizeUnitX;
464
- }
465
- else
466
- {
467
- this .sizeUnitX = WORLD;
468
- this .sizeUnitY = WORLD;
469
- }
470
- },
471
- set_size__: function ()
472
- {
473
- if (this .size_ .length > 0)
474
- {
475
- // X
476
-
477
- this .sizeX = this .size_ [0];
478
-
479
- // Y
480
-
481
- if (this .size_ .length > 1)
482
- this .sizeY = this .size_ [1];
483
-
484
- else
485
- this .sizeY = this .sizeX;
486
- }
487
- else
488
- {
489
- this .sizeX = 0;
490
- this .sizeY = 0;
491
- }
492
- },
493
- set_scaleMode__: function ()
494
- {
495
- if (this .scaleMode_ .length > 0)
496
- {
497
- // X
498
-
499
- if (this .scaleMode_ [0] === "FRACTION")
500
- this .scaleModeX = FRACTION;
501
-
502
- else if (this .scaleMode_ [0] === "PIXEL")
503
- this .scaleModeX = PIXEL;
504
-
505
- else if (this .scaleMode_ [0] === "STRETCH")
506
- this .scaleModeX = STRETCH;
507
-
508
- else
509
- this .scaleModeX = NONE;
510
-
511
- // Y
512
-
513
- if (this .scaleMode_ .length > 1)
514
- {
515
- if (this .scaleMode_ [1] === "FRACTION")
516
- this .scaleModeY = FRACTION;
517
-
518
- else if (this .scaleMode_ [1] === "PIXEL")
519
- this .scaleModeY = PIXEL;
520
-
521
- else if (this .scaleMode_ [1] === "STRETCH")
522
- this .scaleModeY = STRETCH;
523
-
524
- else
525
- this .scaleModeY = NONE;
526
- }
527
- else
528
- this .scaleModeY = this .scaleModeX;
529
- }
530
- else
531
- {
532
- this .scaleModeX = NONE;
533
- this .scaleModeY = NONE;
534
- }
535
- },
536
- getRectangleCenter: function ()
537
- {
538
- return this .rectangleCenter;
539
- },
540
- getRectangleSize: function ()
541
- {
542
- return this .rectangleSize;
543
- },
544
- getAlignX: function ()
545
- {
546
- return this .alignX;
547
- },
548
- getAlignY: function ()
549
- {
550
- return this .alignY;
551
- },
552
- getOffsetUnitX: function ()
553
- {
554
- if (this .offsetUnitX === WORLD)
555
- {
556
- if (this .parent)
557
- return this .parent .getOffsetUnitX ();
558
-
559
- return FRACTION;
560
- }
561
-
562
- return this .offsetUnitX;
563
- },
564
- getOffsetUnitY: function ()
565
- {
566
- if (this .offsetUnitY === WORLD)
567
- {
568
- if (this .parent)
569
- return this .parent .getOffsetUnitY ();
570
-
571
- return FRACTION;
572
- }
573
-
574
- return this .offsetUnitY;
575
- },
576
- getOffsetX: function ()
577
- {
578
- return this .offsetX;
579
- },
580
- getOffsetY: function ()
581
- {
582
- return this .offsetY;
583
- },
584
- getSizeUnitX: function ()
585
- {
586
- if (this .sizeUnitX === WORLD)
587
- {
588
- if (this .parent)
589
- return this .parent .getSizeUnitX ();
590
-
591
- return FRACTION;
592
- }
593
-
594
- return this .sizeUnitX;
595
- },
596
- getSizeUnitY: function ()
597
- {
598
- if (this .sizeUnitY === WORLD)
599
- {
600
- if (this .parent)
601
- return this .parent .getSizeUnitY ();
602
-
603
- return FRACTION;
604
- }
605
-
606
- return this .sizeUnitY;
607
- },
608
- getSizeX: function ()
609
- {
610
- return this .sizeX;
611
- },
612
- getSizeY: function ()
613
- {
614
- return this .sizeY;
615
- },
616
- getScaleModeX: function ()
617
- {
618
- if (this .parent)
619
- return this .scaleModeX;
620
-
621
- if (this .scaleModeX === NONE)
622
- return FRACTION;
623
-
624
- return this .scaleModeX;
625
- },
626
- getScaleModeY: function ()
627
- {
628
- if (this .parent)
629
- return this .scaleModeY;
630
-
631
- if (this .scaleModeY === NONE)
632
- return FRACTION;
633
-
634
- return this .scaleModeY;
635
- },
636
- transform: function (type, renderObject)
637
- {
638
- var parent = this .parent = renderObject .getParentLayout ();
639
-
640
- // Calculate rectangleSize
641
-
642
- var
643
- matrix = this .matrix,
644
- viewpoint = renderObject .getViewpoint (),
645
- nearValue = renderObject .getNavigationInfo () .getNearValue (), // in meters
646
- viewport = renderObject .getViewVolume () .getScissor (), // in pixels
647
- viewportMeter = viewpoint .getViewportSize (viewport, nearValue), // in meters
648
- viewportPixel = this .viewportPixel, // in pixels
649
- pixelSize = this .pixelSize, // size of one pixel in meters
650
- parentRectangleSize = parent ? parent .getRectangleSize () : viewportMeter, // in meters
651
- rectangleSize = this .rectangleSize,
652
- rectangleCenter = this .rectangleCenter;
653
-
654
- viewportPixel .set (viewport [2], viewport [3]); // in pixel
655
- pixelSize .assign (viewportMeter) .divVec (viewportPixel); // size of one pixel in meter
656
-
657
- switch (this .getSizeUnitX ())
658
- {
659
- case FRACTION:
660
- rectangleSize .x = this .sizeX * parentRectangleSize .x;
661
- break;
662
- case PIXEL:
663
- rectangleSize .x = this .sizeX * pixelSize .x;
664
- break;
665
- default:
666
- break;
667
- }
668
-
669
- switch (this .getSizeUnitY ())
670
- {
671
- case FRACTION:
672
- rectangleSize .y = this .sizeY * parentRectangleSize .y;
673
- break;
674
- case PIXEL:
675
- rectangleSize .y = this .sizeY * pixelSize .y;
676
- break;
677
- default:
678
- break;
679
- }
680
-
681
- // Calculate translation
682
-
683
- var translation = this .translation .set (0, 0, 0);
684
-
685
- switch (this .getAlignX ())
686
- {
687
- case LEFT:
688
- translation .x = -(parentRectangleSize .x - rectangleSize .x) / 2;
689
- break;
690
- case CENTER:
691
-
692
- if (this .getSizeUnitX () === PIXEL && viewportPixel .x & 1)
693
- translation .x = -pixelSize .x / 2;
694
-
695
- break;
696
- case RIGHT:
697
- translation .x = (parentRectangleSize .x - rectangleSize .x) / 2;
698
- break;
699
- }
700
-
701
- switch (this .getAlignY ())
702
- {
703
- case BOTTOM:
704
- translation .y = -(parentRectangleSize .y - rectangleSize .y) / 2;
705
- break;
706
- case CENTER:
707
-
708
- if (this .getSizeUnitX === PIXEL && viewportPixel .y & 1)
709
- translation .y = -pixelSize .y / 2;
710
-
711
- break;
712
- case TOP:
713
- translation .y = (parentRectangleSize .y - rectangleSize .y) / 2;
714
- break;
715
- }
716
-
717
- // Calculate offset
718
-
719
- var offset = this .offset .set (0, 0, 0);
720
-
721
- switch (this .getOffsetUnitX ())
722
- {
723
- case FRACTION:
724
- offset .x = this .offsetX * parentRectangleSize .x;
725
- break;
726
- case PIXEL:
727
- offset .x = this .offsetX * viewportMeter .x / viewportPixel .x;
728
- break;
729
- }
730
-
731
- switch (this .getOffsetUnitY ())
732
- {
733
- case FRACTION:
734
- offset .y = this .offsetY * parentRectangleSize .y;
735
- break;
736
- case PIXEL:
737
- offset .y = this .offsetY * viewportMeter .y / viewportPixel .y;
738
- break;
739
- }
740
-
741
- // Calculate scale
742
-
743
- var
744
- scale = this .scale .set (1, 1, 1),
745
- currentTranslation = this .currentTranslation,
746
- currentRotation = this .currentRotation,
747
- currentScale = this .currentScale;
748
-
749
- var modelViewMatrix = renderObject .getModelViewMatrix () .get ();
750
- modelViewMatrix .get (currentTranslation, currentRotation, currentScale);
751
-
752
- switch (this .getScaleModeX ())
753
- {
754
- case NONE:
755
- scale .x = currentScale .x;
756
- break;
757
- case FRACTION:
758
- scale .x = rectangleSize .x;
759
- break;
760
- case STRETCH:
761
- break;
762
- case PIXEL:
763
- scale .x = viewportMeter .x / viewportPixel .x;
764
- break;
765
- }
766
-
767
- switch (this .getScaleModeY ())
768
- {
769
- case NONE:
770
- scale .y = currentScale .y;
771
- break;
772
- case FRACTION:
773
- scale .y = rectangleSize .y;
774
- break;
775
- case STRETCH:
776
- break;
777
- case PIXEL:
778
- scale .y = viewportMeter .y / viewportPixel .y;
779
- break;
780
- }
781
-
782
- // Calculate scale for scaleMode STRETCH
783
-
784
- if (this .getScaleModeX () === STRETCH)
785
- {
786
- if (this .getScaleModeY () === STRETCH)
787
- {
788
- if (rectangleSize .x > rectangleSize .y)
789
- {
790
- scale .x = rectangleSize .x;
791
- scale .y = scale .x;
792
- }
793
- else
794
- {
795
- scale .y = rectangleSize .y;
796
- scale .x = scale .y;
797
- }
798
- }
799
- else
800
- scale .x = scale .y;
801
- }
802
- else if (this .getScaleModeY () === STRETCH)
803
- scale .y = scale .x;
804
-
805
- // Transform
806
-
807
- rectangleCenter .assign (translation) .add (offset);
808
-
809
- matrix .set (currentTranslation, currentRotation);
810
- matrix .translate (translation .add (offset));
811
- matrix .scale (scale);
812
-
813
- return matrix;
814
- },
815
- });
816
-
817
- return Layout;
257
+ var
258
+ i = 0,
259
+ LEFT = i++,
260
+ CENTER = i++,
261
+ RIGHT = i++,
262
+ BOTTOM = i++,
263
+ TOP = i++,
264
+ WORLD = i++,
265
+ FRACTION = i++,
266
+ PIXEL = i++,
267
+ NONE = i++,
268
+ STRETCH = i++;
269
+
270
+ function Layout (executionContext)
271
+ {
272
+ X3DLayoutNode .call (this, executionContext);
273
+
274
+ this .addType (X3DConstants .Layout);
275
+
276
+ this .alignX = CENTER;
277
+ this .alignY = CENTER;
278
+ this .offsetUnitX = WORLD;
279
+ this .offsetUnitY = WORLD;
280
+ this .offsetX = 0;
281
+ this .offsetY = 0;
282
+ this .sizeUnitX = WORLD;
283
+ this .sizeUnitY = WORLD;
284
+ this .sizeX = 1;
285
+ this .sizeY = 1;
286
+ this .scaleModeX = NONE;
287
+ this .scaleModeY = NONE;
288
+ this .parent = null;
289
+ this .rectangleCenter = new Vector2 (0, 0);
290
+ this .rectangleSize = new Vector2 (0, 0);
291
+ this .matrix = new Matrix4 ();
292
+ }
293
+
294
+ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
295
+ {
296
+ constructor: Layout,
297
+ viewportPixel: new Vector2 (0, 0),
298
+ pixelSize: new Vector2 (0, 0),
299
+ translation: new Vector3 (0, 0, 0),
300
+ offset: new Vector3 (0, 0, 0),
301
+ scale: new Vector3 (1, 1, 1),
302
+ currentTranslation: new Vector3 (0, 0, 0),
303
+ currentRotation: new Rotation4 (0, 0, 1, 0),
304
+ currentScale: new Vector3 (0, 0, 0),
305
+ modelViewMatrix: new Matrix4 (),
306
+ [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
307
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
308
+ new X3DFieldDefinition (X3DConstants .inputOutput, "align", new Fields .MFString ("CENTER", "CENTER")),
309
+ new X3DFieldDefinition (X3DConstants .inputOutput, "offsetUnits", new Fields .MFString ("WORLD", "WORLD")),
310
+ new X3DFieldDefinition (X3DConstants .inputOutput, "offset", new Fields .MFFloat (0, 0)),
311
+ new X3DFieldDefinition (X3DConstants .inputOutput, "sizeUnits", new Fields .MFString ("WORLD", "WORLD")),
312
+ new X3DFieldDefinition (X3DConstants .inputOutput, "size", new Fields .MFFloat (1, 1)),
313
+ new X3DFieldDefinition (X3DConstants .inputOutput, "scaleMode", new Fields .MFString ("NONE", "NONE")),
314
+ ]),
315
+ getTypeName: function ()
316
+ {
317
+ return "Layout";
318
+ },
319
+ getComponentName: function ()
320
+ {
321
+ return "Layout";
322
+ },
323
+ getContainerField: function ()
324
+ {
325
+ return "layout";
326
+ },
327
+ initialize: function ()
328
+ {
329
+ X3DLayoutNode .prototype .initialize .call (this);
330
+
331
+ this ._align .addInterest ("set_align__", this);
332
+ this ._offsetUnits .addInterest ("set_offsetUnits__", this);
333
+ this ._offset .addInterest ("set_offset__", this);
334
+ this ._sizeUnits .addInterest ("set_sizeUnits__", this);
335
+ this ._size .addInterest ("set_size__", this);
336
+ this ._scaleMode .addInterest ("set_scaleMode__", this);
337
+
338
+ this .set_align__ ();
339
+ this .set_offsetUnits__ ();
340
+ this .set_offset__ ();
341
+ this .set_sizeUnits__ ();
342
+ this .set_size__ ();
343
+ this .set_scaleMode__ ();
344
+ },
345
+ set_align__: function ()
346
+ {
347
+ // X
348
+
349
+ if (this ._align .length > 0)
350
+ {
351
+ if (this ._align [0] === "LEFT")
352
+ this .alignX = LEFT;
353
+
354
+ else if (this ._align [0] === "RIGHT")
355
+ this .alignX = RIGHT;
356
+
357
+ else
358
+ this .alignX = CENTER;
359
+ }
360
+ else
361
+ this .alignX = CENTER;
362
+
363
+ // Y
364
+
365
+ if (this ._align .length > 1)
366
+ {
367
+ if (this ._align [1] === "BOTTOM")
368
+ this .alignY = BOTTOM;
369
+
370
+ else if (this ._align [1] === "TOP")
371
+ this .alignY = TOP;
372
+
373
+ else
374
+ this .alignY = CENTER;
375
+ }
376
+ else
377
+ this .alignY = CENTER;
378
+ },
379
+ set_offsetUnits__: function ()
380
+ {
381
+ if (this ._offsetUnits .length > 0)
382
+ {
383
+ // X
384
+
385
+ if (this ._offsetUnits [0] === "FRACTION")
386
+ this .offsetUnitX = FRACTION;
387
+
388
+ else if (this ._offsetUnits [0] === "PIXEL")
389
+ this .offsetUnitX = PIXEL;
390
+
391
+ else
392
+ this .offsetUnitX = WORLD;
393
+
394
+ // Y
395
+
396
+ if (this ._offsetUnits .length > 1)
397
+ {
398
+ if (this ._offsetUnits [1] === "FRACTION")
399
+ this .offsetUnitY = FRACTION;
400
+
401
+ else if (this ._offsetUnits [1] === "PIXEL")
402
+ this .offsetUnitY = PIXEL;
403
+
404
+ else
405
+ this .offsetUnitY = WORLD;
406
+ }
407
+ else
408
+ this .offsetUnitY = this .offsetUnitX;
409
+ }
410
+ else
411
+ {
412
+ this .offsetUnitX = WORLD;
413
+ this .offsetUnitY = WORLD;
414
+ }
415
+ },
416
+ set_offset__: function ()
417
+ {
418
+ if (this ._offset .length > 0)
419
+ {
420
+ // X
421
+
422
+ this .offsetX = this ._offset [0];
423
+
424
+ // Y
425
+
426
+ if (this ._offset .length > 1)
427
+ this .offsetY = this ._offset [1];
428
+
429
+ else
430
+ this .offsetY = offsetX;
431
+ }
432
+ else
433
+ {
434
+ this .offsetX = 0;
435
+ this .offsetY = 0;
436
+ }
437
+ },
438
+ set_sizeUnits__: function ()
439
+ {
440
+ if (this ._sizeUnits .length > 0)
441
+ {
442
+ // X
443
+
444
+ if (this ._sizeUnits [0] === "FRACTION")
445
+ this .sizeUnitX = FRACTION;
446
+
447
+ else if (this ._sizeUnits [0] === "PIXEL")
448
+ this .sizeUnitX = PIXEL;
449
+
450
+ else
451
+ this .sizeUnitX = WORLD;
452
+
453
+ // Y
454
+
455
+ if (this ._sizeUnits .length > 1)
456
+ {
457
+ if (this ._sizeUnits [1] === "FRACTION")
458
+ this .sizeUnitY = FRACTION;
459
+
460
+ else if (this ._sizeUnits [1] === "PIXEL")
461
+ this .sizeUnitY = PIXEL;
462
+
463
+ else
464
+ this .sizeUnitY = WORLD;
465
+ }
466
+ else
467
+ this .sizeUnitY = this .sizeUnitX;
468
+ }
469
+ else
470
+ {
471
+ this .sizeUnitX = WORLD;
472
+ this .sizeUnitY = WORLD;
473
+ }
474
+ },
475
+ set_size__: function ()
476
+ {
477
+ if (this ._size .length > 0)
478
+ {
479
+ // X
480
+
481
+ this .sizeX = this ._size [0];
482
+
483
+ // Y
484
+
485
+ if (this ._size .length > 1)
486
+ this .sizeY = this ._size [1];
487
+
488
+ else
489
+ this .sizeY = this .sizeX;
490
+ }
491
+ else
492
+ {
493
+ this .sizeX = 0;
494
+ this .sizeY = 0;
495
+ }
496
+ },
497
+ set_scaleMode__: function ()
498
+ {
499
+ if (this ._scaleMode .length > 0)
500
+ {
501
+ // X
502
+
503
+ if (this ._scaleMode [0] === "FRACTION")
504
+ this .scaleModeX = FRACTION;
505
+
506
+ else if (this ._scaleMode [0] === "PIXEL")
507
+ this .scaleModeX = PIXEL;
508
+
509
+ else if (this ._scaleMode [0] === "STRETCH")
510
+ this .scaleModeX = STRETCH;
511
+
512
+ else
513
+ this .scaleModeX = NONE;
514
+
515
+ // Y
516
+
517
+ if (this ._scaleMode .length > 1)
518
+ {
519
+ if (this ._scaleMode [1] === "FRACTION")
520
+ this .scaleModeY = FRACTION;
521
+
522
+ else if (this ._scaleMode [1] === "PIXEL")
523
+ this .scaleModeY = PIXEL;
524
+
525
+ else if (this ._scaleMode [1] === "STRETCH")
526
+ this .scaleModeY = STRETCH;
527
+
528
+ else
529
+ this .scaleModeY = NONE;
530
+ }
531
+ else
532
+ this .scaleModeY = this .scaleModeX;
533
+ }
534
+ else
535
+ {
536
+ this .scaleModeX = NONE;
537
+ this .scaleModeY = NONE;
538
+ }
539
+ },
540
+ getRectangleCenter: function ()
541
+ {
542
+ return this .rectangleCenter;
543
+ },
544
+ getRectangleSize: function ()
545
+ {
546
+ return this .rectangleSize;
547
+ },
548
+ getAlignX: function ()
549
+ {
550
+ return this .alignX;
551
+ },
552
+ getAlignY: function ()
553
+ {
554
+ return this .alignY;
555
+ },
556
+ getOffsetUnitX: function ()
557
+ {
558
+ if (this .offsetUnitX === WORLD)
559
+ {
560
+ if (this .parent)
561
+ return this .parent .getOffsetUnitX ();
562
+
563
+ return FRACTION;
564
+ }
565
+
566
+ return this .offsetUnitX;
567
+ },
568
+ getOffsetUnitY: function ()
569
+ {
570
+ if (this .offsetUnitY === WORLD)
571
+ {
572
+ if (this .parent)
573
+ return this .parent .getOffsetUnitY ();
574
+
575
+ return FRACTION;
576
+ }
577
+
578
+ return this .offsetUnitY;
579
+ },
580
+ getOffsetX: function ()
581
+ {
582
+ return this .offsetX;
583
+ },
584
+ getOffsetY: function ()
585
+ {
586
+ return this .offsetY;
587
+ },
588
+ getSizeUnitX: function ()
589
+ {
590
+ if (this .sizeUnitX === WORLD)
591
+ {
592
+ if (this .parent)
593
+ return this .parent .getSizeUnitX ();
594
+
595
+ return FRACTION;
596
+ }
597
+
598
+ return this .sizeUnitX;
599
+ },
600
+ getSizeUnitY: function ()
601
+ {
602
+ if (this .sizeUnitY === WORLD)
603
+ {
604
+ if (this .parent)
605
+ return this .parent .getSizeUnitY ();
606
+
607
+ return FRACTION;
608
+ }
609
+
610
+ return this .sizeUnitY;
611
+ },
612
+ getSizeX: function ()
613
+ {
614
+ return this .sizeX;
615
+ },
616
+ getSizeY: function ()
617
+ {
618
+ return this .sizeY;
619
+ },
620
+ getScaleModeX: function ()
621
+ {
622
+ if (this .parent)
623
+ return this .scaleModeX;
624
+
625
+ if (this .scaleModeX === NONE)
626
+ return FRACTION;
627
+
628
+ return this .scaleModeX;
629
+ },
630
+ getScaleModeY: function ()
631
+ {
632
+ if (this .parent)
633
+ return this .scaleModeY;
634
+
635
+ if (this .scaleModeY === NONE)
636
+ return FRACTION;
637
+
638
+ return this .scaleModeY;
639
+ },
640
+ transform: function (type, renderObject)
641
+ {
642
+ var parent = this .parent = renderObject .getParentLayout ();
643
+
644
+ // Calculate rectangleSize
645
+
646
+ var
647
+ matrix = this .matrix,
648
+ viewpoint = renderObject .getViewpoint (),
649
+ nearValue = renderObject .getNavigationInfo () .getNearValue (), // in meters
650
+ viewport = renderObject .getViewVolume () .getScissor (), // in pixels
651
+ viewportMeter = viewpoint .getViewportSize (viewport, nearValue), // in meters
652
+ viewportPixel = this .viewportPixel, // in pixels
653
+ pixelSize = this .pixelSize, // size of one pixel in meters
654
+ parentRectangleSize = parent ? parent .getRectangleSize () : viewportMeter, // in meters
655
+ rectangleSize = this .rectangleSize,
656
+ rectangleCenter = this .rectangleCenter;
657
+
658
+ viewportPixel .set (viewport [2], viewport [3]); // in pixel
659
+ pixelSize .assign (viewportMeter) .divVec (viewportPixel); // size of one pixel in meter
660
+
661
+ switch (this .getSizeUnitX ())
662
+ {
663
+ case FRACTION:
664
+ rectangleSize .x = this .sizeX * parentRectangleSize .x;
665
+ break;
666
+ case PIXEL:
667
+ rectangleSize .x = this .sizeX * pixelSize .x;
668
+ break;
669
+ default:
670
+ break;
671
+ }
672
+
673
+ switch (this .getSizeUnitY ())
674
+ {
675
+ case FRACTION:
676
+ rectangleSize .y = this .sizeY * parentRectangleSize .y;
677
+ break;
678
+ case PIXEL:
679
+ rectangleSize .y = this .sizeY * pixelSize .y;
680
+ break;
681
+ default:
682
+ break;
683
+ }
684
+
685
+ // Calculate translation
686
+
687
+ var translation = this .translation .set (0, 0, 0);
688
+
689
+ switch (this .getAlignX ())
690
+ {
691
+ case LEFT:
692
+ translation .x = -(parentRectangleSize .x - rectangleSize .x) / 2;
693
+ break;
694
+ case CENTER:
695
+
696
+ if (this .getSizeUnitX () === PIXEL && viewportPixel .x & 1)
697
+ translation .x = -pixelSize .x / 2;
698
+
699
+ break;
700
+ case RIGHT:
701
+ translation .x = (parentRectangleSize .x - rectangleSize .x) / 2;
702
+ break;
703
+ }
704
+
705
+ switch (this .getAlignY ())
706
+ {
707
+ case BOTTOM:
708
+ translation .y = -(parentRectangleSize .y - rectangleSize .y) / 2;
709
+ break;
710
+ case CENTER:
711
+
712
+ if (this .getSizeUnitX === PIXEL && viewportPixel .y & 1)
713
+ translation .y = -pixelSize .y / 2;
714
+
715
+ break;
716
+ case TOP:
717
+ translation .y = (parentRectangleSize .y - rectangleSize .y) / 2;
718
+ break;
719
+ }
720
+
721
+ // Calculate offset
722
+
723
+ var offset = this .offset .set (0, 0, 0);
724
+
725
+ switch (this .getOffsetUnitX ())
726
+ {
727
+ case FRACTION:
728
+ offset .x = this .offsetX * parentRectangleSize .x;
729
+ break;
730
+ case PIXEL:
731
+ offset .x = this .offsetX * viewportMeter .x / viewportPixel .x;
732
+ break;
733
+ }
734
+
735
+ switch (this .getOffsetUnitY ())
736
+ {
737
+ case FRACTION:
738
+ offset .y = this .offsetY * parentRectangleSize .y;
739
+ break;
740
+ case PIXEL:
741
+ offset .y = this .offsetY * viewportMeter .y / viewportPixel .y;
742
+ break;
743
+ }
744
+
745
+ // Calculate scale
746
+
747
+ var
748
+ scale = this .scale .set (1, 1, 1),
749
+ currentTranslation = this .currentTranslation,
750
+ currentRotation = this .currentRotation,
751
+ currentScale = this .currentScale;
752
+
753
+ var modelViewMatrix = renderObject .getModelViewMatrix () .get ();
754
+ modelViewMatrix .get (currentTranslation, currentRotation, currentScale);
755
+
756
+ switch (this .getScaleModeX ())
757
+ {
758
+ case NONE:
759
+ scale .x = currentScale .x;
760
+ break;
761
+ case FRACTION:
762
+ scale .x = rectangleSize .x;
763
+ break;
764
+ case STRETCH:
765
+ break;
766
+ case PIXEL:
767
+ scale .x = viewportMeter .x / viewportPixel .x;
768
+ break;
769
+ }
770
+
771
+ switch (this .getScaleModeY ())
772
+ {
773
+ case NONE:
774
+ scale .y = currentScale .y;
775
+ break;
776
+ case FRACTION:
777
+ scale .y = rectangleSize .y;
778
+ break;
779
+ case STRETCH:
780
+ break;
781
+ case PIXEL:
782
+ scale .y = viewportMeter .y / viewportPixel .y;
783
+ break;
784
+ }
785
+
786
+ // Calculate scale for scaleMode STRETCH
787
+
788
+ if (this .getScaleModeX () === STRETCH)
789
+ {
790
+ if (this .getScaleModeY () === STRETCH)
791
+ {
792
+ if (rectangleSize .x > rectangleSize .y)
793
+ {
794
+ scale .x = rectangleSize .x;
795
+ scale .y = scale .x;
796
+ }
797
+ else
798
+ {
799
+ scale .y = rectangleSize .y;
800
+ scale .x = scale .y;
801
+ }
802
+ }
803
+ else
804
+ scale .x = scale .y;
805
+ }
806
+ else if (this .getScaleModeY () === STRETCH)
807
+ scale .y = scale .x;
808
+
809
+ // Transform
810
+
811
+ rectangleCenter .assign (translation) .add (offset);
812
+
813
+ matrix .set (currentTranslation, currentRotation);
814
+ matrix .translate (translation .add (offset));
815
+ matrix .scale (scale);
816
+
817
+ return matrix;
818
+ },
819
+ });
820
+
821
+ return Layout;
818
822
  });
819
823
 
820
-
821
-
822
824
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
823
825
  *******************************************************************************
824
826
  *
@@ -869,14 +871,14 @@ function (Fields,
869
871
 
870
872
 
871
873
  define ('x_ite/Components/Layout/LayoutGroup',[
872
- "x_ite/Fields",
873
- "x_ite/Basic/X3DFieldDefinition",
874
- "x_ite/Basic/FieldDefinitionArray",
875
- "x_ite/Components/Grouping/X3DGroupingNode",
876
- "x_ite/Bits/X3DCast",
877
- "x_ite/Bits/TraverseType",
878
- "x_ite/Bits/X3DConstants",
879
- "standard/Math/Numbers/Matrix4",
874
+ "x_ite/Fields",
875
+ "x_ite/Base/X3DFieldDefinition",
876
+ "x_ite/Base/FieldDefinitionArray",
877
+ "x_ite/Components/Grouping/X3DGroupingNode",
878
+ "x_ite/Base/X3DCast",
879
+ "x_ite/Rendering/TraverseType",
880
+ "x_ite/Base/X3DConstants",
881
+ "standard/Math/Numbers/Matrix4",
880
882
  ],
881
883
  function (Fields,
882
884
  X3DFieldDefinition,
@@ -889,124 +891,124 @@ function (Fields,
889
891
  {
890
892
  "use strict";
891
893
 
892
- function LayoutGroup (executionContext)
893
- {
894
- X3DGroupingNode .call (this, executionContext);
895
-
896
- this .addType (X3DConstants .LayoutGroup);
897
-
898
- this .viewportNode = null;
899
- this .layoutNode = null;
900
- this .modelViewMatrix = new Matrix4 ();
901
- this .screenMatrix = new Matrix4 ();
902
- }
903
-
904
- LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
905
- {
906
- constructor: LayoutGroup,
907
- fieldDefinitions: new FieldDefinitionArray ([
908
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
909
- new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
910
- new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
911
- new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
912
- new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
913
- new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
914
- new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
915
- new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
916
- new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
917
- new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
918
- ]),
919
- getTypeName: function ()
920
- {
921
- return "LayoutGroup";
922
- },
923
- getComponentName: function ()
924
- {
925
- return "Layout";
926
- },
927
- getContainerField: function ()
928
- {
929
- return "children";
930
- },
931
- initialize: function ()
932
- {
933
- X3DGroupingNode .prototype .initialize .call (this);
934
-
935
- this .viewport_ .addInterest ("set_viewport__", this);
936
- this .layout_ .addInterest ("set_layout__", this);
937
-
938
- this .set_viewport__ ();
939
- this .set_layout__ ();
940
- },
941
- set_viewport__: function ()
942
- {
943
- this .viewportNode = X3DCast (X3DConstants .X3DViewportNode, this .viewport_);
944
- },
945
- set_layout__: function ()
946
- {
947
- this .layoutNode = X3DCast (X3DConstants .X3DLayoutNode, this .layout_);
948
- },
949
- getBBox: function (bbox, shadow)
950
- {
951
- return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .getMatrix ());
952
- },
953
- getMatrix: function ()
954
- {
955
- try
956
- {
957
- if (this .layoutNode)
958
- this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
959
- else
960
- this .matrix .identity ();
961
- }
962
- catch (error)
963
- { }
964
-
965
- return this .matrix;
966
- },
967
- traverse: function (type, renderObject)
968
- {
969
- switch (type)
970
- {
971
- case TraverseType .COLLISION:
972
- {
973
- return;
974
- }
975
- default:
976
- {
977
- if (this .viewportNode)
978
- this .viewportNode .push ();
979
-
980
- if (this .layoutNode)
981
- {
982
- var modelViewMatrix = renderObject .getModelViewMatrix ();
983
-
984
- this .modelViewMatrix .assign (modelViewMatrix .get ());
985
- this .screenMatrix .assign (this .layoutNode .transform (type, renderObject));
986
-
987
- modelViewMatrix .pushMatrix (this .screenMatrix);
988
- renderObject .getLayouts () .push (this .layoutNode);
989
-
990
- X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
991
-
992
- renderObject .getLayouts () .pop ();
993
- modelViewMatrix .pop ();
994
- }
995
- else
996
- {
997
- X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
998
- }
999
-
1000
- if (this .viewportNode)
1001
- this .viewportNode .pop ();
1002
-
1003
- return;
1004
- }
1005
- }
1006
- },
1007
- });
1008
-
1009
- return LayoutGroup;
894
+ function LayoutGroup (executionContext)
895
+ {
896
+ X3DGroupingNode .call (this, executionContext);
897
+
898
+ this .addType (X3DConstants .LayoutGroup);
899
+
900
+ this .viewportNode = null;
901
+ this .layoutNode = null;
902
+ this .modelViewMatrix = new Matrix4 ();
903
+ this .screenMatrix = new Matrix4 ();
904
+ }
905
+
906
+ LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
907
+ {
908
+ constructor: LayoutGroup,
909
+ [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
910
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
911
+ new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
912
+ new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
913
+ new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
914
+ new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
915
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
916
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
917
+ new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
918
+ new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
919
+ new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
920
+ ]),
921
+ getTypeName: function ()
922
+ {
923
+ return "LayoutGroup";
924
+ },
925
+ getComponentName: function ()
926
+ {
927
+ return "Layout";
928
+ },
929
+ getContainerField: function ()
930
+ {
931
+ return "children";
932
+ },
933
+ initialize: function ()
934
+ {
935
+ X3DGroupingNode .prototype .initialize .call (this);
936
+
937
+ this ._viewport .addInterest ("set_viewport__", this);
938
+ this ._layout .addInterest ("set_layout__", this);
939
+
940
+ this .set_viewport__ ();
941
+ this .set_layout__ ();
942
+ },
943
+ set_viewport__: function ()
944
+ {
945
+ this .viewportNode = X3DCast (X3DConstants .X3DViewportNode, this ._viewport);
946
+ },
947
+ set_layout__: function ()
948
+ {
949
+ this .layoutNode = X3DCast (X3DConstants .X3DLayoutNode, this ._layout);
950
+ },
951
+ getBBox: function (bbox, shadow)
952
+ {
953
+ return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .getMatrix ());
954
+ },
955
+ getMatrix: function ()
956
+ {
957
+ try
958
+ {
959
+ if (this .layoutNode)
960
+ this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
961
+ else
962
+ this .matrix .identity ();
963
+ }
964
+ catch (error)
965
+ { }
966
+
967
+ return this .matrix;
968
+ },
969
+ traverse: function (type, renderObject)
970
+ {
971
+ switch (type)
972
+ {
973
+ case TraverseType .COLLISION:
974
+ {
975
+ return;
976
+ }
977
+ default:
978
+ {
979
+ if (this .viewportNode)
980
+ this .viewportNode .push ();
981
+
982
+ if (this .layoutNode)
983
+ {
984
+ var modelViewMatrix = renderObject .getModelViewMatrix ();
985
+
986
+ this .modelViewMatrix .assign (modelViewMatrix .get ());
987
+ this .screenMatrix .assign (this .layoutNode .transform (type, renderObject));
988
+
989
+ modelViewMatrix .pushMatrix (this .screenMatrix);
990
+ renderObject .getLayouts () .push (this .layoutNode);
991
+
992
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
993
+
994
+ renderObject .getLayouts () .pop ();
995
+ modelViewMatrix .pop ();
996
+ }
997
+ else
998
+ {
999
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1000
+ }
1001
+
1002
+ if (this .viewportNode)
1003
+ this .viewportNode .pop ();
1004
+
1005
+ return;
1006
+ }
1007
+ }
1008
+ },
1009
+ });
1010
+
1011
+ return LayoutGroup;
1010
1012
  });
1011
1013
 
1012
1014
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -1059,13 +1061,13 @@ function (Fields,
1059
1061
 
1060
1062
 
1061
1063
  define ('x_ite/Components/Layout/LayoutLayer',[
1062
- "x_ite/Fields",
1063
- "x_ite/Basic/X3DFieldDefinition",
1064
- "x_ite/Basic/FieldDefinitionArray",
1065
- "x_ite/Components/Layering/X3DLayerNode",
1066
- "x_ite/Components/Layout/LayoutGroup",
1067
- "x_ite/Components/Navigation/OrthoViewpoint",
1068
- "x_ite/Bits/X3DConstants",
1064
+ "x_ite/Fields",
1065
+ "x_ite/Base/X3DFieldDefinition",
1066
+ "x_ite/Base/FieldDefinitionArray",
1067
+ "x_ite/Components/Layering/X3DLayerNode",
1068
+ "x_ite/Components/Layout/LayoutGroup",
1069
+ "x_ite/Components/Navigation/OrthoViewpoint",
1070
+ "x_ite/Base/X3DConstants",
1069
1071
  ],
1070
1072
  function (Fields,
1071
1073
  X3DFieldDefinition,
@@ -1077,58 +1079,58 @@ function (Fields,
1077
1079
  {
1078
1080
  "use strict";
1079
1081
 
1080
- function LayoutLayer (executionContext)
1081
- {
1082
- X3DLayerNode .call (this,
1083
- executionContext,
1084
- new OrthoViewpoint (executionContext),
1085
- new LayoutGroup (executionContext));
1086
-
1087
- this .addType (X3DConstants .LayoutLayer);
1088
- }
1089
-
1090
- LayoutLayer .prototype = Object .assign (Object .create (X3DLayerNode .prototype),
1091
- {
1092
- constructor: LayoutLayer,
1093
- fieldDefinitions: new FieldDefinitionArray ([
1094
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1095
- new X3DFieldDefinition (X3DConstants .inputOutput, "isPickable", new Fields .SFBool (true)),
1096
- new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
1097
- new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
1098
- new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
1099
- new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
1100
- new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
1101
- ]),
1102
- getTypeName: function ()
1103
- {
1104
- return "LayoutLayer";
1105
- },
1106
- getComponentName: function ()
1107
- {
1108
- return "Layout";
1109
- },
1110
- getContainerField: function ()
1111
- {
1112
- return "layers";
1113
- },
1114
- initialize: function ()
1115
- {
1116
- X3DLayerNode .prototype .initialize .call (this);
1117
-
1118
- this .layout_ .addFieldInterest (this .getGroup () .layout_);
1119
- this .addChildren_ .addFieldInterest (this .getGroup () .addChildren_);
1120
- this .removeChildren_ .addFieldInterest (this .getGroup () .removeChildren_);
1121
- this .children_ .addFieldInterest (this .getGroup () .children_);
1122
-
1123
- this .getGroup () .layout_ = this .layout_;
1124
- this .getGroup () .children_ = this .children_;
1125
-
1126
- this .getGroup () .setPrivate (true);
1127
- this .getGroup () .setup ();
1128
- },
1129
- });
1130
-
1131
- return LayoutLayer;
1082
+ function LayoutLayer (executionContext)
1083
+ {
1084
+ X3DLayerNode .call (this,
1085
+ executionContext,
1086
+ new OrthoViewpoint (executionContext),
1087
+ new LayoutGroup (executionContext));
1088
+
1089
+ this .addType (X3DConstants .LayoutLayer);
1090
+ }
1091
+
1092
+ LayoutLayer .prototype = Object .assign (Object .create (X3DLayerNode .prototype),
1093
+ {
1094
+ constructor: LayoutLayer,
1095
+ [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
1096
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1097
+ new X3DFieldDefinition (X3DConstants .inputOutput, "isPickable", new Fields .SFBool (true)),
1098
+ new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
1099
+ new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
1100
+ new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
1101
+ new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
1102
+ new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
1103
+ ]),
1104
+ getTypeName: function ()
1105
+ {
1106
+ return "LayoutLayer";
1107
+ },
1108
+ getComponentName: function ()
1109
+ {
1110
+ return "Layout";
1111
+ },
1112
+ getContainerField: function ()
1113
+ {
1114
+ return "layers";
1115
+ },
1116
+ initialize: function ()
1117
+ {
1118
+ X3DLayerNode .prototype .initialize .call (this);
1119
+
1120
+ this ._layout .addFieldInterest (this .getGroup () ._layout);
1121
+ this ._addChildren .addFieldInterest (this .getGroup () ._addChildren);
1122
+ this ._removeChildren .addFieldInterest (this .getGroup () ._removeChildren);
1123
+ this ._children .addFieldInterest (this .getGroup () ._children);
1124
+
1125
+ this .getGroup () ._layout = this ._layout;
1126
+ this .getGroup () ._children = this ._children;
1127
+
1128
+ this .getGroup () .setPrivate (true);
1129
+ this .getGroup () .setup ();
1130
+ },
1131
+ });
1132
+
1133
+ return LayoutLayer;
1132
1134
  });
1133
1135
 
1134
1136
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -1181,17 +1183,17 @@ function (Fields,
1181
1183
 
1182
1184
 
1183
1185
  define ('x_ite/Browser/Layout/ScreenText',[
1184
- "jquery",
1185
- "x_ite/Browser/Text/X3DTextGeometry",
1186
- "x_ite/Browser/Text/TextAlignment",
1187
- "x_ite/Components/Texturing/PixelTexture",
1188
- "x_ite/Components/Rendering/X3DGeometryNode",
1189
- "standard/Math/Numbers/Vector3",
1190
- "standard/Math/Numbers/Vector4",
1191
- "standard/Math/Numbers/Matrix4",
1192
- "standard/Math/Geometry/Box3",
1193
- "standard/Math/Geometry/ViewVolume",
1194
- "standard/Math/Algorithm",
1186
+ "jquery",
1187
+ "x_ite/Browser/Text/X3DTextGeometry",
1188
+ "x_ite/Browser/Text/TextAlignment",
1189
+ "x_ite/Components/Texturing/PixelTexture",
1190
+ "x_ite/Components/Rendering/X3DGeometryNode",
1191
+ "standard/Math/Numbers/Vector3",
1192
+ "standard/Math/Numbers/Vector4",
1193
+ "standard/Math/Numbers/Matrix4",
1194
+ "standard/Math/Geometry/Box3",
1195
+ "standard/Math/Geometry/ViewVolume",
1196
+ "standard/Math/Algorithm",
1195
1197
  ],
1196
1198
  function ($,
1197
1199
  X3DTextGeometry,
@@ -1207,400 +1209,401 @@ function ($,
1207
1209
  {
1208
1210
  "use strict";
1209
1211
 
1210
- function ScreenText (text, fontStyle)
1211
- {
1212
- X3DTextGeometry .call (this, text, fontStyle);
1213
-
1214
- text .setTransparent (true);
1215
-
1216
- this .texCoordArray = X3DGeometryNode .createArray ();
1217
- this .textureNode = new PixelTexture (text .getExecutionContext ());
1218
- this .canvas = $("<canvas></canvas>");
1219
- this .context = this .canvas [0] .getContext ("2d");
1220
- this .matrix = new Matrix4 ();
1221
-
1222
- this .textureNode .textureProperties_ = fontStyle .getBrowser () .getScreenTextureProperties ();
1223
- this .textureNode .setup ();
1224
- }
1225
-
1226
- ScreenText .prototype = Object .assign (Object .create (X3DTextGeometry .prototype),
1227
- {
1228
- constructor: ScreenText,
1229
- modelViewMatrix: new Matrix4 (),
1230
- getTransparent: function ()
1231
- {
1232
- return true;
1233
- },
1234
- getMatrix: function ()
1235
- {
1236
- return this .matrix;
1237
- },
1238
- update: (function ()
1239
- {
1240
- var
1241
- min = new Vector3 (0, 0, 0),
1242
- max = new Vector3 (1, 1, 0);
1243
-
1244
- return function ()
1245
- {
1246
- X3DTextGeometry .prototype .update .call (this);
1247
-
1248
- var
1249
- fontStyle = this .getFontStyle (),
1250
- text = this .getText (),
1251
- offset = 1; // For antialiasing border on bottom and right side
1252
-
1253
- text .textBounds_ .x = Math .ceil (text .textBounds_ .x) + offset;
1254
- text .textBounds_ .y = Math .ceil (text .textBounds_ .y) + offset;
1255
-
1256
- this .getBBox () .getExtents (min, max);
1257
-
1258
- min .x -= offset;
1259
- min .y -= offset;
1260
-
1261
- switch (fontStyle .getMajorAlignment ())
1262
- {
1263
- case TextAlignment .BEGIN:
1264
- case TextAlignment .FIRST:
1265
- min .x = Math .floor (min .x);
1266
- max .x = min .x + text .textBounds_ .x;
1267
- break;
1268
- case TextAlignment .MIDDLE:
1269
- min .x = Math .round (min .x);
1270
- max .x = min .x + text .textBounds_ .x;
1271
- break;
1272
- case TextAlignment .END:
1273
- max .x = Math .ceil (max .x);
1274
- min .x = max .x - text .textBounds_ .x;
1275
- break;
1276
- }
1277
-
1278
- switch (fontStyle .getMinorAlignment ())
1279
- {
1280
- case TextAlignment .BEGIN:
1281
- case TextAlignment .FIRST:
1282
- max .y = Math .ceil (max .y);
1283
- min .y = max .y - text .textBounds_ .y;
1284
- break;
1285
- case TextAlignment .MIDDLE:
1286
- max .y = Math .round (max .y);
1287
- min .y = max .y - text .textBounds_ .y;
1288
- break;
1289
- case TextAlignment .END:
1290
- min .y = Math .floor (min .y);
1291
- max .y = min .y + text .textBounds_ .y;
1292
- break;
1293
- }
1294
-
1295
- text .origin_ .x = min .x;
1296
- text .origin_ .y = max .y;
1297
-
1298
- this .getBBox () .setExtents (min, max);
1299
- };
1300
- })(),
1301
- build: (function ()
1302
- {
1303
- var
1304
- min = new Vector3 (0, 0, 0),
1305
- max = new Vector3 (1, 1, 0);
1306
-
1307
- return function ()
1308
- {
1309
- var
1310
- fontStyle = this .getFontStyle (),
1311
- font = fontStyle .getFont ();
1312
-
1313
- if (! font)
1314
- return;
1315
-
1316
- var
1317
- text = this .getText (),
1318
- glyphs = this .getGlyphs (),
1319
- minorAlignment = this .getMinorAlignment (),
1320
- translations = this .getTranslations (),
1321
- charSpacings = this .getCharSpacings (),
1322
- size = fontStyle .getScale (), // in pixel
1323
- sizeUnitsPerEm = size / font .unitsPerEm,
1324
- texCoordArray = this .texCoordArray,
1325
- normalArray = text .getNormals (),
1326
- vertexArray = text .getVertices (),
1327
- canvas = this .canvas [0],
1328
- cx = this .context;
1329
-
1330
- // Set texCoord.
1331
-
1332
- texCoordArray .length = 0;
1333
-
1334
- text .getMultiTexCoords () .push (texCoordArray);
1335
-
1336
- // Triangle one and two.
1337
-
1338
- this .getBBox () .getExtents (min, max);
1339
-
1340
- normalArray .push (0, 0, 1,
1341
- 0, 0, 1,
1342
- 0, 0, 1,
1343
- 0, 0, 1,
1344
- 0, 0, 1,
1345
- 0, 0, 1);
1346
-
1347
- vertexArray .push (min .x, min .y, 0, 1,
1348
- max .x, min .y, 0, 1,
1349
- max .x, max .y, 0, 1,
1350
- min .x, min .y, 0, 1,
1351
- max .x, max .y, 0, 1,
1352
- min .x, max .y, 0, 1);
1353
-
1354
- // Generate texture.
1355
-
1356
- var
1357
- width = text .textBounds_ .x,
1358
- height = text .textBounds_ .y;
1359
-
1360
- // Scale canvas.
1361
-
1362
- canvas .width = Algorithm .nextPowerOfTwo (width),
1363
- canvas .height = Algorithm .nextPowerOfTwo (height);
1364
-
1365
- var
1366
- w = width / canvas .width,
1367
- h = height / canvas .height,
1368
- y = 1 - h;
1369
-
1370
- texCoordArray .push (0, y, 0, 1,
1371
- w, y, 0, 1,
1372
- w, 1, 0, 1,
1373
- 0, y, 0, 1,
1374
- w, 1, 0, 1,
1375
- 0, 1, 0, 1);
1376
-
1377
- // Setup canvas.
1378
-
1379
- cx .fillStyle = "rgba(255,255,255,0)";
1380
- cx .fillRect (0, 0, canvas .width, canvas .height);
1381
- cx .fillStyle = "rgba(255,255,255,1)";
1382
-
1383
- // Draw glyphs.
1384
-
1385
- if (fontStyle .horizontal_ .getValue ())
1386
- {
1387
- for (var l = 0, length = glyphs .length; l < length; ++ l)
1388
- {
1389
- var
1390
- line = glyphs [l],
1391
- charSpacing = charSpacings [l],
1392
- translation = translations [l],
1393
- advanceWidth = 0;
1394
-
1395
- for (var g = 0, gl = line .length; g < gl; ++ g)
1396
- {
1397
- var
1398
- glyph = line [g],
1399
- x = minorAlignment .x + translation .x + advanceWidth + g * charSpacing - min .x,
1400
- y = minorAlignment .y + translation .y - max .y;
1401
-
1402
- this .drawGlyph (cx, font, glyph, x, y, size);
1403
-
1404
- // Calculate advanceWidth.
1405
-
1406
- var kerning = 0;
1407
-
1408
- if (g + 1 < line .length)
1409
- kerning = font .getKerningValue (glyph, line [g + 1]);
1410
-
1411
- advanceWidth += (glyph .advanceWidth + kerning) * sizeUnitsPerEm;
1412
- }
1413
- }
1414
- }
1415
- else
1416
- {
1417
- var
1418
- leftToRight = fontStyle .leftToRight_ .getValue (),
1419
- topToBottom = fontStyle .topToBottom_ .getValue (),
1420
- first = leftToRight ? 0 : text .string_ .length - 1,
1421
- last = leftToRight ? text .string_ .length : -1,
1422
- step = leftToRight ? 1 : -1;
1423
-
1424
- for (var l = first, t = 0; l !== last; l += step)
1425
- {
1426
- var line = glyphs [l];
1427
-
1428
- var
1429
- numChars = line .length,
1430
- firstG = topToBottom ? 0 : numChars - 1,
1431
- lastG = topToBottom ? numChars : -1,
1432
- stepG = topToBottom ? 1 : -1;
1433
-
1434
- for (var g = firstG; g !== lastG; g += stepG, ++ t)
1435
- {
1436
- var translation = translations [t];
1437
-
1438
- var
1439
- x = minorAlignment .x + translation .x - min .x,
1440
- y = minorAlignment .y + translation .y - max .y;
1441
-
1442
- this .drawGlyph (cx, font, line [g], x, y, size);
1443
- }
1444
- }
1445
- }
1446
-
1447
- // Transfer texture data.
1448
-
1449
- var imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
1450
-
1451
- // If the cavas is to large imageData is null.
1452
- if (imageData)
1453
- this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data), true);
1454
- else
1455
- this .textureNode .clear ();
1456
- };
1457
- })(),
1458
- drawGlyph: function (cx, font, glyph, x, y, size)
1459
- {
1460
- //console .log (glyph .name, x, y);
1461
-
1462
- // Get curves for the current glyph.
1463
-
1464
- var
1465
- path = glyph .getPath (x, -y, size),
1466
- commands = path .commands;
1467
-
1468
- cx .beginPath ();
1469
-
1470
- for (var i = 0, cl = commands .length; i < cl; ++ i)
1471
- {
1472
- var command = commands [i];
1473
-
1474
- switch (command .type)
1475
- {
1476
- case "M": // Start
1477
- {
1478
- cx .moveTo (command .x, command .y);
1479
- continue;
1480
- }
1481
- case "Z": // End
1482
- {
1483
- cx .closePath ();
1484
- continue;
1485
- }
1486
- case "L": // Linear
1487
- {
1488
- cx .lineTo (command .x, command .y);
1489
- continue;
1490
- }
1491
- case "Q": // Cubic
1492
- {
1493
- cx .quadraticCurveTo (command .x1, command .y1, command .x, command .y);
1494
- continue;
1495
- }
1496
- case "C": // Bezier
1497
- {
1498
- cx .bezierCurveTo (command .x1, command .y1, command .x2, command .y2, command .x, command .y);
1499
- continue;
1500
- }
1501
- }
1502
- }
1503
-
1504
- if (path .fill)
1505
- cx .fill ();
1506
-
1507
- if (path .stroke)
1508
- {
1509
- cx .lineWidth = path .strokeWidth;
1510
- cx .stroke ();
1511
- }
1512
- },
1513
- getGlyphExtents: function (font, glyph, primitiveQuality, min, max)
1514
- {
1515
- var unitsPerEm = font .unitsPerEm;
1516
-
1517
- min .set ((glyph .xMin || 0) / unitsPerEm, (glyph .yMin || 0) / unitsPerEm, 0);
1518
- max .set ((glyph .xMax || 0) / unitsPerEm, (glyph .yMax || 0) / unitsPerEm, 0);
1519
- },
1520
- transform: (function ()
1521
- {
1522
- var
1523
- x = new Vector4 (0, 0, 0, 0),
1524
- y = new Vector4 (0, 0, 0, 0),
1525
- z = new Vector4 (0, 0, 0, 0),
1526
- screenPoint = new Vector3 (0, 0, 0),
1527
- screenMatrix = new Matrix4 (),
1528
- bbox = new Box3 ();
1529
-
1530
- return function (renderObject)
1531
- {
1532
- // throws an exception
1533
-
1534
- var
1535
- text = this .getText (),
1536
- modelViewMatrix = renderObject .getModelViewMatrix () .get (),
1537
- projectionMatrix = renderObject .getProjectionMatrix () .get (),
1538
- viewport = renderObject .getViewVolume () .getViewport ();
1539
-
1540
- // Determine screenMatrix.
1541
- // Same as in ScreenGroup.
1542
-
1543
- var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
1544
-
1545
- x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
1546
- y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
1547
- z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
1548
-
1549
- x .normalize () .multiply (screenScale .x);
1550
- y .normalize () .multiply (screenScale .y);
1551
- z .normalize () .multiply (screenScale .z);
1552
-
1553
- screenMatrix .set (x .x, x .y, x .z, x .w,
1554
- y .x, y .y, y .z, y .w,
1555
- z .x, z .y, z .z, z .w,
1556
- modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
1557
-
1558
- // Snap to whole pixel.
1559
-
1560
- ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
1561
-
1562
- screenPoint .x = Math .round (screenPoint .x);
1563
- screenPoint .y = Math .round (screenPoint .y);
1564
-
1565
- ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
1566
-
1567
- screenPoint .z = 0;
1568
- screenMatrix .translate (screenPoint);
1569
-
1570
- // Assign modelViewMatrix and calculate relative matrix.
1571
-
1572
- this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
1573
-
1574
- // Update Text bbox.
1575
-
1576
- bbox .assign (this .getBBox ()) .multRight (this .matrix);
1577
-
1578
- text .setBBox (bbox);
1579
- };
1580
- })(),
1581
- traverse: function (type, renderObject)
1582
- {
1583
- this .transform (renderObject);
1584
- },
1585
- display: function (gl, context)
1586
- {
1587
- Matrix4 .prototype .multLeft .call (context .modelViewMatrix, this .matrix);
1588
-
1589
- context .textureNode = this .textureNode;
1590
- },
1591
- transformLine: function (line)
1592
- {
1593
- // Apply sceen nodes transformation in place here.
1594
- return line .multLineMatrix (Matrix4 .inverse (this .matrix));
1595
- },
1596
- transformMatrix: function (matrix)
1597
- {
1598
- // Apply sceen nodes transformation in place here.
1599
- return matrix .multLeft (this .matrix);
1600
- },
1601
- });
1602
-
1603
- return ScreenText;
1212
+ function ScreenText (text, fontStyle)
1213
+ {
1214
+ X3DTextGeometry .call (this, text, fontStyle);
1215
+
1216
+ text .setTransparent (true);
1217
+
1218
+ this .texCoordArray = X3DGeometryNode .createArray ();
1219
+ this .textureNode = new PixelTexture (text .getExecutionContext ());
1220
+ this .canvas = $("<canvas></canvas>");
1221
+ this .context = this .canvas [0] .getContext ("2d");
1222
+ this .matrix = new Matrix4 ();
1223
+
1224
+ this .textureNode ._textureProperties = fontStyle .getBrowser () .getScreenTextureProperties ();
1225
+ this .textureNode .setup ();
1226
+ }
1227
+
1228
+ ScreenText .prototype = Object .assign (Object .create (X3DTextGeometry .prototype),
1229
+ {
1230
+ constructor: ScreenText,
1231
+ modelViewMatrix: new Matrix4 (),
1232
+ getTransparent: function ()
1233
+ {
1234
+ return true;
1235
+ },
1236
+ getMatrix: function ()
1237
+ {
1238
+ return this .matrix;
1239
+ },
1240
+ update: (function ()
1241
+ {
1242
+ const
1243
+ min = new Vector3 (0, 0, 0),
1244
+ max = new Vector3 (1, 1, 0);
1245
+
1246
+ return function ()
1247
+ {
1248
+ X3DTextGeometry .prototype .update .call (this);
1249
+
1250
+ const
1251
+ fontStyle = this .getFontStyle (),
1252
+ text = this .getText (),
1253
+ offset = 1; // For antialiasing border on bottom and right side
1254
+
1255
+ text ._textBounds .x = Math .ceil (text ._textBounds .x) + offset;
1256
+ text ._textBounds .y = Math .ceil (text ._textBounds .y) + offset;
1257
+
1258
+ this .getBBox () .getExtents (min, max);
1259
+
1260
+ min .x -= offset;
1261
+ min .y -= offset;
1262
+
1263
+ switch (fontStyle .getMajorAlignment ())
1264
+ {
1265
+ case TextAlignment .BEGIN:
1266
+ case TextAlignment .FIRST:
1267
+ min .x = Math .floor (min .x);
1268
+ max .x = min .x + text ._textBounds .x;
1269
+ break;
1270
+ case TextAlignment .MIDDLE:
1271
+ min .x = Math .round (min .x);
1272
+ max .x = min .x + text ._textBounds .x;
1273
+ break;
1274
+ case TextAlignment .END:
1275
+ max .x = Math .ceil (max .x);
1276
+ min .x = max .x - text ._textBounds .x;
1277
+ break;
1278
+ }
1279
+
1280
+ switch (fontStyle .getMinorAlignment ())
1281
+ {
1282
+ case TextAlignment .BEGIN:
1283
+ case TextAlignment .FIRST:
1284
+ max .y = Math .ceil (max .y);
1285
+ min .y = max .y - text ._textBounds .y;
1286
+ break;
1287
+ case TextAlignment .MIDDLE:
1288
+ max .y = Math .round (max .y);
1289
+ min .y = max .y - text ._textBounds .y;
1290
+ break;
1291
+ case TextAlignment .END:
1292
+ min .y = Math .floor (min .y);
1293
+ max .y = min .y + text ._textBounds .y;
1294
+ break;
1295
+ }
1296
+
1297
+ text ._origin .x = min .x;
1298
+ text ._origin .y = max .y;
1299
+
1300
+ this .getBBox () .setExtents (min, max);
1301
+ };
1302
+ })(),
1303
+ build: (function ()
1304
+ {
1305
+ const
1306
+ min = new Vector3 (0, 0, 0),
1307
+ max = new Vector3 (1, 1, 0);
1308
+
1309
+ return function ()
1310
+ {
1311
+ const
1312
+ fontStyle = this .getFontStyle (),
1313
+ font = fontStyle .getFont ();
1314
+
1315
+ if (! font)
1316
+ return;
1317
+
1318
+ const
1319
+ text = this .getText (),
1320
+ glyphs = this .getGlyphs (),
1321
+ minorAlignment = this .getMinorAlignment (),
1322
+ translations = this .getTranslations (),
1323
+ charSpacings = this .getCharSpacings (),
1324
+ size = fontStyle .getScale (), // in pixel
1325
+ sizeUnitsPerEm = size / font .unitsPerEm,
1326
+ texCoordArray = this .texCoordArray,
1327
+ normalArray = text .getNormals (),
1328
+ vertexArray = text .getVertices (),
1329
+ canvas = this .canvas [0],
1330
+ cx = this .context;
1331
+
1332
+ // Set texCoord.
1333
+
1334
+ texCoordArray .length = 0;
1335
+
1336
+ text .getMultiTexCoords () .push (texCoordArray);
1337
+
1338
+ // Triangle one and two.
1339
+
1340
+ this .getBBox () .getExtents (min, max);
1341
+
1342
+ normalArray .push (0, 0, 1,
1343
+ 0, 0, 1,
1344
+ 0, 0, 1,
1345
+ 0, 0, 1,
1346
+ 0, 0, 1,
1347
+ 0, 0, 1);
1348
+
1349
+ vertexArray .push (min .x, min .y, 0, 1,
1350
+ max .x, min .y, 0, 1,
1351
+ max .x, max .y, 0, 1,
1352
+ min .x, min .y, 0, 1,
1353
+ max .x, max .y, 0, 1,
1354
+ min .x, max .y, 0, 1);
1355
+
1356
+ // Generate texture.
1357
+
1358
+ const
1359
+ width = text ._textBounds .x,
1360
+ height = text ._textBounds .y;
1361
+
1362
+ // Scale canvas.
1363
+
1364
+ canvas .width = Algorithm .nextPowerOfTwo (width),
1365
+ canvas .height = Algorithm .nextPowerOfTwo (height);
1366
+
1367
+ const
1368
+ w = width / canvas .width,
1369
+ h = height / canvas .height,
1370
+ y = 1 - h;
1371
+
1372
+ texCoordArray .push (0, y, 0, 1,
1373
+ w, y, 0, 1,
1374
+ w, 1, 0, 1,
1375
+ 0, y, 0, 1,
1376
+ w, 1, 0, 1,
1377
+ 0, 1, 0, 1);
1378
+
1379
+ // Setup canvas.
1380
+
1381
+ cx .fillStyle = "rgba(255,255,255,0)";
1382
+ cx .fillRect (0, 0, canvas .width, canvas .height);
1383
+ cx .fillStyle = "rgba(255,255,255,1)";
1384
+
1385
+ // Draw glyphs.
1386
+
1387
+ if (fontStyle ._horizontal .getValue ())
1388
+ {
1389
+ for (let l = 0, length = glyphs .length; l < length; ++ l)
1390
+ {
1391
+ const
1392
+ line = glyphs [l],
1393
+ charSpacing = charSpacings [l],
1394
+ translation = translations [l];
1395
+
1396
+ let advanceWidth = 0;
1397
+
1398
+ for (let g = 0, gl = line .length; g < gl; ++ g)
1399
+ {
1400
+ const
1401
+ glyph = line [g],
1402
+ x = minorAlignment .x + translation .x + advanceWidth + g * charSpacing - min .x,
1403
+ y = minorAlignment .y + translation .y - max .y;
1404
+
1405
+ this .drawGlyph (cx, font, glyph, x, y, size);
1406
+
1407
+ // Calculate advanceWidth.
1408
+
1409
+ let kerning = 0;
1410
+
1411
+ if (g + 1 < line .length)
1412
+ kerning = font .getKerningValue (glyph, line [g + 1]);
1413
+
1414
+ advanceWidth += (glyph .advanceWidth + kerning) * sizeUnitsPerEm;
1415
+ }
1416
+ }
1417
+ }
1418
+ else
1419
+ {
1420
+ const
1421
+ leftToRight = fontStyle ._leftToRight .getValue (),
1422
+ topToBottom = fontStyle ._topToBottom .getValue (),
1423
+ first = leftToRight ? 0 : text ._string .length - 1,
1424
+ last = leftToRight ? text ._string .length : -1,
1425
+ step = leftToRight ? 1 : -1;
1426
+
1427
+ for (let l = first, t = 0; l !== last; l += step)
1428
+ {
1429
+ const line = glyphs [l];
1430
+
1431
+ const
1432
+ numChars = line .length,
1433
+ firstG = topToBottom ? 0 : numChars - 1,
1434
+ lastG = topToBottom ? numChars : -1,
1435
+ stepG = topToBottom ? 1 : -1;
1436
+
1437
+ for (let g = firstG; g !== lastG; g += stepG, ++ t)
1438
+ {
1439
+ const translation = translations [t];
1440
+
1441
+ const
1442
+ x = minorAlignment .x + translation .x - min .x,
1443
+ y = minorAlignment .y + translation .y - max .y;
1444
+
1445
+ this .drawGlyph (cx, font, line [g], x, y, size);
1446
+ }
1447
+ }
1448
+ }
1449
+
1450
+ // Transfer texture data.
1451
+
1452
+ const imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
1453
+
1454
+ // If the cavas is to large imageData is null.
1455
+ if (imageData)
1456
+ this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer), true);
1457
+ else
1458
+ this .textureNode .clear ();
1459
+ };
1460
+ })(),
1461
+ drawGlyph: function (cx, font, glyph, x, y, size)
1462
+ {
1463
+ //console .log (glyph .name, x, y);
1464
+
1465
+ // Get curves for the current glyph.
1466
+
1467
+ const
1468
+ path = glyph .getPath (x, -y, size),
1469
+ commands = path .commands;
1470
+
1471
+ cx .beginPath ();
1472
+
1473
+ for (let i = 0, cl = commands .length; i < cl; ++ i)
1474
+ {
1475
+ const command = commands [i];
1476
+
1477
+ switch (command .type)
1478
+ {
1479
+ case "M": // Start
1480
+ {
1481
+ cx .moveTo (command .x, command .y);
1482
+ continue;
1483
+ }
1484
+ case "Z": // End
1485
+ {
1486
+ cx .closePath ();
1487
+ continue;
1488
+ }
1489
+ case "L": // Linear
1490
+ {
1491
+ cx .lineTo (command .x, command .y);
1492
+ continue;
1493
+ }
1494
+ case "Q": // Cubic
1495
+ {
1496
+ cx .quadraticCurveTo (command .x1, command .y1, command .x, command .y);
1497
+ continue;
1498
+ }
1499
+ case "C": // Bezier
1500
+ {
1501
+ cx .bezierCurveTo (command .x1, command .y1, command .x2, command .y2, command .x, command .y);
1502
+ continue;
1503
+ }
1504
+ }
1505
+ }
1506
+
1507
+ if (path .fill)
1508
+ cx .fill ();
1509
+
1510
+ if (path .stroke)
1511
+ {
1512
+ cx .lineWidth = path .strokeWidth;
1513
+ cx .stroke ();
1514
+ }
1515
+ },
1516
+ getGlyphExtents: function (font, glyph, primitiveQuality, min, max)
1517
+ {
1518
+ const unitsPerEm = font .unitsPerEm;
1519
+
1520
+ min .set ((glyph .xMin || 0) / unitsPerEm, (glyph .yMin || 0) / unitsPerEm, 0);
1521
+ max .set ((glyph .xMax || 0) / unitsPerEm, (glyph .yMax || 0) / unitsPerEm, 0);
1522
+ },
1523
+ transform: (function ()
1524
+ {
1525
+ const
1526
+ x = new Vector4 (0, 0, 0, 0),
1527
+ y = new Vector4 (0, 0, 0, 0),
1528
+ z = new Vector4 (0, 0, 0, 0),
1529
+ screenPoint = new Vector3 (0, 0, 0),
1530
+ screenMatrix = new Matrix4 (),
1531
+ bbox = new Box3 ();
1532
+
1533
+ return function (renderObject)
1534
+ {
1535
+ // throws an exception
1536
+
1537
+ const
1538
+ text = this .getText (),
1539
+ modelViewMatrix = renderObject .getModelViewMatrix () .get (),
1540
+ projectionMatrix = renderObject .getProjectionMatrix () .get (),
1541
+ viewport = renderObject .getViewVolume () .getViewport ();
1542
+
1543
+ // Determine screenMatrix.
1544
+ // Same as in ScreenGroup.
1545
+
1546
+ const screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
1547
+
1548
+ x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
1549
+ y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
1550
+ z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
1551
+
1552
+ x .normalize () .multiply (screenScale .x);
1553
+ y .normalize () .multiply (screenScale .y);
1554
+ z .normalize () .multiply (screenScale .z);
1555
+
1556
+ screenMatrix .set (x .x, x .y, x .z, x .w,
1557
+ y .x, y .y, y .z, y .w,
1558
+ z .x, z .y, z .z, z .w,
1559
+ modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
1560
+
1561
+ // Snap to whole pixel.
1562
+
1563
+ ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
1564
+
1565
+ screenPoint .x = Math .round (screenPoint .x);
1566
+ screenPoint .y = Math .round (screenPoint .y);
1567
+
1568
+ ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
1569
+
1570
+ screenPoint .z = 0;
1571
+ screenMatrix .translate (screenPoint);
1572
+
1573
+ // Assign modelViewMatrix and calculate relative matrix.
1574
+
1575
+ this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
1576
+
1577
+ // Update Text bbox.
1578
+
1579
+ bbox .assign (this .getBBox ()) .multRight (this .matrix);
1580
+
1581
+ text .setBBox (bbox);
1582
+ };
1583
+ })(),
1584
+ traverse: function (type, renderObject)
1585
+ {
1586
+ this .transform (renderObject);
1587
+ },
1588
+ display: function (gl, context)
1589
+ {
1590
+ Matrix4 .prototype .multLeft .call (context .modelViewMatrix, this .matrix);
1591
+
1592
+ context .textureNode = this .textureNode;
1593
+ },
1594
+ transformLine: function (line)
1595
+ {
1596
+ // Apply sceen nodes transformation in place here.
1597
+ return line .multLineMatrix (Matrix4 .inverse (this .matrix));
1598
+ },
1599
+ transformMatrix: function (matrix)
1600
+ {
1601
+ // Apply sceen nodes transformation in place here.
1602
+ return matrix .multLeft (this .matrix);
1603
+ },
1604
+ });
1605
+
1606
+ return ScreenText;
1604
1607
  });
1605
1608
 
1606
1609
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -1653,12 +1656,12 @@ function ($,
1653
1656
 
1654
1657
 
1655
1658
  define ('x_ite/Components/Layout/ScreenFontStyle',[
1656
- "x_ite/Fields",
1657
- "x_ite/Basic/X3DFieldDefinition",
1658
- "x_ite/Basic/FieldDefinitionArray",
1659
- "x_ite/Components/Text/X3DFontStyleNode",
1660
- "x_ite/Browser/Layout/ScreenText",
1661
- "x_ite/Bits/X3DConstants",
1659
+ "x_ite/Fields",
1660
+ "x_ite/Base/X3DFieldDefinition",
1661
+ "x_ite/Base/FieldDefinitionArray",
1662
+ "x_ite/Components/Text/X3DFontStyleNode",
1663
+ "x_ite/Browser/Layout/ScreenText",
1664
+ "x_ite/Base/X3DConstants",
1662
1665
  ],
1663
1666
  function (Fields,
1664
1667
  X3DFieldDefinition,
@@ -1669,51 +1672,51 @@ function (Fields,
1669
1672
  {
1670
1673
  "use strict";
1671
1674
 
1672
- function ScreenFontStyle (executionContext)
1673
- {
1674
- X3DFontStyleNode .call (this, executionContext);
1675
-
1676
- this .addType (X3DConstants .ScreenFontStyle);
1677
- }
1678
-
1679
- ScreenFontStyle .prototype = Object .assign (Object .create (X3DFontStyleNode .prototype),
1680
- {
1681
- constructor: ScreenFontStyle,
1682
- fieldDefinitions: new FieldDefinitionArray ([
1683
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1684
- new X3DFieldDefinition (X3DConstants .initializeOnly, "language", new Fields .SFString ()),
1685
- new X3DFieldDefinition (X3DConstants .initializeOnly, "family", new Fields .MFString ("SERIF")),
1686
- new X3DFieldDefinition (X3DConstants .initializeOnly, "style", new Fields .SFString ("PLAIN")),
1687
- new X3DFieldDefinition (X3DConstants .initializeOnly, "pointSize", new Fields .SFFloat (12)),
1688
- new X3DFieldDefinition (X3DConstants .initializeOnly, "spacing", new Fields .SFFloat (1)),
1689
- new X3DFieldDefinition (X3DConstants .initializeOnly, "horizontal", new Fields .SFBool (true)),
1690
- new X3DFieldDefinition (X3DConstants .initializeOnly, "leftToRight", new Fields .SFBool (true)),
1691
- new X3DFieldDefinition (X3DConstants .initializeOnly, "topToBottom", new Fields .SFBool (true)),
1692
- new X3DFieldDefinition (X3DConstants .initializeOnly, "justify", new Fields .MFString ("BEGIN")),
1693
- ]),
1694
- getTypeName: function ()
1695
- {
1696
- return "ScreenFontStyle";
1697
- },
1698
- getComponentName: function ()
1699
- {
1700
- return "Layout";
1701
- },
1702
- getContainerField: function ()
1703
- {
1704
- return "fontStyle";
1705
- },
1706
- getTextGeometry: function (text)
1707
- {
1708
- return new ScreenText (text, this);
1709
- },
1710
- getScale: function ()
1711
- {
1712
- return this .pointSize_ .getValue () * this .getBrowser () .getPointSize ();
1713
- },
1714
- });
1715
-
1716
- return ScreenFontStyle;
1675
+ function ScreenFontStyle (executionContext)
1676
+ {
1677
+ X3DFontStyleNode .call (this, executionContext);
1678
+
1679
+ this .addType (X3DConstants .ScreenFontStyle);
1680
+ }
1681
+
1682
+ ScreenFontStyle .prototype = Object .assign (Object .create (X3DFontStyleNode .prototype),
1683
+ {
1684
+ constructor: ScreenFontStyle,
1685
+ [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
1686
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1687
+ new X3DFieldDefinition (X3DConstants .inputOutput, "language", new Fields .SFString ()),
1688
+ new X3DFieldDefinition (X3DConstants .inputOutput, "family", new Fields .MFString ("SERIF")),
1689
+ new X3DFieldDefinition (X3DConstants .inputOutput, "style", new Fields .SFString ("PLAIN")),
1690
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pointSize", new Fields .SFFloat (12)),
1691
+ new X3DFieldDefinition (X3DConstants .inputOutput, "spacing", new Fields .SFFloat (1)),
1692
+ new X3DFieldDefinition (X3DConstants .inputOutput, "horizontal", new Fields .SFBool (true)),
1693
+ new X3DFieldDefinition (X3DConstants .inputOutput, "leftToRight", new Fields .SFBool (true)),
1694
+ new X3DFieldDefinition (X3DConstants .inputOutput, "topToBottom", new Fields .SFBool (true)),
1695
+ new X3DFieldDefinition (X3DConstants .inputOutput, "justify", new Fields .MFString ("BEGIN")),
1696
+ ]),
1697
+ getTypeName: function ()
1698
+ {
1699
+ return "ScreenFontStyle";
1700
+ },
1701
+ getComponentName: function ()
1702
+ {
1703
+ return "Layout";
1704
+ },
1705
+ getContainerField: function ()
1706
+ {
1707
+ return "fontStyle";
1708
+ },
1709
+ getTextGeometry: function (text)
1710
+ {
1711
+ return new ScreenText (text, this);
1712
+ },
1713
+ getScale: function ()
1714
+ {
1715
+ return this ._pointSize .getValue () * this .getBrowser () .getPointSize ();
1716
+ },
1717
+ });
1718
+
1719
+ return ScreenFontStyle;
1717
1720
  });
1718
1721
 
1719
1722
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -1766,16 +1769,16 @@ function (Fields,
1766
1769
 
1767
1770
 
1768
1771
  define ('x_ite/Components/Layout/ScreenGroup',[
1769
- "x_ite/Fields",
1770
- "x_ite/Basic/X3DFieldDefinition",
1771
- "x_ite/Basic/FieldDefinitionArray",
1772
- "x_ite/Components/Grouping/X3DGroupingNode",
1773
- "x_ite/Bits/X3DConstants",
1774
- "x_ite/Bits/TraverseType",
1775
- "standard/Math/Numbers/Vector3",
1776
- "standard/Math/Numbers/Vector4",
1777
- "standard/Math/Numbers/Matrix4",
1778
- "standard/Math/Geometry/ViewVolume",
1772
+ "x_ite/Fields",
1773
+ "x_ite/Base/X3DFieldDefinition",
1774
+ "x_ite/Base/FieldDefinitionArray",
1775
+ "x_ite/Components/Grouping/X3DGroupingNode",
1776
+ "x_ite/Base/X3DConstants",
1777
+ "x_ite/Rendering/TraverseType",
1778
+ "standard/Math/Numbers/Vector3",
1779
+ "standard/Math/Numbers/Vector4",
1780
+ "standard/Math/Numbers/Matrix4",
1781
+ "standard/Math/Geometry/ViewVolume",
1779
1782
  ],
1780
1783
  function (Fields,
1781
1784
  X3DFieldDefinition,
@@ -1790,132 +1793,132 @@ function (Fields,
1790
1793
  {
1791
1794
  "use strict";
1792
1795
 
1793
- function ScreenGroup (executionContext)
1794
- {
1795
- X3DGroupingNode .call (this, executionContext);
1796
-
1797
- this .addType (X3DConstants .ScreenGroup);
1798
-
1799
- this .matrix = new Matrix4 ();
1800
- }
1801
-
1802
- ScreenGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
1803
- {
1804
- constructor: ScreenGroup,
1805
- fieldDefinitions: new FieldDefinitionArray ([
1806
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1807
- new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
1808
- new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
1809
- new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
1810
- new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
1811
- new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
1812
- new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
1813
- new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
1814
- ]),
1815
- getTypeName: function ()
1816
- {
1817
- return "ScreenGroup";
1818
- },
1819
- getComponentName: function ()
1820
- {
1821
- return "Layout";
1822
- },
1823
- getContainerField: function ()
1824
- {
1825
- return "children";
1826
- },
1827
- getBBox: function (bbox, shadow)
1828
- {
1829
- return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .matrix);
1830
- },
1831
- getMatrix: function ()
1832
- {
1833
- return this .matrix;
1834
- },
1835
- scale: (function ()
1836
- {
1837
- var
1838
- x = new Vector4 (0, 0, 0, 0),
1839
- y = new Vector4 (0, 0, 0, 0),
1840
- z = new Vector4 (0, 0, 0, 0),
1841
- screenPoint = new Vector3 (0, 0, 0),
1842
- screenMatrix = new Matrix4 ();
1843
-
1844
- return function (renderObject)
1845
- {
1846
- // throws domain error
1847
-
1848
- var
1849
- modelViewMatrix = renderObject .getModelViewMatrix () .get (),
1850
- projectionMatrix = renderObject .getProjectionMatrix () .get (),
1851
- viewport = renderObject .getViewVolume () .getViewport ();
1852
-
1853
- // Determine screenMatrix.
1854
- // Same as in ScreenText.
1855
-
1856
- var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
1857
-
1858
- x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
1859
- y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
1860
- z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
1861
-
1862
- x .normalize () .multiply (screenScale .x);
1863
- y .normalize () .multiply (screenScale .y);
1864
- z .normalize () .multiply (screenScale .z);
1865
-
1866
- screenMatrix .set (x .x, x .y, x .z, x .w,
1867
- y .x, y .y, y .z, y .w,
1868
- z .x, z .y, z .z, z .w,
1869
- modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
1870
-
1871
- // Snap to whole pixel.
1872
-
1873
- ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
1874
-
1875
- screenPoint .x = Math .round (screenPoint .x);
1876
- screenPoint .y = Math .round (screenPoint .y);
1877
-
1878
- ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
1879
-
1880
- screenPoint .z = 0;
1881
- screenMatrix .translate (screenPoint);
1882
-
1883
- // Assign relative matrix.
1884
-
1885
- this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
1886
- };
1887
- })(),
1888
- traverse: function (type, renderObject)
1889
- {
1890
- try
1891
- {
1892
- switch (type)
1893
- {
1894
- case TraverseType .CAMERA:
1895
- case TraverseType .PICKING:
1896
- case TraverseType .SHADOW: // ???
1897
- // No clone support for shadow, generated cube map texture and bbox
1898
- break;
1899
- default:
1900
- this .scale (renderObject);
1901
- break;
1902
- }
1903
-
1904
- var modelViewMatrix = renderObject .getModelViewMatrix ();
1905
-
1906
- modelViewMatrix .push ();
1907
- modelViewMatrix .multLeft (this .matrix);
1908
-
1909
- X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1910
-
1911
- modelViewMatrix .pop ();
1912
- }
1913
- catch (error)
1914
- { }
1915
- },
1916
- });
1917
-
1918
- return ScreenGroup;
1796
+ function ScreenGroup (executionContext)
1797
+ {
1798
+ X3DGroupingNode .call (this, executionContext);
1799
+
1800
+ this .addType (X3DConstants .ScreenGroup);
1801
+
1802
+ this .matrix = new Matrix4 ();
1803
+ }
1804
+
1805
+ ScreenGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
1806
+ {
1807
+ constructor: ScreenGroup,
1808
+ [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
1809
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1810
+ new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
1811
+ new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
1812
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
1813
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
1814
+ new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
1815
+ new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
1816
+ new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
1817
+ ]),
1818
+ getTypeName: function ()
1819
+ {
1820
+ return "ScreenGroup";
1821
+ },
1822
+ getComponentName: function ()
1823
+ {
1824
+ return "Layout";
1825
+ },
1826
+ getContainerField: function ()
1827
+ {
1828
+ return "children";
1829
+ },
1830
+ getBBox: function (bbox, shadow)
1831
+ {
1832
+ return this .getSubBBox (bbox, shadow) .multRight (this .matrix);
1833
+ },
1834
+ getMatrix: function ()
1835
+ {
1836
+ return this .matrix;
1837
+ },
1838
+ scale: (function ()
1839
+ {
1840
+ var
1841
+ x = new Vector4 (0, 0, 0, 0),
1842
+ y = new Vector4 (0, 0, 0, 0),
1843
+ z = new Vector4 (0, 0, 0, 0),
1844
+ screenPoint = new Vector3 (0, 0, 0),
1845
+ screenMatrix = new Matrix4 ();
1846
+
1847
+ return function (renderObject)
1848
+ {
1849
+ // throws domain error
1850
+
1851
+ var
1852
+ modelViewMatrix = renderObject .getModelViewMatrix () .get (),
1853
+ projectionMatrix = renderObject .getProjectionMatrix () .get (),
1854
+ viewport = renderObject .getViewVolume () .getViewport ();
1855
+
1856
+ // Determine screenMatrix.
1857
+ // Same as in ScreenText.
1858
+
1859
+ var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
1860
+
1861
+ x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
1862
+ y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
1863
+ z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
1864
+
1865
+ x .normalize () .multiply (screenScale .x);
1866
+ y .normalize () .multiply (screenScale .y);
1867
+ z .normalize () .multiply (screenScale .z);
1868
+
1869
+ screenMatrix .set (x .x, x .y, x .z, x .w,
1870
+ y .x, y .y, y .z, y .w,
1871
+ z .x, z .y, z .z, z .w,
1872
+ modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
1873
+
1874
+ // Snap to whole pixel.
1875
+
1876
+ ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
1877
+
1878
+ screenPoint .x = Math .round (screenPoint .x);
1879
+ screenPoint .y = Math .round (screenPoint .y);
1880
+
1881
+ ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
1882
+
1883
+ screenPoint .z = 0;
1884
+ screenMatrix .translate (screenPoint);
1885
+
1886
+ // Assign relative matrix.
1887
+
1888
+ this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
1889
+ };
1890
+ })(),
1891
+ traverse: function (type, renderObject)
1892
+ {
1893
+ try
1894
+ {
1895
+ switch (type)
1896
+ {
1897
+ case TraverseType .CAMERA:
1898
+ case TraverseType .PICKING:
1899
+ case TraverseType .SHADOW: // ???
1900
+ // No clone support for shadow, generated cube map texture and bbox
1901
+ break;
1902
+ default:
1903
+ this .scale (renderObject);
1904
+ break;
1905
+ }
1906
+
1907
+ var modelViewMatrix = renderObject .getModelViewMatrix ();
1908
+
1909
+ modelViewMatrix .push ();
1910
+ modelViewMatrix .multLeft (this .matrix);
1911
+
1912
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1913
+
1914
+ modelViewMatrix .pop ();
1915
+ }
1916
+ catch (error)
1917
+ { }
1918
+ },
1919
+ });
1920
+
1921
+ return ScreenGroup;
1919
1922
  });
1920
1923
 
1921
1924
  /*******************************************************************************
@@ -1967,14 +1970,14 @@ function (Fields,
1967
1970
 
1968
1971
 
1969
1972
  define (require .getComponentUrl ("layout"), [
1970
- "x_ite/Components",
1971
- "x_ite/Browser/Layout/X3DLayoutContext",
1972
- "x_ite/Components/Layout/Layout",
1973
- "x_ite/Components/Layout/LayoutGroup",
1974
- "x_ite/Components/Layout/LayoutLayer",
1975
- "x_ite/Components/Layout/ScreenFontStyle",
1976
- "x_ite/Components/Layout/ScreenGroup",
1977
- "x_ite/Components/Layout/X3DLayoutNode",
1973
+ "x_ite/Components",
1974
+ "x_ite/Browser/Layout/X3DLayoutContext",
1975
+ "x_ite/Components/Layout/Layout",
1976
+ "x_ite/Components/Layout/LayoutGroup",
1977
+ "x_ite/Components/Layout/LayoutLayer",
1978
+ "x_ite/Components/Layout/ScreenFontStyle",
1979
+ "x_ite/Components/Layout/ScreenGroup",
1980
+ "x_ite/Components/Layout/X3DLayoutNode",
1978
1981
  ],
1979
1982
  function (Components,
1980
1983
  X3DLayoutContext,
@@ -1987,24 +1990,23 @@ function (Components,
1987
1990
  {
1988
1991
  "use strict";
1989
1992
 
1990
- Components .addComponent ({
1991
- name: "Layout",
1992
- types:
1993
- {
1994
- Layout: Layout,
1995
- LayoutGroup: LayoutGroup,
1996
- LayoutLayer: LayoutLayer,
1997
- ScreenFontStyle: ScreenFontStyle,
1998
- ScreenGroup: ScreenGroup,
1999
- },
2000
- abstractTypes:
2001
- {
2002
- X3DLayoutNode: X3DLayoutNode,
2003
- },
2004
- browser: X3DLayoutContext,
2005
- });
1993
+ Components .addComponent ({
1994
+ name: "Layout",
1995
+ types:
1996
+ {
1997
+ Layout: Layout,
1998
+ LayoutGroup: LayoutGroup,
1999
+ LayoutLayer: LayoutLayer,
2000
+ ScreenFontStyle: ScreenFontStyle,
2001
+ ScreenGroup: ScreenGroup,
2002
+ },
2003
+ abstractTypes:
2004
+ {
2005
+ X3DLayoutNode: X3DLayoutNode,
2006
+ },
2007
+ browser: X3DLayoutContext,
2008
+ });
2006
2009
  });
2007
2010
 
2008
2011
 
2009
-
2010
2012
  })();