x_ite 4.2.17 → 4.7.7
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/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +27 -10
- package/README.md +13 -145
- package/build/bin/dist.pl +65 -8
- package/build/bin/version-number.pl +25 -0
- package/build/bin/version.pl +54 -14
- package/build/components/annotation.build.js +15 -0
- package/build/components/cad-geometry.build.js +15 -0
- package/build/components/cube-map-texturing.build.js +15 -0
- package/build/components/dis.build.js +15 -0
- package/build/components/event-utilities.build.js +15 -0
- package/build/components/geometry2d.build.js +15 -0
- package/build/components/geospatial.build.js +15 -0
- package/build/components/h-anim.build.js +15 -0
- package/build/components/key-device-sensor.build.js +15 -0
- package/build/components/layout.build.js +15 -0
- package/build/components/nurbs.build.js +15 -0
- package/build/components/particle-systems.build.js +15 -0
- package/build/components/picking.build.js +15 -0
- package/build/components/projective-texture-mapping.build.js +15 -0
- package/build/components/rigid-body-physics.build.js +15 -0
- package/build/components/scripting.build.js +15 -0
- package/build/components/texturing-3d.build.js +15 -0
- package/build/components/volume-rendering.build.js +15 -0
- package/build/components/x_ite.build.js +15 -0
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/x_ite.end.frag.js +25 -0
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +5 -2
- package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/{components → assets/components}/cad-geometry.js +180 -76
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1222 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +918 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1124 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2200 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/{components → assets/components}/geospatial.js +364 -269
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/{components → assets/components}/h-anim.js +224 -62
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +860 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2018 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/{components → assets/components}/nurbs.js +632 -348
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/{components → assets/components}/particle-systems.js +514 -476
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2491 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +823 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4579 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +816 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10064 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3976 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +295 -0
- package/dist/assets/components/x_ite.min.js +1 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Bold.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-BoldItalic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Italic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Regular.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-RI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-RI.ttf +0 -0
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/hatching/1.png +0 -0
- package/dist/assets/hatching/10.png +0 -0
- package/dist/assets/hatching/11.png +0 -0
- package/dist/assets/hatching/12.png +0 -0
- package/dist/assets/hatching/13.png +0 -0
- package/dist/assets/hatching/14.png +0 -0
- package/dist/assets/hatching/15.png +0 -0
- package/dist/assets/hatching/16.png +0 -0
- package/dist/assets/hatching/17.png +0 -0
- package/dist/assets/hatching/18.png +0 -0
- package/dist/assets/hatching/19.png +0 -0
- package/dist/assets/hatching/2.png +0 -0
- package/dist/assets/hatching/3.png +0 -0
- package/dist/assets/hatching/4.png +0 -0
- package/dist/assets/hatching/5.png +0 -0
- package/dist/assets/hatching/6.png +0 -0
- package/dist/assets/hatching/7.png +0 -0
- package/dist/assets/hatching/8.png +0 -0
- package/dist/assets/hatching/9.png +0 -0
- package/dist/{images → assets/images}/ExamineViewer.png +0 -0
- package/dist/{images → assets/images}/FlyViewer.png +0 -0
- package/dist/{images → assets/images}/NoneViewer.png +0 -0
- package/dist/{images → assets/images}/PlaneViewer.png +0 -0
- package/dist/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/dist/{images → assets/images}/TextureQuality.png +0 -0
- package/dist/{images → assets/images}/Time.png +0 -0
- package/dist/{images → assets/images}/Viewpoint.png +0 -0
- package/dist/{images → assets/images}/WalkViewer.png +0 -0
- package/dist/assets/images/go-next.png +0 -0
- package/dist/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/dist/{images → assets/images}/help-about.png +0 -0
- package/dist/{images → assets/images}/icon.bw.png +0 -0
- package/dist/{images → assets/images}/icon.png +0 -0
- package/dist/assets/images/logo.128.png +0 -0
- package/dist/{images → assets/images}/logo.bw.png +0 -0
- package/dist/{images → assets/images}/logo.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- 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/Background.fs +23 -0
- package/dist/assets/shaders/webgl1/Background.vs +16 -0
- package/dist/assets/shaders/webgl1/Depth.fs +60 -0
- package/dist/assets/shaders/webgl1/Depth.vs +13 -0
- package/dist/assets/shaders/webgl1/Fallback.fs +28 -0
- package/dist/assets/shaders/webgl1/Fallback.vs +24 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +15 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.vs +18 -0
- package/dist/assets/shaders/webgl1/Gouraud.fs +529 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +107 -0
- package/dist/assets/shaders/webgl1/Phong.fs +837 -0
- package/dist/assets/shaders/webgl1/Phong.vs +52 -0
- package/dist/assets/shaders/webgl1/PointSet.fs +541 -0
- package/dist/assets/shaders/webgl1/PointSet.vs +48 -0
- package/dist/assets/shaders/webgl1/Unlit.fs +538 -0
- package/dist/assets/shaders/webgl1/Unlit.vs +52 -0
- package/dist/assets/shaders/webgl1/Wireframe.fs +93 -0
- package/dist/assets/shaders/webgl1/Wireframe.vs +47 -0
- package/dist/assets/shaders/webgl2/Background.fs +25 -0
- package/dist/assets/shaders/webgl2/Background.vs +17 -0
- package/dist/assets/shaders/webgl2/Depth.fs +62 -0
- package/dist/assets/shaders/webgl2/Depth.vs +14 -0
- package/dist/assets/shaders/webgl2/Gouraud.fs +684 -0
- package/dist/assets/shaders/webgl2/Gouraud.vs +108 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1013 -0
- package/dist/assets/shaders/webgl2/Phong.vs +53 -0
- package/dist/assets/shaders/webgl2/PointSet.fs +696 -0
- package/dist/assets/shaders/webgl2/PointSet.vs +49 -0
- package/dist/assets/shaders/webgl2/Unlit.fs +693 -0
- package/dist/assets/shaders/webgl2/Unlit.vs +53 -0
- package/dist/assets/shaders/webgl2/Wireframe.fs +102 -0
- package/dist/assets/shaders/webgl2/Wireframe.vs +48 -0
- package/dist/example.html +8 -7
- package/dist/x_ite.css +167 -49
- package/dist/x_ite.js +66263 -60020
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +319 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +896 -0
- package/docs/Features.md +49 -0
- package/docs/Glossary.md +339 -0
- package/docs/How-To-Configure-Your-Web-Server.md +56 -0
- package/docs/Supported-Nodes.md +370 -0
- package/docs/What's-New.md +1295 -0
- package/docs/XHTML-DOM-Integration.md +82 -0
- package/docs/_config.yml +140 -0
- package/docs/_data/navigation.yml +137 -0
- package/docs/assets/css/main.scss +100 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/google3696ee938394d7b6.html +1 -0
- package/docs/index.md +1033 -0
- package/docs/reference/Browser-Services.md +361 -0
- package/docs/reference/Constants-Services.md +376 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +128 -0
- package/docs/reference/Field-Services-and-Objects.md +1006 -0
- package/docs/reference/Prototype-Services.md +121 -0
- package/docs/reference/Route-Services.md +49 -0
- package/docs/reference/Scene-Services.md +360 -0
- package/docs/reference/Script-Node-Authoring-Interface.md +342 -0
- package/docs/tutorials/Adding-backgrounds.md +268 -0
- package/docs/tutorials/Adding-fog.md +67 -0
- package/docs/tutorials/Adding-sound.md +326 -0
- package/docs/tutorials/Animating-transforms.md +385 -0
- package/docs/tutorials/Basic-Nodes.md +317 -0
- package/docs/tutorials/Building-a-X3D-world.md +152 -0
- package/docs/tutorials/Building-elevation-grids.md +170 -0
- package/docs/tutorials/Building-extruded-shapes.md +145 -0
- package/docs/tutorials/Building-primitive-shapes.md +204 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +311 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +186 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +208 -0
- package/docs/tutorials/Controlling-detail.md +130 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +277 -0
- package/docs/tutorials/Controlling-navigation.md +70 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +180 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +49 -0
- package/docs/tutorials/Creating-new-node-types.md +313 -0
- package/docs/tutorials/Grouping-nodes.md +237 -0
- package/docs/tutorials/Hello,-World!.md +204 -0
- package/docs/tutorials/Improving-Performance.md +227 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +110 -0
- package/docs/tutorials/Introducing-X3D.md +94 -0
- package/docs/tutorials/Introducing-animation.md +211 -0
- package/docs/tutorials/Introducing-script-use.md +127 -0
- package/docs/tutorials/Lighting-your-world.md +139 -0
- package/docs/tutorials/Mapping-textures.md +212 -0
- package/docs/tutorials/Naming-nodes.md +161 -0
- package/docs/tutorials/Providing-information-about-your-world.md +30 -0
- package/docs/tutorials/Sensing-the-viewer.md +205 -0
- package/docs/tutorials/Sensing-viewer-actions.md +214 -0
- package/docs/tutorials/Transforming-Shapes.md +270 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +631 -0
- package/docs/tutorials/index.md +78 -0
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.svg +216 -217
- package/meta/web3d.html +3 -3
- package/package.json +43 -28
- package/src/assets/components/annotation.js +87 -0
- package/src/{components → assets/components}/cad-geometry.js +0 -0
- package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
- package/src/assets/components/dis.js +84 -0
- package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
- package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
- package/src/{components → assets/components}/geospatial.js +0 -0
- package/src/{components → assets/components}/h-anim.js +9 -7
- package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
- package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
- package/src/{components → assets/components}/nurbs.js +0 -0
- package/src/{components → assets/components}/particle-systems.js +1 -1
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/{components → assets/components}/rigid-body-physics.js +7 -2
- package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
- package/src/{components → assets/components}/texturing-3d.js +12 -13
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/{images → assets/images}/ExamineViewer.png +0 -0
- package/src/{images → assets/images}/FlyViewer.png +0 -0
- package/src/{images → assets/images}/NoneViewer.png +0 -0
- package/src/{images → assets/images}/PlaneViewer.png +0 -0
- package/src/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/src/{images → assets/images}/TextureQuality.png +0 -0
- package/src/{images → assets/images}/Time.png +0 -0
- package/src/{images → assets/images}/Viewpoint.png +0 -0
- package/src/{images → assets/images}/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/src/{images → assets/images}/help-about.png +0 -0
- package/src/{images → assets/images}/icon.bw.png +0 -0
- package/src/{images → assets/images}/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/{images → assets/images}/logo.bw.png +0 -0
- package/src/{images → assets/images}/logo.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- 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 +102 -0
- package/src/assets/shaders/webgl1/Background.fs +16 -0
- package/src/assets/shaders/webgl1/Background.vs +22 -0
- package/src/assets/shaders/webgl1/Depth.fs +16 -0
- package/src/assets/shaders/webgl1/Depth.vs +20 -0
- package/src/assets/shaders/webgl1/Fallback.fs +38 -0
- package/src/assets/shaders/webgl1/Fallback.vs +30 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +21 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +24 -0
- package/src/assets/shaders/webgl1/Gouraud.fs +66 -0
- package/src/assets/shaders/webgl1/Gouraud.vs +147 -0
- package/src/assets/shaders/webgl1/Phong.fs +172 -0
- package/src/assets/shaders/webgl1/Phong.vs +67 -0
- package/src/assets/shaders/webgl1/PointSet.fs +100 -0
- package/src/assets/shaders/webgl1/PointSet.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +86 -0
- package/src/assets/shaders/webgl1/Unlit.vs +67 -0
- package/src/assets/shaders/webgl1/Wireframe.fs +74 -0
- package/src/assets/shaders/webgl1/Wireframe.vs +63 -0
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +38 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl +18 -0
- package/src/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
- package/src/assets/shaders/webgl1/include/Texture.glsl +488 -0
- package/src/assets/shaders/webgl2/Background.fs +19 -0
- package/src/assets/shaders/webgl2/Background.vs +23 -0
- package/src/assets/shaders/webgl2/Depth.fs +19 -0
- package/src/assets/shaders/webgl2/Depth.vs +21 -0
- package/src/assets/shaders/webgl2/Gouraud.fs +64 -0
- package/src/assets/shaders/webgl2/Gouraud.vs +148 -0
- package/src/assets/shaders/webgl2/Phong.fs +170 -0
- package/src/assets/shaders/webgl2/Phong.vs +68 -0
- package/src/assets/shaders/webgl2/PointSet.fs +99 -0
- package/src/assets/shaders/webgl2/PointSet.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +85 -0
- package/src/assets/shaders/webgl2/Unlit.vs +68 -0
- package/src/assets/shaders/webgl2/Wireframe.fs +73 -0
- package/src/assets/shaders/webgl2/Wireframe.vs +64 -0
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Hatch.glsl +18 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl2/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl2/include/Shadow.glsl +324 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +623 -0
- package/src/bookmarks.js +33 -12
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +21 -3
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +4 -0
- package/src/lib/ammojs/ammo.idl +72 -1
- package/src/lib/ammojs/ammo.js +25 -21
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +137 -80
- package/src/locale/de.po +18 -73
- package/src/locale/fr.po +18 -74
- package/src/spinner.css +18 -6
- package/src/standard/Geospatial/Geodetic.js +43 -43
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
- package/src/standard/Math/Algorithm.js +22 -39
- package/src/standard/Math/Algorithms/Bezier.js +147 -0
- package/src/standard/Math/Algorithms/MergeSort.js +2 -2
- package/src/standard/Math/Algorithms/PartialSort.js +6 -6
- package/src/standard/Math/Algorithms/QuickSort.js +8 -6
- package/src/standard/Math/Algorithms/SAT.js +4 -8
- package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
- package/src/standard/Math/Geometry/Box2.js +84 -56
- package/src/standard/Math/Geometry/Box3.js +400 -358
- package/src/standard/Math/Geometry/Camera.js +19 -16
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +34 -34
- package/src/standard/Math/Geometry/Plane3.js +15 -15
- package/src/standard/Math/Geometry/Sphere3.js +122 -105
- package/src/standard/Math/Geometry/Spheroid3.js +1 -1
- package/src/standard/Math/Geometry/Triangle2.js +5 -5
- package/src/standard/Math/Geometry/Triangle3.js +12 -14
- package/src/standard/Math/Geometry/ViewVolume.js +303 -106
- package/src/standard/Math/Numbers/Color3.js +26 -23
- package/src/standard/Math/Numbers/Color4.js +9 -9
- package/src/standard/Math/Numbers/Complex.js +13 -17
- package/src/standard/Math/Numbers/Matrix2.js +20 -13
- package/src/standard/Math/Numbers/Matrix3.js +129 -205
- package/src/standard/Math/Numbers/Matrix4.js +136 -257
- package/src/standard/Math/Numbers/Quaternion.js +49 -138
- package/src/standard/Math/Numbers/Rotation4.js +42 -55
- package/src/standard/Math/Numbers/Vector2.js +32 -115
- package/src/standard/Math/Numbers/Vector3.js +46 -151
- package/src/standard/Math/Numbers/Vector4.js +44 -163
- package/src/standard/Math/Utility/BVH.js +21 -20
- package/src/standard/Math/Utility/MatrixStack.js +4 -4
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +81 -0
- package/src/standard/Utility/DataStorage.js +11 -14
- package/src/standard/Utility/MapUtilities.js +69 -0
- package/src/standard/Utility/ObjectCache.js +2 -3
- package/src/standard/Utility/Shuffle.js +5 -6
- package/src/tests.js +84 -5
- package/src/x_ite/Base/Events.js +9 -10
- package/src/x_ite/Base/X3DChildObject.js +20 -16
- package/src/x_ite/Base/X3DEventObject.js +3 -7
- package/src/x_ite/Base/X3DObject.js +44 -27
- package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
- package/src/x_ite/Basic/X3DBaseNode.js +427 -246
- package/src/x_ite/Basic/X3DField.js +48 -69
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
- package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +11 -2
- package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
- package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
- package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
- package/src/x_ite/Browser/Core/Notification.js +3 -3
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/Shading.js +3 -7
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
- package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
- package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
- package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
- package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
- package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
- package/src/x_ite/Browser/Networking/urls.js +31 -16
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
- package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
- package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
- package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +112 -92
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
- package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
- package/src/x_ite/Browser/Text/PolygonText.js +153 -170
- package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
- package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
- package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
- package/src/x_ite/Browser/X3DBrowser.js +282 -224
- package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
- package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
- package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
- package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
- package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
- package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
- package/src/x_ite/Components/Core/WorldInfo.js +16 -6
- package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
- package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
- package/src/x_ite/Components/Core/X3DNode.js +0 -63
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
- package/src/x_ite/Components/Core.js +6 -9
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
- package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
- package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
- package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
- package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
- package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
- package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
- package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
- package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
- package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
- package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
- package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
- package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
- package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
- package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
- package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
- package/src/x_ite/Components/Followers.js +6 -9
- package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
- package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
- package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
- package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
- package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
- package/src/x_ite/Components/Geometry3D.js +6 -9
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
- package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
- package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
- package/src/x_ite/Components/Grouping/Group.js +3 -3
- package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
- package/src/x_ite/Components/Grouping/Switch.js +171 -21
- package/src/x_ite/Components/Grouping/Transform.js +3 -3
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
- package/src/x_ite/Components/Grouping.js +6 -9
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
- package/src/x_ite/Components/Interpolation.js +6 -9
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
- package/src/x_ite/Components/Layering/Layer.js +12 -2
- package/src/x_ite/Components/Layering/LayerSet.js +4 -6
- package/src/x_ite/Components/Layering/Viewport.js +8 -8
- package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
- package/src/x_ite/Components/Layering.js +6 -9
- package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
- package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
- package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
- package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
- package/src/x_ite/Components/Lighting/PointLight.js +26 -29
- package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
- package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
- package/src/x_ite/Components/Lighting.js +6 -9
- package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
- package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
- package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
- package/src/x_ite/Components/Navigation/Billboard.js +12 -11
- package/src/x_ite/Components/Navigation/Collision.js +10 -8
- package/src/x_ite/Components/Navigation/LOD.js +207 -59
- package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
- package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
- package/src/x_ite/Components/Navigation.js +6 -9
- package/src/x_ite/Components/Networking/Anchor.js +22 -24
- package/src/x_ite/Components/Networking/Inline.js +63 -44
- package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
- package/src/x_ite/Components/Networking.js +6 -9
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
- package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
- package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
- package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
- package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
- package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
- package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
- package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
- package/src/x_ite/Components/Rendering/Color.js +22 -13
- package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
- package/src/x_ite/Components/Rendering/LineSet.js +44 -27
- package/src/x_ite/Components/Rendering/Normal.js +20 -4
- package/src/x_ite/Components/Rendering/PointSet.js +38 -16
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
- package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
- package/src/x_ite/Components/Rendering.js +6 -9
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
- package/src/x_ite/Components/Scripting/Script.js +147 -101
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
- package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
- package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
- package/src/x_ite/Components/Shaders.js +15 -18
- package/src/x_ite/Components/Shape/Appearance.js +153 -77
- package/src/x_ite/Components/Shape/FillProperties.js +63 -4
- package/src/x_ite/Components/Shape/LineProperties.js +27 -5
- package/src/x_ite/Components/Shape/Material.js +48 -62
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +86 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
- package/src/x_ite/Components/Shape.js +22 -16
- package/src/x_ite/Components/Sound/AudioClip.js +36 -50
- package/src/x_ite/Components/Sound/Sound.js +36 -36
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
- package/src/x_ite/Components/Sound.js +6 -9
- package/src/x_ite/Components/Text/FontStyle.js +10 -12
- package/src/x_ite/Components/Text/Text.js +6 -6
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
- package/src/x_ite/Components/Text.js +6 -9
- package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
- package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
- package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
- package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
- package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
- package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
- package/src/x_ite/Components/Texturing.js +31 -25
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
- package/src/x_ite/Components/Time/TimeSensor.js +23 -19
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
- package/src/x_ite/Components/Time.js +6 -9
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
- package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
- package/src/x_ite/Components.js +11 -16
- package/src/x_ite/Configuration/ComponentInfo.js +12 -6
- package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
- package/src/x_ite/Configuration/ProfileInfo.js +10 -6
- package/src/x_ite/Configuration/SupportedComponents.js +66 -40
- package/src/x_ite/Configuration/SupportedNodes.js +22 -6
- package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
- package/src/x_ite/Configuration/UnitInfo.js +12 -2
- package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
- package/src/x_ite/Execution/BindableList.js +63 -38
- package/src/x_ite/Execution/BindableStack.js +63 -71
- package/src/x_ite/Execution/ExportedNode.js +25 -2
- package/src/x_ite/Execution/ImportedNode.js +122 -39
- package/src/x_ite/Execution/Scene.js +22 -14
- package/src/x_ite/Execution/World.js +22 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
- package/src/x_ite/Execution/X3DScene.js +213 -53
- package/src/x_ite/{Error.js → Fallback.js} +26 -29
- package/src/x_ite/Fields/ArrayFields.js +176 -57
- package/src/x_ite/Fields/SFBool.js +6 -5
- package/src/x_ite/Fields/SFColor.js +24 -21
- package/src/x_ite/Fields/SFColorRGBA.js +23 -23
- package/src/x_ite/Fields/SFDouble.js +6 -5
- package/src/x_ite/Fields/SFFloat.js +7 -6
- package/src/x_ite/Fields/SFImage.js +37 -36
- package/src/x_ite/Fields/SFInt32.js +5 -4
- package/src/x_ite/Fields/SFMatrix3.js +19 -15
- package/src/x_ite/Fields/SFMatrix4.js +19 -15
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
- package/src/x_ite/Fields/SFNode.js +105 -53
- package/src/x_ite/Fields/SFNodeCache.js +93 -0
- package/src/x_ite/Fields/SFRotation.js +31 -27
- package/src/x_ite/Fields/SFString.js +9 -8
- package/src/x_ite/Fields/SFTime.js +6 -5
- package/src/x_ite/Fields/SFVec2.js +17 -13
- package/src/x_ite/Fields/SFVec3.js +21 -17
- package/src/x_ite/Fields/SFVec4.js +24 -20
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
- package/src/x_ite/Fields.js +2 -6
- package/src/x_ite/InputOutput/FileLoader.js +174 -190
- package/src/x_ite/InputOutput/Generator.js +133 -104
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +348 -245
- package/src/x_ite/Parser/Parser.js +314 -303
- package/src/x_ite/Parser/X3DParser.js +41 -20
- package/src/x_ite/Parser/XMLParser.js +178 -60
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
- package/src/x_ite/Rendering/DependentRenderer.js +7 -9
- package/src/x_ite/Rendering/TextureBuffer.js +24 -19
- package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
- package/src/x_ite/Routing/RouteArray.js +34 -11
- package/src/x_ite/Routing/X3DRoute.js +60 -60
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +30 -37
- package/src/x_ite.config.js +40 -5
- package/src/x_ite.css +165 -45
- package/src/x_ite.html +49 -29
- package/src/x_ite.js +86 -25
- package/x_ite.min.html +49 -22
- package/.bzrignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -54
- package/X_ITE.userprefs +0 -14
- package/build/build.mdproj +0 -47
- package/build/cad-geometry.build.js +0 -15
- package/build/geospatial.build.js +0 -15
- package/build/h-anim.build.js +0 -15
- package/build/nurbs.build.js +0 -15
- package/build/particle-systems.build.js +0 -15
- package/build/parts/cad-geometry.end.frag +0 -2
- package/build/parts/cad-geometry.start.frag +0 -6
- package/build/parts/geospatial.end.frag +0 -2
- package/build/parts/geospatial.start.frag +0 -6
- package/build/parts/h-anim.end.frag +0 -2
- package/build/parts/h-anim.start.frag +0 -6
- package/build/parts/nurbs.end.frag +0 -2
- package/build/parts/nurbs.start.frag +0 -6
- package/build/parts/particle-systems.end.frag +0 -2
- package/build/parts/particle-systems.start.frag +0 -6
- package/build/parts/rigid-body-physics.end.frag +0 -2
- package/build/parts/rigid-body-physics.start.frag +0 -6
- package/build/parts/texturing-3d.end.frag +0 -2
- package/build/parts/texturing-3d.start.frag +0 -6
- package/build/parts/x_ite.end.frag +0 -9
- package/build/parts/x_ite.start.frag +0 -6
- package/build/rigid-body-physics.build.js +0 -15
- package/build/texturing-3d.build.js +0 -15
- package/dist/components/README +0 -3
- package/dist/components/cad-geometry.min.js +0 -1
- package/dist/components/geospatial.min.js +0 -2
- package/dist/components/h-anim.min.js +0 -1
- package/dist/components/nurbs.min.js +0 -2
- package/dist/components/particle-systems.min.js +0 -2
- package/dist/components/rigid-body-physics.js +0 -3761
- package/dist/components/rigid-body-physics.min.js +0 -56
- package/dist/components/texturing-3d.min.js +0 -1
- package/dist/dist.mdproj +0 -61
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/src/components/cad-geometry.config.js +0 -56
- package/src/components/geospatial.config.js +0 -56
- package/src/components/h-anim.config.js +0 -56
- package/src/components/nurbs.config.js +0 -61
- package/src/components/particle-systems.config.js +0 -56
- package/src/components/rigid-body-physics.config.js +0 -61
- package/src/components/texturing-3d.config.js +0 -56
- package/src/images/logo.128.png +0 -0
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/src.mdproj +0 -698
- package/src/standard/Networking/URI.js +0 -785
- package/src/test.x3d +0 -225
- package/src/x_ite/Browser/Shaders/Background.fs +0 -31
- package/src/x_ite/Browser/Shaders/Background.vs +0 -23
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
- package/src/x_ite/Browser/Shaders/Types.h +0 -55
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
- package/src/x_ite/Components/DIS.js +0 -91
- package/src/x_ite/Components/Picking.js +0 -94
- package/src/x_ite/Components/VolumeRendering.js +0 -121
|
@@ -0,0 +1,2018 @@
|
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
12
|
+
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
16
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
17
|
+
*******************************************************************************
|
|
18
|
+
*
|
|
19
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
20
|
+
*
|
|
21
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
22
|
+
*
|
|
23
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
24
|
+
*
|
|
25
|
+
* The copyright notice above does not evidence any actual of intended
|
|
26
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
27
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
28
|
+
* create3000.
|
|
29
|
+
*
|
|
30
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
31
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
32
|
+
* permission of create3000.
|
|
33
|
+
*
|
|
34
|
+
* NON-MILITARY USE ONLY
|
|
35
|
+
*
|
|
36
|
+
* All create3000 software are effectively free software with a non-military use
|
|
37
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
38
|
+
* source in any way you please with the exception anything that uses it must be
|
|
39
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
40
|
+
*
|
|
41
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
42
|
+
*
|
|
43
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
44
|
+
*
|
|
45
|
+
* This file is part of the X_ITE Project.
|
|
46
|
+
*
|
|
47
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
48
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
49
|
+
* Free Software Foundation.
|
|
50
|
+
*
|
|
51
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
52
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
53
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
54
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
55
|
+
*
|
|
56
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
57
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
58
|
+
* copy of the GPLv3 License.
|
|
59
|
+
*
|
|
60
|
+
* For Silvio, Joy and Adi.
|
|
61
|
+
*
|
|
62
|
+
******************************************************************************/
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
define ('x_ite/Browser/Layout/X3DLayoutContext',[
|
|
66
|
+
"jquery",
|
|
67
|
+
"x_ite/Components/Texturing/TextureProperties",
|
|
68
|
+
],
|
|
69
|
+
function ($,
|
|
70
|
+
TextureProperties)
|
|
71
|
+
{
|
|
72
|
+
"use strict";
|
|
73
|
+
|
|
74
|
+
function X3DLayoutContext () { }
|
|
75
|
+
|
|
76
|
+
X3DLayoutContext .prototype =
|
|
77
|
+
{
|
|
78
|
+
getScreenTextureProperties: function ()
|
|
79
|
+
{
|
|
80
|
+
this .screenTextureProperties = new TextureProperties (this .getPrivateScene ());
|
|
81
|
+
|
|
82
|
+
this .screenTextureProperties .boundaryModeS_ = "CLAMP";
|
|
83
|
+
this .screenTextureProperties .boundaryModeT_ = "CLAMP";
|
|
84
|
+
this .screenTextureProperties .boundaryModeR_ = "CLAMP";
|
|
85
|
+
this .screenTextureProperties .minificationFilter_ = "NEAREST";
|
|
86
|
+
this .screenTextureProperties .magnificationFilter_ = "NEAREST";
|
|
87
|
+
this .screenTextureProperties .generateMipMaps_ = false;
|
|
88
|
+
|
|
89
|
+
this .screenTextureProperties .setup ();
|
|
90
|
+
|
|
91
|
+
this .getScreenTextureProperties = function () { return this .screenTextureProperties; };
|
|
92
|
+
|
|
93
|
+
return this .screenTextureProperties;
|
|
94
|
+
},
|
|
95
|
+
getPointSize: function ()
|
|
96
|
+
{
|
|
97
|
+
if (this .pointSize === undefined)
|
|
98
|
+
{
|
|
99
|
+
var div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
|
|
100
|
+
this .pointSize = div .appendTo ($("body")) .height () / 72;
|
|
101
|
+
div .remove ();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return this .pointSize;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return X3DLayoutContext;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
112
|
+
*******************************************************************************
|
|
113
|
+
*
|
|
114
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
115
|
+
*
|
|
116
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
117
|
+
*
|
|
118
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
119
|
+
*
|
|
120
|
+
* The copyright notice above does not evidence any actual of intended
|
|
121
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
122
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
123
|
+
* create3000.
|
|
124
|
+
*
|
|
125
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
126
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
127
|
+
* permission of create3000.
|
|
128
|
+
*
|
|
129
|
+
* NON-MILITARY USE ONLY
|
|
130
|
+
*
|
|
131
|
+
* All create3000 software are effectively free software with a non-military use
|
|
132
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
133
|
+
* source in any way you please with the exception anything that uses it must be
|
|
134
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
135
|
+
*
|
|
136
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
137
|
+
*
|
|
138
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
139
|
+
*
|
|
140
|
+
* This file is part of the X_ITE Project.
|
|
141
|
+
*
|
|
142
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
143
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
144
|
+
* Free Software Foundation.
|
|
145
|
+
*
|
|
146
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
147
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
148
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
149
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
150
|
+
*
|
|
151
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
152
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
153
|
+
* copy of the GPLv3 License.
|
|
154
|
+
*
|
|
155
|
+
* For Silvio, Joy and Adi.
|
|
156
|
+
*
|
|
157
|
+
******************************************************************************/
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
define ('x_ite/Components/Layout/X3DLayoutNode',[
|
|
161
|
+
"x_ite/Components/Core/X3DChildNode",
|
|
162
|
+
"x_ite/Bits/X3DConstants",
|
|
163
|
+
],
|
|
164
|
+
function (X3DChildNode,
|
|
165
|
+
X3DConstants)
|
|
166
|
+
{
|
|
167
|
+
"use strict";
|
|
168
|
+
|
|
169
|
+
function X3DLayoutNode (executionContext)
|
|
170
|
+
{
|
|
171
|
+
X3DChildNode .call (this, executionContext);
|
|
172
|
+
|
|
173
|
+
this .addType (X3DConstants .X3DLayoutNode);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
X3DLayoutNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
|
|
177
|
+
{
|
|
178
|
+
constructor: X3DLayoutNode,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
return X3DLayoutNode;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
187
|
+
*******************************************************************************
|
|
188
|
+
*
|
|
189
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
190
|
+
*
|
|
191
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
192
|
+
*
|
|
193
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
194
|
+
*
|
|
195
|
+
* The copyright notice above does not evidence any actual of intended
|
|
196
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
197
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
198
|
+
* create3000.
|
|
199
|
+
*
|
|
200
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
201
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
202
|
+
* permission of create3000.
|
|
203
|
+
*
|
|
204
|
+
* NON-MILITARY USE ONLY
|
|
205
|
+
*
|
|
206
|
+
* All create3000 software are effectively free software with a non-military use
|
|
207
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
208
|
+
* source in any way you please with the exception anything that uses it must be
|
|
209
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
210
|
+
*
|
|
211
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
212
|
+
*
|
|
213
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
214
|
+
*
|
|
215
|
+
* This file is part of the X_ITE Project.
|
|
216
|
+
*
|
|
217
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
218
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
219
|
+
* Free Software Foundation.
|
|
220
|
+
*
|
|
221
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
222
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
223
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
224
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
225
|
+
*
|
|
226
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
227
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
228
|
+
* copy of the GPLv3 License.
|
|
229
|
+
*
|
|
230
|
+
* For Silvio, Joy and Adi.
|
|
231
|
+
*
|
|
232
|
+
******************************************************************************/
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
define ('x_ite/Components/Layout/Layout',[
|
|
236
|
+
"x_ite/Fields",
|
|
237
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
238
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
239
|
+
"x_ite/Components/Layout/X3DLayoutNode",
|
|
240
|
+
"x_ite/Bits/X3DCast",
|
|
241
|
+
"x_ite/Bits/X3DConstants",
|
|
242
|
+
"standard/Math/Numbers/Vector2",
|
|
243
|
+
"standard/Math/Numbers/Vector3",
|
|
244
|
+
"standard/Math/Numbers/Rotation4",
|
|
245
|
+
"standard/Math/Numbers/Matrix4",
|
|
246
|
+
],
|
|
247
|
+
function (Fields,
|
|
248
|
+
X3DFieldDefinition,
|
|
249
|
+
FieldDefinitionArray,
|
|
250
|
+
X3DLayoutNode,
|
|
251
|
+
X3DCast,
|
|
252
|
+
X3DConstants,
|
|
253
|
+
Vector2,
|
|
254
|
+
Vector3,
|
|
255
|
+
Rotation4,
|
|
256
|
+
Matrix4)
|
|
257
|
+
{
|
|
258
|
+
"use strict";
|
|
259
|
+
|
|
260
|
+
var
|
|
261
|
+
i = 0,
|
|
262
|
+
LEFT = i++,
|
|
263
|
+
CENTER = i++,
|
|
264
|
+
RIGHT = i++,
|
|
265
|
+
BOTTOM = i++,
|
|
266
|
+
TOP = i++,
|
|
267
|
+
WORLD = i++,
|
|
268
|
+
FRACTION = i++,
|
|
269
|
+
PIXEL = i++,
|
|
270
|
+
NONE = i++,
|
|
271
|
+
STRETCH = i++;
|
|
272
|
+
|
|
273
|
+
function Layout (executionContext)
|
|
274
|
+
{
|
|
275
|
+
X3DLayoutNode .call (this, executionContext);
|
|
276
|
+
|
|
277
|
+
this .addType (X3DConstants .Layout);
|
|
278
|
+
|
|
279
|
+
this .alignX = CENTER;
|
|
280
|
+
this .alignY = CENTER;
|
|
281
|
+
this .offsetUnitX = WORLD;
|
|
282
|
+
this .offsetUnitY = WORLD;
|
|
283
|
+
this .offsetX = 0;
|
|
284
|
+
this .offsetY = 0;
|
|
285
|
+
this .sizeUnitX = WORLD;
|
|
286
|
+
this .sizeUnitY = WORLD;
|
|
287
|
+
this .sizeX = 1;
|
|
288
|
+
this .sizeY = 1;
|
|
289
|
+
this .scaleModeX = NONE;
|
|
290
|
+
this .scaleModeY = NONE;
|
|
291
|
+
this .parent = null;
|
|
292
|
+
this .rectangleCenter = new Vector2 (0, 0);
|
|
293
|
+
this .rectangleSize = new Vector2 (0, 0);
|
|
294
|
+
this .matrix = new Matrix4 ();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
|
|
298
|
+
{
|
|
299
|
+
constructor: Layout,
|
|
300
|
+
viewportPixel: new Vector2 (0, 0),
|
|
301
|
+
pixelSize: new Vector2 (0, 0),
|
|
302
|
+
translation: new Vector3 (0, 0, 0),
|
|
303
|
+
offset: new Vector3 (0, 0, 0),
|
|
304
|
+
scale: new Vector3 (1, 1, 1),
|
|
305
|
+
currentTranslation: new Vector3 (0, 0, 0),
|
|
306
|
+
currentRotation: new Rotation4 (0, 0, 1, 0),
|
|
307
|
+
currentScale: new Vector3 (0, 0, 0),
|
|
308
|
+
modelViewMatrix: new Matrix4 (),
|
|
309
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
310
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
311
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "align", new Fields .MFString ("CENTER", "CENTER")),
|
|
312
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "offsetUnits", new Fields .MFString ("WORLD", "WORLD")),
|
|
313
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "offset", new Fields .MFFloat (0, 0)),
|
|
314
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "sizeUnits", new Fields .MFString ("WORLD", "WORLD")),
|
|
315
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "size", new Fields .MFFloat (1, 1)),
|
|
316
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "scaleMode", new Fields .MFString ("NONE", "NONE")),
|
|
317
|
+
]),
|
|
318
|
+
getTypeName: function ()
|
|
319
|
+
{
|
|
320
|
+
return "Layout";
|
|
321
|
+
},
|
|
322
|
+
getComponentName: function ()
|
|
323
|
+
{
|
|
324
|
+
return "Layout";
|
|
325
|
+
},
|
|
326
|
+
getContainerField: function ()
|
|
327
|
+
{
|
|
328
|
+
return "layout";
|
|
329
|
+
},
|
|
330
|
+
initialize: function ()
|
|
331
|
+
{
|
|
332
|
+
X3DLayoutNode .prototype .initialize .call (this);
|
|
333
|
+
|
|
334
|
+
this .align_ .addInterest ("set_align__", this);
|
|
335
|
+
this .offsetUnits_ .addInterest ("set_offsetUnits__", this);
|
|
336
|
+
this .offset_ .addInterest ("set_offset__", this);
|
|
337
|
+
this .sizeUnits_ .addInterest ("set_sizeUnits__", this);
|
|
338
|
+
this .size_ .addInterest ("set_size__", this);
|
|
339
|
+
this .scaleMode_ .addInterest ("set_scaleMode__", this);
|
|
340
|
+
|
|
341
|
+
this .set_align__ ();
|
|
342
|
+
this .set_offsetUnits__ ();
|
|
343
|
+
this .set_offset__ ();
|
|
344
|
+
this .set_sizeUnits__ ();
|
|
345
|
+
this .set_size__ ();
|
|
346
|
+
this .set_scaleMode__ ();
|
|
347
|
+
},
|
|
348
|
+
set_align__: function ()
|
|
349
|
+
{
|
|
350
|
+
// X
|
|
351
|
+
|
|
352
|
+
if (this .align_ .length > 0)
|
|
353
|
+
{
|
|
354
|
+
if (this .align_ [0] === "LEFT")
|
|
355
|
+
this .alignX = LEFT;
|
|
356
|
+
|
|
357
|
+
else if (this .align_ [0] === "RIGHT")
|
|
358
|
+
this .alignX = RIGHT;
|
|
359
|
+
|
|
360
|
+
else
|
|
361
|
+
this .alignX = CENTER;
|
|
362
|
+
}
|
|
363
|
+
else
|
|
364
|
+
this .alignX = CENTER;
|
|
365
|
+
|
|
366
|
+
// Y
|
|
367
|
+
|
|
368
|
+
if (this .align_ .length > 1)
|
|
369
|
+
{
|
|
370
|
+
if (this .align_ [1] === "BOTTOM")
|
|
371
|
+
this .alignY = BOTTOM;
|
|
372
|
+
|
|
373
|
+
else if (this .align_ [1] === "TOP")
|
|
374
|
+
this .alignY = TOP;
|
|
375
|
+
|
|
376
|
+
else
|
|
377
|
+
this .alignY = CENTER;
|
|
378
|
+
}
|
|
379
|
+
else
|
|
380
|
+
this .alignY = CENTER;
|
|
381
|
+
},
|
|
382
|
+
set_offsetUnits__: function ()
|
|
383
|
+
{
|
|
384
|
+
if (this .offsetUnits_ .length > 0)
|
|
385
|
+
{
|
|
386
|
+
// X
|
|
387
|
+
|
|
388
|
+
if (this .offsetUnits_ [0] === "FRACTION")
|
|
389
|
+
this .offsetUnitX = FRACTION;
|
|
390
|
+
|
|
391
|
+
else if (this .offsetUnits_ [0] === "PIXEL")
|
|
392
|
+
this .offsetUnitX = PIXEL;
|
|
393
|
+
|
|
394
|
+
else
|
|
395
|
+
this .offsetUnitX = WORLD;
|
|
396
|
+
|
|
397
|
+
// Y
|
|
398
|
+
|
|
399
|
+
if (this .offsetUnits_ .length > 1)
|
|
400
|
+
{
|
|
401
|
+
if (this .offsetUnits_ [1] === "FRACTION")
|
|
402
|
+
this .offsetUnitY = FRACTION;
|
|
403
|
+
|
|
404
|
+
else if (this .offsetUnits_ [1] === "PIXEL")
|
|
405
|
+
this .offsetUnitY = PIXEL;
|
|
406
|
+
|
|
407
|
+
else
|
|
408
|
+
this .offsetUnitY = WORLD;
|
|
409
|
+
}
|
|
410
|
+
else
|
|
411
|
+
this .offsetUnitY = this .offsetUnitX;
|
|
412
|
+
}
|
|
413
|
+
else
|
|
414
|
+
{
|
|
415
|
+
this .offsetUnitX = WORLD;
|
|
416
|
+
this .offsetUnitY = WORLD;
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
set_offset__: function ()
|
|
420
|
+
{
|
|
421
|
+
if (this .offset_ .length > 0)
|
|
422
|
+
{
|
|
423
|
+
// X
|
|
424
|
+
|
|
425
|
+
this .offsetX = this .offset_ [0];
|
|
426
|
+
|
|
427
|
+
// Y
|
|
428
|
+
|
|
429
|
+
if (this .offset_ .length > 1)
|
|
430
|
+
this .offsetY = this .offset_ [1];
|
|
431
|
+
|
|
432
|
+
else
|
|
433
|
+
this .offsetY = offsetX;
|
|
434
|
+
}
|
|
435
|
+
else
|
|
436
|
+
{
|
|
437
|
+
this .offsetX = 0;
|
|
438
|
+
this .offsetY = 0;
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
set_sizeUnits__: function ()
|
|
442
|
+
{
|
|
443
|
+
if (this .sizeUnits_ .length > 0)
|
|
444
|
+
{
|
|
445
|
+
// X
|
|
446
|
+
|
|
447
|
+
if (this .sizeUnits_ [0] === "FRACTION")
|
|
448
|
+
this .sizeUnitX = FRACTION;
|
|
449
|
+
|
|
450
|
+
else if (this .sizeUnits_ [0] === "PIXEL")
|
|
451
|
+
this .sizeUnitX = PIXEL;
|
|
452
|
+
|
|
453
|
+
else
|
|
454
|
+
this .sizeUnitX = WORLD;
|
|
455
|
+
|
|
456
|
+
// Y
|
|
457
|
+
|
|
458
|
+
if (this .sizeUnits_ .length > 1)
|
|
459
|
+
{
|
|
460
|
+
if (this .sizeUnits_ [1] === "FRACTION")
|
|
461
|
+
this .sizeUnitY = FRACTION;
|
|
462
|
+
|
|
463
|
+
else if (this .sizeUnits_ [1] === "PIXEL")
|
|
464
|
+
this .sizeUnitY = PIXEL;
|
|
465
|
+
|
|
466
|
+
else
|
|
467
|
+
this .sizeUnitY = WORLD;
|
|
468
|
+
}
|
|
469
|
+
else
|
|
470
|
+
this .sizeUnitY = this .sizeUnitX;
|
|
471
|
+
}
|
|
472
|
+
else
|
|
473
|
+
{
|
|
474
|
+
this .sizeUnitX = WORLD;
|
|
475
|
+
this .sizeUnitY = WORLD;
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
set_size__: function ()
|
|
479
|
+
{
|
|
480
|
+
if (this .size_ .length > 0)
|
|
481
|
+
{
|
|
482
|
+
// X
|
|
483
|
+
|
|
484
|
+
this .sizeX = this .size_ [0];
|
|
485
|
+
|
|
486
|
+
// Y
|
|
487
|
+
|
|
488
|
+
if (this .size_ .length > 1)
|
|
489
|
+
this .sizeY = this .size_ [1];
|
|
490
|
+
|
|
491
|
+
else
|
|
492
|
+
this .sizeY = this .sizeX;
|
|
493
|
+
}
|
|
494
|
+
else
|
|
495
|
+
{
|
|
496
|
+
this .sizeX = 0;
|
|
497
|
+
this .sizeY = 0;
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
set_scaleMode__: function ()
|
|
501
|
+
{
|
|
502
|
+
if (this .scaleMode_ .length > 0)
|
|
503
|
+
{
|
|
504
|
+
// X
|
|
505
|
+
|
|
506
|
+
if (this .scaleMode_ [0] === "FRACTION")
|
|
507
|
+
this .scaleModeX = FRACTION;
|
|
508
|
+
|
|
509
|
+
else if (this .scaleMode_ [0] === "PIXEL")
|
|
510
|
+
this .scaleModeX = PIXEL;
|
|
511
|
+
|
|
512
|
+
else if (this .scaleMode_ [0] === "STRETCH")
|
|
513
|
+
this .scaleModeX = STRETCH;
|
|
514
|
+
|
|
515
|
+
else
|
|
516
|
+
this .scaleModeX = NONE;
|
|
517
|
+
|
|
518
|
+
// Y
|
|
519
|
+
|
|
520
|
+
if (this .scaleMode_ .length > 1)
|
|
521
|
+
{
|
|
522
|
+
if (this .scaleMode_ [1] === "FRACTION")
|
|
523
|
+
this .scaleModeY = FRACTION;
|
|
524
|
+
|
|
525
|
+
else if (this .scaleMode_ [1] === "PIXEL")
|
|
526
|
+
this .scaleModeY = PIXEL;
|
|
527
|
+
|
|
528
|
+
else if (this .scaleMode_ [1] === "STRETCH")
|
|
529
|
+
this .scaleModeY = STRETCH;
|
|
530
|
+
|
|
531
|
+
else
|
|
532
|
+
this .scaleModeY = NONE;
|
|
533
|
+
}
|
|
534
|
+
else
|
|
535
|
+
this .scaleModeY = this .scaleModeX;
|
|
536
|
+
}
|
|
537
|
+
else
|
|
538
|
+
{
|
|
539
|
+
this .scaleModeX = NONE;
|
|
540
|
+
this .scaleModeY = NONE;
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
getRectangleCenter: function ()
|
|
544
|
+
{
|
|
545
|
+
return this .rectangleCenter;
|
|
546
|
+
},
|
|
547
|
+
getRectangleSize: function ()
|
|
548
|
+
{
|
|
549
|
+
return this .rectangleSize;
|
|
550
|
+
},
|
|
551
|
+
getAlignX: function ()
|
|
552
|
+
{
|
|
553
|
+
return this .alignX;
|
|
554
|
+
},
|
|
555
|
+
getAlignY: function ()
|
|
556
|
+
{
|
|
557
|
+
return this .alignY;
|
|
558
|
+
},
|
|
559
|
+
getOffsetUnitX: function ()
|
|
560
|
+
{
|
|
561
|
+
if (this .offsetUnitX === WORLD)
|
|
562
|
+
{
|
|
563
|
+
if (this .parent)
|
|
564
|
+
return this .parent .getOffsetUnitX ();
|
|
565
|
+
|
|
566
|
+
return FRACTION;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
return this .offsetUnitX;
|
|
570
|
+
},
|
|
571
|
+
getOffsetUnitY: function ()
|
|
572
|
+
{
|
|
573
|
+
if (this .offsetUnitY === WORLD)
|
|
574
|
+
{
|
|
575
|
+
if (this .parent)
|
|
576
|
+
return this .parent .getOffsetUnitY ();
|
|
577
|
+
|
|
578
|
+
return FRACTION;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return this .offsetUnitY;
|
|
582
|
+
},
|
|
583
|
+
getOffsetX: function ()
|
|
584
|
+
{
|
|
585
|
+
return this .offsetX;
|
|
586
|
+
},
|
|
587
|
+
getOffsetY: function ()
|
|
588
|
+
{
|
|
589
|
+
return this .offsetY;
|
|
590
|
+
},
|
|
591
|
+
getSizeUnitX: function ()
|
|
592
|
+
{
|
|
593
|
+
if (this .sizeUnitX === WORLD)
|
|
594
|
+
{
|
|
595
|
+
if (this .parent)
|
|
596
|
+
return this .parent .getSizeUnitX ();
|
|
597
|
+
|
|
598
|
+
return FRACTION;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return this .sizeUnitX;
|
|
602
|
+
},
|
|
603
|
+
getSizeUnitY: function ()
|
|
604
|
+
{
|
|
605
|
+
if (this .sizeUnitY === WORLD)
|
|
606
|
+
{
|
|
607
|
+
if (this .parent)
|
|
608
|
+
return this .parent .getSizeUnitY ();
|
|
609
|
+
|
|
610
|
+
return FRACTION;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
return this .sizeUnitY;
|
|
614
|
+
},
|
|
615
|
+
getSizeX: function ()
|
|
616
|
+
{
|
|
617
|
+
return this .sizeX;
|
|
618
|
+
},
|
|
619
|
+
getSizeY: function ()
|
|
620
|
+
{
|
|
621
|
+
return this .sizeY;
|
|
622
|
+
},
|
|
623
|
+
getScaleModeX: function ()
|
|
624
|
+
{
|
|
625
|
+
if (this .parent)
|
|
626
|
+
return this .scaleModeX;
|
|
627
|
+
|
|
628
|
+
if (this .scaleModeX === NONE)
|
|
629
|
+
return FRACTION;
|
|
630
|
+
|
|
631
|
+
return this .scaleModeX;
|
|
632
|
+
},
|
|
633
|
+
getScaleModeY: function ()
|
|
634
|
+
{
|
|
635
|
+
if (this .parent)
|
|
636
|
+
return this .scaleModeY;
|
|
637
|
+
|
|
638
|
+
if (this .scaleModeY === NONE)
|
|
639
|
+
return FRACTION;
|
|
640
|
+
|
|
641
|
+
return this .scaleModeY;
|
|
642
|
+
},
|
|
643
|
+
transform: function (type, renderObject)
|
|
644
|
+
{
|
|
645
|
+
var parent = this .parent = renderObject .getParentLayout ();
|
|
646
|
+
|
|
647
|
+
// Calculate rectangleSize
|
|
648
|
+
|
|
649
|
+
var
|
|
650
|
+
matrix = this .matrix,
|
|
651
|
+
viewpoint = renderObject .getViewpoint (),
|
|
652
|
+
nearValue = renderObject .getNavigationInfo () .getNearValue (), // in meters
|
|
653
|
+
viewport = renderObject .getViewVolume () .getScissor (), // in pixels
|
|
654
|
+
viewportMeter = viewpoint .getViewportSize (viewport, nearValue), // in meters
|
|
655
|
+
viewportPixel = this .viewportPixel, // in pixels
|
|
656
|
+
pixelSize = this .pixelSize, // size of one pixel in meters
|
|
657
|
+
parentRectangleSize = parent ? parent .getRectangleSize () : viewportMeter, // in meters
|
|
658
|
+
rectangleSize = this .rectangleSize,
|
|
659
|
+
rectangleCenter = this .rectangleCenter;
|
|
660
|
+
|
|
661
|
+
viewportPixel .set (viewport [2], viewport [3]); // in pixel
|
|
662
|
+
pixelSize .assign (viewportMeter) .divVec (viewportPixel); // size of one pixel in meter
|
|
663
|
+
|
|
664
|
+
switch (this .getSizeUnitX ())
|
|
665
|
+
{
|
|
666
|
+
case FRACTION:
|
|
667
|
+
rectangleSize .x = this .sizeX * parentRectangleSize .x;
|
|
668
|
+
break;
|
|
669
|
+
case PIXEL:
|
|
670
|
+
rectangleSize .x = this .sizeX * pixelSize .x;
|
|
671
|
+
break;
|
|
672
|
+
default:
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
switch (this .getSizeUnitY ())
|
|
677
|
+
{
|
|
678
|
+
case FRACTION:
|
|
679
|
+
rectangleSize .y = this .sizeY * parentRectangleSize .y;
|
|
680
|
+
break;
|
|
681
|
+
case PIXEL:
|
|
682
|
+
rectangleSize .y = this .sizeY * pixelSize .y;
|
|
683
|
+
break;
|
|
684
|
+
default:
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
// Calculate translation
|
|
689
|
+
|
|
690
|
+
var translation = this .translation .set (0, 0, 0);
|
|
691
|
+
|
|
692
|
+
switch (this .getAlignX ())
|
|
693
|
+
{
|
|
694
|
+
case LEFT:
|
|
695
|
+
translation .x = -(parentRectangleSize .x - rectangleSize .x) / 2;
|
|
696
|
+
break;
|
|
697
|
+
case CENTER:
|
|
698
|
+
|
|
699
|
+
if (this .getSizeUnitX () === PIXEL && viewportPixel .x & 1)
|
|
700
|
+
translation .x = -pixelSize .x / 2;
|
|
701
|
+
|
|
702
|
+
break;
|
|
703
|
+
case RIGHT:
|
|
704
|
+
translation .x = (parentRectangleSize .x - rectangleSize .x) / 2;
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
switch (this .getAlignY ())
|
|
709
|
+
{
|
|
710
|
+
case BOTTOM:
|
|
711
|
+
translation .y = -(parentRectangleSize .y - rectangleSize .y) / 2;
|
|
712
|
+
break;
|
|
713
|
+
case CENTER:
|
|
714
|
+
|
|
715
|
+
if (this .getSizeUnitX === PIXEL && viewportPixel .y & 1)
|
|
716
|
+
translation .y = -pixelSize .y / 2;
|
|
717
|
+
|
|
718
|
+
break;
|
|
719
|
+
case TOP:
|
|
720
|
+
translation .y = (parentRectangleSize .y - rectangleSize .y) / 2;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// Calculate offset
|
|
725
|
+
|
|
726
|
+
var offset = this .offset .set (0, 0, 0);
|
|
727
|
+
|
|
728
|
+
switch (this .getOffsetUnitX ())
|
|
729
|
+
{
|
|
730
|
+
case FRACTION:
|
|
731
|
+
offset .x = this .offsetX * parentRectangleSize .x;
|
|
732
|
+
break;
|
|
733
|
+
case PIXEL:
|
|
734
|
+
offset .x = this .offsetX * viewportMeter .x / viewportPixel .x;
|
|
735
|
+
break;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
switch (this .getOffsetUnitY ())
|
|
739
|
+
{
|
|
740
|
+
case FRACTION:
|
|
741
|
+
offset .y = this .offsetY * parentRectangleSize .y;
|
|
742
|
+
break;
|
|
743
|
+
case PIXEL:
|
|
744
|
+
offset .y = this .offsetY * viewportMeter .y / viewportPixel .y;
|
|
745
|
+
break;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// Calculate scale
|
|
749
|
+
|
|
750
|
+
var
|
|
751
|
+
scale = this .scale .set (1, 1, 1),
|
|
752
|
+
currentTranslation = this .currentTranslation,
|
|
753
|
+
currentRotation = this .currentRotation,
|
|
754
|
+
currentScale = this .currentScale;
|
|
755
|
+
|
|
756
|
+
var modelViewMatrix = renderObject .getModelViewMatrix () .get ();
|
|
757
|
+
modelViewMatrix .get (currentTranslation, currentRotation, currentScale);
|
|
758
|
+
|
|
759
|
+
switch (this .getScaleModeX ())
|
|
760
|
+
{
|
|
761
|
+
case NONE:
|
|
762
|
+
scale .x = currentScale .x;
|
|
763
|
+
break;
|
|
764
|
+
case FRACTION:
|
|
765
|
+
scale .x = rectangleSize .x;
|
|
766
|
+
break;
|
|
767
|
+
case STRETCH:
|
|
768
|
+
break;
|
|
769
|
+
case PIXEL:
|
|
770
|
+
scale .x = viewportMeter .x / viewportPixel .x;
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
switch (this .getScaleModeY ())
|
|
775
|
+
{
|
|
776
|
+
case NONE:
|
|
777
|
+
scale .y = currentScale .y;
|
|
778
|
+
break;
|
|
779
|
+
case FRACTION:
|
|
780
|
+
scale .y = rectangleSize .y;
|
|
781
|
+
break;
|
|
782
|
+
case STRETCH:
|
|
783
|
+
break;
|
|
784
|
+
case PIXEL:
|
|
785
|
+
scale .y = viewportMeter .y / viewportPixel .y;
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// Calculate scale for scaleMode STRETCH
|
|
790
|
+
|
|
791
|
+
if (this .getScaleModeX () === STRETCH)
|
|
792
|
+
{
|
|
793
|
+
if (this .getScaleModeY () === STRETCH)
|
|
794
|
+
{
|
|
795
|
+
if (rectangleSize .x > rectangleSize .y)
|
|
796
|
+
{
|
|
797
|
+
scale .x = rectangleSize .x;
|
|
798
|
+
scale .y = scale .x;
|
|
799
|
+
}
|
|
800
|
+
else
|
|
801
|
+
{
|
|
802
|
+
scale .y = rectangleSize .y;
|
|
803
|
+
scale .x = scale .y;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
else
|
|
807
|
+
scale .x = scale .y;
|
|
808
|
+
}
|
|
809
|
+
else if (this .getScaleModeY () === STRETCH)
|
|
810
|
+
scale .y = scale .x;
|
|
811
|
+
|
|
812
|
+
// Transform
|
|
813
|
+
|
|
814
|
+
rectangleCenter .assign (translation) .add (offset);
|
|
815
|
+
|
|
816
|
+
matrix .set (currentTranslation, currentRotation);
|
|
817
|
+
matrix .translate (translation .add (offset));
|
|
818
|
+
matrix .scale (scale);
|
|
819
|
+
|
|
820
|
+
return matrix;
|
|
821
|
+
},
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
return Layout;
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
830
|
+
*******************************************************************************
|
|
831
|
+
*
|
|
832
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
833
|
+
*
|
|
834
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
835
|
+
*
|
|
836
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
837
|
+
*
|
|
838
|
+
* The copyright notice above does not evidence any actual of intended
|
|
839
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
840
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
841
|
+
* create3000.
|
|
842
|
+
*
|
|
843
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
844
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
845
|
+
* permission of create3000.
|
|
846
|
+
*
|
|
847
|
+
* NON-MILITARY USE ONLY
|
|
848
|
+
*
|
|
849
|
+
* All create3000 software are effectively free software with a non-military use
|
|
850
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
851
|
+
* source in any way you please with the exception anything that uses it must be
|
|
852
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
853
|
+
*
|
|
854
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
855
|
+
*
|
|
856
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
857
|
+
*
|
|
858
|
+
* This file is part of the X_ITE Project.
|
|
859
|
+
*
|
|
860
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
861
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
862
|
+
* Free Software Foundation.
|
|
863
|
+
*
|
|
864
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
865
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
866
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
867
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
868
|
+
*
|
|
869
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
870
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
871
|
+
* copy of the GPLv3 License.
|
|
872
|
+
*
|
|
873
|
+
* For Silvio, Joy and Adi.
|
|
874
|
+
*
|
|
875
|
+
******************************************************************************/
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
define ('x_ite/Components/Layout/LayoutGroup',[
|
|
879
|
+
"x_ite/Fields",
|
|
880
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
881
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
882
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
883
|
+
"x_ite/Bits/X3DCast",
|
|
884
|
+
"x_ite/Bits/TraverseType",
|
|
885
|
+
"x_ite/Bits/X3DConstants",
|
|
886
|
+
"standard/Math/Numbers/Matrix4",
|
|
887
|
+
],
|
|
888
|
+
function (Fields,
|
|
889
|
+
X3DFieldDefinition,
|
|
890
|
+
FieldDefinitionArray,
|
|
891
|
+
X3DGroupingNode,
|
|
892
|
+
X3DCast,
|
|
893
|
+
TraverseType,
|
|
894
|
+
X3DConstants,
|
|
895
|
+
Matrix4)
|
|
896
|
+
{
|
|
897
|
+
"use strict";
|
|
898
|
+
|
|
899
|
+
function LayoutGroup (executionContext)
|
|
900
|
+
{
|
|
901
|
+
X3DGroupingNode .call (this, executionContext);
|
|
902
|
+
|
|
903
|
+
this .addType (X3DConstants .LayoutGroup);
|
|
904
|
+
|
|
905
|
+
this .viewportNode = null;
|
|
906
|
+
this .layoutNode = null;
|
|
907
|
+
this .modelViewMatrix = new Matrix4 ();
|
|
908
|
+
this .screenMatrix = new Matrix4 ();
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
912
|
+
{
|
|
913
|
+
constructor: LayoutGroup,
|
|
914
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
915
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
916
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
|
|
917
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
|
|
918
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
919
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
920
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
921
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
922
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
923
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
924
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
925
|
+
]),
|
|
926
|
+
getTypeName: function ()
|
|
927
|
+
{
|
|
928
|
+
return "LayoutGroup";
|
|
929
|
+
},
|
|
930
|
+
getComponentName: function ()
|
|
931
|
+
{
|
|
932
|
+
return "Layout";
|
|
933
|
+
},
|
|
934
|
+
getContainerField: function ()
|
|
935
|
+
{
|
|
936
|
+
return "children";
|
|
937
|
+
},
|
|
938
|
+
initialize: function ()
|
|
939
|
+
{
|
|
940
|
+
X3DGroupingNode .prototype .initialize .call (this);
|
|
941
|
+
|
|
942
|
+
this .viewport_ .addInterest ("set_viewport__", this);
|
|
943
|
+
this .layout_ .addInterest ("set_layout__", this);
|
|
944
|
+
|
|
945
|
+
this .set_viewport__ ();
|
|
946
|
+
this .set_layout__ ();
|
|
947
|
+
},
|
|
948
|
+
set_viewport__: function ()
|
|
949
|
+
{
|
|
950
|
+
this .viewportNode = X3DCast (X3DConstants .X3DViewportNode, this .viewport_);
|
|
951
|
+
},
|
|
952
|
+
set_layout__: function ()
|
|
953
|
+
{
|
|
954
|
+
this .layoutNode = X3DCast (X3DConstants .X3DLayoutNode, this .layout_);
|
|
955
|
+
},
|
|
956
|
+
getBBox: function (bbox, shadow)
|
|
957
|
+
{
|
|
958
|
+
return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .getMatrix ());
|
|
959
|
+
},
|
|
960
|
+
getMatrix: function ()
|
|
961
|
+
{
|
|
962
|
+
try
|
|
963
|
+
{
|
|
964
|
+
if (this .layoutNode)
|
|
965
|
+
this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
|
|
966
|
+
else
|
|
967
|
+
this .matrix .identity ();
|
|
968
|
+
}
|
|
969
|
+
catch (error)
|
|
970
|
+
{ }
|
|
971
|
+
|
|
972
|
+
return this .matrix;
|
|
973
|
+
},
|
|
974
|
+
traverse: function (type, renderObject)
|
|
975
|
+
{
|
|
976
|
+
switch (type)
|
|
977
|
+
{
|
|
978
|
+
case TraverseType .COLLISION:
|
|
979
|
+
{
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
default:
|
|
983
|
+
{
|
|
984
|
+
if (this .viewportNode)
|
|
985
|
+
this .viewportNode .push ();
|
|
986
|
+
|
|
987
|
+
if (this .layoutNode)
|
|
988
|
+
{
|
|
989
|
+
var modelViewMatrix = renderObject .getModelViewMatrix ();
|
|
990
|
+
|
|
991
|
+
this .modelViewMatrix .assign (modelViewMatrix .get ());
|
|
992
|
+
this .screenMatrix .assign (this .layoutNode .transform (type, renderObject));
|
|
993
|
+
|
|
994
|
+
modelViewMatrix .pushMatrix (this .screenMatrix);
|
|
995
|
+
renderObject .getLayouts () .push (this .layoutNode);
|
|
996
|
+
|
|
997
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
998
|
+
|
|
999
|
+
renderObject .getLayouts () .pop ();
|
|
1000
|
+
modelViewMatrix .pop ();
|
|
1001
|
+
}
|
|
1002
|
+
else
|
|
1003
|
+
{
|
|
1004
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (this .viewportNode)
|
|
1008
|
+
this .viewportNode .pop ();
|
|
1009
|
+
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
},
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
return LayoutGroup;
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1020
|
+
*******************************************************************************
|
|
1021
|
+
*
|
|
1022
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1023
|
+
*
|
|
1024
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1025
|
+
*
|
|
1026
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1027
|
+
*
|
|
1028
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1029
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1030
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1031
|
+
* create3000.
|
|
1032
|
+
*
|
|
1033
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1034
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1035
|
+
* permission of create3000.
|
|
1036
|
+
*
|
|
1037
|
+
* NON-MILITARY USE ONLY
|
|
1038
|
+
*
|
|
1039
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1040
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1041
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1042
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1043
|
+
*
|
|
1044
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1045
|
+
*
|
|
1046
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1047
|
+
*
|
|
1048
|
+
* This file is part of the X_ITE Project.
|
|
1049
|
+
*
|
|
1050
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1051
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1052
|
+
* Free Software Foundation.
|
|
1053
|
+
*
|
|
1054
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1055
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1056
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1057
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1058
|
+
*
|
|
1059
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1060
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1061
|
+
* copy of the GPLv3 License.
|
|
1062
|
+
*
|
|
1063
|
+
* For Silvio, Joy and Adi.
|
|
1064
|
+
*
|
|
1065
|
+
******************************************************************************/
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
define ('x_ite/Components/Layout/LayoutLayer',[
|
|
1069
|
+
"x_ite/Fields",
|
|
1070
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1071
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1072
|
+
"x_ite/Components/Layering/X3DLayerNode",
|
|
1073
|
+
"x_ite/Components/Layout/LayoutGroup",
|
|
1074
|
+
"x_ite/Components/Navigation/OrthoViewpoint",
|
|
1075
|
+
"x_ite/Bits/X3DConstants",
|
|
1076
|
+
],
|
|
1077
|
+
function (Fields,
|
|
1078
|
+
X3DFieldDefinition,
|
|
1079
|
+
FieldDefinitionArray,
|
|
1080
|
+
X3DLayerNode,
|
|
1081
|
+
LayoutGroup,
|
|
1082
|
+
OrthoViewpoint,
|
|
1083
|
+
X3DConstants)
|
|
1084
|
+
{
|
|
1085
|
+
"use strict";
|
|
1086
|
+
|
|
1087
|
+
function LayoutLayer (executionContext)
|
|
1088
|
+
{
|
|
1089
|
+
X3DLayerNode .call (this,
|
|
1090
|
+
executionContext,
|
|
1091
|
+
new OrthoViewpoint (executionContext),
|
|
1092
|
+
new LayoutGroup (executionContext));
|
|
1093
|
+
|
|
1094
|
+
this .addType (X3DConstants .LayoutLayer);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
LayoutLayer .prototype = Object .assign (Object .create (X3DLayerNode .prototype),
|
|
1098
|
+
{
|
|
1099
|
+
constructor: LayoutLayer,
|
|
1100
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1101
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1102
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "isPickable", new Fields .SFBool (true)),
|
|
1103
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
|
|
1104
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
|
|
1105
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1106
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1107
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1108
|
+
]),
|
|
1109
|
+
getTypeName: function ()
|
|
1110
|
+
{
|
|
1111
|
+
return "LayoutLayer";
|
|
1112
|
+
},
|
|
1113
|
+
getComponentName: function ()
|
|
1114
|
+
{
|
|
1115
|
+
return "Layout";
|
|
1116
|
+
},
|
|
1117
|
+
getContainerField: function ()
|
|
1118
|
+
{
|
|
1119
|
+
return "layers";
|
|
1120
|
+
},
|
|
1121
|
+
initialize: function ()
|
|
1122
|
+
{
|
|
1123
|
+
X3DLayerNode .prototype .initialize .call (this);
|
|
1124
|
+
|
|
1125
|
+
this .layout_ .addFieldInterest (this .getGroup () .layout_);
|
|
1126
|
+
this .addChildren_ .addFieldInterest (this .getGroup () .addChildren_);
|
|
1127
|
+
this .removeChildren_ .addFieldInterest (this .getGroup () .removeChildren_);
|
|
1128
|
+
this .children_ .addFieldInterest (this .getGroup () .children_);
|
|
1129
|
+
|
|
1130
|
+
this .getGroup () .layout_ = this .layout_;
|
|
1131
|
+
this .getGroup () .children_ = this .children_;
|
|
1132
|
+
|
|
1133
|
+
this .getGroup () .setPrivate (true);
|
|
1134
|
+
this .getGroup () .setup ();
|
|
1135
|
+
},
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1138
|
+
return LayoutLayer;
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1142
|
+
*******************************************************************************
|
|
1143
|
+
*
|
|
1144
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1145
|
+
*
|
|
1146
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1147
|
+
*
|
|
1148
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1149
|
+
*
|
|
1150
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1151
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1152
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1153
|
+
* create3000.
|
|
1154
|
+
*
|
|
1155
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1156
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1157
|
+
* permission of create3000.
|
|
1158
|
+
*
|
|
1159
|
+
* NON-MILITARY USE ONLY
|
|
1160
|
+
*
|
|
1161
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1162
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1163
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1164
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1165
|
+
*
|
|
1166
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1167
|
+
*
|
|
1168
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1169
|
+
*
|
|
1170
|
+
* This file is part of the X_ITE Project.
|
|
1171
|
+
*
|
|
1172
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1173
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1174
|
+
* Free Software Foundation.
|
|
1175
|
+
*
|
|
1176
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1177
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1178
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1179
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1180
|
+
*
|
|
1181
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1182
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1183
|
+
* copy of the GPLv3 License.
|
|
1184
|
+
*
|
|
1185
|
+
* For Silvio, Joy and Adi.
|
|
1186
|
+
*
|
|
1187
|
+
******************************************************************************/
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
define ('x_ite/Browser/Layout/ScreenText',[
|
|
1191
|
+
"jquery",
|
|
1192
|
+
"x_ite/Browser/Text/X3DTextGeometry",
|
|
1193
|
+
"x_ite/Browser/Text/TextAlignment",
|
|
1194
|
+
"x_ite/Components/Texturing/PixelTexture",
|
|
1195
|
+
"x_ite/Components/Rendering/X3DGeometryNode",
|
|
1196
|
+
"standard/Math/Numbers/Vector3",
|
|
1197
|
+
"standard/Math/Numbers/Vector4",
|
|
1198
|
+
"standard/Math/Numbers/Matrix4",
|
|
1199
|
+
"standard/Math/Geometry/Box3",
|
|
1200
|
+
"standard/Math/Geometry/ViewVolume",
|
|
1201
|
+
"standard/Math/Algorithm",
|
|
1202
|
+
],
|
|
1203
|
+
function ($,
|
|
1204
|
+
X3DTextGeometry,
|
|
1205
|
+
TextAlignment,
|
|
1206
|
+
PixelTexture,
|
|
1207
|
+
X3DGeometryNode,
|
|
1208
|
+
Vector3,
|
|
1209
|
+
Vector4,
|
|
1210
|
+
Matrix4,
|
|
1211
|
+
Box3,
|
|
1212
|
+
ViewVolume,
|
|
1213
|
+
Algorithm)
|
|
1214
|
+
{
|
|
1215
|
+
"use strict";
|
|
1216
|
+
|
|
1217
|
+
function ScreenText (text, fontStyle)
|
|
1218
|
+
{
|
|
1219
|
+
X3DTextGeometry .call (this, text, fontStyle);
|
|
1220
|
+
|
|
1221
|
+
text .setTransparent (true);
|
|
1222
|
+
|
|
1223
|
+
this .texCoordArray = X3DGeometryNode .createArray ();
|
|
1224
|
+
this .textureNode = new PixelTexture (text .getExecutionContext ());
|
|
1225
|
+
this .canvas = $("<canvas></canvas>");
|
|
1226
|
+
this .context = this .canvas [0] .getContext ("2d");
|
|
1227
|
+
this .matrix = new Matrix4 ();
|
|
1228
|
+
|
|
1229
|
+
this .textureNode .textureProperties_ = fontStyle .getBrowser () .getScreenTextureProperties ();
|
|
1230
|
+
this .textureNode .setup ();
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
ScreenText .prototype = Object .assign (Object .create (X3DTextGeometry .prototype),
|
|
1234
|
+
{
|
|
1235
|
+
constructor: ScreenText,
|
|
1236
|
+
modelViewMatrix: new Matrix4 (),
|
|
1237
|
+
getTransparent: function ()
|
|
1238
|
+
{
|
|
1239
|
+
return true;
|
|
1240
|
+
},
|
|
1241
|
+
getMatrix: function ()
|
|
1242
|
+
{
|
|
1243
|
+
return this .matrix;
|
|
1244
|
+
},
|
|
1245
|
+
update: (function ()
|
|
1246
|
+
{
|
|
1247
|
+
var
|
|
1248
|
+
min = new Vector3 (0, 0, 0),
|
|
1249
|
+
max = new Vector3 (1, 1, 0);
|
|
1250
|
+
|
|
1251
|
+
return function ()
|
|
1252
|
+
{
|
|
1253
|
+
X3DTextGeometry .prototype .update .call (this);
|
|
1254
|
+
|
|
1255
|
+
var
|
|
1256
|
+
fontStyle = this .getFontStyle (),
|
|
1257
|
+
text = this .getText (),
|
|
1258
|
+
offset = 1; // For antialiasing border on bottom and right side
|
|
1259
|
+
|
|
1260
|
+
text .textBounds_ .x = Math .ceil (text .textBounds_ .x) + offset;
|
|
1261
|
+
text .textBounds_ .y = Math .ceil (text .textBounds_ .y) + offset;
|
|
1262
|
+
|
|
1263
|
+
this .getBBox () .getExtents (min, max);
|
|
1264
|
+
|
|
1265
|
+
min .x -= offset;
|
|
1266
|
+
min .y -= offset;
|
|
1267
|
+
|
|
1268
|
+
switch (fontStyle .getMajorAlignment ())
|
|
1269
|
+
{
|
|
1270
|
+
case TextAlignment .BEGIN:
|
|
1271
|
+
case TextAlignment .FIRST:
|
|
1272
|
+
min .x = Math .floor (min .x);
|
|
1273
|
+
max .x = min .x + text .textBounds_ .x;
|
|
1274
|
+
break;
|
|
1275
|
+
case TextAlignment .MIDDLE:
|
|
1276
|
+
min .x = Math .round (min .x);
|
|
1277
|
+
max .x = min .x + text .textBounds_ .x;
|
|
1278
|
+
break;
|
|
1279
|
+
case TextAlignment .END:
|
|
1280
|
+
max .x = Math .ceil (max .x);
|
|
1281
|
+
min .x = max .x - text .textBounds_ .x;
|
|
1282
|
+
break;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
switch (fontStyle .getMinorAlignment ())
|
|
1286
|
+
{
|
|
1287
|
+
case TextAlignment .BEGIN:
|
|
1288
|
+
case TextAlignment .FIRST:
|
|
1289
|
+
max .y = Math .ceil (max .y);
|
|
1290
|
+
min .y = max .y - text .textBounds_ .y;
|
|
1291
|
+
break;
|
|
1292
|
+
case TextAlignment .MIDDLE:
|
|
1293
|
+
max .y = Math .round (max .y);
|
|
1294
|
+
min .y = max .y - text .textBounds_ .y;
|
|
1295
|
+
break;
|
|
1296
|
+
case TextAlignment .END:
|
|
1297
|
+
min .y = Math .floor (min .y);
|
|
1298
|
+
max .y = min .y + text .textBounds_ .y;
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
text .origin_ .x = min .x;
|
|
1303
|
+
text .origin_ .y = max .y;
|
|
1304
|
+
|
|
1305
|
+
this .getBBox () .setExtents (min, max);
|
|
1306
|
+
};
|
|
1307
|
+
})(),
|
|
1308
|
+
build: (function ()
|
|
1309
|
+
{
|
|
1310
|
+
var
|
|
1311
|
+
min = new Vector3 (0, 0, 0),
|
|
1312
|
+
max = new Vector3 (1, 1, 0);
|
|
1313
|
+
|
|
1314
|
+
return function ()
|
|
1315
|
+
{
|
|
1316
|
+
var
|
|
1317
|
+
fontStyle = this .getFontStyle (),
|
|
1318
|
+
font = fontStyle .getFont ();
|
|
1319
|
+
|
|
1320
|
+
if (! font)
|
|
1321
|
+
return;
|
|
1322
|
+
|
|
1323
|
+
var
|
|
1324
|
+
text = this .getText (),
|
|
1325
|
+
glyphs = this .getGlyphs (),
|
|
1326
|
+
minorAlignment = this .getMinorAlignment (),
|
|
1327
|
+
translations = this .getTranslations (),
|
|
1328
|
+
charSpacings = this .getCharSpacings (),
|
|
1329
|
+
size = fontStyle .getScale (), // in pixel
|
|
1330
|
+
sizeUnitsPerEm = size / font .unitsPerEm,
|
|
1331
|
+
texCoordArray = this .texCoordArray,
|
|
1332
|
+
normalArray = text .getNormals (),
|
|
1333
|
+
vertexArray = text .getVertices (),
|
|
1334
|
+
canvas = this .canvas [0],
|
|
1335
|
+
cx = this .context;
|
|
1336
|
+
|
|
1337
|
+
// Set texCoord.
|
|
1338
|
+
|
|
1339
|
+
texCoordArray .length = 0;
|
|
1340
|
+
|
|
1341
|
+
text .getMultiTexCoords () .push (texCoordArray);
|
|
1342
|
+
|
|
1343
|
+
// Triangle one and two.
|
|
1344
|
+
|
|
1345
|
+
this .getBBox () .getExtents (min, max);
|
|
1346
|
+
|
|
1347
|
+
normalArray .push (0, 0, 1,
|
|
1348
|
+
0, 0, 1,
|
|
1349
|
+
0, 0, 1,
|
|
1350
|
+
0, 0, 1,
|
|
1351
|
+
0, 0, 1,
|
|
1352
|
+
0, 0, 1);
|
|
1353
|
+
|
|
1354
|
+
vertexArray .push (min .x, min .y, 0, 1,
|
|
1355
|
+
max .x, min .y, 0, 1,
|
|
1356
|
+
max .x, max .y, 0, 1,
|
|
1357
|
+
min .x, min .y, 0, 1,
|
|
1358
|
+
max .x, max .y, 0, 1,
|
|
1359
|
+
min .x, max .y, 0, 1);
|
|
1360
|
+
|
|
1361
|
+
// Generate texture.
|
|
1362
|
+
|
|
1363
|
+
var
|
|
1364
|
+
width = text .textBounds_ .x,
|
|
1365
|
+
height = text .textBounds_ .y;
|
|
1366
|
+
|
|
1367
|
+
// Scale canvas.
|
|
1368
|
+
|
|
1369
|
+
canvas .width = Algorithm .nextPowerOfTwo (width),
|
|
1370
|
+
canvas .height = Algorithm .nextPowerOfTwo (height);
|
|
1371
|
+
|
|
1372
|
+
var
|
|
1373
|
+
w = width / canvas .width,
|
|
1374
|
+
h = height / canvas .height,
|
|
1375
|
+
y = 1 - h;
|
|
1376
|
+
|
|
1377
|
+
texCoordArray .push (0, y, 0, 1,
|
|
1378
|
+
w, y, 0, 1,
|
|
1379
|
+
w, 1, 0, 1,
|
|
1380
|
+
0, y, 0, 1,
|
|
1381
|
+
w, 1, 0, 1,
|
|
1382
|
+
0, 1, 0, 1);
|
|
1383
|
+
|
|
1384
|
+
// Setup canvas.
|
|
1385
|
+
|
|
1386
|
+
cx .fillStyle = "rgba(255,255,255,0)";
|
|
1387
|
+
cx .fillRect (0, 0, canvas .width, canvas .height);
|
|
1388
|
+
cx .fillStyle = "rgba(255,255,255,1)";
|
|
1389
|
+
|
|
1390
|
+
// Draw glyphs.
|
|
1391
|
+
|
|
1392
|
+
if (fontStyle .horizontal_ .getValue ())
|
|
1393
|
+
{
|
|
1394
|
+
for (var l = 0, length = glyphs .length; l < length; ++ l)
|
|
1395
|
+
{
|
|
1396
|
+
var
|
|
1397
|
+
line = glyphs [l],
|
|
1398
|
+
charSpacing = charSpacings [l],
|
|
1399
|
+
translation = translations [l],
|
|
1400
|
+
advanceWidth = 0;
|
|
1401
|
+
|
|
1402
|
+
for (var g = 0, gl = line .length; g < gl; ++ g)
|
|
1403
|
+
{
|
|
1404
|
+
var
|
|
1405
|
+
glyph = line [g],
|
|
1406
|
+
x = minorAlignment .x + translation .x + advanceWidth + g * charSpacing - min .x,
|
|
1407
|
+
y = minorAlignment .y + translation .y - max .y;
|
|
1408
|
+
|
|
1409
|
+
this .drawGlyph (cx, font, glyph, x, y, size);
|
|
1410
|
+
|
|
1411
|
+
// Calculate advanceWidth.
|
|
1412
|
+
|
|
1413
|
+
var kerning = 0;
|
|
1414
|
+
|
|
1415
|
+
if (g + 1 < line .length)
|
|
1416
|
+
kerning = font .getKerningValue (glyph, line [g + 1]);
|
|
1417
|
+
|
|
1418
|
+
advanceWidth += (glyph .advanceWidth + kerning) * sizeUnitsPerEm;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
else
|
|
1423
|
+
{
|
|
1424
|
+
var
|
|
1425
|
+
leftToRight = fontStyle .leftToRight_ .getValue (),
|
|
1426
|
+
topToBottom = fontStyle .topToBottom_ .getValue (),
|
|
1427
|
+
first = leftToRight ? 0 : text .string_ .length - 1,
|
|
1428
|
+
last = leftToRight ? text .string_ .length : -1,
|
|
1429
|
+
step = leftToRight ? 1 : -1;
|
|
1430
|
+
|
|
1431
|
+
for (var l = first, t = 0; l !== last; l += step)
|
|
1432
|
+
{
|
|
1433
|
+
var line = glyphs [l];
|
|
1434
|
+
|
|
1435
|
+
var
|
|
1436
|
+
numChars = line .length,
|
|
1437
|
+
firstG = topToBottom ? 0 : numChars - 1,
|
|
1438
|
+
lastG = topToBottom ? numChars : -1,
|
|
1439
|
+
stepG = topToBottom ? 1 : -1;
|
|
1440
|
+
|
|
1441
|
+
for (var g = firstG; g !== lastG; g += stepG, ++ t)
|
|
1442
|
+
{
|
|
1443
|
+
var translation = translations [t];
|
|
1444
|
+
|
|
1445
|
+
var
|
|
1446
|
+
x = minorAlignment .x + translation .x - min .x,
|
|
1447
|
+
y = minorAlignment .y + translation .y - max .y;
|
|
1448
|
+
|
|
1449
|
+
this .drawGlyph (cx, font, line [g], x, y, size);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
// Transfer texture data.
|
|
1455
|
+
|
|
1456
|
+
var imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
|
|
1457
|
+
|
|
1458
|
+
// If the cavas is to large imageData is null.
|
|
1459
|
+
if (imageData)
|
|
1460
|
+
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data), true);
|
|
1461
|
+
else
|
|
1462
|
+
this .textureNode .clear ();
|
|
1463
|
+
};
|
|
1464
|
+
})(),
|
|
1465
|
+
drawGlyph: function (cx, font, glyph, x, y, size)
|
|
1466
|
+
{
|
|
1467
|
+
//console .log (glyph .name, x, y);
|
|
1468
|
+
|
|
1469
|
+
// Get curves for the current glyph.
|
|
1470
|
+
|
|
1471
|
+
var
|
|
1472
|
+
path = glyph .getPath (x, -y, size),
|
|
1473
|
+
commands = path .commands;
|
|
1474
|
+
|
|
1475
|
+
cx .beginPath ();
|
|
1476
|
+
|
|
1477
|
+
for (var i = 0, cl = commands .length; i < cl; ++ i)
|
|
1478
|
+
{
|
|
1479
|
+
var command = commands [i];
|
|
1480
|
+
|
|
1481
|
+
switch (command .type)
|
|
1482
|
+
{
|
|
1483
|
+
case "M": // Start
|
|
1484
|
+
{
|
|
1485
|
+
cx .moveTo (command .x, command .y);
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
case "Z": // End
|
|
1489
|
+
{
|
|
1490
|
+
cx .closePath ();
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
case "L": // Linear
|
|
1494
|
+
{
|
|
1495
|
+
cx .lineTo (command .x, command .y);
|
|
1496
|
+
continue;
|
|
1497
|
+
}
|
|
1498
|
+
case "Q": // Cubic
|
|
1499
|
+
{
|
|
1500
|
+
cx .quadraticCurveTo (command .x1, command .y1, command .x, command .y);
|
|
1501
|
+
continue;
|
|
1502
|
+
}
|
|
1503
|
+
case "C": // Bezier
|
|
1504
|
+
{
|
|
1505
|
+
cx .bezierCurveTo (command .x1, command .y1, command .x2, command .y2, command .x, command .y);
|
|
1506
|
+
continue;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
if (path .fill)
|
|
1512
|
+
cx .fill ();
|
|
1513
|
+
|
|
1514
|
+
if (path .stroke)
|
|
1515
|
+
{
|
|
1516
|
+
cx .lineWidth = path .strokeWidth;
|
|
1517
|
+
cx .stroke ();
|
|
1518
|
+
}
|
|
1519
|
+
},
|
|
1520
|
+
getGlyphExtents: function (font, glyph, primitiveQuality, min, max)
|
|
1521
|
+
{
|
|
1522
|
+
var unitsPerEm = font .unitsPerEm;
|
|
1523
|
+
|
|
1524
|
+
min .set ((glyph .xMin || 0) / unitsPerEm, (glyph .yMin || 0) / unitsPerEm, 0);
|
|
1525
|
+
max .set ((glyph .xMax || 0) / unitsPerEm, (glyph .yMax || 0) / unitsPerEm, 0);
|
|
1526
|
+
},
|
|
1527
|
+
transform: (function ()
|
|
1528
|
+
{
|
|
1529
|
+
var
|
|
1530
|
+
x = new Vector4 (0, 0, 0, 0),
|
|
1531
|
+
y = new Vector4 (0, 0, 0, 0),
|
|
1532
|
+
z = new Vector4 (0, 0, 0, 0),
|
|
1533
|
+
screenPoint = new Vector3 (0, 0, 0),
|
|
1534
|
+
screenMatrix = new Matrix4 (),
|
|
1535
|
+
bbox = new Box3 ();
|
|
1536
|
+
|
|
1537
|
+
return function (renderObject)
|
|
1538
|
+
{
|
|
1539
|
+
// throws an exception
|
|
1540
|
+
|
|
1541
|
+
var
|
|
1542
|
+
text = this .getText (),
|
|
1543
|
+
modelViewMatrix = renderObject .getModelViewMatrix () .get (),
|
|
1544
|
+
projectionMatrix = renderObject .getProjectionMatrix () .get (),
|
|
1545
|
+
viewport = renderObject .getViewVolume () .getViewport ();
|
|
1546
|
+
|
|
1547
|
+
// Determine screenMatrix.
|
|
1548
|
+
// Same as in ScreenGroup.
|
|
1549
|
+
|
|
1550
|
+
var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
|
|
1551
|
+
|
|
1552
|
+
x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
|
|
1553
|
+
y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
|
|
1554
|
+
z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
|
|
1555
|
+
|
|
1556
|
+
x .normalize () .multiply (screenScale .x);
|
|
1557
|
+
y .normalize () .multiply (screenScale .y);
|
|
1558
|
+
z .normalize () .multiply (screenScale .z);
|
|
1559
|
+
|
|
1560
|
+
screenMatrix .set (x .x, x .y, x .z, x .w,
|
|
1561
|
+
y .x, y .y, y .z, y .w,
|
|
1562
|
+
z .x, z .y, z .z, z .w,
|
|
1563
|
+
modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
|
|
1564
|
+
|
|
1565
|
+
// Snap to whole pixel.
|
|
1566
|
+
|
|
1567
|
+
ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1568
|
+
|
|
1569
|
+
screenPoint .x = Math .round (screenPoint .x);
|
|
1570
|
+
screenPoint .y = Math .round (screenPoint .y);
|
|
1571
|
+
|
|
1572
|
+
ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1573
|
+
|
|
1574
|
+
screenPoint .z = 0;
|
|
1575
|
+
screenMatrix .translate (screenPoint);
|
|
1576
|
+
|
|
1577
|
+
// Assign modelViewMatrix and calculate relative matrix.
|
|
1578
|
+
|
|
1579
|
+
this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
|
|
1580
|
+
|
|
1581
|
+
// Update Text bbox.
|
|
1582
|
+
|
|
1583
|
+
bbox .assign (this .getBBox ()) .multRight (this .matrix);
|
|
1584
|
+
|
|
1585
|
+
text .setBBox (bbox);
|
|
1586
|
+
};
|
|
1587
|
+
})(),
|
|
1588
|
+
traverse: function (type, renderObject)
|
|
1589
|
+
{
|
|
1590
|
+
this .transform (renderObject);
|
|
1591
|
+
},
|
|
1592
|
+
display: function (gl, context)
|
|
1593
|
+
{
|
|
1594
|
+
Matrix4 .prototype .multLeft .call (context .modelViewMatrix, this .matrix);
|
|
1595
|
+
|
|
1596
|
+
context .textureNode = this .textureNode;
|
|
1597
|
+
},
|
|
1598
|
+
transformLine: function (line)
|
|
1599
|
+
{
|
|
1600
|
+
// Apply sceen nodes transformation in place here.
|
|
1601
|
+
return line .multLineMatrix (Matrix4 .inverse (this .matrix));
|
|
1602
|
+
},
|
|
1603
|
+
transformMatrix: function (matrix)
|
|
1604
|
+
{
|
|
1605
|
+
// Apply sceen nodes transformation in place here.
|
|
1606
|
+
return matrix .multLeft (this .matrix);
|
|
1607
|
+
},
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1610
|
+
return ScreenText;
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1614
|
+
*******************************************************************************
|
|
1615
|
+
*
|
|
1616
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1617
|
+
*
|
|
1618
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1619
|
+
*
|
|
1620
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1621
|
+
*
|
|
1622
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1623
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1624
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1625
|
+
* create3000.
|
|
1626
|
+
*
|
|
1627
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1628
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1629
|
+
* permission of create3000.
|
|
1630
|
+
*
|
|
1631
|
+
* NON-MILITARY USE ONLY
|
|
1632
|
+
*
|
|
1633
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1634
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1635
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1636
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1637
|
+
*
|
|
1638
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1639
|
+
*
|
|
1640
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1641
|
+
*
|
|
1642
|
+
* This file is part of the X_ITE Project.
|
|
1643
|
+
*
|
|
1644
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1645
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1646
|
+
* Free Software Foundation.
|
|
1647
|
+
*
|
|
1648
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1649
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1650
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1651
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1652
|
+
*
|
|
1653
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1654
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1655
|
+
* copy of the GPLv3 License.
|
|
1656
|
+
*
|
|
1657
|
+
* For Silvio, Joy and Adi.
|
|
1658
|
+
*
|
|
1659
|
+
******************************************************************************/
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
define ('x_ite/Components/Layout/ScreenFontStyle',[
|
|
1663
|
+
"x_ite/Fields",
|
|
1664
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1665
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1666
|
+
"x_ite/Components/Text/X3DFontStyleNode",
|
|
1667
|
+
"x_ite/Browser/Layout/ScreenText",
|
|
1668
|
+
"x_ite/Bits/X3DConstants",
|
|
1669
|
+
],
|
|
1670
|
+
function (Fields,
|
|
1671
|
+
X3DFieldDefinition,
|
|
1672
|
+
FieldDefinitionArray,
|
|
1673
|
+
X3DFontStyleNode,
|
|
1674
|
+
ScreenText,
|
|
1675
|
+
X3DConstants)
|
|
1676
|
+
{
|
|
1677
|
+
"use strict";
|
|
1678
|
+
|
|
1679
|
+
function ScreenFontStyle (executionContext)
|
|
1680
|
+
{
|
|
1681
|
+
X3DFontStyleNode .call (this, executionContext);
|
|
1682
|
+
|
|
1683
|
+
this .addType (X3DConstants .ScreenFontStyle);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
ScreenFontStyle .prototype = Object .assign (Object .create (X3DFontStyleNode .prototype),
|
|
1687
|
+
{
|
|
1688
|
+
constructor: ScreenFontStyle,
|
|
1689
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1690
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1691
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "language", new Fields .SFString ()),
|
|
1692
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "family", new Fields .MFString ("SERIF")),
|
|
1693
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "style", new Fields .SFString ("PLAIN")),
|
|
1694
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "pointSize", new Fields .SFFloat (12)),
|
|
1695
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "spacing", new Fields .SFFloat (1)),
|
|
1696
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "horizontal", new Fields .SFBool (true)),
|
|
1697
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "leftToRight", new Fields .SFBool (true)),
|
|
1698
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "topToBottom", new Fields .SFBool (true)),
|
|
1699
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "justify", new Fields .MFString ("BEGIN")),
|
|
1700
|
+
]),
|
|
1701
|
+
getTypeName: function ()
|
|
1702
|
+
{
|
|
1703
|
+
return "ScreenFontStyle";
|
|
1704
|
+
},
|
|
1705
|
+
getComponentName: function ()
|
|
1706
|
+
{
|
|
1707
|
+
return "Layout";
|
|
1708
|
+
},
|
|
1709
|
+
getContainerField: function ()
|
|
1710
|
+
{
|
|
1711
|
+
return "fontStyle";
|
|
1712
|
+
},
|
|
1713
|
+
getTextGeometry: function (text)
|
|
1714
|
+
{
|
|
1715
|
+
return new ScreenText (text, this);
|
|
1716
|
+
},
|
|
1717
|
+
getScale: function ()
|
|
1718
|
+
{
|
|
1719
|
+
return this .pointSize_ .getValue () * this .getBrowser () .getPointSize ();
|
|
1720
|
+
},
|
|
1721
|
+
});
|
|
1722
|
+
|
|
1723
|
+
return ScreenFontStyle;
|
|
1724
|
+
});
|
|
1725
|
+
|
|
1726
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1727
|
+
*******************************************************************************
|
|
1728
|
+
*
|
|
1729
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1730
|
+
*
|
|
1731
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1732
|
+
*
|
|
1733
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1734
|
+
*
|
|
1735
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1736
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1737
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1738
|
+
* create3000.
|
|
1739
|
+
*
|
|
1740
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1741
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1742
|
+
* permission of create3000.
|
|
1743
|
+
*
|
|
1744
|
+
* NON-MILITARY USE ONLY
|
|
1745
|
+
*
|
|
1746
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1747
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1748
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1749
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1750
|
+
*
|
|
1751
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1752
|
+
*
|
|
1753
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1754
|
+
*
|
|
1755
|
+
* This file is part of the X_ITE Project.
|
|
1756
|
+
*
|
|
1757
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1758
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1759
|
+
* Free Software Foundation.
|
|
1760
|
+
*
|
|
1761
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1762
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1763
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1764
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1765
|
+
*
|
|
1766
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1767
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1768
|
+
* copy of the GPLv3 License.
|
|
1769
|
+
*
|
|
1770
|
+
* For Silvio, Joy and Adi.
|
|
1771
|
+
*
|
|
1772
|
+
******************************************************************************/
|
|
1773
|
+
|
|
1774
|
+
|
|
1775
|
+
define ('x_ite/Components/Layout/ScreenGroup',[
|
|
1776
|
+
"x_ite/Fields",
|
|
1777
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1778
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1779
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
1780
|
+
"x_ite/Bits/X3DConstants",
|
|
1781
|
+
"x_ite/Bits/TraverseType",
|
|
1782
|
+
"standard/Math/Numbers/Vector3",
|
|
1783
|
+
"standard/Math/Numbers/Vector4",
|
|
1784
|
+
"standard/Math/Numbers/Matrix4",
|
|
1785
|
+
"standard/Math/Geometry/ViewVolume",
|
|
1786
|
+
],
|
|
1787
|
+
function (Fields,
|
|
1788
|
+
X3DFieldDefinition,
|
|
1789
|
+
FieldDefinitionArray,
|
|
1790
|
+
X3DGroupingNode,
|
|
1791
|
+
X3DConstants,
|
|
1792
|
+
TraverseType,
|
|
1793
|
+
Vector3,
|
|
1794
|
+
Vector4,
|
|
1795
|
+
Matrix4,
|
|
1796
|
+
ViewVolume)
|
|
1797
|
+
{
|
|
1798
|
+
"use strict";
|
|
1799
|
+
|
|
1800
|
+
function ScreenGroup (executionContext)
|
|
1801
|
+
{
|
|
1802
|
+
X3DGroupingNode .call (this, executionContext);
|
|
1803
|
+
|
|
1804
|
+
this .addType (X3DConstants .ScreenGroup);
|
|
1805
|
+
|
|
1806
|
+
this .matrix = new Matrix4 ();
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
ScreenGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
1810
|
+
{
|
|
1811
|
+
constructor: ScreenGroup,
|
|
1812
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1813
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1814
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
1815
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
1816
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
1817
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
1818
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1819
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1820
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1821
|
+
]),
|
|
1822
|
+
getTypeName: function ()
|
|
1823
|
+
{
|
|
1824
|
+
return "ScreenGroup";
|
|
1825
|
+
},
|
|
1826
|
+
getComponentName: function ()
|
|
1827
|
+
{
|
|
1828
|
+
return "Layout";
|
|
1829
|
+
},
|
|
1830
|
+
getContainerField: function ()
|
|
1831
|
+
{
|
|
1832
|
+
return "children";
|
|
1833
|
+
},
|
|
1834
|
+
getBBox: function (bbox, shadow)
|
|
1835
|
+
{
|
|
1836
|
+
return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .matrix);
|
|
1837
|
+
},
|
|
1838
|
+
getMatrix: function ()
|
|
1839
|
+
{
|
|
1840
|
+
return this .matrix;
|
|
1841
|
+
},
|
|
1842
|
+
scale: (function ()
|
|
1843
|
+
{
|
|
1844
|
+
var
|
|
1845
|
+
x = new Vector4 (0, 0, 0, 0),
|
|
1846
|
+
y = new Vector4 (0, 0, 0, 0),
|
|
1847
|
+
z = new Vector4 (0, 0, 0, 0),
|
|
1848
|
+
screenPoint = new Vector3 (0, 0, 0),
|
|
1849
|
+
screenMatrix = new Matrix4 ();
|
|
1850
|
+
|
|
1851
|
+
return function (renderObject)
|
|
1852
|
+
{
|
|
1853
|
+
// throws domain error
|
|
1854
|
+
|
|
1855
|
+
var
|
|
1856
|
+
modelViewMatrix = renderObject .getModelViewMatrix () .get (),
|
|
1857
|
+
projectionMatrix = renderObject .getProjectionMatrix () .get (),
|
|
1858
|
+
viewport = renderObject .getViewVolume () .getViewport ();
|
|
1859
|
+
|
|
1860
|
+
// Determine screenMatrix.
|
|
1861
|
+
// Same as in ScreenText.
|
|
1862
|
+
|
|
1863
|
+
var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
|
|
1864
|
+
|
|
1865
|
+
x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
|
|
1866
|
+
y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
|
|
1867
|
+
z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
|
|
1868
|
+
|
|
1869
|
+
x .normalize () .multiply (screenScale .x);
|
|
1870
|
+
y .normalize () .multiply (screenScale .y);
|
|
1871
|
+
z .normalize () .multiply (screenScale .z);
|
|
1872
|
+
|
|
1873
|
+
screenMatrix .set (x .x, x .y, x .z, x .w,
|
|
1874
|
+
y .x, y .y, y .z, y .w,
|
|
1875
|
+
z .x, z .y, z .z, z .w,
|
|
1876
|
+
modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
|
|
1877
|
+
|
|
1878
|
+
// Snap to whole pixel.
|
|
1879
|
+
|
|
1880
|
+
ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1881
|
+
|
|
1882
|
+
screenPoint .x = Math .round (screenPoint .x);
|
|
1883
|
+
screenPoint .y = Math .round (screenPoint .y);
|
|
1884
|
+
|
|
1885
|
+
ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1886
|
+
|
|
1887
|
+
screenPoint .z = 0;
|
|
1888
|
+
screenMatrix .translate (screenPoint);
|
|
1889
|
+
|
|
1890
|
+
// Assign relative matrix.
|
|
1891
|
+
|
|
1892
|
+
this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
|
|
1893
|
+
};
|
|
1894
|
+
})(),
|
|
1895
|
+
traverse: function (type, renderObject)
|
|
1896
|
+
{
|
|
1897
|
+
try
|
|
1898
|
+
{
|
|
1899
|
+
switch (type)
|
|
1900
|
+
{
|
|
1901
|
+
case TraverseType .CAMERA:
|
|
1902
|
+
case TraverseType .PICKING:
|
|
1903
|
+
case TraverseType .SHADOW: // ???
|
|
1904
|
+
// No clone support for shadow, generated cube map texture and bbox
|
|
1905
|
+
break;
|
|
1906
|
+
default:
|
|
1907
|
+
this .scale (renderObject);
|
|
1908
|
+
break;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
var modelViewMatrix = renderObject .getModelViewMatrix ();
|
|
1912
|
+
|
|
1913
|
+
modelViewMatrix .push ();
|
|
1914
|
+
modelViewMatrix .multLeft (this .matrix);
|
|
1915
|
+
|
|
1916
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1917
|
+
|
|
1918
|
+
modelViewMatrix .pop ();
|
|
1919
|
+
}
|
|
1920
|
+
catch (error)
|
|
1921
|
+
{ }
|
|
1922
|
+
},
|
|
1923
|
+
});
|
|
1924
|
+
|
|
1925
|
+
return ScreenGroup;
|
|
1926
|
+
});
|
|
1927
|
+
|
|
1928
|
+
/*******************************************************************************
|
|
1929
|
+
*
|
|
1930
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1931
|
+
*
|
|
1932
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1933
|
+
*
|
|
1934
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1935
|
+
*
|
|
1936
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1937
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1938
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1939
|
+
* create3000.
|
|
1940
|
+
*
|
|
1941
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1942
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1943
|
+
* permission of create3000.
|
|
1944
|
+
*
|
|
1945
|
+
* NON-MILITARY USE ONLY
|
|
1946
|
+
*
|
|
1947
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1948
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1949
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1950
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1951
|
+
*
|
|
1952
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1953
|
+
*
|
|
1954
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1955
|
+
*
|
|
1956
|
+
* This file is part of the X_ITE Project.
|
|
1957
|
+
*
|
|
1958
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1959
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1960
|
+
* Free Software Foundation.
|
|
1961
|
+
*
|
|
1962
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1963
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1964
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1965
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1966
|
+
*
|
|
1967
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1968
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1969
|
+
* copy of the GPLv3 License.
|
|
1970
|
+
*
|
|
1971
|
+
* For Silvio, Joy and Adi.
|
|
1972
|
+
*
|
|
1973
|
+
******************************************************************************/
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
define (require .getComponentUrl ("layout"), [
|
|
1977
|
+
"x_ite/Components",
|
|
1978
|
+
"x_ite/Browser/Layout/X3DLayoutContext",
|
|
1979
|
+
"x_ite/Components/Layout/Layout",
|
|
1980
|
+
"x_ite/Components/Layout/LayoutGroup",
|
|
1981
|
+
"x_ite/Components/Layout/LayoutLayer",
|
|
1982
|
+
"x_ite/Components/Layout/ScreenFontStyle",
|
|
1983
|
+
"x_ite/Components/Layout/ScreenGroup",
|
|
1984
|
+
"x_ite/Components/Layout/X3DLayoutNode",
|
|
1985
|
+
],
|
|
1986
|
+
function (Components,
|
|
1987
|
+
X3DLayoutContext,
|
|
1988
|
+
Layout,
|
|
1989
|
+
LayoutGroup,
|
|
1990
|
+
LayoutLayer,
|
|
1991
|
+
ScreenFontStyle,
|
|
1992
|
+
ScreenGroup,
|
|
1993
|
+
X3DLayoutNode)
|
|
1994
|
+
{
|
|
1995
|
+
"use strict";
|
|
1996
|
+
|
|
1997
|
+
Components .addComponent ({
|
|
1998
|
+
name: "Layout",
|
|
1999
|
+
types:
|
|
2000
|
+
{
|
|
2001
|
+
Layout: Layout,
|
|
2002
|
+
LayoutGroup: LayoutGroup,
|
|
2003
|
+
LayoutLayer: LayoutLayer,
|
|
2004
|
+
ScreenFontStyle: ScreenFontStyle,
|
|
2005
|
+
ScreenGroup: ScreenGroup,
|
|
2006
|
+
},
|
|
2007
|
+
abstractTypes:
|
|
2008
|
+
{
|
|
2009
|
+
X3DLayoutNode: X3DLayoutNode,
|
|
2010
|
+
},
|
|
2011
|
+
browser: X3DLayoutContext,
|
|
2012
|
+
});
|
|
2013
|
+
});
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
})
|
|
2018
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|