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.
- package/.vscode/settings.json +9 -2
- package/Makefile +27 -24
- package/build/bin/version-number.pl +1 -1
- package/build/bin/version.pl +3 -3
- package/build/parts/default.start.frag.js +2 -2
- package/build/parts/x_ite.end.frag.js +1 -2
- package/build/parts/x_ite.start.frag.js +4 -7
- package/dist/assets/components/annotation.js +312 -312
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +536 -538
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +797 -796
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +487 -472
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +486 -505
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +1221 -1271
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +2657 -2653
- package/dist/assets/components/geospatial.min.js +1 -2
- package/dist/assets/components/h-anim.js +640 -640
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +547 -549
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +1435 -1433
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +3942 -3964
- package/dist/assets/components/nurbs.min.js +1 -2
- package/dist/assets/components/particle-systems.js +3227 -3238
- package/dist/assets/components/particle-systems.min.js +1 -2
- package/dist/assets/components/picking.js +1704 -1712
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +553 -553
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +3255 -3265
- package/dist/assets/components/rigid-body-physics.min.js +1 -59
- package/dist/assets/components/scripting.js +544 -549
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +2716 -2651
- package/dist/assets/components/texturing-3d.min.js +131 -48
- package/dist/assets/components/volume-rendering.js +2815 -2804
- package/dist/assets/components/volume-rendering.min.js +1 -3
- package/dist/assets/components/x_ite.js +142 -144
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/Gouraud.fs +52 -15
- package/dist/assets/shaders/webgl1/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl1/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl1/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl1/PBR.fs +785 -0
- package/dist/assets/shaders/webgl1/PBR.vs +37 -0
- package/dist/assets/shaders/webgl1/Phong.fs +204 -32
- package/dist/assets/shaders/webgl1/Phong.vs +2 -3
- package/dist/assets/shaders/webgl1/{PointSet.fs → Point.fs} +59 -33
- package/dist/assets/shaders/webgl1/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl1/Unlit.fs +73 -18
- package/dist/assets/shaders/webgl1/Unlit.vs +2 -3
- package/dist/assets/shaders/webgl2/Gouraud.fs +31 -19
- package/dist/assets/shaders/webgl2/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl2/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl2/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl2/PBR.fs +913 -0
- package/dist/assets/shaders/webgl2/PBR.vs +37 -0
- package/dist/assets/shaders/webgl2/Phong.fs +196 -35
- package/dist/assets/shaders/webgl2/Phong.vs +2 -3
- package/dist/assets/shaders/webgl2/{PointSet.fs → Point.fs} +87 -86
- package/dist/assets/shaders/webgl2/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl2/Unlit.fs +55 -22
- package/dist/assets/shaders/webgl2/Unlit.vs +2 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +316 -328
- package/dist/x_ite.js +55663 -52034
- package/dist/x_ite.min.js +79 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Custom-Shaders.md +4 -3
- package/docs/_config.yml +1 -1
- package/docs/index.md +60 -7
- package/package.json +20 -20
- package/src/assets/components/annotation.js +24 -24
- package/src/assets/components/cad-geometry.js +24 -25
- package/src/assets/components/cube-map-texturing.js +18 -19
- package/src/assets/components/dis.js +22 -23
- package/src/assets/components/event-utilities.js +28 -29
- package/src/assets/components/geometry2d.js +28 -29
- package/src/assets/components/geospatial.js +34 -35
- package/src/assets/components/h-anim.js +22 -22
- package/src/assets/components/key-device-sensor.js +18 -19
- package/src/assets/components/layout.js +24 -25
- package/src/assets/components/nurbs.js +44 -45
- package/src/assets/components/particle-systems.js +36 -37
- package/src/assets/components/picking.js +25 -25
- package/src/assets/components/projective-texture-mapping.js +16 -16
- package/src/assets/components/rigid-body-physics.js +48 -48
- package/src/assets/components/scripting.js +14 -15
- package/src/assets/components/texturing-3d.js +26 -27
- package/src/assets/components/volume-rendering.js +46 -46
- package/src/assets/components/x_ite.js +12 -12
- package/src/assets/shaders/Types.glsl +230 -51
- package/src/assets/shaders/webgl1/Background.fs +2 -2
- package/src/assets/shaders/webgl1/Background.vs +4 -4
- package/src/assets/shaders/webgl1/Depth.fs +2 -2
- package/src/assets/shaders/webgl1/Depth.vs +3 -3
- package/src/assets/shaders/webgl1/Fallback.fs +15 -15
- package/src/assets/shaders/webgl1/Fallback.vs +5 -5
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +4 -4
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +3 -3
- package/src/assets/shaders/webgl1/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl1/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl1/Line.fs +74 -0
- package/src/assets/shaders/webgl1/Line.vs +63 -0
- package/src/assets/shaders/webgl1/PBR.fs +364 -0
- package/src/assets/shaders/webgl1/PBR.vs +46 -0
- package/src/assets/shaders/webgl1/Phong.fs +207 -84
- package/src/assets/shaders/webgl1/Phong.vs +17 -18
- package/src/assets/shaders/webgl1/Point.fs +88 -0
- package/src/assets/shaders/webgl1/Point.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +53 -28
- package/src/assets/shaders/webgl1/Unlit.vs +17 -18
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl1/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +17 -17
- package/src/assets/shaders/webgl1/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl1/include/Normal.glsl +44 -0
- package/src/assets/shaders/webgl1/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl1/include/Perlin.glsl +19 -19
- package/src/assets/shaders/webgl1/include/Shadow.glsl +212 -212
- package/src/assets/shaders/webgl1/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl1/include/Texture.glsl +444 -393
- package/src/assets/shaders/webgl2/Background.fs +2 -2
- package/src/assets/shaders/webgl2/Background.vs +4 -4
- package/src/assets/shaders/webgl2/Depth.fs +2 -2
- package/src/assets/shaders/webgl2/Depth.vs +3 -3
- package/src/assets/shaders/webgl2/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl2/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl2/Line.fs +73 -0
- package/src/assets/shaders/webgl2/Line.vs +64 -0
- package/src/assets/shaders/webgl2/PBR.fs +370 -0
- package/src/assets/shaders/webgl2/PBR.vs +48 -0
- package/src/assets/shaders/webgl2/Phong.fs +219 -84
- package/src/assets/shaders/webgl2/Phong.vs +17 -18
- package/src/assets/shaders/webgl2/Point.fs +87 -0
- package/src/assets/shaders/webgl2/Point.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +56 -28
- package/src/assets/shaders/webgl2/Unlit.vs +17 -18
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl2/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +34 -34
- package/src/assets/shaders/webgl2/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl2/include/Normal.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl2/include/Perlin.glsl +19 -20
- package/src/assets/shaders/webgl2/include/Shadow.glsl +226 -226
- package/src/assets/shaders/webgl2/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +557 -537
- package/src/bookmarks.js +92 -92
- package/src/examples.js +147 -147
- package/src/lib/ammojs/AmmoJS.js +2 -2
- package/src/lib/ammojs/Makefile +14 -15
- package/src/lib/jquery.fullscreen-min.js +2 -2
- package/src/lib/nurbs/extras/sample.js +215 -215
- package/src/lib/nurbs/nurbs.js +326 -326
- package/src/lib/nurbs/src/evaluate.js +405 -405
- package/src/lib/nurbs/src/numerical-derivative.js +48 -48
- package/src/lib/nurbs/src/support.js +143 -143
- package/src/lib/nurbs/src/transform.js +70 -70
- package/src/lib/nurbs/src/utils/accessor-preamble.js +23 -23
- package/src/lib/nurbs/src/utils/bisection-search.js +18 -18
- package/src/lib/nurbs/src/utils/cache-key.js +49 -50
- package/src/lib/nurbs/src/utils/create-accessors.js +101 -101
- package/src/lib/nurbs/src/utils/infer-type.js +43 -43
- package/src/lib/nurbs/src/utils/is-array-like.js +5 -5
- package/src/lib/nurbs/src/utils/is-ndarray-like.js +11 -11
- package/src/lib/nurbs/src/utils/is-ndarray.js +13 -13
- package/src/lib/nurbs/src/utils/ndloop.js +18 -18
- package/src/lib/nurbs/src/utils/size-getter.js +15 -15
- package/src/lib/nurbs/src/utils/variable.js +25 -25
- package/src/lib/opentype.js/bin/ot +27 -27
- package/src/lib/opentype.js/dist/opentype.js +5 -5
- package/src/lib/opentype.js/font-inspector.html +1 -1
- package/src/lib/opentype.js/site.css +1 -3
- package/src/locale/gettext.js +73 -73
- package/src/spinner.css +40 -43
- package/src/standard/Geospatial/Geodetic.js +195 -195
- package/src/standard/Geospatial/ReferenceEllipsoids.js +43 -43
- package/src/standard/Geospatial/UniversalTransverseMercator.js +159 -159
- package/src/standard/Math/Algorithm.js +199 -187
- package/src/standard/Math/Algorithms/Bezier.js +80 -80
- package/src/standard/Math/Algorithms/MergeSort.js +49 -49
- package/src/standard/Math/Algorithms/PartialSort.js +36 -36
- package/src/standard/Math/Algorithms/QuickSort.js +51 -51
- package/src/standard/Math/Algorithms/SAT.js +62 -62
- package/src/standard/Math/Algorithms/eigendecomposition.js +141 -141
- package/src/standard/Math/Geometry/Box2.js +205 -205
- package/src/standard/Math/Geometry/Box3.js +624 -624
- package/src/standard/Math/Geometry/Camera.js +68 -68
- package/src/standard/Math/Geometry/Cylinder3.js +112 -112
- package/src/standard/Math/Geometry/Line3.js +188 -153
- package/src/standard/Math/Geometry/Plane3.js +120 -120
- package/src/standard/Math/Geometry/Sphere3.js +148 -148
- package/src/standard/Math/Geometry/Spheroid3.js +38 -38
- package/src/standard/Math/Geometry/Triangle2.js +19 -19
- package/src/standard/Math/Geometry/Triangle3.js +148 -148
- package/src/standard/Math/Geometry/ViewVolume.js +359 -359
- package/src/standard/Math/Numbers/Color3.js +219 -214
- package/src/standard/Math/Numbers/Color4.js +148 -142
- package/src/standard/Math/Numbers/Complex.js +139 -139
- package/src/standard/Math/Numbers/Matrix2.js +193 -193
- package/src/standard/Math/Numbers/Matrix3.js +679 -679
- package/src/standard/Math/Numbers/Matrix4.js +883 -883
- package/src/standard/Math/Numbers/Quaternion.js +496 -496
- package/src/standard/Math/Numbers/Rotation4.js +421 -415
- package/src/standard/Math/Numbers/Vector2.js +220 -220
- package/src/standard/Math/Numbers/Vector3.js +280 -280
- package/src/standard/Math/Numbers/Vector4.js +296 -296
- package/src/standard/Math/Utility/BVH.js +303 -303
- package/src/standard/Math/Utility/MatrixStack.js +64 -64
- package/src/standard/Networking/BinaryTransport.js +67 -67
- package/src/standard/Time/MicroTime.js +22 -22
- package/src/standard/Utility/DataStorage.js +85 -81
- package/src/standard/Utility/MapUtilities.js +14 -1
- package/src/standard/Utility/ObjectCache.js +24 -24
- package/src/standard/Utility/Shuffle.js +13 -13
- package/src/tests.js +355 -384
- package/src/x_ite/Base/Events.js +64 -55
- package/src/x_ite/{Basic/X3DArrayField.js → Base/FieldArray.js} +19 -12
- package/src/x_ite/Base/FieldDefinitionArray.js +75 -0
- package/src/x_ite/{Basic/FieldDefinitionArray.js → Base/X3DArrayField.js} +35 -59
- package/src/x_ite/Base/X3DBaseNode.js +588 -0
- package/src/x_ite/{Bits → Base}/X3DCast.js +23 -22
- package/src/x_ite/Base/X3DChildObject.js +68 -62
- package/src/x_ite/{Bits → Base}/X3DConstants.js +85 -85
- package/src/x_ite/Base/X3DEventObject.js +73 -68
- package/src/x_ite/Base/X3DField.js +450 -0
- package/src/x_ite/Base/X3DFieldDefinition.js +78 -0
- package/src/x_ite/Base/X3DInfoArray.js +291 -0
- package/src/x_ite/Base/X3DObject.js +152 -109
- package/src/x_ite/Base/X3DObjectArrayField.js +573 -0
- package/src/x_ite/Base/X3DTypedArrayField.js +866 -0
- package/src/x_ite/Browser/Core/BrowserOptions.js +376 -394
- package/src/x_ite/Browser/Core/BrowserProperties.js +38 -38
- package/src/x_ite/Browser/Core/BrowserTimings.js +173 -172
- package/src/x_ite/Browser/Core/ContextMenu.js +547 -551
- package/src/x_ite/Browser/Core/Notification.js +57 -56
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +8 -8
- package/src/x_ite/Browser/Core/RenderingProperties.js +55 -55
- package/src/x_ite/Browser/Core/Shading.js +10 -10
- package/src/x_ite/Browser/Core/TextureQuality.js +8 -8
- package/src/x_ite/Browser/Core/X3DCoreContext.js +746 -724
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +33 -25
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +23 -23
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +127 -127
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +56 -55
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +116 -116
- package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +59 -59
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +80 -77
- package/src/x_ite/Browser/Geometry3D/BoxOptions.js +70 -70
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +26 -26
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +27 -27
- package/src/x_ite/Browser/Geometry3D/IcoSphere.js +357 -357
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +61 -61
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +243 -241
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +37 -34
- package/src/x_ite/Browser/Geospatial/Geocentric.js +27 -27
- package/src/x_ite/Browser/Geospatial/Geospatial.js +157 -156
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +38 -33
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +128 -130
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +39 -41
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +54 -56
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +54 -56
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +44 -41
- package/src/x_ite/Browser/Layering/X3DLayeringContext.js +20 -18
- package/src/x_ite/Browser/Layout/ScreenText.js +406 -405
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +36 -30
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +54 -50
- package/src/x_ite/Browser/NURBS/NURBS.js +417 -417
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +753 -753
- package/src/x_ite/Browser/Navigation/FlyViewer.js +39 -39
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +461 -461
- package/src/x_ite/Browser/Navigation/NoneViewer.js +18 -18
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +193 -193
- package/src/x_ite/Browser/Navigation/WalkViewer.js +61 -61
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +709 -710
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +188 -182
- package/src/x_ite/Browser/Navigation/X3DViewer.js +160 -160
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +152 -143
- package/src/x_ite/Browser/Networking/urls.js +31 -31
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +17 -13
- package/src/x_ite/Browser/Picking/IntersectionType.js +7 -7
- package/src/x_ite/Browser/Picking/MatchCriterion.js +8 -8
- package/src/x_ite/Browser/Picking/SortOrder.js +9 -9
- package/src/x_ite/Browser/Picking/VolumePicker.js +138 -138
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +80 -69
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +208 -209
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +34 -34
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +269 -263
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +132 -119
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +14 -14
- package/src/x_ite/Browser/Scripting/X3DScriptingContext.js +20 -19
- package/src/x_ite/Browser/Scripting/evaluate.js +7 -7
- package/src/x_ite/Browser/Shaders/Shader.js +152 -159
- package/src/x_ite/Browser/Shaders/ShaderSource.js +81 -63
- package/src/x_ite/Browser/Shaders/ShaderTest.js +97 -98
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +256 -249
- package/src/x_ite/Browser/Shape/AlphaMode.js +9 -9
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +111 -89
- package/src/x_ite/Browser/Sound/X3DSoundContext.js +11 -11
- package/src/x_ite/Browser/Text/PolygonText.js +319 -319
- package/src/x_ite/Browser/Text/TextAlignment.js +9 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +72 -65
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +506 -506
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +8 -8
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +25 -25
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +9 -9
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +17 -17
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +259 -224
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1066 -1066
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +641 -630
- package/src/x_ite/Browser/Time/X3DTimeContext.js +54 -37
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +55 -55
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +5 -5
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +52 -41
- package/src/x_ite/Browser/X3DBrowser.js +819 -755
- package/src/x_ite/Browser/X3DBrowserContext.js +253 -220
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +43 -43
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +38 -38
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +48 -48
- package/src/x_ite/Components/Annotation/IconAnnotation.js +46 -46
- package/src/x_ite/Components/Annotation/TextAnnotation.js +39 -39
- package/src/x_ite/Components/Annotation/URLAnnotation.js +38 -38
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +16 -16
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +41 -41
- package/src/x_ite/Components/CADGeometry/CADFace.js +189 -189
- package/src/x_ite/Components/CADGeometry/CADLayer.js +38 -38
- package/src/x_ite/Components/CADGeometry/CADPart.js +46 -46
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +67 -67
- package/src/x_ite/Components/CADGeometry/QuadSet.js +64 -63
- package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +13 -15
- package/src/x_ite/Components/Core/MetadataBoolean.js +38 -40
- package/src/x_ite/Components/Core/MetadataDouble.js +38 -40
- package/src/x_ite/Components/Core/MetadataFloat.js +38 -40
- package/src/x_ite/Components/Core/MetadataInteger.js +38 -40
- package/src/x_ite/Components/Core/MetadataSet.js +38 -40
- package/src/x_ite/Components/Core/MetadataString.js +38 -40
- package/src/x_ite/Components/Core/WorldInfo.js +42 -42
- package/src/x_ite/Components/Core/X3DBindableNode.js +20 -20
- package/src/x_ite/Components/Core/X3DChildNode.js +38 -40
- package/src/x_ite/Components/Core/X3DInfoNode.js +13 -15
- package/src/x_ite/Components/Core/X3DMetadataObject.js +11 -13
- package/src/x_ite/Components/Core/X3DNode.js +795 -14
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +585 -479
- package/src/x_ite/Components/Core/X3DSensorNode.js +13 -15
- package/src/x_ite/Components/Core.js +39 -39
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +193 -200
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +209 -206
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +213 -219
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +69 -60
- package/src/x_ite/Components/DIS/DISEntityManager.js +38 -40
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +59 -41
- package/src/x_ite/Components/DIS/EspduTransform.js +128 -128
- package/src/x_ite/Components/DIS/ReceiverPdu.js +68 -68
- package/src/x_ite/Components/DIS/SignalPdu.js +68 -68
- package/src/x_ite/Components/DIS/TransmitterPdu.js +84 -84
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +87 -89
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +59 -59
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +78 -78
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +56 -56
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +86 -88
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +582 -589
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +105 -105
- package/src/x_ite/Components/EnvironmentalEffects.js +25 -25
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +229 -229
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +256 -256
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +114 -114
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +71 -71
- package/src/x_ite/Components/EnvironmentalSensor.js +19 -19
- package/src/x_ite/Components/EventUtilities/BooleanFilter.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanToggle.js +43 -45
- package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +42 -44
- package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/TimeTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +92 -94
- package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +13 -15
- package/src/x_ite/Components/Followers/ColorChaser.js +78 -78
- package/src/x_ite/Components/Followers/ColorDamper.js +78 -78
- package/src/x_ite/Components/Followers/CoordinateChaser.js +46 -46
- package/src/x_ite/Components/Followers/CoordinateDamper.js +48 -48
- package/src/x_ite/Components/Followers/OrientationChaser.js +64 -64
- package/src/x_ite/Components/Followers/OrientationDamper.js +61 -61
- package/src/x_ite/Components/Followers/PositionChaser.js +42 -42
- package/src/x_ite/Components/Followers/PositionChaser2D.js +42 -42
- package/src/x_ite/Components/Followers/PositionDamper.js +44 -44
- package/src/x_ite/Components/Followers/PositionDamper2D.js +44 -44
- package/src/x_ite/Components/Followers/ScalarChaser.js +70 -70
- package/src/x_ite/Components/Followers/ScalarDamper.js +60 -60
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +46 -46
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +48 -48
- package/src/x_ite/Components/Followers/X3DChaserNode.js +194 -194
- package/src/x_ite/Components/Followers/X3DDamperNode.js +120 -120
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +83 -83
- package/src/x_ite/Components/Followers.js +45 -45
- package/src/x_ite/Components/Geometry2D/Arc2D.js +99 -113
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +164 -166
- package/src/x_ite/Components/Geometry2D/Circle2D.js +59 -67
- package/src/x_ite/Components/Geometry2D/Disk2D.js +207 -211
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +43 -52
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +43 -60
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +76 -73
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +69 -71
- package/src/x_ite/Components/Geometry3D/Box.js +90 -86
- package/src/x_ite/Components/Geometry3D/Cone.js +185 -187
- package/src/x_ite/Components/Geometry3D/Cylinder.js +246 -246
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +383 -384
- package/src/x_ite/Components/Geometry3D/Extrusion.js +653 -647
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +437 -445
- package/src/x_ite/Components/Geometry3D/Sphere.js +72 -74
- package/src/x_ite/Components/Geometry3D.js +25 -25
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +189 -191
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +381 -383
- package/src/x_ite/Components/Geospatial/GeoLOD.js +397 -397
- package/src/x_ite/Components/Geospatial/GeoLocation.js +56 -56
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +54 -36
- package/src/x_ite/Components/Geospatial/GeoOrigin.js +50 -52
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +81 -83
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +95 -97
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +77 -79
- package/src/x_ite/Components/Geospatial/GeoTransform.js +79 -79
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +278 -278
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +216 -218
- package/src/x_ite/Components/Grouping/Group.js +37 -37
- package/src/x_ite/Components/Grouping/StaticGroup.js +245 -245
- package/src/x_ite/Components/Grouping/Switch.js +234 -234
- package/src/x_ite/Components/Grouping/Transform.js +42 -42
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +93 -93
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +654 -649
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +99 -99
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +31 -31
- package/src/x_ite/Components/Grouping.js +27 -27
- package/src/x_ite/Components/HAnim/HAnimDisplacer.js +35 -35
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +293 -293
- package/src/x_ite/Components/HAnim/HAnimJoint.js +137 -137
- package/src/x_ite/Components/HAnim/HAnimMotion.js +50 -50
- package/src/x_ite/Components/HAnim/HAnimSegment.js +44 -44
- package/src/x_ite/Components/HAnim/HAnimSite.js +43 -43
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +61 -63
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +60 -62
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +79 -80
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +96 -93
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +70 -70
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +57 -59
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +53 -55
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +77 -79
- package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +66 -66
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +67 -69
- package/src/x_ite/Components/Interpolation.js +39 -39
- package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +304 -306
- package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +102 -104
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +51 -51
- package/src/x_ite/Components/Layering/Layer.js +50 -50
- package/src/x_ite/Components/Layering/LayerSet.js +160 -161
- package/src/x_ite/Components/Layering/Viewport.js +118 -118
- package/src/x_ite/Components/Layering/X3DLayerNode.js +322 -322
- package/src/x_ite/Components/Layering/X3DViewportNode.js +13 -13
- package/src/x_ite/Components/Layering.js +21 -21
- package/src/x_ite/Components/Layout/Layout.js +576 -578
- package/src/x_ite/Components/Layout/LayoutGroup.js +126 -126
- package/src/x_ite/Components/Layout/LayoutLayer.js +53 -53
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +48 -48
- package/src/x_ite/Components/Layout/ScreenGroup.js +136 -136
- package/src/x_ite/Components/Layout/X3DLayoutNode.js +12 -14
- package/src/x_ite/Components/Lighting/DirectionalLight.js +239 -246
- package/src/x_ite/Components/Lighting/PointLight.js +296 -303
- package/src/x_ite/Components/Lighting/SpotLight.js +321 -316
- package/src/x_ite/Components/Lighting/X3DLightNode.js +153 -153
- package/src/x_ite/Components/Lighting.js +19 -19
- package/src/x_ite/Components/NURBS/Contour2D.js +81 -83
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +100 -102
- package/src/x_ite/Components/NURBS/CoordinateDouble.js +32 -34
- package/src/x_ite/Components/NURBS/NurbsCurve.js +167 -169
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +149 -149
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +166 -166
- package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +45 -47
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +154 -154
- package/src/x_ite/Components/NURBS/NurbsSet.js +125 -125
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +128 -130
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +93 -93
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +88 -90
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +13 -15
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +339 -339
- package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +18 -20
- package/src/x_ite/Components/Navigation/Billboard.js +132 -132
- package/src/x_ite/Components/Navigation/Collision.js +116 -116
- package/src/x_ite/Components/Navigation/LOD.js +308 -308
- package/src/x_ite/Components/Navigation/NavigationInfo.js +279 -285
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +258 -258
- package/src/x_ite/Components/Navigation/Viewpoint.js +137 -137
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +169 -171
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +450 -453
- package/src/x_ite/Components/Navigation.js +27 -27
- package/src/x_ite/Components/Networking/Anchor.js +140 -128
- package/src/x_ite/Components/Networking/Inline.js +156 -197
- package/src/x_ite/Components/Networking/LoadSensor.js +193 -195
- package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +13 -15
- package/src/x_ite/Components/Networking/X3DUrlObject.js +170 -116
- package/src/x_ite/Components/Networking.js +21 -21
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +62 -64
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +81 -83
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +59 -61
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +42 -44
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +1433 -1433
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +77 -79
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +196 -196
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +195 -195
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +250 -250
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +69 -71
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +346 -346
- package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +15 -17
- package/src/x_ite/Components/Picking/LinePickSensor.js +284 -286
- package/src/x_ite/Components/Picking/PickableGroup.js +155 -155
- package/src/x_ite/Components/Picking/PointPickSensor.js +272 -272
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +207 -209
- package/src/x_ite/Components/Picking/VolumePickSensor.js +182 -184
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +382 -382
- package/src/x_ite/Components/Picking/X3DPickableObject.js +28 -30
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +257 -259
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +245 -247
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +173 -175
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +61 -63
- package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +14 -16
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +57 -59
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +19 -21
- package/src/x_ite/Components/PointingDeviceSensor.js +25 -25
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +191 -191
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +162 -162
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +156 -156
- package/src/x_ite/Components/Rendering/ClipPlane.js +120 -120
- package/src/x_ite/Components/Rendering/Color.js +112 -112
- package/src/x_ite/Components/Rendering/ColorRGBA.js +114 -114
- package/src/x_ite/Components/Rendering/Coordinate.js +33 -35
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +236 -243
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +102 -102
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +55 -55
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +110 -110
- package/src/x_ite/Components/Rendering/LineSet.js +172 -179
- package/src/x_ite/Components/Rendering/Normal.js +100 -100
- package/src/x_ite/Components/Rendering/PointSet.js +142 -154
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +73 -73
- package/src/x_ite/Components/Rendering/TriangleSet.js +51 -53
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +76 -76
- package/src/x_ite/Components/Rendering/X3DColorNode.js +25 -27
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +318 -321
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +132 -132
- package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1190 -1171
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +231 -189
- package/src/x_ite/Components/Rendering/X3DNormalNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +267 -0
- package/src/x_ite/Components/Rendering.js +53 -53
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +149 -149
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +229 -229
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +465 -465
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +152 -154
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +223 -223
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +117 -117
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +54 -56
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +245 -245
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +68 -70
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +453 -453
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +326 -326
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +171 -171
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +169 -169
- package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +50 -52
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +101 -101
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +15 -15
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +161 -163
- package/src/x_ite/Components/Scripting/Script.js +506 -510
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +15 -15
- package/src/x_ite/Components/Shaders/ComposedShader.js +215 -178
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +84 -83
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +74 -74
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +73 -73
- package/src/x_ite/Components/Shaders/PackagedShader.js +52 -49
- package/src/x_ite/Components/Shaders/ProgramShader.js +36 -38
- package/src/x_ite/Components/Shaders/ShaderPart.js +135 -147
- package/src/x_ite/Components/Shaders/ShaderProgram.js +49 -46
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1259 -1255
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +83 -93
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +13 -15
- package/src/x_ite/Components/Shaders.js +33 -33
- package/src/x_ite/{Execution/ExportedNode.js → Components/Shape/AcousticProperties.js} +41 -71
- package/src/x_ite/Components/Shape/Appearance.js +331 -318
- package/src/x_ite/Components/Shape/FillProperties.js +101 -98
- package/src/x_ite/Components/Shape/LineProperties.js +71 -69
- package/src/x_ite/Components/Shape/Material.js +344 -116
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +310 -0
- package/src/x_ite/Components/Shape/PointProperties.js +79 -95
- package/src/x_ite/Components/Shape/Shape.js +178 -181
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +200 -200
- package/src/x_ite/Components/Shape/UnlitMaterial.js +93 -46
- package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +13 -15
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +158 -54
- package/src/x_ite/Components/Shape/X3DShapeNode.js +147 -147
- package/src/x_ite/Components/Shape.js +43 -37
- package/src/x_ite/Components/Sound/AudioClip.js +135 -140
- package/src/x_ite/Components/Sound/Sound.js +246 -246
- package/src/x_ite/Components/Sound/X3DSoundNode.js +13 -15
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +165 -179
- package/src/x_ite/Components/Sound.js +19 -19
- package/src/x_ite/Components/Text/FontStyle.js +49 -49
- package/src/x_ite/Components/Text/Text.js +135 -135
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +207 -205
- package/src/x_ite/Components/Text.js +17 -17
- package/src/x_ite/Components/Texturing/ImageTexture.js +181 -194
- package/src/x_ite/Components/Texturing/MovieTexture.js +180 -190
- package/src/x_ite/Components/Texturing/MultiTexture.js +255 -262
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +124 -118
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +82 -76
- package/src/x_ite/Components/Texturing/PixelTexture.js +222 -221
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +116 -116
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +90 -90
- package/src/x_ite/Components/Texturing/TextureProperties.js +158 -160
- package/src/x_ite/Components/Texturing/TextureTransform.js +99 -99
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +33 -28
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +54 -54
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +22 -17
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +135 -124
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +16 -16
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +24 -24
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +22 -22
- package/src/x_ite/Components/Texturing.js +45 -45
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +125 -123
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +115 -131
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +158 -160
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +88 -88
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +46 -46
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +135 -121
- package/src/x_ite/Components/Time/TimeSensor.js +155 -152
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +299 -302
- package/src/x_ite/Components/Time.js +15 -15
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +338 -338
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +80 -80
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +228 -228
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +163 -163
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +117 -117
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +334 -334
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +167 -167
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +247 -247
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +198 -198
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +126 -126
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +173 -173
- package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +12 -12
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +167 -167
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +70 -70
- package/src/x_ite/Components/X_ITE/BlendMode.js +143 -145
- package/src/x_ite/Components.js +47 -47
- package/src/x_ite/Configuration/ComponentInfo.js +47 -42
- package/src/x_ite/Configuration/ComponentInfoArray.js +21 -19
- package/src/x_ite/Configuration/ProfileInfo.js +33 -23
- package/src/x_ite/Configuration/ProfileInfoArray.js +26 -16
- package/src/x_ite/Configuration/SupportedComponents.js +311 -311
- package/src/x_ite/Configuration/SupportedNodes.js +53 -38
- package/src/x_ite/Configuration/SupportedProfiles.js +190 -190
- package/src/x_ite/Configuration/UnitInfo.js +60 -51
- package/src/x_ite/Configuration/UnitInfoArray.js +17 -10
- package/src/x_ite/DEBUG.js +2 -2
- package/src/x_ite/Execution/BindableList.js +146 -149
- package/src/x_ite/Execution/BindableStack.js +130 -123
- package/src/x_ite/Execution/ExportedNodesArray.js +75 -0
- package/src/x_ite/Execution/ImportedNodesArray.js +75 -0
- package/src/x_ite/{Basic/X3DFieldDefinition.js → Execution/NamedNodesArray.js} +20 -10
- package/src/x_ite/Execution/Scene.js +93 -90
- package/src/x_ite/Execution/X3DExecutionContext.js +957 -781
- package/src/x_ite/Execution/X3DExportedNode.js +152 -0
- package/src/x_ite/Execution/X3DImportedNode.js +393 -0
- package/src/x_ite/Execution/X3DScene.js +546 -493
- package/src/x_ite/Execution/X3DWorld.js +171 -0
- package/src/x_ite/Fallback.js +31 -31
- package/src/x_ite/Fields/ArrayFields.js +463 -443
- package/src/x_ite/Fields/SFBool.js +50 -47
- package/src/x_ite/Fields/SFColor.js +163 -160
- package/src/x_ite/Fields/SFColorRGBA.js +155 -152
- package/src/x_ite/Fields/SFDouble.js +51 -48
- package/src/x_ite/Fields/SFFloat.js +51 -48
- package/src/x_ite/Fields/SFImage.js +216 -213
- package/src/x_ite/Fields/SFInt32.js +47 -44
- package/src/x_ite/Fields/SFMatrix3.js +74 -71
- package/src/x_ite/Fields/SFMatrix4.js +68 -65
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +98 -98
- package/src/x_ite/Fields/SFNode.js +392 -299
- package/src/x_ite/Fields/SFNodeCache.js +22 -33
- package/src/x_ite/Fields/SFRotation.js +178 -175
- package/src/x_ite/Fields/SFString.js +71 -68
- package/src/x_ite/Fields/SFTime.js +47 -44
- package/src/x_ite/Fields/SFVec2.js +73 -70
- package/src/x_ite/Fields/SFVec3.js +105 -102
- package/src/x_ite/Fields/SFVec4.js +118 -115
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +94 -94
- package/src/x_ite/Fields.js +44 -44
- package/src/x_ite/InputOutput/FileLoader.js +426 -531
- package/src/x_ite/InputOutput/Generator.js +379 -376
- package/src/x_ite/{Configuration/X3DInfoArray.js → Parser/GoldenGate.js} +54 -86
- package/src/x_ite/Parser/HTMLSupport.js +28 -6
- package/src/x_ite/Parser/JSONParser.js +414 -388
- package/src/x_ite/Parser/VRMLParser.js +2964 -0
- package/src/x_ite/Parser/X3DParser.js +128 -128
- package/src/x_ite/Parser/XMLParser.js +1231 -1178
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +279 -297
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +264 -263
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +58 -35
- package/src/x_ite/Rendering/DependentRenderer.js +83 -80
- package/src/x_ite/Rendering/TextureBuffer.js +171 -168
- package/src/x_ite/{Bits → Rendering}/TraverseType.js +11 -11
- package/src/x_ite/Rendering/X3DRenderObject.js +895 -906
- package/src/x_ite/Routing/RouteArray.js +19 -71
- package/src/x_ite/Routing/X3DRoute.js +185 -179
- package/src/x_ite/Routing/X3DRoutingContext.js +60 -54
- package/src/x_ite/X3D.js +191 -175
- package/src/x_ite.config.js +83 -83
- package/src/x_ite.css +279 -288
- package/src/x_ite.html +226 -193
- package/src/x_ite.js +100 -127
- package/x_ite.min.html +220 -187
- package/src/assets/shaders/webgl1/PointSet.fs +0 -100
- package/src/assets/shaders/webgl1/PointSet.vs +0 -70
- package/src/assets/shaders/webgl1/Wireframe.fs +0 -74
- package/src/assets/shaders/webgl1/Wireframe.vs +0 -63
- package/src/assets/shaders/webgl2/PointSet.fs +0 -99
- package/src/assets/shaders/webgl2/PointSet.vs +0 -71
- package/src/assets/shaders/webgl2/Wireframe.fs +0 -73
- package/src/assets/shaders/webgl2/Wireframe.vs +0 -64
- package/src/x_ite/Basic/X3DBaseNode.js +0 -1253
- package/src/x_ite/Basic/X3DField.js +0 -370
- package/src/x_ite/Basic/X3DObjectArrayField.js +0 -545
- package/src/x_ite/Basic/X3DTypedArrayField.js +0 -839
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +0 -714
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +0 -209
- package/src/x_ite/Execution/ImportedNode.js +0 -375
- package/src/x_ite/Execution/World.js +0 -162
- package/src/x_ite/Parser/Parser.js +0 -2944
|
@@ -48,22 +48,28 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
"x_ite/Configuration/SupportedNodes",
|
|
52
|
+
"x_ite/Fields",
|
|
53
|
+
"x_ite/Base/X3DBaseNode",
|
|
54
|
+
"x_ite/Execution/NamedNodesArray",
|
|
55
|
+
"x_ite/Execution/X3DImportedNode",
|
|
56
|
+
"x_ite/Execution/ImportedNodesArray",
|
|
57
|
+
"x_ite/Prototype/ExternProtoDeclarationArray",
|
|
58
|
+
"x_ite/Prototype/ProtoDeclarationArray",
|
|
59
|
+
"x_ite/Routing/RouteArray",
|
|
60
|
+
"x_ite/Routing/X3DRoute",
|
|
61
|
+
"x_ite/Base/X3DCast",
|
|
62
|
+
"x_ite/Base/X3DConstants",
|
|
63
|
+
"x_ite/InputOutput/Generator",
|
|
64
|
+
"x_ite/Fields/SFNodeCache",
|
|
65
|
+
"standard/Math/Algorithm",
|
|
63
66
|
],
|
|
64
|
-
function (
|
|
67
|
+
function (SupportedNodes,
|
|
68
|
+
Fields,
|
|
65
69
|
X3DBaseNode,
|
|
66
|
-
|
|
70
|
+
NamedNodesArray,
|
|
71
|
+
X3DImportedNode,
|
|
72
|
+
ImportedNodesArray,
|
|
67
73
|
ExternProtoDeclarationArray,
|
|
68
74
|
ProtoDeclarationArray,
|
|
69
75
|
RouteArray,
|
|
@@ -76,778 +82,948 @@ function (Fields,
|
|
|
76
82
|
{
|
|
77
83
|
"use strict";
|
|
78
84
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
getNamedNode: function (name)
|
|
257
|
-
{
|
|
258
|
-
const baseNode = this ._namedNodes .get (name);
|
|
259
|
-
|
|
260
|
-
if (baseNode)
|
|
261
|
-
return SFNodeCache .get (baseNode);
|
|
262
|
-
|
|
263
|
-
throw new Error ("Named node '" + name + "' not found.");
|
|
264
|
-
},
|
|
265
|
-
getNamedNodes: function ()
|
|
266
|
-
{
|
|
267
|
-
return this ._namedNodes;
|
|
268
|
-
},
|
|
269
|
-
getUniqueName: function (name)
|
|
270
|
-
{
|
|
271
|
-
const _TrailingNumbers = /(_\d+$)/;
|
|
272
|
-
|
|
273
|
-
name = name .replace (_TrailingNumbers, "");
|
|
274
|
-
|
|
275
|
-
let
|
|
276
|
-
newName = name,
|
|
277
|
-
i = 64;
|
|
278
|
-
|
|
279
|
-
for (; i;)
|
|
280
|
-
{
|
|
281
|
-
if (this ._namedNodes .has (newName) || newName .length === 0)
|
|
282
|
-
{
|
|
283
|
-
const
|
|
284
|
-
min = i,
|
|
285
|
-
max = i <<= 1;
|
|
286
|
-
|
|
287
|
-
newName = name;
|
|
288
|
-
newName += '_';
|
|
289
|
-
newName += Math .round (Algorithm .random (min, max));
|
|
290
|
-
}
|
|
291
|
-
else
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return newName;
|
|
296
|
-
},
|
|
297
|
-
addImportedNode: function (inlineNode, exportedName, importedName)
|
|
298
|
-
{
|
|
299
|
-
if (importedName === undefined)
|
|
300
|
-
importedName = exportedName;
|
|
301
|
-
|
|
302
|
-
if (this ._importedNodes .has (importedName))
|
|
303
|
-
throw new Error ("Couldn't add imported node: imported name '" + importedName + "' already in use.");
|
|
304
|
-
|
|
305
|
-
this .updateImportedNode (inlineNode, exportedName, importedName);
|
|
306
|
-
},
|
|
307
|
-
updateImportedNode: function (inlineNode, exportedName, importedName)
|
|
308
|
-
{
|
|
309
|
-
inlineNode = X3DCast (X3DConstants .Inline, inlineNode);
|
|
310
|
-
exportedName = String (exportedName);
|
|
311
|
-
importedName = importedName === undefined ? exportedName : String (importedName);
|
|
312
|
-
|
|
313
|
-
if (! inlineNode)
|
|
314
|
-
throw new Error ("Node named is not an Inline node.");
|
|
315
|
-
|
|
316
|
-
if (inlineNode .getExecutionContext () !== this)
|
|
317
|
-
throw new Error ("Couldn't update imported node: Inline node does not belong to this execution context.");
|
|
318
|
-
|
|
319
|
-
if (exportedName .length === 0)
|
|
320
|
-
throw new Error ("Couldn't update imported node: exported name is empty.");
|
|
321
|
-
|
|
322
|
-
if (importedName .length === 0)
|
|
323
|
-
throw new Error ("Couldn't update imported node: imported name is empty.");
|
|
324
|
-
|
|
325
|
-
// Update imported node.
|
|
326
|
-
|
|
327
|
-
this .removeImportedNode (importedName);
|
|
328
|
-
|
|
329
|
-
const importedNode = new ImportedNode (this, inlineNode, exportedName, importedName);
|
|
330
|
-
|
|
331
|
-
this ._importedNodes .set (importedName, importedNode);
|
|
332
|
-
|
|
333
|
-
importedNode .setup ();
|
|
334
|
-
},
|
|
335
|
-
removeImportedNode: function (importedName)
|
|
336
|
-
{
|
|
337
|
-
const importedNode = this ._importedNodes .get (importedName);
|
|
338
|
-
|
|
339
|
-
if (! importedNode)
|
|
340
|
-
return;
|
|
341
|
-
|
|
342
|
-
importedNode .dispose ();
|
|
343
|
-
|
|
344
|
-
this ._importedNodes .delete (importedName);
|
|
345
|
-
},
|
|
346
|
-
getImportedNode: function (importedName)
|
|
347
|
-
{
|
|
348
|
-
const importedNode = this ._importedNodes .get (importedName);
|
|
349
|
-
|
|
350
|
-
if (importedNode)
|
|
351
|
-
return importedNode .getExportedNode () .valueOf ();
|
|
352
|
-
|
|
353
|
-
throw new Error ("Imported node '" + importedName + "' not found.");
|
|
354
|
-
},
|
|
355
|
-
getImportedNodes: function ()
|
|
356
|
-
{
|
|
357
|
-
return this ._importedNodes;
|
|
358
|
-
},
|
|
359
|
-
getLocalNode: function (name)
|
|
360
|
-
{
|
|
361
|
-
try
|
|
362
|
-
{
|
|
363
|
-
return this .getNamedNode (name);
|
|
364
|
-
}
|
|
365
|
-
catch (error)
|
|
366
|
-
{
|
|
367
|
-
const importedNode = this ._importedNodes .get (name);
|
|
368
|
-
|
|
369
|
-
if (importedNode)
|
|
370
|
-
return SFNodeCache .get (importedNode);
|
|
371
|
-
|
|
372
|
-
throw new Error ("Unknown named or imported node '" + name + "'.");
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
getLocalName: function (node)
|
|
376
|
-
{
|
|
377
|
-
if (! (node instanceof Fields .SFNode))
|
|
378
|
-
throw new Error ("Couldn't get local name: node is NULL.");
|
|
379
|
-
|
|
380
|
-
if (node .getValue () .getExecutionContext () === this)
|
|
381
|
-
return node .getValue () .getName ();
|
|
382
|
-
|
|
383
|
-
for (const importedNode of this ._importedNodes .values ())
|
|
384
|
-
{
|
|
385
|
-
try
|
|
386
|
-
{
|
|
387
|
-
if (importedNode .getExportedNode () .getValue () === node .getValue ())
|
|
388
|
-
return importedNode .getImportedName ();
|
|
389
|
-
}
|
|
390
|
-
catch (error)
|
|
391
|
-
{
|
|
392
|
-
//console .log (error);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
throw new Error ("Couldn't get local name: node is shared.");
|
|
397
|
-
},
|
|
398
|
-
setRootNodes: function () { },
|
|
399
|
-
getRootNodes: function ()
|
|
400
|
-
{
|
|
401
|
-
return this .rootNodes_;
|
|
402
|
-
},
|
|
403
|
-
getProtoDeclaration: function (name)
|
|
404
|
-
{
|
|
405
|
-
const proto = this ._protos .get (name);
|
|
406
|
-
|
|
407
|
-
if (proto)
|
|
408
|
-
return proto;
|
|
409
|
-
|
|
410
|
-
throw new Error ("Proto declaration '" + name + "' not found.");
|
|
411
|
-
},
|
|
412
|
-
getProtoDeclarations: function ()
|
|
413
|
-
{
|
|
414
|
-
return this ._protos;
|
|
415
|
-
},
|
|
416
|
-
getExternProtoDeclaration: function (name)
|
|
417
|
-
{
|
|
418
|
-
const externproto = this ._externprotos .get (name);
|
|
419
|
-
|
|
420
|
-
if (externproto)
|
|
421
|
-
return externproto;
|
|
422
|
-
|
|
423
|
-
throw new Error ("Extern proto declaration '" + name + "' not found.");
|
|
424
|
-
},
|
|
425
|
-
getExternProtoDeclarations: function ()
|
|
426
|
-
{
|
|
427
|
-
return this ._externprotos;
|
|
428
|
-
},
|
|
429
|
-
addRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
430
|
-
{
|
|
431
|
-
sourceField = String (sourceField);
|
|
432
|
-
destinationField = String (destinationField);
|
|
433
|
-
|
|
434
|
-
if (! (sourceNode instanceof Fields .SFNode))
|
|
435
|
-
throw new Error ("Bad ROUTE specification: source node must be of type SFNode.");
|
|
436
|
-
|
|
437
|
-
if (! (destinationNode instanceof Fields .SFNode))
|
|
438
|
-
throw new Error ("Bad ROUTE specification: destination node must be of type SFNode.");
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
sourceNodeValue = sourceNode .getValue (),
|
|
442
|
-
destinationNodeValue = destinationNode .getValue ();
|
|
443
|
-
|
|
444
|
-
if (! sourceNodeValue)
|
|
445
|
-
throw new Error ("Bad ROUTE specification: source node is NULL.");
|
|
446
|
-
|
|
447
|
-
if (! destinationNodeValue)
|
|
448
|
-
throw new Error ("Bad ROUTE specification: destination node is NULL.");
|
|
449
|
-
|
|
450
|
-
// Imported nodes handling.
|
|
451
|
-
|
|
452
|
-
let
|
|
453
|
-
importedSourceNode = sourceNodeValue instanceof ImportedNode ? sourceNodeValue : null,
|
|
454
|
-
importedDestinationNode = destinationNodeValue instanceof ImportedNode ? destinationNodeValue : null;
|
|
455
|
-
|
|
456
|
-
try
|
|
457
|
-
{
|
|
458
|
-
// If sourceNode is shared node try to find the corresponding ImportedNode.
|
|
459
|
-
if (sourceNodeValue .getExecutionContext () !== this)
|
|
460
|
-
importedSourceNode = this .getLocalNode (this .getLocalName (sourceNode)) .getValue ();
|
|
461
|
-
}
|
|
462
|
-
catch (error)
|
|
463
|
-
{
|
|
464
|
-
// Source node is shared but not imported.
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
try
|
|
468
|
-
{
|
|
469
|
-
// If destinationNode is shared node try to find the corresponding ImportedNode.
|
|
470
|
-
if (destinationNodeValue .getExecutionContext () !== this)
|
|
471
|
-
importedDestinationNode = this .getLocalNode (this .getLocalName (destinationNode)) .getValue ();
|
|
472
|
-
}
|
|
473
|
-
catch (error)
|
|
474
|
-
{
|
|
475
|
-
// Destination node is shared but not imported.
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (importedSourceNode instanceof ImportedNode && importedDestinationNode instanceof ImportedNode)
|
|
479
|
-
{
|
|
480
|
-
importedSourceNode .addRoute (importedSourceNode, sourceField, importedDestinationNode, destinationField);
|
|
481
|
-
importedDestinationNode .addRoute (importedSourceNode, sourceField, importedDestinationNode, destinationField);
|
|
482
|
-
}
|
|
483
|
-
else if (importedSourceNode instanceof ImportedNode)
|
|
484
|
-
{
|
|
485
|
-
importedSourceNode .addRoute (importedSourceNode, sourceField, destinationNodeValue, destinationField);
|
|
486
|
-
}
|
|
487
|
-
else if (importedDestinationNode instanceof ImportedNode)
|
|
488
|
-
{
|
|
489
|
-
importedDestinationNode .addRoute (sourceNodeValue, sourceField, importedDestinationNode, destinationField);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
// If either sourceNode or destinationNode is an ImportedNode return here without value.
|
|
493
|
-
if (importedSourceNode === sourceNodeValue || importedDestinationNode === destinationNodeValue)
|
|
494
|
-
return;
|
|
495
|
-
|
|
496
|
-
// Create route and return.
|
|
497
|
-
|
|
498
|
-
return this .addSimpleRoute (sourceNodeValue, sourceField, destinationNodeValue, destinationField);
|
|
499
|
-
},
|
|
500
|
-
addSimpleRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
501
|
-
{
|
|
502
|
-
// Source and dest node are here X3DBaseNode.
|
|
503
|
-
|
|
504
|
-
try
|
|
505
|
-
{
|
|
506
|
-
// Private function.
|
|
507
|
-
// Create route and return.
|
|
508
|
-
|
|
509
|
-
sourceField = sourceNode .getField (sourceField),
|
|
510
|
-
destinationField = destinationNode .getField (destinationField);
|
|
511
|
-
|
|
512
|
-
if (! sourceField .isOutput ())
|
|
513
|
-
throw new Error ("Field named '" + sourceField .getName () + "' in node named '" + sourceNode .getName () + "' of type " + sourceNode .getTypeName () + " is not an output field.");
|
|
514
|
-
|
|
515
|
-
if (! destinationField .isInput ())
|
|
516
|
-
throw new Error ("Field named '" + destinationField .getName () + "' in node named '" + destinationNode .getName () + "' of type " + destinationNode .getTypeName () + " is not an input field.");
|
|
517
|
-
|
|
518
|
-
if (sourceField .getType () !== destinationField .getType ())
|
|
519
|
-
throw new Error ("ROUTE types " + sourceField .getTypeName () + " and " + destinationField .getTypeName () + " do not match.");
|
|
520
|
-
|
|
521
|
-
const id = sourceField .getId () + "." + destinationField .getId ();
|
|
522
|
-
|
|
523
|
-
let route = this ._routeIndex .get (id);
|
|
524
|
-
|
|
525
|
-
if (route)
|
|
526
|
-
return route;
|
|
527
|
-
|
|
528
|
-
route = new X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
|
|
529
|
-
|
|
530
|
-
this ._routes .getValue () .push (route);
|
|
531
|
-
this ._routeIndex .set (id, route);
|
|
532
|
-
|
|
533
|
-
return route;
|
|
534
|
-
}
|
|
535
|
-
catch (error)
|
|
536
|
-
{
|
|
537
|
-
throw new Error ("Bad ROUTE specification: " + error .message);
|
|
538
|
-
}
|
|
539
|
-
},
|
|
540
|
-
deleteRoute: function (route)
|
|
541
|
-
{
|
|
542
|
-
// sourceNode, sourceField, destinationNode, destinationField
|
|
543
|
-
if (arguments .length === 4)
|
|
544
|
-
{
|
|
545
|
-
route = this .getRoute .apply (this, arguments);
|
|
546
|
-
|
|
547
|
-
if (! route)
|
|
548
|
-
return false;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
if (this .deleteSimpleRoute (route))
|
|
552
|
-
this .deleteImportedRoute (route .getSourceNode (), route .getDestinationNode (), route);
|
|
553
|
-
},
|
|
554
|
-
deleteSimpleRoute: function (route)
|
|
555
|
-
{
|
|
556
|
-
try
|
|
557
|
-
{
|
|
558
|
-
const
|
|
559
|
-
sourceField = route ._sourceField,
|
|
560
|
-
destinationField = route ._destinationField,
|
|
561
|
-
id = sourceField .getId () + "." + destinationField .getId (),
|
|
562
|
-
index = this ._routes .getValue () .indexOf (route);
|
|
563
|
-
|
|
564
|
-
route .disconnect ();
|
|
565
|
-
|
|
566
|
-
if (index !== -1)
|
|
567
|
-
this ._routes .getValue () .splice (index, 1);
|
|
568
|
-
|
|
569
|
-
this ._routeIndex .delete (id);
|
|
570
|
-
|
|
571
|
-
return true;
|
|
572
|
-
}
|
|
573
|
-
catch (error)
|
|
574
|
-
{
|
|
575
|
-
console .log (error);
|
|
576
|
-
return false;
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
deleteImportedRoute (sourceNode, destinationNode, route)
|
|
580
|
-
{
|
|
581
|
-
// Imported nodes handling.
|
|
582
|
-
|
|
583
|
-
let
|
|
584
|
-
importedSourceNode = null,
|
|
585
|
-
importedDestinationNode = null;
|
|
586
|
-
|
|
587
|
-
try
|
|
588
|
-
{
|
|
589
|
-
// If sourceNode is shared node try to find the corresponding ImportedNode.
|
|
590
|
-
if (sourceNode .getValue () .getExecutionContext () !== this)
|
|
591
|
-
importedSourceNode = this .getLocalNode (this .getLocalName (sourceNode)) .getValue ();
|
|
592
|
-
}
|
|
593
|
-
catch (error)
|
|
594
|
-
{
|
|
595
|
-
// Source node is shared but not imported.
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
try
|
|
599
|
-
{
|
|
600
|
-
// If destinationNode is shared node try to find the corresponding ImportedNode.
|
|
601
|
-
if (destinationNode .getValue () .getExecutionContext () !== this)
|
|
602
|
-
importedDestinationNode = this .getLocalNode (this .getLocalName (destinationNode)) .getValue ();
|
|
603
|
-
}
|
|
604
|
-
catch (error)
|
|
605
|
-
{
|
|
606
|
-
// Destination node is shared but not imported.
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
if (importedSourceNode instanceof ImportedNode && importedDestinationNode instanceof ImportedNode)
|
|
610
|
-
{
|
|
611
|
-
importedSourceNode .deleteRoute (route);
|
|
612
|
-
importedDestinationNode .deleteRoute (route);
|
|
613
|
-
}
|
|
614
|
-
else if (importedSourceNode instanceof ImportedNode)
|
|
615
|
-
{
|
|
616
|
-
importedSourceNode .deleteRoute (route);
|
|
617
|
-
}
|
|
618
|
-
else if (importedDestinationNode instanceof ImportedNode)
|
|
619
|
-
{
|
|
620
|
-
importedDestinationNode .deleteRoute (route);
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
getRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
624
|
-
{
|
|
625
|
-
if (! sourceNode .getValue ())
|
|
626
|
-
throw new Error ("Bad ROUTE specification: sourceNode is NULL.");
|
|
627
|
-
|
|
628
|
-
if (! destinationNode .getValue ())
|
|
629
|
-
throw new Error ("Bad ROUTE specification: destinationNode is NULL.");
|
|
630
|
-
|
|
631
|
-
sourceField = sourceNode .getValue () .getField (sourceField);
|
|
632
|
-
destinationField = destinationNode .getValue () .getField (destinationField);
|
|
633
|
-
|
|
634
|
-
const id = sourceField .getId () + "." + destinationField .getId ();
|
|
635
|
-
|
|
636
|
-
return this ._routeIndex .get (id);
|
|
637
|
-
},
|
|
638
|
-
getRoutes: function ()
|
|
639
|
-
{
|
|
640
|
-
return this ._routes;
|
|
641
|
-
},
|
|
642
|
-
getWorldInfos: function ()
|
|
643
|
-
{
|
|
644
|
-
return this .worldInfos_;
|
|
645
|
-
},
|
|
646
|
-
addWorldInfo: function (worldInfoNode)
|
|
647
|
-
{
|
|
648
|
-
this .worldInfos_ .push (worldInfoNode);
|
|
649
|
-
},
|
|
650
|
-
removeWorldInfo: function (worldInfoNode)
|
|
651
|
-
{
|
|
652
|
-
const index = this .worldInfos_ .getValue () .indexOf (worldInfoNode);
|
|
653
|
-
|
|
654
|
-
if (index !== -1)
|
|
655
|
-
this .worldInfos_ .splice (index, 1);
|
|
656
|
-
},
|
|
657
|
-
toVRMLStream: function (stream)
|
|
658
|
-
{
|
|
659
|
-
const generator = Generator .Get (stream);
|
|
660
|
-
|
|
661
|
-
generator .PushExecutionContext (this);
|
|
662
|
-
generator .EnterScope ();
|
|
663
|
-
generator .ImportedNodes (this .getImportedNodes ());
|
|
664
|
-
|
|
665
|
-
// Output extern protos
|
|
666
|
-
|
|
667
|
-
this .getExternProtoDeclarations () .toVRMLStream (stream);
|
|
668
|
-
|
|
669
|
-
// Output protos
|
|
670
|
-
|
|
671
|
-
this .getProtoDeclarations () .toVRMLStream (stream);
|
|
672
|
-
|
|
673
|
-
// Output root nodes
|
|
674
|
-
|
|
675
|
-
const rootNodes = this .getRootNodes ();
|
|
676
|
-
|
|
677
|
-
for (let i = 0, length = rootNodes .length; i < length; ++ i)
|
|
678
|
-
{
|
|
679
|
-
const rootNode = rootNodes [i];
|
|
680
|
-
|
|
681
|
-
stream .string += generator .Indent ();
|
|
682
|
-
|
|
683
|
-
if (rootNode)
|
|
684
|
-
rootNode .toVRMLStream (stream);
|
|
685
|
-
else
|
|
686
|
-
stream .string += "NULL";
|
|
687
|
-
|
|
688
|
-
stream .string += "\n";
|
|
689
|
-
|
|
690
|
-
if (i !== length - 1)
|
|
691
|
-
stream .string += "\n";
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
// Output imported nodes
|
|
695
|
-
|
|
696
|
-
const importedNodes = this .getImportedNodes ();
|
|
697
|
-
|
|
698
|
-
if (importedNodes .size)
|
|
699
|
-
{
|
|
700
|
-
stream .string += "\n";
|
|
701
|
-
|
|
702
|
-
importedNodes .forEach (function (importedNode)
|
|
703
|
-
{
|
|
704
|
-
try
|
|
705
|
-
{
|
|
706
|
-
importedNode .toVRMLStream (stream);
|
|
707
|
-
|
|
708
|
-
stream .string += "\n";
|
|
709
|
-
}
|
|
710
|
-
catch (error)
|
|
711
|
-
{ }
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
// Output routes
|
|
716
|
-
|
|
717
|
-
const routes = this .getRoutes ();
|
|
718
|
-
|
|
719
|
-
if (routes .length)
|
|
720
|
-
{
|
|
721
|
-
stream .string += "\n";
|
|
85
|
+
const
|
|
86
|
+
_namedNodes = Symbol (),
|
|
87
|
+
_importedNodes = Symbol (),
|
|
88
|
+
_protos = Symbol (),
|
|
89
|
+
_externprotos = Symbol (),
|
|
90
|
+
_routes = Symbol (),
|
|
91
|
+
_outerNode = Symbol ();
|
|
92
|
+
|
|
93
|
+
SupportedNodes .addAbstractType ("X3DExecutionContext", X3DExecutionContext);
|
|
94
|
+
|
|
95
|
+
function X3DExecutionContext (executionContext)
|
|
96
|
+
{
|
|
97
|
+
X3DBaseNode .call (this, executionContext);
|
|
98
|
+
|
|
99
|
+
this .addType (X3DConstants .X3DExecutionContext)
|
|
100
|
+
|
|
101
|
+
this .addChildObjects ("rootNodes", new Fields .MFNode (),
|
|
102
|
+
"worldInfos", new Fields .MFNode (),
|
|
103
|
+
"sceneGraph_changed", new Fields .SFTime ());
|
|
104
|
+
|
|
105
|
+
this ._rootNodes .setAccessType (X3DConstants .initializeOnly);
|
|
106
|
+
this ._rootNodes .addCloneCount (1);
|
|
107
|
+
|
|
108
|
+
this [_namedNodes] = new NamedNodesArray ();
|
|
109
|
+
this [_importedNodes] = new ImportedNodesArray ();
|
|
110
|
+
this [_protos] = new ProtoDeclarationArray ();
|
|
111
|
+
this [_externprotos] = new ExternProtoDeclarationArray ();
|
|
112
|
+
this [_routes] = new RouteArray ();
|
|
113
|
+
|
|
114
|
+
this .addChildObjects ("namedNodes_changed", new Fields .SFTime (),
|
|
115
|
+
"importedNodes_changed", new Fields .SFTime (),
|
|
116
|
+
"protos_changed", new Fields .SFTime (),
|
|
117
|
+
"externprotos_changed", new Fields .SFTime (),
|
|
118
|
+
"routes_changed", new Fields .SFTime ())
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
123
|
+
{
|
|
124
|
+
constructor: X3DExecutionContext,
|
|
125
|
+
initialize: function ()
|
|
126
|
+
{
|
|
127
|
+
X3DBaseNode .prototype .initialize .call (this);
|
|
128
|
+
|
|
129
|
+
if (!this .isScene ())
|
|
130
|
+
this ._sceneGraph_changed .addInterest ("set_sceneGraph", this)
|
|
131
|
+
},
|
|
132
|
+
set_sceneGraph: function ()
|
|
133
|
+
{
|
|
134
|
+
this .getExecutionContext () ._sceneGraph_changed = this .getBrowser () .getCurrentTime ();
|
|
135
|
+
},
|
|
136
|
+
isScene: function ()
|
|
137
|
+
{
|
|
138
|
+
return false;
|
|
139
|
+
},
|
|
140
|
+
getTypeName: function ()
|
|
141
|
+
{
|
|
142
|
+
return "X3DExecutionContext";
|
|
143
|
+
},
|
|
144
|
+
[_outerNode]: null,
|
|
145
|
+
getOuterNode: function ()
|
|
146
|
+
{
|
|
147
|
+
// Can be either of type X3DProtoDeclaration or X3DPrototypeInstance, or null.
|
|
148
|
+
return this [_outerNode];
|
|
149
|
+
},
|
|
150
|
+
setOuterNode: function (value)
|
|
151
|
+
{
|
|
152
|
+
this [_outerNode] = value;
|
|
153
|
+
},
|
|
154
|
+
getSpecificationVersion: function ()
|
|
155
|
+
{
|
|
156
|
+
return this .getExecutionContext () .getSpecificationVersion ();
|
|
157
|
+
},
|
|
158
|
+
getEncoding: function ()
|
|
159
|
+
{
|
|
160
|
+
return this .getExecutionContext () .getEncoding ();
|
|
161
|
+
},
|
|
162
|
+
getWorldURL: function ()
|
|
163
|
+
{
|
|
164
|
+
return this .getExecutionContext () .getWorldURL ();
|
|
165
|
+
},
|
|
166
|
+
getProfile: function ()
|
|
167
|
+
{
|
|
168
|
+
return this .getExecutionContext () .getProfile ();
|
|
169
|
+
},
|
|
170
|
+
getComponents: function ()
|
|
171
|
+
{
|
|
172
|
+
return this .getExecutionContext () .getComponents ();
|
|
173
|
+
},
|
|
174
|
+
fromUnit: function (category, value)
|
|
175
|
+
{
|
|
176
|
+
return this .getExecutionContext () .fromUnit (category, value);
|
|
177
|
+
},
|
|
178
|
+
toUnit: function (category, value)
|
|
179
|
+
{
|
|
180
|
+
return this .getExecutionContext () .toUnit (category, value);
|
|
181
|
+
},
|
|
182
|
+
getUnits: function ()
|
|
183
|
+
{
|
|
184
|
+
return this .getExecutionContext () .getUnits ();
|
|
185
|
+
},
|
|
186
|
+
createNode: function (typeName, setup = true)
|
|
187
|
+
{
|
|
188
|
+
typeName = String (typeName);
|
|
189
|
+
|
|
190
|
+
if (setup === false)
|
|
191
|
+
{
|
|
192
|
+
const Type = this .getBrowser () .getSupportedNode (typeName);
|
|
193
|
+
|
|
194
|
+
if (!Type)
|
|
195
|
+
return null;
|
|
196
|
+
|
|
197
|
+
return new Type (this);
|
|
198
|
+
}
|
|
199
|
+
else
|
|
200
|
+
{
|
|
201
|
+
const Type = this .getBrowser () .getSupportedNode (typeName);
|
|
202
|
+
|
|
203
|
+
if (!Type)
|
|
204
|
+
throw new Error ("Unknown node type '" + typeName + "'.");
|
|
205
|
+
|
|
206
|
+
const baseNode = new Type (this);
|
|
207
|
+
|
|
208
|
+
baseNode .setup ();
|
|
209
|
+
|
|
210
|
+
return SFNodeCache .get (baseNode);
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
createProto: function (name, setup = true)
|
|
214
|
+
{
|
|
215
|
+
name = String (name);
|
|
216
|
+
|
|
217
|
+
let executionContext = this;
|
|
218
|
+
|
|
219
|
+
for (;;)
|
|
220
|
+
{
|
|
221
|
+
const proto = executionContext .protos .get (name);
|
|
222
|
+
|
|
223
|
+
if (proto)
|
|
224
|
+
return proto .createInstance (this, setup);
|
|
225
|
+
|
|
226
|
+
const externproto = executionContext .externprotos .get (name);
|
|
227
|
+
|
|
228
|
+
if (externproto)
|
|
229
|
+
return externproto .createInstance (this, setup);
|
|
230
|
+
|
|
231
|
+
if (executionContext .isScene ())
|
|
232
|
+
break;
|
|
233
|
+
|
|
234
|
+
executionContext = executionContext .getExecutionContext ();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (setup === false)
|
|
238
|
+
return null;
|
|
239
|
+
|
|
240
|
+
throw new Error ("Unknown proto or externproto type '" + name + "'.");
|
|
241
|
+
},
|
|
242
|
+
addNamedNode: function (name, node)
|
|
243
|
+
{
|
|
244
|
+
if (this [_namedNodes] .has (name))
|
|
245
|
+
throw new Error ("Couldn't add named node: node named '" + name + "' is already in use.");
|
|
246
|
+
|
|
247
|
+
this .updateNamedNode (name, node);
|
|
248
|
+
},
|
|
249
|
+
updateNamedNode: function (name, node)
|
|
250
|
+
{
|
|
251
|
+
name = String (name);
|
|
252
|
+
node = X3DCast (X3DConstants .X3DNode, node, false);
|
|
253
|
+
|
|
254
|
+
if (!node)
|
|
255
|
+
throw new Error ("Couldn't update named node: node must be of type X3DNode.");
|
|
256
|
+
|
|
257
|
+
if (node .getExecutionContext () !== this)
|
|
258
|
+
throw new Error ("Couldn't update named node: node does not belong to this execution context.");
|
|
259
|
+
|
|
260
|
+
if (name .length === 0)
|
|
261
|
+
throw new Error ("Couldn't update named node: node name is empty.");
|
|
722
262
|
|
|
723
|
-
|
|
724
|
-
}
|
|
263
|
+
// Remove named node.
|
|
725
264
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
},
|
|
729
|
-
toXMLStream: function (stream)
|
|
730
|
-
{
|
|
731
|
-
const generator = Generator .Get (stream);
|
|
732
|
-
|
|
733
|
-
generator .PushExecutionContext (this);
|
|
734
|
-
generator .EnterScope ();
|
|
735
|
-
generator .ImportedNodes (this .getImportedNodes ());
|
|
736
|
-
|
|
737
|
-
// Output extern protos
|
|
738
|
-
|
|
739
|
-
this .getExternProtoDeclarations () .toXMLStream (stream);
|
|
740
|
-
|
|
741
|
-
// Output protos
|
|
742
|
-
|
|
743
|
-
this .getProtoDeclarations () .toXMLStream (stream);
|
|
744
|
-
|
|
745
|
-
// Output root nodes
|
|
746
|
-
|
|
747
|
-
const rootNodes = this .getRootNodes ();
|
|
748
|
-
|
|
749
|
-
if (rootNodes .length)
|
|
750
|
-
{
|
|
751
|
-
rootNodes .toXMLStream (stream);
|
|
265
|
+
this .removeNamedNode (node .getName ());
|
|
266
|
+
this .removeNamedNode (name);
|
|
752
267
|
|
|
753
|
-
|
|
754
|
-
}
|
|
268
|
+
// Update named node.
|
|
755
269
|
|
|
756
|
-
|
|
270
|
+
node .setName (name);
|
|
757
271
|
|
|
758
|
-
|
|
272
|
+
this [_namedNodes] .add (name, node);
|
|
759
273
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
274
|
+
this ._namedNodes_changed = this .getBrowser () .getCurrentTime ();
|
|
275
|
+
},
|
|
276
|
+
removeNamedNode: function (name)
|
|
277
|
+
{
|
|
278
|
+
name = String (name);
|
|
765
279
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
280
|
+
const node = this [_namedNodes] .get (name);
|
|
281
|
+
|
|
282
|
+
if (!node)
|
|
283
|
+
return;
|
|
284
|
+
|
|
285
|
+
node .setName ("");
|
|
286
|
+
|
|
287
|
+
this [_namedNodes] .remove (name);
|
|
288
|
+
|
|
289
|
+
this ._namedNodes_changed = this .getBrowser () .getCurrentTime ();
|
|
290
|
+
},
|
|
291
|
+
getNamedNode: function (name)
|
|
292
|
+
{
|
|
293
|
+
name = String (name);
|
|
294
|
+
|
|
295
|
+
const node = this [_namedNodes] .get (name);
|
|
296
|
+
|
|
297
|
+
if (node)
|
|
298
|
+
return SFNodeCache .get (node);
|
|
299
|
+
|
|
300
|
+
throw new Error ("Named node '" + name + "' not found.");
|
|
301
|
+
},
|
|
302
|
+
getNamedNodes: function ()
|
|
303
|
+
{
|
|
304
|
+
return this [_namedNodes];
|
|
305
|
+
},
|
|
306
|
+
getUniqueName: function (name = "")
|
|
307
|
+
{
|
|
308
|
+
return getUniqueName .call (this, _namedNodes, name);
|
|
309
|
+
},
|
|
310
|
+
addImportedNode: function (inlineNode, exportedName, importedName)
|
|
311
|
+
{
|
|
312
|
+
if (importedName === undefined)
|
|
313
|
+
importedName = exportedName;
|
|
314
|
+
|
|
315
|
+
exportedName = String (exportedName);
|
|
316
|
+
importedName = String (importedName);
|
|
317
|
+
|
|
318
|
+
if (this [_importedNodes] .has (importedName))
|
|
319
|
+
throw new Error ("Couldn't add imported node: imported name '" + importedName + "' already in use.");
|
|
320
|
+
|
|
321
|
+
this .updateImportedNode (inlineNode, exportedName, importedName);
|
|
322
|
+
},
|
|
323
|
+
updateImportedNode: function (inlineNode, exportedName, importedName)
|
|
324
|
+
{
|
|
325
|
+
inlineNode = X3DCast (X3DConstants .Inline, inlineNode, false);
|
|
326
|
+
exportedName = String (exportedName);
|
|
327
|
+
importedName = importedName === undefined ? exportedName : String (importedName);
|
|
328
|
+
|
|
329
|
+
if (!inlineNode)
|
|
330
|
+
throw new Error ("Node must be of type Inline node.");
|
|
331
|
+
|
|
332
|
+
if (inlineNode .getExecutionContext () !== this)
|
|
333
|
+
throw new Error ("Couldn't update imported node: Inline node does not belong to this execution context.");
|
|
334
|
+
|
|
335
|
+
if (exportedName .length === 0)
|
|
336
|
+
throw new Error ("Couldn't update imported node: exported name is empty.");
|
|
337
|
+
|
|
338
|
+
if (importedName .length === 0)
|
|
339
|
+
throw new Error ("Couldn't update imported node: imported name is empty.");
|
|
340
|
+
|
|
341
|
+
// Update imported node.
|
|
342
|
+
|
|
343
|
+
this .removeImportedNode (importedName);
|
|
344
|
+
|
|
345
|
+
const importedNode = new X3DImportedNode (this, inlineNode, exportedName, importedName);
|
|
346
|
+
|
|
347
|
+
this [_importedNodes] .add (importedName, importedNode);
|
|
348
|
+
|
|
349
|
+
importedNode .setup ();
|
|
350
|
+
|
|
351
|
+
this ._importedNodes_changed = this .getBrowser () .getCurrentTime ();
|
|
352
|
+
},
|
|
353
|
+
removeImportedNode: function (importedName)
|
|
354
|
+
{
|
|
355
|
+
importedName = String (importedName);
|
|
356
|
+
|
|
357
|
+
const importedNode = this [_importedNodes] .get (importedName);
|
|
358
|
+
|
|
359
|
+
if (!importedNode)
|
|
360
|
+
return;
|
|
361
|
+
|
|
362
|
+
importedNode .dispose ();
|
|
363
|
+
|
|
364
|
+
this [_importedNodes] .remove (importedName);
|
|
365
|
+
|
|
366
|
+
this ._importedNodes_changed = this .getBrowser () .getCurrentTime ();
|
|
367
|
+
},
|
|
368
|
+
getImportedNode: function (importedName)
|
|
369
|
+
{
|
|
370
|
+
importedName = String (importedName);
|
|
371
|
+
|
|
372
|
+
const importedNode = this [_importedNodes] .get (importedName);
|
|
373
|
+
|
|
374
|
+
if (importedNode)
|
|
375
|
+
return SFNodeCache .get (importedNode .getExportedNode ());
|
|
376
|
+
|
|
377
|
+
throw new Error ("Imported node '" + importedName + "' not found.");
|
|
378
|
+
},
|
|
379
|
+
getImportedNodes: function ()
|
|
380
|
+
{
|
|
381
|
+
return this [_importedNodes];
|
|
382
|
+
},
|
|
383
|
+
getLocalNode: function (name)
|
|
384
|
+
{
|
|
385
|
+
name = String (name);
|
|
386
|
+
|
|
387
|
+
try
|
|
388
|
+
{
|
|
389
|
+
return this .getNamedNode (name);
|
|
390
|
+
}
|
|
391
|
+
catch (error)
|
|
392
|
+
{
|
|
393
|
+
const importedNode = this [_importedNodes] .get (name);
|
|
394
|
+
|
|
395
|
+
if (importedNode)
|
|
396
|
+
return SFNodeCache .get (importedNode);
|
|
397
|
+
|
|
398
|
+
throw new Error ("Unknown named or imported node '" + name + "'.");
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
getLocalName: function (node)
|
|
402
|
+
{
|
|
403
|
+
node = X3DCast (X3DConstants .X3DNode, node, false);
|
|
404
|
+
|
|
405
|
+
if (!node)
|
|
406
|
+
throw new Error ("Couldn't get local name: node must be of type X3DNode.");
|
|
407
|
+
|
|
408
|
+
if (node .getExecutionContext () === this)
|
|
409
|
+
return node .getName ();
|
|
410
|
+
|
|
411
|
+
for (const importedNode of this [_importedNodes])
|
|
412
|
+
{
|
|
413
|
+
try
|
|
414
|
+
{
|
|
415
|
+
if (importedNode .getExportedNode () === node)
|
|
416
|
+
return importedNode .getImportedName ();
|
|
417
|
+
}
|
|
418
|
+
catch (error)
|
|
419
|
+
{
|
|
420
|
+
//console .error (error);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
throw new Error ("Couldn't get local name: node is shared.");
|
|
425
|
+
},
|
|
426
|
+
setRootNodes: function () { },
|
|
427
|
+
getRootNodes: function ()
|
|
428
|
+
{
|
|
429
|
+
return this ._rootNodes;
|
|
430
|
+
},
|
|
431
|
+
getProtoDeclaration: function (name)
|
|
432
|
+
{
|
|
433
|
+
name = String (name);
|
|
434
|
+
|
|
435
|
+
const proto = this [_protos] .get (name);
|
|
436
|
+
|
|
437
|
+
if (proto)
|
|
438
|
+
return proto;
|
|
439
|
+
|
|
440
|
+
throw new Error ("Proto declaration '" + name + "' not found.");
|
|
441
|
+
},
|
|
442
|
+
addProtoDeclaration (name, proto)
|
|
443
|
+
{
|
|
444
|
+
name = String (name);
|
|
445
|
+
|
|
446
|
+
const X3DProtoDeclaration = require ("x_ite/Prototype/X3DProtoDeclaration");
|
|
447
|
+
|
|
448
|
+
if (!(proto instanceof X3DProtoDeclaration))
|
|
449
|
+
throw new Error ("Couldn't add proto declaration: proto must be of type X3DProtoDeclaration.");
|
|
450
|
+
|
|
451
|
+
if (this [_protos] .get (name))
|
|
452
|
+
throw new Error ("Couldn't add proto declaration: proto '" + name + "' already in use.");
|
|
453
|
+
|
|
454
|
+
name = String (name);
|
|
455
|
+
|
|
456
|
+
if (name .length === 0)
|
|
457
|
+
throw new Error ("Couldn't add proto declaration: proto name is empty.");
|
|
458
|
+
|
|
459
|
+
this [_protos] .add (name, proto);
|
|
460
|
+
proto .setName (name);
|
|
461
|
+
|
|
462
|
+
this ._protos_changed = this .getBrowser () .getCurrentTime ();
|
|
463
|
+
},
|
|
464
|
+
updateProtoDeclaration (name, proto)
|
|
465
|
+
{
|
|
466
|
+
name = String (name);
|
|
467
|
+
|
|
468
|
+
const X3DProtoDeclaration = require ("x_ite/Prototype/X3DProtoDeclaration");
|
|
469
|
+
|
|
470
|
+
if (!(proto instanceof X3DProtoDeclaration))
|
|
471
|
+
throw new Error ("Couldn't add proto declaration: proto must be of type X3DProtoDeclaration.");
|
|
472
|
+
|
|
473
|
+
name = String (name);
|
|
474
|
+
|
|
475
|
+
if (name .length === 0)
|
|
476
|
+
throw new Error ("Couldn't add proto declaration: proto name is empty.");
|
|
477
|
+
|
|
478
|
+
this [_protos] .update (proto .getName (), name, proto);
|
|
479
|
+
proto .setName (name);
|
|
480
|
+
|
|
481
|
+
this ._protos_changed = this .getBrowser () .getCurrentTime ();
|
|
482
|
+
},
|
|
483
|
+
removeProtoDeclaration (name)
|
|
484
|
+
{
|
|
485
|
+
name = String (name);
|
|
486
|
+
|
|
487
|
+
this [_protos] .remove (name);
|
|
488
|
+
|
|
489
|
+
this ._protos_changed = this .getBrowser () .getCurrentTime ();
|
|
490
|
+
},
|
|
491
|
+
getProtoDeclarations: function ()
|
|
492
|
+
{
|
|
493
|
+
return this [_protos];
|
|
494
|
+
},
|
|
495
|
+
getUniqueProtoName: function (name = "")
|
|
496
|
+
{
|
|
497
|
+
return getUniqueName .call (this, _protos, name);
|
|
498
|
+
},
|
|
499
|
+
getExternProtoDeclaration: function (name)
|
|
500
|
+
{
|
|
501
|
+
name = String (name);
|
|
502
|
+
|
|
503
|
+
const externproto = this [_externprotos] .get (name);
|
|
504
|
+
|
|
505
|
+
if (externproto)
|
|
506
|
+
return externproto;
|
|
507
|
+
|
|
508
|
+
throw new Error ("Extern proto declaration '" + name + "' not found.");
|
|
509
|
+
},
|
|
510
|
+
addExternProtoDeclaration (name, externproto)
|
|
511
|
+
{
|
|
512
|
+
name = String (name);
|
|
513
|
+
|
|
514
|
+
const X3DExternProtoDeclaration = require ("x_ite/Prototype/X3DExternProtoDeclaration");
|
|
515
|
+
|
|
516
|
+
if (!(externproto instanceof X3DExternProtoDeclaration))
|
|
517
|
+
throw new Error ("Couldn't add extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");
|
|
518
|
+
|
|
519
|
+
if (this [_externprotos] .get (name))
|
|
520
|
+
throw new Error ("Couldn't add extern proto declaration: extern proto '" + name + "' already in use.");
|
|
521
|
+
|
|
522
|
+
name = String (name);
|
|
523
|
+
|
|
524
|
+
if (name .length === 0)
|
|
525
|
+
throw new Error ("Couldn't add extern proto declaration: extern proto name is empty.");
|
|
526
|
+
|
|
527
|
+
this [_externprotos] .add (name, externproto);
|
|
528
|
+
externproto .setName (name);
|
|
529
|
+
|
|
530
|
+
this ._externprotos_changed = this .getBrowser () .getCurrentTime ();
|
|
531
|
+
},
|
|
532
|
+
updateExternProtoDeclaration (name, externproto)
|
|
533
|
+
{
|
|
534
|
+
name = String (name);
|
|
535
|
+
|
|
536
|
+
const X3DExternProtoDeclaration = require ("x_ite/Prototype/X3DExternProtoDeclaration");
|
|
537
|
+
|
|
538
|
+
if (!(externproto instanceof X3DExternProtoDeclaration))
|
|
539
|
+
throw new Error ("Couldn't add extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");
|
|
540
|
+
|
|
541
|
+
name = String (name);
|
|
542
|
+
|
|
543
|
+
if (name .length === 0)
|
|
544
|
+
throw new Error ("Couldn't add extern proto declaration: extern proto name is empty.");
|
|
545
|
+
|
|
546
|
+
this [_externprotos] .update (externproto .getName (), name, externproto);
|
|
547
|
+
externproto .setName (name);
|
|
548
|
+
|
|
549
|
+
this ._externprotos_changed = this .getBrowser () .getCurrentTime ();
|
|
550
|
+
},
|
|
551
|
+
removeExternProtoDeclaration (name)
|
|
552
|
+
{
|
|
553
|
+
name = String (name);
|
|
554
|
+
|
|
555
|
+
this [_externprotos] .remove (name);
|
|
556
|
+
|
|
557
|
+
this ._externprotos_changed = this .getBrowser () .getCurrentTime ();
|
|
558
|
+
},
|
|
559
|
+
getExternProtoDeclarations: function ()
|
|
560
|
+
{
|
|
561
|
+
return this [_externprotos];
|
|
562
|
+
},
|
|
563
|
+
getUniqueExternProtoName: function (name = "")
|
|
564
|
+
{
|
|
565
|
+
return getUniqueName .call (this, _externprotos, name);
|
|
566
|
+
},
|
|
567
|
+
addRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
568
|
+
{
|
|
569
|
+
sourceNode = X3DCast (X3DConstants .X3DNode, sourceNode, false);
|
|
570
|
+
sourceField = String (sourceField);
|
|
571
|
+
destinationNode = X3DCast (X3DConstants .X3DNode, destinationNode, false);
|
|
572
|
+
destinationField = String (destinationField);
|
|
573
|
+
|
|
574
|
+
if (!sourceNode)
|
|
575
|
+
throw new Error ("Bad ROUTE specification: source node must be of type X3DNode.");
|
|
576
|
+
|
|
577
|
+
if (!destinationNode)
|
|
578
|
+
throw new Error ("Bad ROUTE specification: destination node must be of type X3DNode.");
|
|
579
|
+
|
|
580
|
+
// Imported nodes handling.
|
|
581
|
+
|
|
582
|
+
let
|
|
583
|
+
importedSourceNode = sourceNode instanceof X3DImportedNode ? sourceNode : null,
|
|
584
|
+
importedDestinationNode = destinationNode instanceof X3DImportedNode ? destinationNode : null;
|
|
585
|
+
|
|
586
|
+
try
|
|
587
|
+
{
|
|
588
|
+
// If sourceNode is shared node try to find the corresponding X3DImportedNode.
|
|
589
|
+
if (sourceNode .getExecutionContext () !== this)
|
|
590
|
+
importedSourceNode = this .getLocalNode (this .getLocalName (sourceNode)) .getValue ();
|
|
591
|
+
}
|
|
592
|
+
catch (error)
|
|
593
|
+
{
|
|
594
|
+
// Source node is shared but not imported.
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
try
|
|
598
|
+
{
|
|
599
|
+
// If destinationNode is shared node try to find the corresponding X3DImportedNode.
|
|
600
|
+
if (destinationNode .getExecutionContext () !== this)
|
|
601
|
+
importedDestinationNode = this .getLocalNode (this .getLocalName (destinationNode)) .getValue ();
|
|
602
|
+
}
|
|
603
|
+
catch (error)
|
|
604
|
+
{
|
|
605
|
+
// Destination node is shared but not imported.
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (importedSourceNode instanceof X3DImportedNode && importedDestinationNode instanceof X3DImportedNode)
|
|
609
|
+
{
|
|
610
|
+
importedSourceNode .addRoute (importedSourceNode, sourceField, importedDestinationNode, destinationField);
|
|
611
|
+
importedDestinationNode .addRoute (importedSourceNode, sourceField, importedDestinationNode, destinationField);
|
|
612
|
+
}
|
|
613
|
+
else if (importedSourceNode instanceof X3DImportedNode)
|
|
614
|
+
{
|
|
615
|
+
importedSourceNode .addRoute (importedSourceNode, sourceField, destinationNode, destinationField);
|
|
616
|
+
}
|
|
617
|
+
else if (importedDestinationNode instanceof X3DImportedNode)
|
|
618
|
+
{
|
|
619
|
+
importedDestinationNode .addRoute (sourceNode, sourceField, importedDestinationNode, destinationField);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// If either sourceNode or destinationNode is an X3DImportedNode return here without value.
|
|
623
|
+
if (importedSourceNode === sourceNode || importedDestinationNode === destinationNode)
|
|
624
|
+
return;
|
|
625
|
+
|
|
626
|
+
// Create route and return.
|
|
627
|
+
|
|
628
|
+
return this .addSimpleRoute (sourceNode, sourceField, destinationNode, destinationField);
|
|
629
|
+
},
|
|
630
|
+
addSimpleRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
631
|
+
{
|
|
632
|
+
// Source and dest node are here X3DBaseNode.
|
|
633
|
+
|
|
634
|
+
try
|
|
635
|
+
{
|
|
636
|
+
// Private function.
|
|
637
|
+
// Create route and return.
|
|
638
|
+
|
|
639
|
+
sourceField = sourceNode .getField (sourceField),
|
|
640
|
+
destinationField = destinationNode .getField (destinationField);
|
|
641
|
+
|
|
642
|
+
if (!sourceField .isOutput ())
|
|
643
|
+
throw new Error ("Field named '" + sourceField .getName () + "' in node named '" + sourceNode .getName () + "' of type " + sourceNode .getTypeName () + " is not an output field.");
|
|
644
|
+
|
|
645
|
+
if (!destinationField .isInput ())
|
|
646
|
+
throw new Error ("Field named '" + destinationField .getName () + "' in node named '" + destinationNode .getName () + "' of type " + destinationNode .getTypeName () + " is not an input field.");
|
|
647
|
+
|
|
648
|
+
if (sourceField .getType () !== destinationField .getType ())
|
|
649
|
+
throw new Error ("ROUTE types " + sourceField .getTypeName () + " and " + destinationField .getTypeName () + " do not match.");
|
|
650
|
+
|
|
651
|
+
const id = sourceField .getId () + "." + destinationField .getId ();
|
|
652
|
+
|
|
653
|
+
let route = this [_routes] .get (id);
|
|
654
|
+
|
|
655
|
+
if (route)
|
|
656
|
+
return route;
|
|
657
|
+
|
|
658
|
+
route = new X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
|
|
659
|
+
|
|
660
|
+
this [_routes] .add (id, route);
|
|
661
|
+
|
|
662
|
+
this ._routes_changed = this .getBrowser () .getCurrentTime ();
|
|
663
|
+
|
|
664
|
+
return route;
|
|
665
|
+
}
|
|
666
|
+
catch (error)
|
|
667
|
+
{
|
|
668
|
+
throw new Error ("Bad ROUTE specification: " + error .message);
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
deleteRoute: function (route)
|
|
672
|
+
{
|
|
673
|
+
// sourceNode, sourceField, destinationNode, destinationField
|
|
674
|
+
if (arguments .length === 4)
|
|
675
|
+
{
|
|
676
|
+
route = this .getRoute .apply (this, arguments);
|
|
677
|
+
|
|
678
|
+
if (!route)
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if (this .deleteSimpleRoute (route))
|
|
683
|
+
this .deleteImportedRoute (route .sourceNode, route .destinationNode, route);
|
|
684
|
+
},
|
|
685
|
+
deleteSimpleRoute: function (route)
|
|
686
|
+
{
|
|
687
|
+
try
|
|
688
|
+
{
|
|
689
|
+
const
|
|
690
|
+
sourceField = route .getSourceField (),
|
|
691
|
+
destinationField = route .getDestinationField (),
|
|
692
|
+
id = sourceField .getId () + "." + destinationField .getId ();
|
|
693
|
+
|
|
694
|
+
this [_routes] .remove (id);
|
|
695
|
+
route .disconnect ();
|
|
696
|
+
|
|
697
|
+
this ._routes_changed = this .getBrowser () .getCurrentTime ();
|
|
698
|
+
|
|
699
|
+
return true;
|
|
700
|
+
}
|
|
701
|
+
catch (error)
|
|
702
|
+
{
|
|
703
|
+
console .error (error);
|
|
704
|
+
return false;
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
deleteImportedRoute (sourceNode, destinationNode, route)
|
|
708
|
+
{
|
|
709
|
+
// Imported nodes handling.
|
|
710
|
+
|
|
711
|
+
let
|
|
712
|
+
importedSourceNode = null,
|
|
713
|
+
importedDestinationNode = null;
|
|
714
|
+
|
|
715
|
+
try
|
|
716
|
+
{
|
|
717
|
+
// If sourceNode is shared node try to find the corresponding X3DImportedNode.
|
|
718
|
+
if (sourceNode .getValue () .getExecutionContext () !== this)
|
|
719
|
+
importedSourceNode = this .getLocalNode (this .getLocalName (sourceNode)) .getValue ();
|
|
720
|
+
}
|
|
721
|
+
catch (error)
|
|
722
|
+
{
|
|
723
|
+
// Source node is shared but not imported.
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
try
|
|
727
|
+
{
|
|
728
|
+
// If destinationNode is shared node try to find the corresponding X3DImportedNode.
|
|
729
|
+
if (destinationNode .getValue () .getExecutionContext () !== this)
|
|
730
|
+
importedDestinationNode = this .getLocalNode (this .getLocalName (destinationNode)) .getValue ();
|
|
731
|
+
}
|
|
732
|
+
catch (error)
|
|
733
|
+
{
|
|
734
|
+
// Destination node is shared but not imported.
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if (importedSourceNode instanceof X3DImportedNode && importedDestinationNode instanceof X3DImportedNode)
|
|
738
|
+
{
|
|
739
|
+
importedSourceNode .deleteRoute (route);
|
|
740
|
+
importedDestinationNode .deleteRoute (route);
|
|
741
|
+
}
|
|
742
|
+
else if (importedSourceNode instanceof X3DImportedNode)
|
|
743
|
+
{
|
|
744
|
+
importedSourceNode .deleteRoute (route);
|
|
745
|
+
}
|
|
746
|
+
else if (importedDestinationNode instanceof X3DImportedNode)
|
|
747
|
+
{
|
|
748
|
+
importedDestinationNode .deleteRoute (route);
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
getRoute: function (sourceNode, sourceField, destinationNode, destinationField)
|
|
752
|
+
{
|
|
753
|
+
sourceNode = X3DCast (X3DConstants .X3DNode, sourceNode, false);
|
|
754
|
+
sourceField = String (sourceField)
|
|
755
|
+
destinationNode = X3DCast (X3DConstants .X3DNode, destinationNode, false);
|
|
756
|
+
destinationField = String (destinationField)
|
|
757
|
+
|
|
758
|
+
if (!sourceNode)
|
|
759
|
+
throw new Error ("Bad ROUTE specification: sourceNode must be of type X3DNode.");
|
|
760
|
+
|
|
761
|
+
if (!destinationNode)
|
|
762
|
+
throw new Error ("Bad ROUTE specification: destinationNode must be of type X3DNode.");
|
|
763
|
+
|
|
764
|
+
sourceField = sourceNode .getField (sourceField);
|
|
765
|
+
destinationField = destinationNode .getField (destinationField);
|
|
766
|
+
|
|
767
|
+
const id = sourceField .getId () + "." + destinationField .getId ();
|
|
768
|
+
|
|
769
|
+
return this [_routes] .get (id);
|
|
770
|
+
},
|
|
771
|
+
getRoutes: function ()
|
|
772
|
+
{
|
|
773
|
+
return this [_routes];
|
|
774
|
+
},
|
|
775
|
+
getWorldInfos: function ()
|
|
776
|
+
{
|
|
777
|
+
return this ._worldInfos;
|
|
778
|
+
},
|
|
779
|
+
addWorldInfo: function (worldInfoNode)
|
|
780
|
+
{
|
|
781
|
+
this ._worldInfos .push (worldInfoNode);
|
|
782
|
+
},
|
|
783
|
+
removeWorldInfo: function (worldInfoNode)
|
|
784
|
+
{
|
|
785
|
+
for (let i = this ._worldInfos .length - 1; i >= 0; -- i)
|
|
786
|
+
{
|
|
787
|
+
if (this ._worldInfos [i] .getValue () === worldInfoNode)
|
|
788
|
+
this ._worldInfos .splice (i, 1);
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
toVRMLStream: function (stream)
|
|
792
|
+
{
|
|
793
|
+
const generator = Generator .Get (stream);
|
|
794
|
+
|
|
795
|
+
generator .PushExecutionContext (this);
|
|
796
|
+
generator .EnterScope ();
|
|
797
|
+
generator .ImportedNodes (this .getImportedNodes ());
|
|
798
|
+
|
|
799
|
+
// Output extern protos
|
|
800
|
+
|
|
801
|
+
this .getExternProtoDeclarations () .toVRMLStream (stream);
|
|
802
|
+
|
|
803
|
+
// Output protos
|
|
804
|
+
|
|
805
|
+
this .getProtoDeclarations () .toVRMLStream (stream);
|
|
806
|
+
|
|
807
|
+
// Output root nodes
|
|
808
|
+
|
|
809
|
+
const rootNodes = this .getRootNodes ();
|
|
810
|
+
|
|
811
|
+
for (let i = 0, length = rootNodes .length; i < length; ++ i)
|
|
812
|
+
{
|
|
813
|
+
const rootNode = rootNodes [i];
|
|
814
|
+
|
|
815
|
+
stream .string += generator .Indent ();
|
|
816
|
+
|
|
817
|
+
if (rootNode)
|
|
818
|
+
rootNode .toVRMLStream (stream);
|
|
819
|
+
else
|
|
820
|
+
stream .string += "NULL";
|
|
821
|
+
|
|
822
|
+
stream .string += "\n";
|
|
823
|
+
|
|
824
|
+
if (i !== length - 1)
|
|
825
|
+
stream .string += "\n";
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Output imported nodes
|
|
829
|
+
|
|
830
|
+
const importedNodes = this .getImportedNodes ();
|
|
831
|
+
|
|
832
|
+
if (importedNodes .size)
|
|
833
|
+
{
|
|
834
|
+
stream .string += "\n";
|
|
835
|
+
|
|
836
|
+
importedNodes .forEach (function (importedNode)
|
|
837
|
+
{
|
|
838
|
+
try
|
|
839
|
+
{
|
|
840
|
+
importedNode .toVRMLStream (stream);
|
|
841
|
+
|
|
842
|
+
stream .string += "\n";
|
|
843
|
+
}
|
|
844
|
+
catch (error)
|
|
845
|
+
{ }
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// Output routes
|
|
850
|
+
|
|
851
|
+
const routes = this .getRoutes ();
|
|
852
|
+
|
|
853
|
+
if (routes .length)
|
|
854
|
+
{
|
|
855
|
+
stream .string += "\n";
|
|
856
|
+
|
|
857
|
+
routes .toVRMLStream (stream);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
generator .LeaveScope ();
|
|
861
|
+
generator .PopExecutionContext ();
|
|
862
|
+
},
|
|
863
|
+
toXMLStream: function (stream)
|
|
864
|
+
{
|
|
865
|
+
const generator = Generator .Get (stream);
|
|
866
|
+
|
|
867
|
+
generator .PushExecutionContext (this);
|
|
868
|
+
generator .EnterScope ();
|
|
869
|
+
generator .ImportedNodes (this .getImportedNodes ());
|
|
870
|
+
|
|
871
|
+
// Output extern protos
|
|
872
|
+
|
|
873
|
+
this .getExternProtoDeclarations () .toXMLStream (stream);
|
|
874
|
+
|
|
875
|
+
// Output protos
|
|
876
|
+
|
|
877
|
+
this .getProtoDeclarations () .toXMLStream (stream);
|
|
878
|
+
|
|
879
|
+
// Output root nodes
|
|
880
|
+
|
|
881
|
+
const rootNodes = this .getRootNodes ();
|
|
882
|
+
|
|
883
|
+
if (rootNodes .length)
|
|
884
|
+
{
|
|
885
|
+
rootNodes .toXMLStream (stream);
|
|
886
|
+
|
|
887
|
+
stream .string += "\n";
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// Output imported nodes
|
|
891
|
+
|
|
892
|
+
const importedNodes = this .getImportedNodes ();
|
|
893
|
+
|
|
894
|
+
importedNodes .forEach (function (importedNode)
|
|
895
|
+
{
|
|
896
|
+
try
|
|
897
|
+
{
|
|
898
|
+
importedNode .toXMLStream (stream);
|
|
899
|
+
|
|
900
|
+
stream .string += "\n";
|
|
901
|
+
}
|
|
902
|
+
catch (error)
|
|
903
|
+
{ }
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
// Output routes
|
|
907
|
+
|
|
908
|
+
this .getRoutes () .toXMLStream (stream);
|
|
909
|
+
|
|
910
|
+
generator .LeaveScope ();
|
|
911
|
+
generator .PopExecutionContext ();
|
|
912
|
+
},
|
|
913
|
+
dispose: function ()
|
|
914
|
+
{
|
|
915
|
+
this ._rootNodes .dispose ();
|
|
916
|
+
|
|
917
|
+
for (const route of this [_routes])
|
|
918
|
+
this .deleteRoute (route);
|
|
919
|
+
|
|
920
|
+
X3DBaseNode .prototype .dispose .call (this);
|
|
921
|
+
},
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
const getUniqueName = (function ()
|
|
925
|
+
{
|
|
926
|
+
const _TrailingNumbers = /_\d+$/;
|
|
927
|
+
|
|
928
|
+
return function (array, name = "")
|
|
929
|
+
{
|
|
930
|
+
name = String (name) .replace (_TrailingNumbers, "");
|
|
931
|
+
|
|
932
|
+
let
|
|
933
|
+
newName = name,
|
|
934
|
+
i = 64;
|
|
935
|
+
|
|
936
|
+
for (; i;)
|
|
937
|
+
{
|
|
938
|
+
if (!(this [array] .has (newName) || newName .length === 0))
|
|
939
|
+
break;
|
|
940
|
+
|
|
941
|
+
const
|
|
942
|
+
min = i,
|
|
943
|
+
max = i <<= 1;
|
|
944
|
+
|
|
945
|
+
newName = name;
|
|
946
|
+
newName += '_';
|
|
947
|
+
newName += Math .round (Algorithm .random (min, max));
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
return newName;
|
|
951
|
+
};
|
|
952
|
+
})();
|
|
953
|
+
|
|
954
|
+
for (const key of Reflect .ownKeys (X3DExecutionContext .prototype))
|
|
955
|
+
Object .defineProperty (X3DExecutionContext .prototype, key, { enumerable: false });
|
|
956
|
+
|
|
957
|
+
Object .defineProperty (X3DExecutionContext .prototype, "specificationVersion",
|
|
958
|
+
{
|
|
959
|
+
get: function () { return this .getSpecificationVersion (); },
|
|
960
|
+
enumerable: true,
|
|
961
|
+
configurable: false
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
Object .defineProperty (X3DExecutionContext .prototype, "encoding",
|
|
965
|
+
{
|
|
966
|
+
get: function () { return this .getEncoding (); },
|
|
967
|
+
enumerable: true,
|
|
968
|
+
configurable: false
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
Object .defineProperty (X3DExecutionContext .prototype, "profile",
|
|
972
|
+
{
|
|
973
|
+
get: function () { return this .getProfile (); },
|
|
974
|
+
enumerable: true,
|
|
975
|
+
configurable: false
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
Object .defineProperty (X3DExecutionContext .prototype, "components",
|
|
979
|
+
{
|
|
980
|
+
get: function () { return this .getComponents (); },
|
|
981
|
+
enumerable: true,
|
|
982
|
+
configurable: false
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
Object .defineProperty (X3DExecutionContext .prototype, "worldURL",
|
|
986
|
+
{
|
|
987
|
+
get: function () { return this .getWorldURL (); },
|
|
988
|
+
enumerable: true,
|
|
989
|
+
configurable: false
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
Object .defineProperty (X3DExecutionContext .prototype, "units",
|
|
993
|
+
{
|
|
994
|
+
get: function () { return this .getUnits (); },
|
|
995
|
+
enumerable: true,
|
|
996
|
+
configurable: false
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
Object .defineProperty (X3DExecutionContext .prototype, "rootNodes",
|
|
1000
|
+
{
|
|
1001
|
+
get: function () { return this .getRootNodes (); },
|
|
1002
|
+
set: function (value) { this .setRootNodes (value); },
|
|
1003
|
+
enumerable: true,
|
|
1004
|
+
configurable: false
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
Object .defineProperty (X3DExecutionContext .prototype, "protos",
|
|
1008
|
+
{
|
|
1009
|
+
get: function () { return this .getProtoDeclarations (); },
|
|
1010
|
+
enumerable: true,
|
|
1011
|
+
configurable: false
|
|
1012
|
+
});
|
|
1013
|
+
|
|
1014
|
+
Object .defineProperty (X3DExecutionContext .prototype, "externprotos",
|
|
1015
|
+
{
|
|
1016
|
+
get: function () { return this .getExternProtoDeclarations (); },
|
|
1017
|
+
enumerable: true,
|
|
1018
|
+
configurable: false
|
|
1019
|
+
});
|
|
1020
|
+
|
|
1021
|
+
Object .defineProperty (X3DExecutionContext .prototype, "routes",
|
|
1022
|
+
{
|
|
1023
|
+
get: function () { return this .getRoutes (); },
|
|
1024
|
+
enumerable: true,
|
|
1025
|
+
configurable: false
|
|
1026
|
+
});
|
|
1027
|
+
|
|
1028
|
+
return X3DExecutionContext;
|
|
853
1029
|
});
|