x_ite 5.0.2 → 6.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 +12 -5
- package/.vscode/tasks.json +21 -0
- package/Makefile +10 -15
- package/README.md +6 -11
- package/build/bin/dist.pl +0 -6
- package/build/bin/version.pl +1 -4
- package/dist/assets/components/annotation.js +2 -2
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +2 -2
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +6 -19
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +2 -2
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +3 -3
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +4 -4
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +32 -1685
- package/dist/assets/components/geospatial.min.js +1 -1
- package/dist/assets/components/h-anim.js +70 -77
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +3 -3
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +38 -52
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +277 -194
- package/dist/assets/components/nurbs.min.js +1 -1
- package/dist/assets/components/particle-systems.js +1918 -1658
- package/dist/assets/components/particle-systems.min.js +1 -1
- package/dist/assets/components/picking.js +33 -41
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +72 -86
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +36 -57
- package/dist/assets/components/rigid-body-physics.min.js +1 -1
- package/dist/assets/components/scripting.js +2 -2
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +26 -75
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +10 -10
- package/dist/assets/components/volume-rendering.min.js +1 -1
- package/dist/assets/components/x_ite.js +2 -2
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Line.fs +0 -21
- package/dist/assets/shaders/webgl1/Line.vs +0 -10
- package/dist/assets/shaders/webgl1/PBR.vs +1 -1
- package/dist/assets/shaders/webgl2/Depth.vs +29 -1
- package/dist/assets/shaders/webgl2/Gouraud.vs +31 -3
- package/dist/assets/shaders/webgl2/Line.fs +24 -12
- package/dist/assets/shaders/webgl2/Line.vs +36 -11
- package/dist/assets/shaders/webgl2/LineTransform.fs +4 -0
- package/dist/assets/shaders/webgl2/LineTransform.vs +57 -0
- package/dist/assets/shaders/webgl2/PBR.vs +35 -7
- package/dist/assets/shaders/webgl2/Phong.vs +31 -3
- package/dist/assets/shaders/webgl2/Point.vs +29 -1
- package/dist/assets/shaders/webgl2/Unlit.vs +31 -3
- package/dist/example.html +6 -6
- package/dist/x_ite.css +180 -208
- package/dist/x_ite.js +16477 -16629
- package/dist/x_ite.min.js +17 -17
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +6 -0
- package/docs/Accessing-the-External-Browser.md +20 -14
- package/docs/Browser-Support.md +6 -0
- package/docs/Custom-Shaders.md +17 -24
- package/docs/Features.md +7 -1
- package/docs/Gemfile +44 -0
- package/docs/Gemfile.lock +122 -0
- package/docs/Glossary.md +6 -0
- package/docs/How-To-Configure-Your-Web-Server.md +6 -0
- package/docs/Supported-Nodes.md +9 -1
- package/docs/What's-New.md +31 -0
- package/docs/XHTML-DOM-Integration.md +6 -0
- package/docs/_config.yml +1 -1
- package/docs/assets/css/main.scss +26 -0
- package/docs/index.md +38 -46
- package/docs/reference/Browser-Services.md +9 -3
- package/docs/reference/Constants-Services.md +6 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +6 -0
- package/docs/reference/Field-Services-and-Objects.md +6 -0
- package/docs/reference/Prototype-Services.md +6 -0
- package/docs/reference/Route-Services.md +6 -0
- package/docs/reference/Scene-Services.md +8 -2
- package/docs/reference/Script-Node-Authoring-Interface.md +7 -1
- package/docs/tutorials/Adding-backgrounds.md +6 -0
- package/docs/tutorials/Adding-fog.md +6 -0
- package/docs/tutorials/Adding-sound.md +6 -0
- package/docs/tutorials/Animating-transforms.md +6 -0
- package/docs/tutorials/Basic-Nodes.md +6 -0
- package/docs/tutorials/Building-a-X3D-world.md +6 -0
- package/docs/tutorials/Building-elevation-grids.md +6 -0
- package/docs/tutorials/Building-extruded-shapes.md +6 -0
- package/docs/tutorials/Building-primitive-shapes.md +6 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +6 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +6 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-detail.md +6 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +6 -0
- package/docs/tutorials/Controlling-navigation.md +6 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +6 -0
- package/docs/tutorials/Creating-new-node-types.md +6 -0
- package/docs/tutorials/Grouping-nodes.md +6 -0
- package/docs/tutorials/Hello,-World!.md +6 -0
- package/docs/tutorials/Improving-Performance.md +6 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +6 -0
- package/docs/tutorials/Introducing-X3D.md +6 -0
- package/docs/tutorials/Introducing-animation.md +6 -0
- package/docs/tutorials/Introducing-script-use.md +6 -0
- package/docs/tutorials/Lighting-your-world.md +6 -0
- package/docs/tutorials/Mapping-textures.md +6 -0
- package/docs/tutorials/Naming-nodes.md +6 -0
- package/docs/tutorials/Providing-information-about-your-world.md +6 -0
- package/docs/tutorials/Sensing-the-viewer.md +6 -0
- package/docs/tutorials/Sensing-viewer-actions.md +6 -0
- package/docs/tutorials/Transforming-Shapes.md +6 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +6 -0
- package/docs/tutorials/index.md +6 -0
- package/package.json +6 -7
- package/src/assets/components/geometry2d.js +1 -1
- package/src/assets/components/key-device-sensor.js +1 -1
- package/src/assets/components/layout.js +1 -1
- package/src/assets/components/particle-systems.js +1 -1
- package/src/assets/components/volume-rendering.js +1 -1
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +1 -9
- package/src/assets/shaders/webgl1/Line.fs +3 -28
- package/src/assets/shaders/webgl1/Line.vs +5 -19
- package/src/assets/shaders/webgl1/PBR.vs +1 -1
- package/src/assets/shaders/webgl1/Point.vs +2 -3
- package/src/assets/shaders/webgl2/Depth.vs +4 -1
- package/src/assets/shaders/webgl2/Gouraud.vs +5 -3
- package/src/assets/shaders/webgl2/Line.fs +11 -17
- package/src/assets/shaders/webgl2/Line.vs +16 -20
- package/src/assets/shaders/webgl2/LineTransform.fs +6 -0
- package/src/assets/shaders/webgl2/LineTransform.vs +77 -0
- package/src/assets/shaders/webgl2/PBR.vs +10 -7
- package/src/assets/shaders/webgl2/Phong.vs +6 -3
- package/src/assets/shaders/webgl2/Point.vs +6 -6
- package/src/assets/shaders/webgl2/Unlit.vs +6 -3
- package/src/assets/shaders/webgl2/include/Line2.glsl +20 -0
- package/src/assets/shaders/webgl2/include/Particle.glsl +36 -0
- package/src/example.html +6 -6
- package/src/standard/Math/Algorithm.js +12 -28
- package/src/standard/Math/Geometry/Plane3.js +0 -2
- package/src/standard/Math/Geometry/ViewVolume.js +88 -83
- package/src/standard/Math/Numbers/Color3.js +6 -0
- package/src/standard/Math/Numbers/Color4.js +7 -0
- package/src/standard/Math/Numbers/Complex.js +5 -0
- package/src/standard/Math/Numbers/Matrix2.js +20 -2
- package/src/standard/Math/Numbers/Matrix3.js +129 -110
- package/src/standard/Math/Numbers/Matrix4.js +138 -119
- package/src/standard/Math/Numbers/Quaternion.js +7 -0
- package/src/standard/Math/Numbers/Rotation4.js +7 -0
- package/src/standard/Math/Numbers/Vector2.js +8 -5
- package/src/standard/Math/Numbers/Vector3.js +16 -10
- package/src/standard/Math/Numbers/Vector4.js +12 -7
- package/src/standard/Math/Utility/BVH.js +45 -17
- package/src/tests.js +6 -1
- package/src/x_ite/Base/X3DBaseNode.js +22 -11
- package/src/x_ite/Base/X3DField.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +2 -2
- package/src/x_ite/Browser/Core/BrowserTimings.js +4 -2
- package/src/x_ite/Browser/Core/Context.js +185 -0
- package/src/x_ite/Browser/Core/ContextMenu.js +299 -193
- package/src/x_ite/Browser/Core/Notification.js +1 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +35 -146
- package/src/x_ite/Browser/Layout/ScreenText.js +11 -4
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +4 -15
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +12 -19
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +14 -7
- package/src/x_ite/Browser/Navigation/X3DViewer.js +12 -20
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +11 -7
- package/src/x_ite/Browser/ParticleSystems/BVH.glsl +183 -0
- package/src/x_ite/Browser/ParticleSystems/Box3.glsl +47 -0
- package/src/x_ite/Browser/ParticleSystems/GeometryTypes.js +66 -0
- package/src/x_ite/Browser/ParticleSystems/Line3.glsl +55 -0
- package/src/x_ite/Browser/ParticleSystems/Plane3.glsl +160 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +27 -3
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +37 -37
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +19 -13
- package/src/x_ite/Browser/Shaders/Shader.js +33 -12
- package/src/x_ite/Browser/Shaders/ShaderSource.js +6 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +16 -10
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +50 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +4 -13
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +23 -33
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +2 -2
- package/src/x_ite/Browser/Time/X3DTimeContext.js +3 -1
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +7 -6
- package/src/x_ite/Browser/X3DBrowserContext.js +35 -10
- package/src/x_ite/Components/Core/X3DNode.js +4 -0
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +0 -2
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +3 -4
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +1 -12
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +0 -1
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +1 -1
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +76 -77
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +2 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +51 -65
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +1 -1
- package/src/x_ite/Components/Followers/X3DChaserNode.js +18 -32
- package/src/x_ite/Components/Followers/X3DDamperNode.js +1 -6
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +1 -1
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +12 -4
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +4 -4
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +10 -27
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +5 -10
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +9 -16
- package/src/x_ite/Components/Geospatial/GeoTransform.js +6 -18
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +20 -27
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +8 -8
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +0 -4
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +68 -75
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +4 -11
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +1 -1
- package/src/x_ite/Components/Layout/LayoutGroup.js +4 -9
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +1 -1
- package/src/x_ite/Components/Layout/ScreenGroup.js +18 -23
- package/src/x_ite/Components/Lighting/DirectionalLight.js +28 -36
- package/src/x_ite/Components/Lighting/PointLight.js +32 -47
- package/src/x_ite/Components/Lighting/SpotLight.js +33 -48
- package/src/x_ite/Components/Navigation/Billboard.js +49 -56
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +82 -111
- package/src/x_ite/Components/Networking/Anchor.js +10 -4
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +6 -6
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +44 -36
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +26 -17
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +20 -7
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +461 -876
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +39 -35
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +112 -128
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +105 -112
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +138 -176
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +16 -11
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +807 -217
- package/src/x_ite/Components/Picking/LinePickSensor.js +31 -39
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +90 -107
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +48 -55
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +53 -70
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +8 -15
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +43 -50
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +32 -39
- package/src/x_ite/Components/Rendering/ClipPlane.js +3 -11
- package/src/x_ite/Components/Rendering/Color.js +12 -37
- package/src/x_ite/Components/Rendering/ColorRGBA.js +13 -38
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +12 -4
- package/src/x_ite/Components/Rendering/LineSet.js +21 -13
- package/src/x_ite/Components/Rendering/PointSet.js +21 -13
- package/src/x_ite/Components/Rendering/X3DColorNode.js +13 -0
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +13 -5
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +248 -325
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +305 -134
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +99 -122
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +24 -38
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +10 -17
- package/src/x_ite/Components/Shaders/ComposedShader.js +35 -75
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +5 -15
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +7 -24
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +7 -24
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -10
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +219 -209
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +1 -1
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +23 -1
- package/src/x_ite/Components/Shape/Appearance.js +12 -0
- package/src/x_ite/Components/Shape/FillProperties.js +12 -1
- package/src/x_ite/Components/Shape/LineProperties.js +33 -1
- package/src/x_ite/Components/Shape/PointProperties.js +23 -1
- package/src/x_ite/Components/Shape/Shape.js +27 -34
- package/src/x_ite/Components/Sound/Sound.js +30 -40
- package/src/x_ite/Components/Text/Text.js +6 -20
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +5 -26
- package/src/x_ite/Components/Texturing/TextureProperties.js +4 -4
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +21 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +5 -4
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +24 -33
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +5 -26
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +5 -26
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +12 -19
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +7 -7
- package/src/x_ite/Components.js +2 -2
- package/src/x_ite/Fallback.js +9 -3
- package/src/x_ite/Fields/SFColor.js +4 -0
- package/src/x_ite/Fields/SFColorRGBA.js +4 -0
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +4 -0
- package/src/x_ite/Fields/SFRotation.js +4 -0
- package/src/x_ite/Fields/SFString.js +4 -0
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +4 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/Rendering/TextureBuffer.js +43 -36
- package/src/x_ite/Rendering/VertexArray.js +101 -0
- package/src/x_ite/Rendering/X3DRenderObject.js +123 -144
- package/src/x_ite/X3D.js +32 -26
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +200 -162
- package/src/x_ite.html +26 -10
- package/src/x_ite.js +42 -0
- package/x_ite.min.html +26 -10
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/spinner.css +0 -67
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = window [Symbol .for ("X_ITE.X3D-
|
|
8
|
-
require = window [Symbol .for ("X_ITE.X3D-
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-6.0.0")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-6.0.0")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -65,24 +65,13 @@ function ($,
|
|
|
65
65
|
"use strict";
|
|
66
66
|
|
|
67
67
|
const
|
|
68
|
-
_pointSize = Symbol (),
|
|
69
68
|
_screenTextureProperties = Symbol ();
|
|
70
69
|
|
|
71
|
-
function X3DLayoutContext ()
|
|
70
|
+
function X3DLayoutContext ()
|
|
71
|
+
{ }
|
|
72
72
|
|
|
73
73
|
X3DLayoutContext .prototype =
|
|
74
74
|
{
|
|
75
|
-
getPointSize: function ()
|
|
76
|
-
{
|
|
77
|
-
if (this [_pointSize] === undefined)
|
|
78
|
-
{
|
|
79
|
-
const div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
|
|
80
|
-
this [_pointSize] = div .appendTo ($("body")) .height () / 72;
|
|
81
|
-
div .remove ();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return this [_pointSize];
|
|
85
|
-
},
|
|
86
75
|
getScreenTextureProperties: function ()
|
|
87
76
|
{
|
|
88
77
|
this [_screenTextureProperties] = new TextureProperties (this .getPrivateScene ());
|
|
@@ -90,8 +79,8 @@ function ($,
|
|
|
90
79
|
this [_screenTextureProperties] ._boundaryModeS = "CLAMP";
|
|
91
80
|
this [_screenTextureProperties] ._boundaryModeT = "CLAMP";
|
|
92
81
|
this [_screenTextureProperties] ._boundaryModeR = "CLAMP";
|
|
93
|
-
this [_screenTextureProperties] ._minificationFilter = "
|
|
94
|
-
this [_screenTextureProperties] ._magnificationFilter = "
|
|
82
|
+
this [_screenTextureProperties] ._minificationFilter = "NEAREST_PIXEL";
|
|
83
|
+
this [_screenTextureProperties] ._magnificationFilter = "NEAREST_PIXEL";
|
|
95
84
|
this [_screenTextureProperties] ._generateMipMaps = false;
|
|
96
85
|
|
|
97
86
|
this [_screenTextureProperties] .setup ();
|
|
@@ -954,15 +943,10 @@ function (Fields,
|
|
|
954
943
|
},
|
|
955
944
|
getMatrix: function ()
|
|
956
945
|
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
else
|
|
962
|
-
this .matrix .identity ();
|
|
963
|
-
}
|
|
964
|
-
catch (error)
|
|
965
|
-
{ }
|
|
946
|
+
if (this .layoutNode)
|
|
947
|
+
this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
|
|
948
|
+
else
|
|
949
|
+
this .matrix .identity ();
|
|
966
950
|
|
|
967
951
|
return this .matrix;
|
|
968
952
|
},
|
|
@@ -1382,6 +1366,10 @@ function ($,
|
|
|
1382
1366
|
cx .fillRect (0, 0, canvas .width, canvas .height);
|
|
1383
1367
|
cx .fillStyle = "rgba(255,255,255,1)";
|
|
1384
1368
|
|
|
1369
|
+
cx .save ();
|
|
1370
|
+
cx .translate (0, canvas .height);
|
|
1371
|
+
cx .scale (1, -1);
|
|
1372
|
+
|
|
1385
1373
|
// Draw glyphs.
|
|
1386
1374
|
|
|
1387
1375
|
if (fontStyle ._horizontal .getValue ())
|
|
@@ -1447,13 +1435,16 @@ function ($,
|
|
|
1447
1435
|
}
|
|
1448
1436
|
}
|
|
1449
1437
|
|
|
1438
|
+
cx .restore ();
|
|
1439
|
+
|
|
1450
1440
|
// Transfer texture data.
|
|
1451
1441
|
|
|
1452
1442
|
const imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
|
|
1453
1443
|
|
|
1454
|
-
// If the
|
|
1444
|
+
// If the canvas is to large imageData is null.
|
|
1445
|
+
|
|
1455
1446
|
if (imageData)
|
|
1456
|
-
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer),
|
|
1447
|
+
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer), false);
|
|
1457
1448
|
else
|
|
1458
1449
|
this .textureNode .clear ();
|
|
1459
1450
|
};
|
|
@@ -1593,12 +1584,12 @@ function ($,
|
|
|
1593
1584
|
},
|
|
1594
1585
|
transformLine: function (line)
|
|
1595
1586
|
{
|
|
1596
|
-
// Apply
|
|
1587
|
+
// Apply screen nodes transformation in place here.
|
|
1597
1588
|
return line .multLineMatrix (Matrix4 .inverse (this .matrix));
|
|
1598
1589
|
},
|
|
1599
1590
|
transformMatrix: function (matrix)
|
|
1600
1591
|
{
|
|
1601
|
-
// Apply
|
|
1592
|
+
// Apply screen nodes transformation in place here.
|
|
1602
1593
|
return matrix .multLeft (this .matrix);
|
|
1603
1594
|
},
|
|
1604
1595
|
});
|
|
@@ -1712,7 +1703,7 @@ function (Fields,
|
|
|
1712
1703
|
},
|
|
1713
1704
|
getScale: function ()
|
|
1714
1705
|
{
|
|
1715
|
-
return this ._pointSize .getValue () * this .getBrowser () .
|
|
1706
|
+
return this ._pointSize .getValue () * this .getBrowser () .getPixelPerPoint ();
|
|
1716
1707
|
},
|
|
1717
1708
|
});
|
|
1718
1709
|
|
|
@@ -1890,31 +1881,26 @@ function (Fields,
|
|
|
1890
1881
|
})(),
|
|
1891
1882
|
traverse: function (type, renderObject)
|
|
1892
1883
|
{
|
|
1893
|
-
|
|
1884
|
+
switch (type)
|
|
1894
1885
|
{
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
break;
|
|
1905
|
-
}
|
|
1886
|
+
case TraverseType .CAMERA:
|
|
1887
|
+
case TraverseType .PICKING:
|
|
1888
|
+
case TraverseType .SHADOW: // ???
|
|
1889
|
+
// No clone support for shadow, generated cube map texture and bbox
|
|
1890
|
+
break;
|
|
1891
|
+
default:
|
|
1892
|
+
this .scale (renderObject);
|
|
1893
|
+
break;
|
|
1894
|
+
}
|
|
1906
1895
|
|
|
1907
|
-
|
|
1896
|
+
var modelViewMatrix = renderObject .getModelViewMatrix ();
|
|
1908
1897
|
|
|
1909
|
-
|
|
1910
|
-
|
|
1898
|
+
modelViewMatrix .push ();
|
|
1899
|
+
modelViewMatrix .multLeft (this .matrix);
|
|
1911
1900
|
|
|
1912
|
-
|
|
1901
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1913
1902
|
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
catch (error)
|
|
1917
|
-
{ }
|
|
1903
|
+
modelViewMatrix .pop ();
|
|
1918
1904
|
},
|
|
1919
1905
|
});
|
|
1920
1906
|
|
|
@@ -2004,7 +1990,7 @@ function (Components,
|
|
|
2004
1990
|
{
|
|
2005
1991
|
X3DLayoutNode: X3DLayoutNode,
|
|
2006
1992
|
},
|
|
2007
|
-
|
|
1993
|
+
context: X3DLayoutContext,
|
|
2008
1994
|
});
|
|
2009
1995
|
});
|
|
2010
1996
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){const t=window[Symbol.for("X_ITE.X3D-5.0.2")].define,e=window[Symbol.for("X_ITE.X3D-5.0.2")].require;t("x_ite/Browser/Layout/X3DLayoutContext",["jquery","x_ite/Components/Texturing/TextureProperties"],(function(t,e){"use strict";const i=Symbol(),n=Symbol();function s(){}return s.prototype={getPointSize:function(){if(void 0===this[i]){const e=t("<div></div>").css("height","1in").css("display","none");this[i]=e.appendTo(t("body")).height()/72,e.remove()}return this[i]},getScreenTextureProperties:function(){return this[n]=new e(this.getPrivateScene()),this[n]._boundaryModeS="CLAMP",this[n]._boundaryModeT="CLAMP",this[n]._boundaryModeR="CLAMP",this[n]._minificationFilter="NEAREST",this[n]._magnificationFilter="NEAREST",this[n]._generateMipMaps=!1,this[n].setup(),this.getScreenTextureProperties=function(){return this[n]},Object.defineProperty(this,"getScreenTextureProperties",{enumerable:!1}),this[n]}},s})),t("x_ite/Components/Layout/X3DLayoutNode",["x_ite/Components/Core/X3DChildNode","x_ite/Base/X3DConstants"],(function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DLayoutNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i})),t("x_ite/Components/Layout/Layout",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Layout/X3DLayoutNode","x_ite/Base/X3DCast","x_ite/Base/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],(function(t,e,i,n,s,o,r,a,u,h){"use strict";var l=0,c=l++,d=l++,p=l++,f=l++,y=l++,x=l++,g=l++,_=l++,w=l++,m=l++;function M(t){n.call(this,t),this.addType(o.Layout),this.alignX=d,this.alignY=d,this.offsetUnitX=x,this.offsetUnitY=x,this.offsetX=0,this.offsetY=0,this.sizeUnitX=x,this.sizeUnitY=x,this.sizeX=1,this.sizeY=1,this.scaleModeX=w,this.scaleModeY=w,this.parent=null,this.rectangleCenter=new r(0,0),this.rectangleSize=new r(0,0),this.matrix=new h}return M.prototype=Object.assign(Object.create(n.prototype),{constructor:M,viewportPixel:new r(0,0),pixelSize:new r(0,0),translation:new a(0,0,0),offset:new a(0,0,0),scale:new a(1,1,1),currentTranslation:new a(0,0,0),currentRotation:new u(0,0,1,0),currentScale:new a(0,0,0),modelViewMatrix:new h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"align",new t.MFString("CENTER","CENTER")),new e(o.inputOutput,"offsetUnits",new t.MFString("WORLD","WORLD")),new e(o.inputOutput,"offset",new t.MFFloat(0,0)),new e(o.inputOutput,"sizeUnits",new t.MFString("WORLD","WORLD")),new e(o.inputOutput,"size",new t.MFFloat(1,1)),new e(o.inputOutput,"scaleMode",new t.MFString("NONE","NONE"))]),getTypeName:function(){return"Layout"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layout"},initialize:function(){n.prototype.initialize.call(this),this._align.addInterest("set_align__",this),this._offsetUnits.addInterest("set_offsetUnits__",this),this._offset.addInterest("set_offset__",this),this._sizeUnits.addInterest("set_sizeUnits__",this),this._size.addInterest("set_size__",this),this._scaleMode.addInterest("set_scaleMode__",this),this.set_align__(),this.set_offsetUnits__(),this.set_offset__(),this.set_sizeUnits__(),this.set_size__(),this.set_scaleMode__()},set_align__:function(){this._align.length>0?"LEFT"===this._align[0]?this.alignX=c:"RIGHT"===this._align[0]?this.alignX=p:this.alignX=d:this.alignX=d,this._align.length>1?"BOTTOM"===this._align[1]?this.alignY=f:"TOP"===this._align[1]?this.alignY=y:this.alignY=d:this.alignY=d},set_offsetUnits__:function(){this._offsetUnits.length>0?("FRACTION"===this._offsetUnits[0]?this.offsetUnitX=g:"PIXEL"===this._offsetUnits[0]?this.offsetUnitX=_:this.offsetUnitX=x,this._offsetUnits.length>1?"FRACTION"===this._offsetUnits[1]?this.offsetUnitY=g:"PIXEL"===this._offsetUnits[1]?this.offsetUnitY=_:this.offsetUnitY=x:this.offsetUnitY=this.offsetUnitX):(this.offsetUnitX=x,this.offsetUnitY=x)},set_offset__:function(){this._offset.length>0?(this.offsetX=this._offset[0],this._offset.length>1?this.offsetY=this._offset[1]:this.offsetY=offsetX):(this.offsetX=0,this.offsetY=0)},set_sizeUnits__:function(){this._sizeUnits.length>0?("FRACTION"===this._sizeUnits[0]?this.sizeUnitX=g:"PIXEL"===this._sizeUnits[0]?this.sizeUnitX=_:this.sizeUnitX=x,this._sizeUnits.length>1?"FRACTION"===this._sizeUnits[1]?this.sizeUnitY=g:"PIXEL"===this._sizeUnits[1]?this.sizeUnitY=_:this.sizeUnitY=x:this.sizeUnitY=this.sizeUnitX):(this.sizeUnitX=x,this.sizeUnitY=x)},set_size__:function(){this._size.length>0?(this.sizeX=this._size[0],this._size.length>1?this.sizeY=this._size[1]:this.sizeY=this.sizeX):(this.sizeX=0,this.sizeY=0)},set_scaleMode__:function(){this._scaleMode.length>0?("FRACTION"===this._scaleMode[0]?this.scaleModeX=g:"PIXEL"===this._scaleMode[0]?this.scaleModeX=_:"STRETCH"===this._scaleMode[0]?this.scaleModeX=m:this.scaleModeX=w,this._scaleMode.length>1?"FRACTION"===this._scaleMode[1]?this.scaleModeY=g:"PIXEL"===this._scaleMode[1]?this.scaleModeY=_:"STRETCH"===this._scaleMode[1]?this.scaleModeY=m:this.scaleModeY=w:this.scaleModeY=this.scaleModeX):(this.scaleModeX=w,this.scaleModeY=w)},getRectangleCenter:function(){return this.rectangleCenter},getRectangleSize:function(){return this.rectangleSize},getAlignX:function(){return this.alignX},getAlignY:function(){return this.alignY},getOffsetUnitX:function(){return this.offsetUnitX===x?this.parent?this.parent.getOffsetUnitX():g:this.offsetUnitX},getOffsetUnitY:function(){return this.offsetUnitY===x?this.parent?this.parent.getOffsetUnitY():g:this.offsetUnitY},getOffsetX:function(){return this.offsetX},getOffsetY:function(){return this.offsetY},getSizeUnitX:function(){return this.sizeUnitX===x?this.parent?this.parent.getSizeUnitX():g:this.sizeUnitX},getSizeUnitY:function(){return this.sizeUnitY===x?this.parent?this.parent.getSizeUnitY():g:this.sizeUnitY},getSizeX:function(){return this.sizeX},getSizeY:function(){return this.sizeY},getScaleModeX:function(){return this.parent?this.scaleModeX:this.scaleModeX===w?g:this.scaleModeX},getScaleModeY:function(){return this.parent?this.scaleModeY:this.scaleModeY===w?g:this.scaleModeY},transform:function(t,e){var i=this.parent=e.getParentLayout(),n=this.matrix,s=e.getViewpoint(),o=e.getNavigationInfo().getNearValue(),r=e.getViewVolume().getScissor(),a=s.getViewportSize(r,o),u=this.viewportPixel,h=this.pixelSize,l=i?i.getRectangleSize():a,x=this.rectangleSize,M=this.rectangleCenter;switch(u.set(r[2],r[3]),h.assign(a).divVec(u),this.getSizeUnitX()){case g:x.x=this.sizeX*l.x;break;case _:x.x=this.sizeX*h.x}switch(this.getSizeUnitY()){case g:x.y=this.sizeY*l.y;break;case _:x.y=this.sizeY*h.y}var S=this.translation.set(0,0,0);switch(this.getAlignX()){case c:S.x=-(l.x-x.x)/2;break;case d:this.getSizeUnitX()===_&&1&u.x&&(S.x=-h.x/2);break;case p:S.x=(l.x-x.x)/2}switch(this.getAlignY()){case f:S.y=-(l.y-x.y)/2;break;case d:this.getSizeUnitX===_&&1&u.y&&(S.y=-h.y/2);break;case y:S.y=(l.y-x.y)/2}var X=this.offset.set(0,0,0);switch(this.getOffsetUnitX()){case g:X.x=this.offsetX*l.x;break;case _:X.x=this.offsetX*a.x/u.x}switch(this.getOffsetUnitY()){case g:X.y=this.offsetY*l.y;break;case _:X.y=this.offsetY*a.y/u.y}var z=this.scale.set(1,1,1),N=this.currentTranslation,F=this.currentRotation,C=this.currentScale;switch(e.getModelViewMatrix().get().get(N,F,C),this.getScaleModeX()){case w:z.x=C.x;break;case g:z.x=x.x;break;case m:break;case _:z.x=a.x/u.x}switch(this.getScaleModeY()){case w:z.y=C.y;break;case g:z.y=x.y;break;case m:break;case _:z.y=a.y/u.y}return this.getScaleModeX()===m?this.getScaleModeY()===m?x.x>x.y?(z.x=x.x,z.y=z.x):(z.y=x.y,z.x=z.y):z.x=z.y:this.getScaleModeY()===m&&(z.y=z.x),M.assign(S).add(X),n.set(N,F),n.translate(S.add(X)),n.scale(z),n}}),M})),t("x_ite/Components/Layout/LayoutGroup",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Base/X3DCast","x_ite/Rendering/TraverseType","x_ite/Base/X3DConstants","standard/Math/Numbers/Matrix4"],(function(t,e,i,n,s,o,r,a){"use strict";function u(t){n.call(this,t),this.addType(r.LayoutGroup),this.viewportNode=null,this.layoutNode=null,this.modelViewMatrix=new a,this.screenMatrix=new a}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"layout",new t.SFNode),new e(r.inputOutput,"viewport",new t.SFNode),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this._viewport.addInterest("set_viewport__",this),this._layout.addInterest("set_layout__",this),this.set_viewport__(),this.set_layout__()},set_viewport__:function(){this.viewportNode=s(r.X3DViewportNode,this._viewport)},set_layout__:function(){this.layoutNode=s(r.X3DLayoutNode,this._layout)},getBBox:function(t,e){return n.prototype.getBBox.call(this,t,e).multRight(this.getMatrix())},getMatrix:function(){try{this.layoutNode?this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix):this.matrix.identity()}catch(t){}return this.matrix},traverse:function(t,e){if(t!==o.COLLISION){if(this.viewportNode&&this.viewportNode.push(),this.layoutNode){var i=e.getModelViewMatrix();this.modelViewMatrix.assign(i.get()),this.screenMatrix.assign(this.layoutNode.transform(t,e)),i.pushMatrix(this.screenMatrix),e.getLayouts().push(this.layoutNode),n.prototype.traverse.call(this,t,e),e.getLayouts().pop(),i.pop()}else n.prototype.traverse.call(this,t,e);this.viewportNode&&this.viewportNode.pop()}}}),u})),t("x_ite/Components/Layout/LayoutLayer",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Layout/LayoutGroup","x_ite/Components/Navigation/OrthoViewpoint","x_ite/Base/X3DConstants"],(function(t,e,i,n,s,o,r){"use strict";function a(t){n.call(this,t,new o(t),new s(t)),this.addType(r.LayoutLayer)}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"isPickable",new t.SFBool(!0)),new e(r.inputOutput,"layout",new t.SFNode),new e(r.inputOutput,"viewport",new t.SFNode),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutLayer"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layers"},initialize:function(){n.prototype.initialize.call(this),this._layout.addFieldInterest(this.getGroup()._layout),this._addChildren.addFieldInterest(this.getGroup()._addChildren),this._removeChildren.addFieldInterest(this.getGroup()._removeChildren),this._children.addFieldInterest(this.getGroup()._children),this.getGroup()._layout=this._layout,this.getGroup()._children=this._children,this.getGroup().setPrivate(!0),this.getGroup().setup()}}),a})),t("x_ite/Browser/Layout/ScreenText",["jquery","x_ite/Browser/Text/X3DTextGeometry","x_ite/Browser/Text/TextAlignment","x_ite/Components/Texturing/PixelTexture","x_ite/Components/Rendering/X3DGeometryNode","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume","standard/Math/Algorithm"],(function(t,e,i,n,s,o,r,a,u,h,l){"use strict";function c(i,o){e.call(this,i,o),i.setTransparent(!0),this.texCoordArray=s.createArray(),this.textureNode=new n(i.getExecutionContext()),this.canvas=t("<canvas></canvas>"),this.context=this.canvas[0].getContext("2d"),this.matrix=new a,this.textureNode._textureProperties=o.getBrowser().getScreenTextureProperties(),this.textureNode.setup()}return c.prototype=Object.assign(Object.create(e.prototype),{constructor:c,modelViewMatrix:new a,getTransparent:function(){return!0},getMatrix:function(){return this.matrix},update:function(){const t=new o(0,0,0),n=new o(1,1,0);return function(){e.prototype.update.call(this);const s=this.getFontStyle(),o=this.getText();switch(o._textBounds.x=Math.ceil(o._textBounds.x)+1,o._textBounds.y=Math.ceil(o._textBounds.y)+1,this.getBBox().getExtents(t,n),t.x-=1,t.y-=1,s.getMajorAlignment()){case i.BEGIN:case i.FIRST:t.x=Math.floor(t.x),n.x=t.x+o._textBounds.x;break;case i.MIDDLE:t.x=Math.round(t.x),n.x=t.x+o._textBounds.x;break;case i.END:n.x=Math.ceil(n.x),t.x=n.x-o._textBounds.x}switch(s.getMinorAlignment()){case i.BEGIN:case i.FIRST:n.y=Math.ceil(n.y),t.y=n.y-o._textBounds.y;break;case i.MIDDLE:n.y=Math.round(n.y),t.y=n.y-o._textBounds.y;break;case i.END:t.y=Math.floor(t.y),n.y=t.y+o._textBounds.y}o._origin.x=t.x,o._origin.y=n.y,this.getBBox().setExtents(t,n)}}(),build:function(){const t=new o(0,0,0),e=new o(1,1,0);return function(){const i=this.getFontStyle(),n=i.getFont();if(!n)return;const s=this.getText(),o=this.getGlyphs(),r=this.getMinorAlignment(),a=this.getTranslations(),u=this.getCharSpacings(),h=i.getScale(),c=h/n.unitsPerEm,d=this.texCoordArray,p=s.getNormals(),f=s.getVertices(),y=this.canvas[0],x=this.context;d.length=0,s.getMultiTexCoords().push(d),this.getBBox().getExtents(t,e),p.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),f.push(t.x,t.y,0,1,e.x,t.y,0,1,e.x,e.y,0,1,t.x,t.y,0,1,e.x,e.y,0,1,t.x,e.y,0,1);const g=s._textBounds.x,_=s._textBounds.y;y.width=l.nextPowerOfTwo(g),y.height=l.nextPowerOfTwo(_);const w=g/y.width,m=1-_/y.height;if(d.push(0,m,0,1,w,m,0,1,w,1,0,1,0,m,0,1,w,1,0,1,0,1,0,1),x.fillStyle="rgba(255,255,255,0)",x.fillRect(0,0,y.width,y.height),x.fillStyle="rgba(255,255,255,1)",i._horizontal.getValue())for(let i=0,s=o.length;i<s;++i){const s=o[i],l=u[i],d=a[i];let p=0;for(let i=0,o=s.length;i<o;++i){const o=s[i],a=r.x+d.x+p+i*l-t.x,u=r.y+d.y-e.y;this.drawGlyph(x,n,o,a,u,h);let f=0;i+1<s.length&&(f=n.getKerningValue(o,s[i+1])),p+=(o.advanceWidth+f)*c}}else{const u=i._leftToRight.getValue(),l=i._topToBottom.getValue(),c=u?0:s._string.length-1,d=u?s._string.length:-1,p=u?1:-1;for(let i=c,s=0;i!==d;i+=p){const u=o[i],c=u.length,d=l?c:-1,p=l?1:-1;for(let i=l?0:c-1;i!==d;i+=p,++s){const o=a[s],l=r.x+o.x-t.x,c=r.y+o.y-e.y;this.drawGlyph(x,n,u[i],l,c,h)}}}const M=x.getImageData(0,0,y.width,y.height);M?this.textureNode.setTexture(y.width,y.height,!0,new Uint8Array(M.data.buffer),!0):this.textureNode.clear()}}(),drawGlyph:function(t,e,i,n,s,o){const r=i.getPath(n,-s,o),a=r.commands;t.beginPath();for(let e=0,i=a.length;e<i;++e){const i=a[e];switch(i.type){case"M":t.moveTo(i.x,i.y);continue;case"Z":t.closePath();continue;case"L":t.lineTo(i.x,i.y);continue;case"Q":t.quadraticCurveTo(i.x1,i.y1,i.x,i.y);continue;case"C":t.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y);continue}}r.fill&&t.fill(),r.stroke&&(t.lineWidth=r.strokeWidth,t.stroke())},getGlyphExtents:function(t,e,i,n,s){const o=t.unitsPerEm;n.set((e.xMin||0)/o,(e.yMin||0)/o,0),s.set((e.xMax||0)/o,(e.yMax||0)/o,0)},transform:function(){const t=new r(0,0,0,0),e=new r(0,0,0,0),i=new r(0,0,0,0),n=new o(0,0,0),s=new a,l=new u;return function(r){const a=this.getText(),u=r.getModelViewMatrix().get(),c=r.getProjectionMatrix().get(),d=r.getViewVolume().getViewport(),p=r.getViewpoint().getScreenScale(u.origin,d);t.set(u[0],u[1],u[2],u[3]),e.set(u[4],u[5],u[6],u[7]),i.set(u[8],u[9],u[10],u[11]),t.normalize().multiply(p.x),e.normalize().multiply(p.y),i.normalize().multiply(p.z),s.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,u[12],u[13],u[14],u[15]),h.projectPoint(o.Zero,s,c,d,n),n.x=Math.round(n.x),n.y=Math.round(n.y),h.unProjectPoint(n.x,n.y,n.z,s,c,d,n),n.z=0,s.translate(n),this.matrix.assign(u).inverse().multLeft(s),l.assign(this.getBBox()).multRight(this.matrix),a.setBBox(l)}}(),traverse:function(t,e){this.transform(e)},display:function(t,e){a.prototype.multLeft.call(e.modelViewMatrix,this.matrix),e.textureNode=this.textureNode},transformLine:function(t){return t.multLineMatrix(a.inverse(this.matrix))},transformMatrix:function(t){return t.multLeft(this.matrix)}}),c})),t("x_ite/Components/Layout/ScreenFontStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Text/X3DFontStyleNode","x_ite/Browser/Layout/ScreenText","x_ite/Base/X3DConstants"],(function(t,e,i,n,s,o){"use strict";function r(t){n.call(this,t),this.addType(o.ScreenFontStyle)}return r.prototype=Object.assign(Object.create(n.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"language",new t.SFString),new e(o.inputOutput,"family",new t.MFString("SERIF")),new e(o.inputOutput,"style",new t.SFString("PLAIN")),new e(o.inputOutput,"pointSize",new t.SFFloat(12)),new e(o.inputOutput,"spacing",new t.SFFloat(1)),new e(o.inputOutput,"horizontal",new t.SFBool(!0)),new e(o.inputOutput,"leftToRight",new t.SFBool(!0)),new e(o.inputOutput,"topToBottom",new t.SFBool(!0)),new e(o.inputOutput,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"ScreenFontStyle"},getComponentName:function(){return"Layout"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(t){return new s(t,this)},getScale:function(){return this._pointSize.getValue()*this.getBrowser().getPointSize()}}),r})),t("x_ite/Components/Layout/ScreenGroup",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Base/X3DConstants","x_ite/Rendering/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/ViewVolume"],(function(t,e,i,n,s,o,r,a,u,h){"use strict";function l(t){n.call(this,t),this.addType(s.ScreenGroup),this.matrix=new u}var c,d,p,f,y;return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"visible",new t.SFBool(!0)),new e(s.inputOutput,"bboxDisplay",new t.SFBool),new e(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(s.initializeOnly,"bboxCenter",new t.SFVec3f),new e(s.inputOnly,"addChildren",new t.MFNode),new e(s.inputOnly,"removeChildren",new t.MFNode),new e(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"ScreenGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},getBBox:function(t,e){return this.getSubBBox(t,e).multRight(this.matrix)},getMatrix:function(){return this.matrix},scale:(c=new a(0,0,0,0),d=new a(0,0,0,0),p=new a(0,0,0,0),f=new r(0,0,0),y=new u,function(t){var e=t.getModelViewMatrix().get(),i=t.getProjectionMatrix().get(),n=t.getViewVolume().getViewport(),s=t.getViewpoint().getScreenScale(e.origin,n);c.set(e[0],e[1],e[2],e[3]),d.set(e[4],e[5],e[6],e[7]),p.set(e[8],e[9],e[10],e[11]),c.normalize().multiply(s.x),d.normalize().multiply(s.y),p.normalize().multiply(s.z),y.set(c.x,c.y,c.z,c.w,d.x,d.y,d.z,d.w,p.x,p.y,p.z,p.w,e[12],e[13],e[14],e[15]),h.projectPoint(r.Zero,y,i,n,f),f.x=Math.round(f.x),f.y=Math.round(f.y),h.unProjectPoint(f.x,f.y,f.z,y,i,n,f),f.z=0,y.translate(f),this.matrix.assign(e).inverse().multLeft(y)}),traverse:function(t,e){try{switch(t){case o.CAMERA:case o.PICKING:case o.SHADOW:break;default:this.scale(e)}var i=e.getModelViewMatrix();i.push(),i.multLeft(this.matrix),n.prototype.traverse.call(this,t,e),i.pop()}catch(t){}}}),l})),t(e.getComponentUrl("layout"),["x_ite/Components","x_ite/Browser/Layout/X3DLayoutContext","x_ite/Components/Layout/Layout","x_ite/Components/Layout/LayoutGroup","x_ite/Components/Layout/LayoutLayer","x_ite/Components/Layout/ScreenFontStyle","x_ite/Components/Layout/ScreenGroup","x_ite/Components/Layout/X3DLayoutNode"],(function(t,e,i,n,s,o,r,a){"use strict";t.addComponent({name:"Layout",types:{Layout:i,LayoutGroup:n,LayoutLayer:s,ScreenFontStyle:o,ScreenGroup:r},abstractTypes:{X3DLayoutNode:a},browser:e})}))}();
|
|
1
|
+
!function(){const t=window[Symbol.for("X_ITE.X3D-6.0.0")].define,e=window[Symbol.for("X_ITE.X3D-6.0.0")].require;t("x_ite/Browser/Layout/X3DLayoutContext",["jquery","x_ite/Components/Texturing/TextureProperties"],(function(t,e){"use strict";const i=Symbol();function n(){}return n.prototype={getScreenTextureProperties:function(){return this[i]=new e(this.getPrivateScene()),this[i]._boundaryModeS="CLAMP",this[i]._boundaryModeT="CLAMP",this[i]._boundaryModeR="CLAMP",this[i]._minificationFilter="NEAREST_PIXEL",this[i]._magnificationFilter="NEAREST_PIXEL",this[i]._generateMipMaps=!1,this[i].setup(),this.getScreenTextureProperties=function(){return this[i]},Object.defineProperty(this,"getScreenTextureProperties",{enumerable:!1}),this[i]}},n})),t("x_ite/Components/Layout/X3DLayoutNode",["x_ite/Components/Core/X3DChildNode","x_ite/Base/X3DConstants"],(function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DLayoutNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i})),t("x_ite/Components/Layout/Layout",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Layout/X3DLayoutNode","x_ite/Base/X3DCast","x_ite/Base/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],(function(t,e,i,n,s,o,r,a,u,h){"use strict";var l=0,c=l++,d=l++,p=l++,f=l++,y=l++,x=l++,g=l++,_=l++,w=l++,m=l++;function M(t){n.call(this,t),this.addType(o.Layout),this.alignX=d,this.alignY=d,this.offsetUnitX=x,this.offsetUnitY=x,this.offsetX=0,this.offsetY=0,this.sizeUnitX=x,this.sizeUnitY=x,this.sizeX=1,this.sizeY=1,this.scaleModeX=w,this.scaleModeY=w,this.parent=null,this.rectangleCenter=new r(0,0),this.rectangleSize=new r(0,0),this.matrix=new h}return M.prototype=Object.assign(Object.create(n.prototype),{constructor:M,viewportPixel:new r(0,0),pixelSize:new r(0,0),translation:new a(0,0,0),offset:new a(0,0,0),scale:new a(1,1,1),currentTranslation:new a(0,0,0),currentRotation:new u(0,0,1,0),currentScale:new a(0,0,0),modelViewMatrix:new h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"align",new t.MFString("CENTER","CENTER")),new e(o.inputOutput,"offsetUnits",new t.MFString("WORLD","WORLD")),new e(o.inputOutput,"offset",new t.MFFloat(0,0)),new e(o.inputOutput,"sizeUnits",new t.MFString("WORLD","WORLD")),new e(o.inputOutput,"size",new t.MFFloat(1,1)),new e(o.inputOutput,"scaleMode",new t.MFString("NONE","NONE"))]),getTypeName:function(){return"Layout"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layout"},initialize:function(){n.prototype.initialize.call(this),this._align.addInterest("set_align__",this),this._offsetUnits.addInterest("set_offsetUnits__",this),this._offset.addInterest("set_offset__",this),this._sizeUnits.addInterest("set_sizeUnits__",this),this._size.addInterest("set_size__",this),this._scaleMode.addInterest("set_scaleMode__",this),this.set_align__(),this.set_offsetUnits__(),this.set_offset__(),this.set_sizeUnits__(),this.set_size__(),this.set_scaleMode__()},set_align__:function(){this._align.length>0?"LEFT"===this._align[0]?this.alignX=c:"RIGHT"===this._align[0]?this.alignX=p:this.alignX=d:this.alignX=d,this._align.length>1?"BOTTOM"===this._align[1]?this.alignY=f:"TOP"===this._align[1]?this.alignY=y:this.alignY=d:this.alignY=d},set_offsetUnits__:function(){this._offsetUnits.length>0?("FRACTION"===this._offsetUnits[0]?this.offsetUnitX=g:"PIXEL"===this._offsetUnits[0]?this.offsetUnitX=_:this.offsetUnitX=x,this._offsetUnits.length>1?"FRACTION"===this._offsetUnits[1]?this.offsetUnitY=g:"PIXEL"===this._offsetUnits[1]?this.offsetUnitY=_:this.offsetUnitY=x:this.offsetUnitY=this.offsetUnitX):(this.offsetUnitX=x,this.offsetUnitY=x)},set_offset__:function(){this._offset.length>0?(this.offsetX=this._offset[0],this._offset.length>1?this.offsetY=this._offset[1]:this.offsetY=offsetX):(this.offsetX=0,this.offsetY=0)},set_sizeUnits__:function(){this._sizeUnits.length>0?("FRACTION"===this._sizeUnits[0]?this.sizeUnitX=g:"PIXEL"===this._sizeUnits[0]?this.sizeUnitX=_:this.sizeUnitX=x,this._sizeUnits.length>1?"FRACTION"===this._sizeUnits[1]?this.sizeUnitY=g:"PIXEL"===this._sizeUnits[1]?this.sizeUnitY=_:this.sizeUnitY=x:this.sizeUnitY=this.sizeUnitX):(this.sizeUnitX=x,this.sizeUnitY=x)},set_size__:function(){this._size.length>0?(this.sizeX=this._size[0],this._size.length>1?this.sizeY=this._size[1]:this.sizeY=this.sizeX):(this.sizeX=0,this.sizeY=0)},set_scaleMode__:function(){this._scaleMode.length>0?("FRACTION"===this._scaleMode[0]?this.scaleModeX=g:"PIXEL"===this._scaleMode[0]?this.scaleModeX=_:"STRETCH"===this._scaleMode[0]?this.scaleModeX=m:this.scaleModeX=w,this._scaleMode.length>1?"FRACTION"===this._scaleMode[1]?this.scaleModeY=g:"PIXEL"===this._scaleMode[1]?this.scaleModeY=_:"STRETCH"===this._scaleMode[1]?this.scaleModeY=m:this.scaleModeY=w:this.scaleModeY=this.scaleModeX):(this.scaleModeX=w,this.scaleModeY=w)},getRectangleCenter:function(){return this.rectangleCenter},getRectangleSize:function(){return this.rectangleSize},getAlignX:function(){return this.alignX},getAlignY:function(){return this.alignY},getOffsetUnitX:function(){return this.offsetUnitX===x?this.parent?this.parent.getOffsetUnitX():g:this.offsetUnitX},getOffsetUnitY:function(){return this.offsetUnitY===x?this.parent?this.parent.getOffsetUnitY():g:this.offsetUnitY},getOffsetX:function(){return this.offsetX},getOffsetY:function(){return this.offsetY},getSizeUnitX:function(){return this.sizeUnitX===x?this.parent?this.parent.getSizeUnitX():g:this.sizeUnitX},getSizeUnitY:function(){return this.sizeUnitY===x?this.parent?this.parent.getSizeUnitY():g:this.sizeUnitY},getSizeX:function(){return this.sizeX},getSizeY:function(){return this.sizeY},getScaleModeX:function(){return this.parent?this.scaleModeX:this.scaleModeX===w?g:this.scaleModeX},getScaleModeY:function(){return this.parent?this.scaleModeY:this.scaleModeY===w?g:this.scaleModeY},transform:function(t,e){var i=this.parent=e.getParentLayout(),n=this.matrix,s=e.getViewpoint(),o=e.getNavigationInfo().getNearValue(),r=e.getViewVolume().getScissor(),a=s.getViewportSize(r,o),u=this.viewportPixel,h=this.pixelSize,l=i?i.getRectangleSize():a,x=this.rectangleSize,M=this.rectangleCenter;switch(u.set(r[2],r[3]),h.assign(a).divVec(u),this.getSizeUnitX()){case g:x.x=this.sizeX*l.x;break;case _:x.x=this.sizeX*h.x}switch(this.getSizeUnitY()){case g:x.y=this.sizeY*l.y;break;case _:x.y=this.sizeY*h.y}var S=this.translation.set(0,0,0);switch(this.getAlignX()){case c:S.x=-(l.x-x.x)/2;break;case d:this.getSizeUnitX()===_&&1&u.x&&(S.x=-h.x/2);break;case p:S.x=(l.x-x.x)/2}switch(this.getAlignY()){case f:S.y=-(l.y-x.y)/2;break;case d:this.getSizeUnitX===_&&1&u.y&&(S.y=-h.y/2);break;case y:S.y=(l.y-x.y)/2}var X=this.offset.set(0,0,0);switch(this.getOffsetUnitX()){case g:X.x=this.offsetX*l.x;break;case _:X.x=this.offsetX*a.x/u.x}switch(this.getOffsetUnitY()){case g:X.y=this.offsetY*l.y;break;case _:X.y=this.offsetY*a.y/u.y}var z=this.scale.set(1,1,1),N=this.currentTranslation,F=this.currentRotation,C=this.currentScale;switch(e.getModelViewMatrix().get().get(N,F,C),this.getScaleModeX()){case w:z.x=C.x;break;case g:z.x=x.x;break;case m:break;case _:z.x=a.x/u.x}switch(this.getScaleModeY()){case w:z.y=C.y;break;case g:z.y=x.y;break;case m:break;case _:z.y=a.y/u.y}return this.getScaleModeX()===m?this.getScaleModeY()===m?x.x>x.y?(z.x=x.x,z.y=z.x):(z.y=x.y,z.x=z.y):z.x=z.y:this.getScaleModeY()===m&&(z.y=z.x),M.assign(S).add(X),n.set(N,F),n.translate(S.add(X)),n.scale(z),n}}),M})),t("x_ite/Components/Layout/LayoutGroup",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Base/X3DCast","x_ite/Rendering/TraverseType","x_ite/Base/X3DConstants","standard/Math/Numbers/Matrix4"],(function(t,e,i,n,s,o,r,a){"use strict";function u(t){n.call(this,t),this.addType(r.LayoutGroup),this.viewportNode=null,this.layoutNode=null,this.modelViewMatrix=new a,this.screenMatrix=new a}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"layout",new t.SFNode),new e(r.inputOutput,"viewport",new t.SFNode),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this._viewport.addInterest("set_viewport__",this),this._layout.addInterest("set_layout__",this),this.set_viewport__(),this.set_layout__()},set_viewport__:function(){this.viewportNode=s(r.X3DViewportNode,this._viewport)},set_layout__:function(){this.layoutNode=s(r.X3DLayoutNode,this._layout)},getBBox:function(t,e){return n.prototype.getBBox.call(this,t,e).multRight(this.getMatrix())},getMatrix:function(){return this.layoutNode?this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix):this.matrix.identity(),this.matrix},traverse:function(t,e){if(t!==o.COLLISION){if(this.viewportNode&&this.viewportNode.push(),this.layoutNode){var i=e.getModelViewMatrix();this.modelViewMatrix.assign(i.get()),this.screenMatrix.assign(this.layoutNode.transform(t,e)),i.pushMatrix(this.screenMatrix),e.getLayouts().push(this.layoutNode),n.prototype.traverse.call(this,t,e),e.getLayouts().pop(),i.pop()}else n.prototype.traverse.call(this,t,e);this.viewportNode&&this.viewportNode.pop()}}}),u})),t("x_ite/Components/Layout/LayoutLayer",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Layout/LayoutGroup","x_ite/Components/Navigation/OrthoViewpoint","x_ite/Base/X3DConstants"],(function(t,e,i,n,s,o,r){"use strict";function a(t){n.call(this,t,new o(t),new s(t)),this.addType(r.LayoutLayer)}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"isPickable",new t.SFBool(!0)),new e(r.inputOutput,"layout",new t.SFNode),new e(r.inputOutput,"viewport",new t.SFNode),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutLayer"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layers"},initialize:function(){n.prototype.initialize.call(this),this._layout.addFieldInterest(this.getGroup()._layout),this._addChildren.addFieldInterest(this.getGroup()._addChildren),this._removeChildren.addFieldInterest(this.getGroup()._removeChildren),this._children.addFieldInterest(this.getGroup()._children),this.getGroup()._layout=this._layout,this.getGroup()._children=this._children,this.getGroup().setPrivate(!0),this.getGroup().setup()}}),a})),t("x_ite/Browser/Layout/ScreenText",["jquery","x_ite/Browser/Text/X3DTextGeometry","x_ite/Browser/Text/TextAlignment","x_ite/Components/Texturing/PixelTexture","x_ite/Components/Rendering/X3DGeometryNode","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume","standard/Math/Algorithm"],(function(t,e,i,n,s,o,r,a,u,h,l){"use strict";function c(i,o){e.call(this,i,o),i.setTransparent(!0),this.texCoordArray=s.createArray(),this.textureNode=new n(i.getExecutionContext()),this.canvas=t("<canvas></canvas>"),this.context=this.canvas[0].getContext("2d"),this.matrix=new a,this.textureNode._textureProperties=o.getBrowser().getScreenTextureProperties(),this.textureNode.setup()}return c.prototype=Object.assign(Object.create(e.prototype),{constructor:c,modelViewMatrix:new a,getTransparent:function(){return!0},getMatrix:function(){return this.matrix},update:function(){const t=new o(0,0,0),n=new o(1,1,0);return function(){e.prototype.update.call(this);const s=this.getFontStyle(),o=this.getText();switch(o._textBounds.x=Math.ceil(o._textBounds.x)+1,o._textBounds.y=Math.ceil(o._textBounds.y)+1,this.getBBox().getExtents(t,n),t.x-=1,t.y-=1,s.getMajorAlignment()){case i.BEGIN:case i.FIRST:t.x=Math.floor(t.x),n.x=t.x+o._textBounds.x;break;case i.MIDDLE:t.x=Math.round(t.x),n.x=t.x+o._textBounds.x;break;case i.END:n.x=Math.ceil(n.x),t.x=n.x-o._textBounds.x}switch(s.getMinorAlignment()){case i.BEGIN:case i.FIRST:n.y=Math.ceil(n.y),t.y=n.y-o._textBounds.y;break;case i.MIDDLE:n.y=Math.round(n.y),t.y=n.y-o._textBounds.y;break;case i.END:t.y=Math.floor(t.y),n.y=t.y+o._textBounds.y}o._origin.x=t.x,o._origin.y=n.y,this.getBBox().setExtents(t,n)}}(),build:function(){const t=new o(0,0,0),e=new o(1,1,0);return function(){const i=this.getFontStyle(),n=i.getFont();if(!n)return;const s=this.getText(),o=this.getGlyphs(),r=this.getMinorAlignment(),a=this.getTranslations(),u=this.getCharSpacings(),h=i.getScale(),c=h/n.unitsPerEm,d=this.texCoordArray,p=s.getNormals(),f=s.getVertices(),y=this.canvas[0],x=this.context;d.length=0,s.getMultiTexCoords().push(d),this.getBBox().getExtents(t,e),p.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),f.push(t.x,t.y,0,1,e.x,t.y,0,1,e.x,e.y,0,1,t.x,t.y,0,1,e.x,e.y,0,1,t.x,e.y,0,1);const g=s._textBounds.x,_=s._textBounds.y;y.width=l.nextPowerOfTwo(g),y.height=l.nextPowerOfTwo(_);const w=g/y.width,m=1-_/y.height;if(d.push(0,m,0,1,w,m,0,1,w,1,0,1,0,m,0,1,w,1,0,1,0,1,0,1),x.fillStyle="rgba(255,255,255,0)",x.fillRect(0,0,y.width,y.height),x.fillStyle="rgba(255,255,255,1)",x.save(),x.translate(0,y.height),x.scale(1,-1),i._horizontal.getValue())for(let i=0,s=o.length;i<s;++i){const s=o[i],l=u[i],d=a[i];let p=0;for(let i=0,o=s.length;i<o;++i){const o=s[i],a=r.x+d.x+p+i*l-t.x,u=r.y+d.y-e.y;this.drawGlyph(x,n,o,a,u,h);let f=0;i+1<s.length&&(f=n.getKerningValue(o,s[i+1])),p+=(o.advanceWidth+f)*c}}else{const u=i._leftToRight.getValue(),l=i._topToBottom.getValue(),c=u?0:s._string.length-1,d=u?s._string.length:-1,p=u?1:-1;for(let i=c,s=0;i!==d;i+=p){const u=o[i],c=u.length,d=l?c:-1,p=l?1:-1;for(let i=l?0:c-1;i!==d;i+=p,++s){const o=a[s],l=r.x+o.x-t.x,c=r.y+o.y-e.y;this.drawGlyph(x,n,u[i],l,c,h)}}}x.restore();const M=x.getImageData(0,0,y.width,y.height);M?this.textureNode.setTexture(y.width,y.height,!0,new Uint8Array(M.data.buffer),!1):this.textureNode.clear()}}(),drawGlyph:function(t,e,i,n,s,o){const r=i.getPath(n,-s,o),a=r.commands;t.beginPath();for(let e=0,i=a.length;e<i;++e){const i=a[e];switch(i.type){case"M":t.moveTo(i.x,i.y);continue;case"Z":t.closePath();continue;case"L":t.lineTo(i.x,i.y);continue;case"Q":t.quadraticCurveTo(i.x1,i.y1,i.x,i.y);continue;case"C":t.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y);continue}}r.fill&&t.fill(),r.stroke&&(t.lineWidth=r.strokeWidth,t.stroke())},getGlyphExtents:function(t,e,i,n,s){const o=t.unitsPerEm;n.set((e.xMin||0)/o,(e.yMin||0)/o,0),s.set((e.xMax||0)/o,(e.yMax||0)/o,0)},transform:function(){const t=new r(0,0,0,0),e=new r(0,0,0,0),i=new r(0,0,0,0),n=new o(0,0,0),s=new a,l=new u;return function(r){const a=this.getText(),u=r.getModelViewMatrix().get(),c=r.getProjectionMatrix().get(),d=r.getViewVolume().getViewport(),p=r.getViewpoint().getScreenScale(u.origin,d);t.set(u[0],u[1],u[2],u[3]),e.set(u[4],u[5],u[6],u[7]),i.set(u[8],u[9],u[10],u[11]),t.normalize().multiply(p.x),e.normalize().multiply(p.y),i.normalize().multiply(p.z),s.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,u[12],u[13],u[14],u[15]),h.projectPoint(o.Zero,s,c,d,n),n.x=Math.round(n.x),n.y=Math.round(n.y),h.unProjectPoint(n.x,n.y,n.z,s,c,d,n),n.z=0,s.translate(n),this.matrix.assign(u).inverse().multLeft(s),l.assign(this.getBBox()).multRight(this.matrix),a.setBBox(l)}}(),traverse:function(t,e){this.transform(e)},display:function(t,e){a.prototype.multLeft.call(e.modelViewMatrix,this.matrix),e.textureNode=this.textureNode},transformLine:function(t){return t.multLineMatrix(a.inverse(this.matrix))},transformMatrix:function(t){return t.multLeft(this.matrix)}}),c})),t("x_ite/Components/Layout/ScreenFontStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Text/X3DFontStyleNode","x_ite/Browser/Layout/ScreenText","x_ite/Base/X3DConstants"],(function(t,e,i,n,s,o){"use strict";function r(t){n.call(this,t),this.addType(o.ScreenFontStyle)}return r.prototype=Object.assign(Object.create(n.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"language",new t.SFString),new e(o.inputOutput,"family",new t.MFString("SERIF")),new e(o.inputOutput,"style",new t.SFString("PLAIN")),new e(o.inputOutput,"pointSize",new t.SFFloat(12)),new e(o.inputOutput,"spacing",new t.SFFloat(1)),new e(o.inputOutput,"horizontal",new t.SFBool(!0)),new e(o.inputOutput,"leftToRight",new t.SFBool(!0)),new e(o.inputOutput,"topToBottom",new t.SFBool(!0)),new e(o.inputOutput,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"ScreenFontStyle"},getComponentName:function(){return"Layout"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(t){return new s(t,this)},getScale:function(){return this._pointSize.getValue()*this.getBrowser().getPixelPerPoint()}}),r})),t("x_ite/Components/Layout/ScreenGroup",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Base/X3DConstants","x_ite/Rendering/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/ViewVolume"],(function(t,e,i,n,s,o,r,a,u,h){"use strict";function l(t){n.call(this,t),this.addType(s.ScreenGroup),this.matrix=new u}var c,d,p,f,y;return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"visible",new t.SFBool(!0)),new e(s.inputOutput,"bboxDisplay",new t.SFBool),new e(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(s.initializeOnly,"bboxCenter",new t.SFVec3f),new e(s.inputOnly,"addChildren",new t.MFNode),new e(s.inputOnly,"removeChildren",new t.MFNode),new e(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"ScreenGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},getBBox:function(t,e){return this.getSubBBox(t,e).multRight(this.matrix)},getMatrix:function(){return this.matrix},scale:(c=new a(0,0,0,0),d=new a(0,0,0,0),p=new a(0,0,0,0),f=new r(0,0,0),y=new u,function(t){var e=t.getModelViewMatrix().get(),i=t.getProjectionMatrix().get(),n=t.getViewVolume().getViewport(),s=t.getViewpoint().getScreenScale(e.origin,n);c.set(e[0],e[1],e[2],e[3]),d.set(e[4],e[5],e[6],e[7]),p.set(e[8],e[9],e[10],e[11]),c.normalize().multiply(s.x),d.normalize().multiply(s.y),p.normalize().multiply(s.z),y.set(c.x,c.y,c.z,c.w,d.x,d.y,d.z,d.w,p.x,p.y,p.z,p.w,e[12],e[13],e[14],e[15]),h.projectPoint(r.Zero,y,i,n,f),f.x=Math.round(f.x),f.y=Math.round(f.y),h.unProjectPoint(f.x,f.y,f.z,y,i,n,f),f.z=0,y.translate(f),this.matrix.assign(e).inverse().multLeft(y)}),traverse:function(t,e){switch(t){case o.CAMERA:case o.PICKING:case o.SHADOW:break;default:this.scale(e)}var i=e.getModelViewMatrix();i.push(),i.multLeft(this.matrix),n.prototype.traverse.call(this,t,e),i.pop()}}),l})),t(e.getComponentUrl("layout"),["x_ite/Components","x_ite/Browser/Layout/X3DLayoutContext","x_ite/Components/Layout/Layout","x_ite/Components/Layout/LayoutGroup","x_ite/Components/Layout/LayoutLayer","x_ite/Components/Layout/ScreenFontStyle","x_ite/Components/Layout/ScreenGroup","x_ite/Components/Layout/X3DLayoutNode"],(function(t,e,i,n,s,o,r,a){"use strict";t.addComponent({name:"Layout",types:{Layout:i,LayoutGroup:n,LayoutLayer:s,ScreenFontStyle:o,ScreenGroup:r},abstractTypes:{X3DLayoutNode:a},context:e})}))}();
|