├── .github ├── CODE_OF_CONDUCT.md ├── FUNDING.yml └── workflows │ └── pages-deploy.yml ├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── LICENSE.md ├── README.md ├── bin └── sunrize.js ├── build ├── X3DUOM.sh ├── download.js ├── make-x_ite-for-sunrize.sh ├── merge-development.sh ├── release.js └── wine-proxy │ └── wine ├── docs ├── Gemfile ├── LICENSE ├── README.md ├── _config.yml ├── _data │ ├── contact.yml │ ├── nav │ │ ├── documentation.yml │ │ └── main.yml │ └── share.yml ├── _includes │ ├── nav.html │ └── scripts.html ├── _layouts │ ├── compress.html │ ├── post.html │ └── wrap.html ├── _plugins │ ├── external-links.rb │ ├── no_date.rb │ └── posts-lastmod-hook.rb ├── _posts │ ├── documentation │ │ ├── a-quick-look-at-the-user-interface.md │ │ ├── cloning-objects.md │ │ ├── creating-group-hierarchies.md │ │ ├── creating-routes-between-fields.md │ │ ├── editing-prototypes.md │ │ ├── imported-and-exported-nodes.md │ │ ├── overview.md │ │ ├── selecting-and-grouping-objects.md │ │ ├── snapping-and-alignment.md │ │ ├── using-the-outline-editor.md │ │ └── using-the-script-editor.md │ └── index.md ├── _tabs │ ├── documentation.md │ ├── tags.md │ └── x_ite.md ├── assets │ ├── css │ │ └── jekyll-theme-chirpy.scss │ ├── img │ │ ├── documentation │ │ │ ├── add-new-field.png │ │ │ ├── add-reference.png │ │ │ ├── angle-layout-tool.png │ │ │ ├── arrow.png │ │ │ ├── cloning-objects-1.png │ │ │ ├── cloning-objects-2.png │ │ │ ├── cone-with-manipulators.png │ │ │ ├── console.png │ │ │ ├── earth-1.png │ │ │ ├── earth-2.png │ │ │ ├── export-node.png │ │ │ ├── foot-shin-thigh-1.png │ │ │ ├── foot-shin-thigh-2.png │ │ │ ├── foot-shin-thigh-3.png │ │ │ ├── foot-shin-thigh-outline-editor-1.png │ │ │ ├── foot-shin-thigh-outline-editor-2.png │ │ │ ├── foot-shin-thigh-outline-editor-3.png │ │ │ ├── foot1.png │ │ │ ├── foot2.png │ │ │ ├── hand.png │ │ │ ├── import-node.png │ │ │ ├── imported-node.png │ │ │ ├── look-at-selection.png │ │ │ ├── outliner-node-context-menu.png │ │ │ ├── play.png │ │ │ ├── prototype-editor.png │ │ │ ├── prototypes.png │ │ │ ├── remove-export-node.png │ │ │ ├── script-editor-glsl.png │ │ │ ├── script-editor-javascript.png │ │ │ ├── sidebar-outline-editor.png │ │ │ ├── smarty-bubbles.jpg │ │ │ ├── snap-target.png │ │ │ ├── straighten.png │ │ │ ├── transform-connectors.png │ │ │ ├── transform-detailed-routes.png │ │ │ ├── transform-detailed.png │ │ │ ├── transform-multiple-routes.png │ │ │ ├── transform-route.png │ │ │ └── unlink-clone.png │ │ ├── favicons │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── favicon.ico │ │ │ └── mstile-150x150.png │ │ ├── icons │ │ │ ├── check.svg │ │ │ └── xmark.svg │ │ ├── logo.png │ │ ├── sunrize.avif │ │ └── sunrize.png │ └── js │ │ └── links.js └── google3696ee938394d7b6.html ├── forge.config.js ├── package.json ├── src ├── Application │ ├── ActionKeys.js │ ├── Application.js │ ├── CSS.js │ ├── Dashboard.js │ ├── DataStorage.js │ ├── Document.js │ ├── Footer.js │ ├── GetText.js │ ├── Hierarchy.js │ ├── Interface.js │ ├── Selection.js │ ├── Sidebar.js │ ├── Tabs.js │ ├── Template.js │ └── Window.js ├── Bits │ ├── Algorithm.js │ ├── Highlight.js │ ├── MimeTypes.js │ ├── Validate.js │ └── X3DUOM.js ├── Components.js ├── Components │ ├── Geometry2D │ │ ├── Arc2D.js │ │ ├── ArcClose2D.js │ │ ├── Circle2D.js │ │ ├── Disk2D.js │ │ ├── Polyline2D.js │ │ ├── Polypoint2D.js │ │ ├── Rectangle2D.js │ │ └── TriangleSet2D.js │ ├── Geometry3D │ │ ├── Box.js │ │ ├── Cone.js │ │ ├── Cylinder.js │ │ ├── ElevationGrid.js │ │ ├── Extrusion.js │ │ ├── IndexedFaceSet.js │ │ └── Sphere.js │ ├── Grouping │ │ ├── StaticGroup.js │ │ └── Switch.js │ ├── NURBS │ │ ├── NurbsCurve.js │ │ ├── NurbsSweptSurface.js │ │ ├── NurbsSwungSurface.js │ │ └── X3DNurbsSurfaceGeometryNode.js │ ├── Navigation │ │ ├── Collision.js │ │ └── LOD.js │ ├── Rendering │ │ ├── IndexedLineSet.js │ │ ├── LineSet.js │ │ ├── X3DComposedGeometryNode.js │ │ └── X3DGeometryNode.js │ └── Text │ │ └── Text.js ├── Controls │ ├── AddPrototypePopover.js │ ├── AudioPreviewPopover.js │ ├── Dialog.js │ ├── EditUserDefinedFieldPopover.js │ ├── ExportNodePopover.js │ ├── ImportNodePopover.js │ ├── MaterialPreviewPopover.js │ ├── Popover.js │ ├── RenameNodeInput.js │ ├── RenameNodePopover.js │ ├── Splitter.js │ ├── Tabs.js │ ├── TexturePreviewPopover.js │ └── VideoPreviewPopover.js ├── Editors │ ├── AnimationEditor.js │ ├── BrowserFrame.js │ ├── Console.js │ ├── FileManager.js │ ├── Library.js │ ├── LibraryPane.js │ ├── Materials.x3d │ ├── MaterialsLibrary.js │ ├── NodeInspector.js │ ├── NodeList.js │ ├── NodesLibrary.js │ ├── OutlineEditor.js │ ├── OutlineRouteGraph.js │ ├── OutlineView.js │ ├── Panel.js │ ├── Primitives.js │ ├── PrimitivesLibrary.js │ ├── SceneProperties.js │ ├── ScriptEditor.js │ └── Units.js ├── Fields.js ├── Fields │ ├── MFStringTextArea.js │ └── SFStringInput.js ├── Parser │ ├── AudioParser.js │ ├── ImageParser.js │ └── VideoParser.js ├── Tools.js ├── Tools │ ├── CADGeometry │ │ ├── CADAssemblyTool.js │ │ ├── CADFaceTool.js │ │ ├── CADLayerTool.js │ │ ├── CADPartTool.js │ │ ├── IndexedQuadSetTool.js │ │ └── QuadSetTool.js │ ├── Core │ │ ├── ToolColors.js │ │ ├── X3DBaseTool.js │ │ ├── X3DChildNodeTool.js │ │ ├── X3DNodeTool.js │ │ └── X3DPrototypeInstanceTool.js │ ├── EnvironmentalSensor │ │ ├── ProximitySensorTool.js │ │ ├── TransformSensorTool.js │ │ ├── VisibilitySensorTool.js │ │ ├── X3DEnvironmentalSensorNodeTool.js │ │ └── X3DEnvironmentalSensorNodeTool.x3d │ ├── Geometry2D │ │ ├── Arc2DTool.js │ │ ├── ArcClose2DTool.js │ │ ├── Circle2DTool.js │ │ ├── Disk2DTool.js │ │ ├── Polyline2DTool.js │ │ ├── Polypoint2DTool.js │ │ ├── Rectangle2DTool.js │ │ └── TriangleSet2DTool.js │ ├── Geometry3D │ │ ├── BoxTool.js │ │ ├── ConeTool.js │ │ ├── CylinderTool.js │ │ ├── ElevationGridTool.js │ │ ├── ExtrusionTool.js │ │ ├── IndexedFaceSetTool.js │ │ └── SphereTool.js │ ├── Geospatial │ │ ├── GeoElevationGridTool.js │ │ ├── GeoLODTool.js │ │ ├── GeoLocationTool.js │ │ ├── GeoTransformTool.js │ │ └── GeoViewpointTool.js │ ├── Grids │ │ ├── AngleGrid.x3d │ │ ├── AngleGridTool.js │ │ ├── AngleGridTool.x3d │ │ ├── AxonometricGrid.x3d │ │ ├── AxonometricGridTool.js │ │ ├── AxonometricGridTool.x3d │ │ ├── Barycentric.js │ │ ├── Grid.x3d │ │ ├── GridTool.js │ │ ├── GridTool.x3d │ │ └── X3DGridNodeTool.js │ ├── Grouping │ │ ├── BooleanSwitch.x3d │ │ ├── GroupTool.js │ │ ├── StaticGroupTool.js │ │ ├── SwitchTool.js │ │ ├── TransformTool.js │ │ ├── Vector.x3d │ │ ├── X3DBoundedObjectTool.js │ │ ├── X3DBoundedObjectTool.x3d │ │ ├── X3DTransformNodeTool.js │ │ └── X3DTransformNodeTool.x3d │ ├── HAnim │ │ ├── HAnimHumanoidTool.js │ │ ├── HAnimJointTool.js │ │ ├── HAnimSegmentTool.js │ │ └── HAnimSiteTool.js │ ├── Layering │ │ ├── LayerTool.js │ │ ├── X3DActiveLayerNodeTool.js │ │ └── X3DLayerNodeTool.js │ ├── Layout │ │ ├── LayoutGroupTool.js │ │ ├── LayoutLayerTool.js │ │ └── ScreenGroupTool.js │ ├── Lighting │ │ ├── DirectionalLightTool.js │ │ ├── PointLightTool.js │ │ ├── SpotLightTool.js │ │ ├── X3DLightNodeTool.js │ │ └── X3DLightNodeTool.x3d │ ├── NURBS │ │ ├── NurbsCurveTool.js │ │ ├── NurbsPatchSurfaceTool.js │ │ ├── NurbsSweptSurfaceTool.js │ │ ├── NurbsSwungSurfaceTool.js │ │ ├── NurbsTrimmedSurfaceTool.js │ │ ├── X3DNurbsSurfaceGeometryNodeTool.js │ │ ├── X3DParametricGeometryNodeTool.js │ │ └── X3DParametricGeometryNodeTool.x3d │ ├── Navigation │ │ ├── BillboardTool.js │ │ ├── CollisionTool.js │ │ ├── LODTool.js │ │ ├── OrthoViewpointTool.js │ │ ├── ViewpointGroupTool.js │ │ ├── ViewpointTool.js │ │ ├── X3DViewpointNodeTool.js │ │ └── X3DViewpointNodeTool.x3d │ ├── Networking │ │ ├── AnchorTool.js │ │ └── InlineTool.js │ ├── ParticleSystems │ │ └── ParticleSystemTool.js │ ├── Picking │ │ └── PickableGroupTool.js │ ├── Rendering │ │ ├── IndexedLineSetTool.js │ │ ├── IndexedTriangleFanSetTool.js │ │ ├── IndexedTriangleSetTool.js │ │ ├── IndexedTriangleStripSetTool.js │ │ ├── LineSetTool.js │ │ ├── PointSetTool.js │ │ ├── TriangleFanSetTool.js │ │ ├── TriangleSetTool.js │ │ ├── TriangleStripSetTool.js │ │ ├── X3DGeometryNodeTool.js │ │ ├── X3DGeometryNodeTool.x3d │ │ ├── X3DLineGeometryNodeTool.js │ │ ├── X3DLineGeometryNodeTool.x3d │ │ ├── X3DPointGeometryNodeTool.js │ │ └── X3DPointGeometryNodeTool.x3d │ ├── RigidBodyPhysics │ │ ├── CollidableOffsetTool.js │ │ ├── CollidableShapeTool.js │ │ └── X3DNBodyCollidableNodeTool.js │ ├── Shaders │ │ ├── TextureShader.x3d │ │ └── ToolShader.x3d │ ├── Shape │ │ └── ShapeTool.js │ ├── SnapTool │ │ ├── SnapSource.js │ │ ├── SnapTarget.js │ │ ├── SnapTool.x3d │ │ └── X3DSnapNodeTool.js │ ├── Sound │ │ ├── CylinderMan.x3d │ │ ├── ListenerPointSourceTool.js │ │ ├── ListenerPointSourceTool.x3d │ │ ├── SoundTool.js │ │ ├── SoundTool.x3d │ │ ├── SpatialSoundTool.js │ │ └── SpatialSoundTool.x3d │ ├── Text │ │ └── TextTool.js │ ├── TextureProjection │ │ ├── TextureProjectorParallelTool.js │ │ ├── TextureProjectorTool.js │ │ ├── X3DTextureProjectorNodeTool.js │ │ └── X3DTextureProjectorNodeTool.x3d │ ├── VolumeRendering │ │ ├── IsoSurfaceVolumeDataTool.js │ │ ├── SegmentedVolumeDataTool.js │ │ ├── VolumeDataTool.js │ │ └── X3DVolumeDataNodeTool.js │ └── X_ITE │ │ └── InstancedShapeTool.js ├── Undo │ ├── Editor.js │ └── UndoManager.js ├── X3D.js ├── assets │ ├── Entitlements.plist │ ├── Info.plist │ ├── X3D │ │ ├── MaterialPreview.x3d │ │ ├── TexturePreview.x3d │ │ └── Volume.x3d │ ├── X3DUOM.xml │ ├── html │ │ ├── application-template.html │ │ ├── application.js │ │ ├── window-template.html │ │ └── window.js │ ├── images │ │ ├── OutlineEditor │ │ │ ├── AccessTypes │ │ │ │ ├── AccessTypes.xcf │ │ │ │ ├── initializeOnly.png │ │ │ │ ├── inputOnly.0.png │ │ │ │ ├── inputOnly.1.png │ │ │ │ ├── inputOnly.2.png │ │ │ │ ├── inputOnly.active.png │ │ │ │ ├── inputOnly.png │ │ │ │ ├── inputOutput.0.0.png │ │ │ │ ├── inputOutput.0.1.png │ │ │ │ ├── inputOutput.0.2.png │ │ │ │ ├── inputOutput.1.0.png │ │ │ │ ├── inputOutput.1.1.png │ │ │ │ ├── inputOutput.1.2.png │ │ │ │ ├── inputOutput.2.0.png │ │ │ │ ├── inputOutput.2.1.png │ │ │ │ ├── inputOutput.2.2.png │ │ │ │ ├── inputOutput.png │ │ │ │ ├── outputOnly.0.png │ │ │ │ ├── outputOnly.1.png │ │ │ │ ├── outputOnly.2.png │ │ │ │ ├── outputOnly.active.png │ │ │ │ └── outputOnly.png │ │ │ ├── Fields │ │ │ │ ├── MFBool.svg │ │ │ │ ├── MFColor.svg │ │ │ │ ├── MFColorRGBA.svg │ │ │ │ ├── MFDouble.svg │ │ │ │ ├── MFFloat.svg │ │ │ │ ├── MFImage.svg │ │ │ │ ├── MFInt32.svg │ │ │ │ ├── MFMatrix3d.svg │ │ │ │ ├── MFMatrix3f.svg │ │ │ │ ├── MFMatrix4d.svg │ │ │ │ ├── MFMatrix4f.svg │ │ │ │ ├── MFNode.svg │ │ │ │ ├── MFRotation.svg │ │ │ │ ├── MFString.svg │ │ │ │ ├── MFTime.svg │ │ │ │ ├── MFVec2d.svg │ │ │ │ ├── MFVec2f.svg │ │ │ │ ├── MFVec3d.svg │ │ │ │ ├── MFVec3f.svg │ │ │ │ ├── MFVec4d.svg │ │ │ │ ├── MFVec4f.svg │ │ │ │ ├── SFBool.svg │ │ │ │ ├── SFColor.svg │ │ │ │ ├── SFColorRGBA.svg │ │ │ │ ├── SFDouble.svg │ │ │ │ ├── SFFloat.svg │ │ │ │ ├── SFImage.svg │ │ │ │ ├── SFInt32.svg │ │ │ │ ├── SFMatrix3d.svg │ │ │ │ ├── SFMatrix3f.svg │ │ │ │ ├── SFMatrix4d.svg │ │ │ │ ├── SFMatrix4f.svg │ │ │ │ ├── SFNode.svg │ │ │ │ ├── SFRotation.svg │ │ │ │ ├── SFString.svg │ │ │ │ ├── SFTime.svg │ │ │ │ ├── SFVec2d.svg │ │ │ │ ├── SFVec2f.svg │ │ │ │ ├── SFVec3d.svg │ │ │ │ ├── SFVec3f.svg │ │ │ │ ├── SFVec4d.svg │ │ │ │ ├── SFVec4f.svg │ │ │ │ ├── Unkown.svg │ │ │ │ └── none.png │ │ │ ├── Node │ │ │ │ ├── ExportedNode.svg │ │ │ │ ├── ExternProto.svg │ │ │ │ ├── ImportedNode.svg │ │ │ │ ├── NULL.svg │ │ │ │ ├── Prototype.svg │ │ │ │ ├── Route.svg │ │ │ │ ├── SharedNode.svg │ │ │ │ ├── X3DBaseNode.svg │ │ │ │ └── X3DExecutionContext.svg │ │ │ └── Values │ │ │ │ ├── Bell.svg │ │ │ │ ├── FALSE.svg │ │ │ │ └── TRUE.svg │ │ ├── icon.icns │ │ ├── icon.ico │ │ ├── icon.png │ │ ├── icon.svg │ │ └── icons │ │ │ ├── arrow.svg │ │ │ └── hand.svg │ └── themes │ │ ├── default-template.css │ │ ├── prompt-template.css │ │ └── system-colors.css └── main.js └── tests ├── Branches.x3d ├── GeometryTools.x3d ├── Grids.x3d ├── NULL.x3d ├── TestCase 1.x3d └── Tools.x3d /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: X_ITE 2 | -------------------------------------------------------------------------------- /.github/workflows/pages-deploy.yml: -------------------------------------------------------------------------------- 1 | name: "Build and Deploy" 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - master 7 | paths: 8 | - docs/** 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow one concurrent deployment 19 | concurrency: 20 | group: "pages" 21 | cancel-in-progress: true 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v4 30 | with: 31 | fetch-depth: 0 32 | # submodules: true 33 | # If using the 'assets' git submodule from Chirpy Starter, uncomment above 34 | # (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets) 35 | 36 | - name: Setup Pages 37 | id: pages 38 | uses: actions/configure-pages@v4 39 | 40 | - name: Setup Ruby 41 | uses: ruby/setup-ruby@v1 42 | with: 43 | ruby-version: 3.3 44 | bundler-cache: true 45 | 46 | - name: Build site 47 | run: cd ./docs && bundle install && bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}" 48 | env: 49 | JEKYLL_ENV: "production" 50 | 51 | - name: Test site 52 | run: | 53 | cd ./docs && bundle exec htmlproofer _site \ 54 | \-\-disable-external \ 55 | \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/,/404/,/\/x_ite\//,/\/categories\//" 56 | 57 | - name: Upload site artifact 58 | uses: actions/upload-pages-artifact@v3 59 | with: 60 | path: "docs/_site${{ steps.pages.outputs.base_path }}" 61 | 62 | deploy: 63 | environment: 64 | name: github-pages 65 | url: ${{ steps.deployment.outputs.page_url }} 66 | runs-on: ubuntu-latest 67 | needs: build 68 | steps: 69 | - name: Deploy to GitHub Pages 70 | id: deployment 71 | uses: actions/deploy-pages@v4 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /out/ 3 | /x_ite/ 4 | /package-lock.json 5 | /docs/ssl/ 6 | certificate.pfx 7 | certificate-creation.ps1 8 | 9 | **/.DS_Store 10 | 11 | Gemfile.lock 12 | _site 13 | .sass-cache 14 | .jekyll-cache 15 | .jekyll-metadata 16 | .bundle 17 | vendor 18 | 19 | src/assets/html/application.html 20 | src/assets/html/document.html 21 | src/assets/html/window.html 22 | src/assets/themes/default.css 23 | src/assets/themes/prompt.css 24 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Verwendet IntelliSense zum Ermitteln möglicher Attribute. 3 | // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. 4 | // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Sunrize", 11 | "cwd": "${workspaceFolder}", 12 | "runtimeExecutable": "npm", 13 | "runtimeArgs": ["start"], 14 | "console": "integratedTerminal" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/*~": true, 4 | "node_modules": true, 5 | "out": true, 6 | "x_ite": true, 7 | "package-lock.json": true, 8 | "**/_site": true, 9 | "**/.jekyll-cache": true, 10 | "**/.jekyll-metadata": true, 11 | "**/.bundle": true, 12 | "**/.tmp.driveupload": true 13 | }, 14 | "cSpell.words": [ 15 | "Collidable", 16 | "colorpicker", 17 | "dragstop", 18 | "fullname", 19 | "gettext", 20 | "jstree", 21 | "mult", 22 | "qtip", 23 | "Sunrize", 24 | "Tink", 25 | "titlebar" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Open Sunrize", 8 | "type": "shell", 9 | "command": "npm run development -- `echo -n \"[\\\"${file}\\\"]\" | grep -E '\\.(?:x3d|x3dz|x3dv|x3dvz|x3dj|x3djz|gltf|glb|obj|stl|svg|svgz)' | base64` 2>&1 | grep -v -E '^\\d'", 10 | "problemMatcher": [], 11 | }, 12 | { 13 | "label": "Package Sunrize for Download", 14 | "type": "shell", 15 | "command": "npm run download", 16 | "problemMatcher": [] 17 | }, 18 | { 19 | "label": "Make X_ITE for Sunrize", 20 | "type": "shell", 21 | "command": "npm run make-x_ite-for-sunrize", 22 | "problemMatcher": [] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2009 Holger Seelig 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Sunrize](https://create3000.github.io/sunrize/) — A Multi-Platform X3D Editor 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/sunrize)](https://www.npmjs.com/package/sunrize) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/sunrize)](https://npmtrends.com/sunrize) 5 | [![DeepScan grade](https://deepscan.io/api/teams/23540/projects/26817/branches/855450/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=23540&pid=26817&bid=855450) 6 | 7 | ## Introduction 8 | 9 | Sunrize is based on [X_ITE](https://create3000.github.io/x_ite/) and is a basic editor for X3D files. The scene can be edited in an Outline Editor and there is a Script Editor where Script nodes and ComposedShader nodes can be edited. 10 | 11 | ## Quick Links 12 | 13 | * [Website](https://create3000.github.io/sunrize/) 14 | * [Documentation](https://create3000.github.io/sunrize/documentation/) 15 | 16 | ## Usage 17 | 18 | First you need to install both Node.js and npm on your system. To accomplish this, you can use a [Node installer](https://nodejs.org/en/download/) (Windows), or use [Homebrew](https://brew.sh) to install node (macos), or use your Linux package manager. 19 | 20 | Then you can run Sunrize without installing it using npm's **npx** command: 21 | 22 | ```console 23 | $ npx sunrize@latest [files] 24 | ``` 25 | 26 | >**Note:** The first time, it may take a while for Sunrize to start. 27 | 28 | ## License 29 | 30 | Sunrize is free software and licensed under the [MIT License](LICENSE.md). 31 | -------------------------------------------------------------------------------- /bin/sunrize.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict"; 3 | 4 | const os = require ("os"); 5 | const path = require ("path"); 6 | const { spawn } = require ("child_process"); 7 | const cwd = process .cwd (); 8 | const cmd = os .platform () === "win32" ? "npm.cmd" : "npm"; 9 | const args = [... process .argv .slice (2), cwd]; 10 | 11 | process .chdir (path .resolve (__dirname, "..")); 12 | 13 | const p = spawn (cmd, ["start", "--silent", "--", btoa (JSON .stringify (args))], { shell: true }); 14 | 15 | p .stdout .pipe (process .stdout); 16 | p .stderr .pipe (process .stderr); 17 | -------------------------------------------------------------------------------- /build/X3DUOM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -q -O - https://www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml > src/assets/X3DUOM.xml 4 | -------------------------------------------------------------------------------- /build/download.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict"; 3 | 4 | const 5 | fs = require ("fs"), 6 | { systemSync, sh } = require ("shell-tools"); 7 | 8 | function main () 9 | { 10 | make (); 11 | docs (); 12 | merge (); 13 | } 14 | 15 | function make () 16 | { 17 | systemSync (`rm -r -f out/make/`); 18 | 19 | systemSync (`npm run github -- --platform darwin`); 20 | systemSync (`npm run github -- --platform win32`); 21 | } 22 | 23 | function docs () 24 | { 25 | const version = sh (`npm pkg get version | sed 's/"//g'`) .trim (); 26 | 27 | // config 28 | let config = sh (`cat 'docs/_config.yml'`); 29 | 30 | config = config .replace (/\bversion:\s*[\d\.]+/sg, `version: ${version}`); 31 | 32 | fs .writeFileSync ("docs/_config.yml", config); 33 | } 34 | 35 | function merge () 36 | { 37 | // commit 38 | systemSync (`git add -A`); 39 | systemSync (`git commit -am 'Updated downloads.'`); 40 | systemSync (`git push origin`); 41 | 42 | // // merge 43 | // systemSync (`git checkout main`); 44 | // systemSync (`git merge development`); 45 | // systemSync (`git push origin`); 46 | // systemSync (`git checkout development`); 47 | } 48 | 49 | main (); 50 | -------------------------------------------------------------------------------- /build/make-x_ite-for-sunrize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ../x_ite; 3 | npm run dist; 4 | rsync -a --delete --exclude=".*" dist/ ../sunrize/node_modules/x_ite/dist/; 5 | git checkout -- dist; 6 | -------------------------------------------------------------------------------- /build/merge-development.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git checkout main 4 | git merge development 5 | git push origin 6 | git checkout development 7 | -------------------------------------------------------------------------------- /build/release.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict"; 3 | 4 | const { sh, systemSync } = require ("shell-tools"); 5 | 6 | function main () 7 | { 8 | if (sh (`git branch --show-current`) !== "development\n") 9 | { 10 | console .error ("Wrong branch, must be development, cannot release version!"); 11 | process .exit (1); 12 | } 13 | 14 | // merge 15 | systemSync (`git checkout main`); 16 | systemSync (`git merge development`); 17 | 18 | // version 19 | const 20 | name = sh (`node -p "require('./package.json').name"`) .trim (), 21 | online = sh (`npm view ${name} version`) .trim (); 22 | 23 | if (sh (`npm pkg get version | sed 's/"//g'`) .trim () === online) 24 | systemSync (`npm version patch --no-git-tag-version --force`); 25 | 26 | const version = sh (`npm pkg get version | sed 's/"//g'`) .trim (); 27 | 28 | console .log (`NPM version ${online}`); 29 | console .log (`New version ${version}`); 30 | 31 | while (systemSync (`npm i x_ite@latest`)) 32 | systemSync (`countdown 60s`); 33 | 34 | while (systemSync (`npm i x3d-traverse@latest`)) 35 | systemSync (`countdown 60s`); 36 | 37 | // x3duom 38 | systemSync (`npm run X3DUOM`); 39 | 40 | // commit 41 | systemSync (`git add -A`); 42 | systemSync (`git commit -am 'Published version ${version}'`); 43 | systemSync (`git push origin`); 44 | 45 | // tags are created with github-publisher 46 | // tag 47 | systemSync (`git tag ${version}`); 48 | systemSync (`git push origin --tags`); 49 | 50 | // npm 51 | systemSync (`npm publish`); 52 | 53 | // merge development into main 54 | systemSync (`git checkout development`); 55 | systemSync (`git merge main`); 56 | systemSync (`git push origin`); 57 | 58 | // // package 59 | // systemSync (`npm run download`); 60 | } 61 | 62 | main (); 63 | -------------------------------------------------------------------------------- /build/wine-proxy/wine: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const { spawn } = require ("child_process"); 3 | 4 | const 5 | args = process .argv .slice (2), 6 | cmd = args .shift (), 7 | cwd = process .cwd (); 8 | 9 | if (cmd .endsWith ("7z.exe")) 10 | { 11 | const z7Args = args .filter (v => v !== "on"); 12 | 13 | spawn ("7zz", z7Args, { cwd }); 14 | } 15 | else 16 | { 17 | // Cannot use "wine" loop! 18 | spawn ("/opt/homebrew/bin/wine64", [cmd, ... args], { cwd }); 19 | } 20 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "jekyll-theme-chirpy", "~> 7.3" 6 | 7 | group :test do 8 | gem "html-proofer", "~> 5.0" 9 | end 10 | 11 | group :jekyll_plugins do 12 | gem 'jekyll-x3d', '~> 1.0' 13 | gem 'jekyll-vrml', '~> 2.2' 14 | end 15 | -------------------------------------------------------------------------------- /docs/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Cotes Chung 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Chirpy Starter 2 | 3 | [![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy)][gem]  4 | [![GitHub license](https://img.shields.io/github/license/cotes2020/chirpy-starter.svg?color=blue)][mit] 5 | 6 | When installing the [**Chirpy**][chirpy] theme through [RubyGems.org][gem], Jekyll can only read files in the folders 7 | `_data`, `_layouts`, `_includes`, `_sass` and `assets`, as well as a small part of options of the `_config.yml` file 8 | from the theme's gem. If you have ever installed this theme gem, you can use the command 9 | `bundle info --path jekyll-theme-chirpy` to locate these files. 10 | 11 | The Jekyll team claims that this is to leave the ball in the user’s court, but this also results in users not being 12 | able to enjoy the out-of-the-box experience when using feature-rich themes. 13 | 14 | To fully use all the features of **Chirpy**, you need to copy the other critical files from the theme's gem to your 15 | Jekyll site. The following is a list of targets: 16 | 17 | ```shell 18 | . 19 | ├── _config.yml 20 | ├── _plugins 21 | ├── _tabs 22 | └── index.html 23 | ``` 24 | 25 | To save you time, and also in case you lose some files while copying, we extract those files/configurations of the 26 | latest version of the **Chirpy** theme and the [CD][CD] workflow to here, so that you can start writing in minutes. 27 | 28 | ## Prerequisites 29 | 30 | Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of 31 | the basic environment. [Git](https://git-scm.com/) also needs to be installed. 32 | 33 | ## Installation 34 | 35 | Sign in to GitHub and [**use this template**][use-template] to generate a brand new repository and name it 36 | `USERNAME.github.io`, where `USERNAME` represents your GitHub username. 37 | 38 | Then clone it to your local machine and run: 39 | 40 | ```console 41 | $ bundle 42 | ``` 43 | 44 | ## Usage 45 | 46 | Please see the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy#documentation). 47 | 48 | ## Contributing 49 | 50 | The contents of this repository are automatically updated when new releases are made to the [main repository][chirpy]. 51 | If you have problems using it, or would like to participate in improving it, please go to the main repository for feedback! 52 | 53 | ## License 54 | 55 | This work is published under [MIT][mit] License. 56 | 57 | [gem]: https://rubygems.org/gems/jekyll-theme-chirpy 58 | [chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/ 59 | [use-template]: https://github.com/cotes2020/chirpy-starter/generate 60 | [CD]: https://en.wikipedia.org/wiki/Continuous_deployment 61 | [mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE 62 | -------------------------------------------------------------------------------- /docs/_data/contact.yml: -------------------------------------------------------------------------------- 1 | # The contact options. 2 | 3 | - type: github 4 | icon: "fab fa-github" 5 | 6 | - type: twitter 7 | icon: "fa-brands fa-x-twitter" 8 | 9 | - type: email 10 | icon: "fas fa-envelope" 11 | noblank: true # open link in current tab 12 | 13 | - type: rss 14 | icon: "fas fa-rss" 15 | noblank: true 16 | # Uncomment and complete the url below to enable more contact options 17 | # 18 | # - type: mastodon 19 | # icon: 'fab fa-mastodon' # icons powered by 20 | # url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification 21 | # 22 | # - type: linkedin 23 | # icon: 'fab fa-linkedin' # icons powered by 24 | # url: '' # Fill with your Linkedin homepage 25 | # 26 | # - type: stack-overflow 27 | # icon: 'fab fa-stack-overflow' 28 | # url: '' # Fill with your stackoverflow homepage 29 | -------------------------------------------------------------------------------- /docs/_data/nav/documentation.yml: -------------------------------------------------------------------------------- 1 | - title: "Documentation" 2 | children: 3 | - title: "Overview" 4 | url: /documentation/ 5 | - title: "A Quick Look at the User Interface" 6 | url: /documentation/a-quick-look-at-the-user-interface/ 7 | - title: "Using the Outline Editor" 8 | url: /documentation/using-the-outline-editor/ 9 | - title: "Selecting and Grouping Objects" 10 | url: /documentation/selecting-and-grouping-objects/ 11 | - title: "Creating Group Hierarchies" 12 | url: /documentation/creating-group-hierarchies/ 13 | - title: "Creating Routes Between Fields" 14 | url: /documentation/creating-routes-between-fields/ 15 | - title: "Cloning Objects" 16 | url: /documentation/cloning-objects/ 17 | - title: "Editing Prototypes" 18 | url: /documentation/editing-prototypes/ 19 | - title: "Imported and Exported Nodes" 20 | url: /documentation/imported-and-exported-nodes/ 21 | - title: "Snapping and Alignment" 22 | url: /documentation/snapping-and-alignment/ 23 | - title: "Using the Script Editor" 24 | url: /documentation/using-the-script-editor/ 25 | -------------------------------------------------------------------------------- /docs/_data/nav/main.yml: -------------------------------------------------------------------------------- 1 | - title: "Main" 2 | children: 3 | - title: "Introduction" 4 | url: / 5 | -------------------------------------------------------------------------------- /docs/_data/share.yml: -------------------------------------------------------------------------------- 1 | # Sharing options at the bottom of the post. 2 | # Icons from 3 | 4 | platforms: 5 | - type: Twitter 6 | icon: "fa-brands fa-square-x-twitter" 7 | link: "https://twitter.com/intent/tweet?text=TITLE&url=URL" 8 | 9 | - type: Facebook 10 | icon: "fab fa-facebook-square" 11 | link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL" 12 | 13 | - type: Telegram 14 | icon: "fab fa-telegram" 15 | link: "https://t.me/share/url?url=URL&text=TITLE" 16 | 17 | # Uncomment below if you need to. 18 | # 19 | # - type: Linkedin 20 | # icon: "fab fa-linkedin" 21 | # link: "https://www.linkedin.com/sharing/share-offsite/?url=URL" 22 | # 23 | # - type: Weibo 24 | # icon: "fab fa-weibo" 25 | # link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL" 26 | # 27 | # - type: Mastodon 28 | # icon: "fa-brands fa-mastodon" 29 | # # See: https://github.com/justinribeiro/share-to-mastodon#properties 30 | # instances: 31 | # - label: mastodon.social 32 | # link: "https://mastodon.social/" 33 | # - label: mastodon.online 34 | # link: "https://mastodon.online/" 35 | # - label: fosstodon.org 36 | # link: "https://fosstodon.org/" 37 | # - label: photog.social 38 | # link: "https://photog.social/" 39 | -------------------------------------------------------------------------------- /docs/_includes/nav.html: -------------------------------------------------------------------------------- 1 | {% assign enable_nav = false %} 2 | {% if site.data.nav[page.nav] %} 3 | {% assign enable_nav = true %} 4 | {% endif %} 5 | 6 | {% if enable_nav %} 7 | {% for item in site.data.nav[page.nav] %} 8 | 18 | {% endfor %} 19 | {% endif %} 20 | -------------------------------------------------------------------------------- /docs/_includes/scripts.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | {% if content contains ' 8 | {% endif %} 9 | -------------------------------------------------------------------------------- /docs/_layouts/wrap.html: -------------------------------------------------------------------------------- 1 | --- 2 | # Wrapper HTML 3 | --- 4 | {{ content | replace: 'data-src=', 'src=' }} 5 | -------------------------------------------------------------------------------- /docs/_plugins/external-links.rb: -------------------------------------------------------------------------------- 1 | [:documents, :pages].each do |hook| 2 | Jekyll::Hooks.register hook, :post_render do |item| 3 | if item.output_ext == ".html" 4 | content = item.output 5 | site_url = item.site.config["url"] 6 | 7 | content.gsub!(%r{ 1 10 | lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"` 11 | post.data['last_modified_at'] = lastmod_date 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /docs/_posts/documentation/cloning-objects.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Cloning Objects 3 | date: 2024-01-14 4 | nav: documentation 5 | categories: [documentation] 6 | tags: [Cloning, Outline Editor] 7 | --- 8 | ## About Cloning 9 | 10 | When you begin creating X3D scenes, you will want to capitalize on the economy of modeling an object once and then reusing it, with modifications, when it appears elsewhere in the scene. Aside from making the X3D file shorter and easier to read, this technique decreases the time it takes to download your scene and increases overall performance. Make it a general practice to reuse nodes whenever possible. 11 | 12 | Creating a node and then referring to it by name in multiple places is called *cloning.* If you change the original named node, all clones of that node will change as well. 13 | 14 | Sometimes you will have the same geometry repeated in a scene, but with different colors and textures. In such cases, you can name the geometry the first time and reuse it, but include different material and texture nodes to change the appearance. 15 | 16 | ## Creating a Clone 17 | 18 | Suppose that you have the same texture used multiple time on different geometries. 19 | 20 | The OutlineEditor might display something like this: 21 | 22 | ![Cloning Objects 1](/assets/img/documentation/cloning-objects-1.png){: .normal .w-50 } 23 | 24 | If you want to clone the ImageTexture node now you just select the first node. Then drag the node and hold down *Ctrl/Command* key and drop the node to the second texture field. 25 | 26 | Now the OutlineEditor will display this: 27 | 28 | ![Cloning Objects 2](/assets/img/documentation/cloning-objects-2.png){: .normal .w-50 } 29 | 30 | You will notice now a small number in brackets behind the node name. This number indicates that the node is cloned and how many times. 31 | 32 | ## Unlink a Clone 33 | 34 | If you don't want the clone anymore for several reasons, you can unlink the clone relationship again. 35 | 36 | 1. Place the mouse pointer over the node name. 37 | 2. Right click to open the context menu. 38 | 3. Choose *Unlink Clone*. 39 | 40 | ![Unlink Clone](/assets/img/documentation/unlink-clone.png){: .normal .w-50 } 41 |
Unlink Clone menu item 42 | {: .small } 43 | 44 | The clone relationship is now broken. You will see no small number behind the node name now. For every instance a copy of the clone is made and the clone is replaced by the copy. 45 | 46 | ## Remove a Clone 47 | 48 | Go to the Outline Editor, place the cursor over a clone and activate the context menu. Select *Delete* will remove only this one clone. 49 | -------------------------------------------------------------------------------- /docs/_posts/documentation/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Documentation 3 | date: 2024-01-08 4 | nav: documentation 5 | categories: [documentation] 6 | tags: [Documentation] 7 | --- 8 | 9 | ## About Sunrize 10 | 11 | Use Sunrize to create standards-compliant X3D/VRML worlds for publishing on the World Wide Web and for building stand-alone applications. Sunrize fully supports the [X3D Specification](/x_ite/supported-nodes/), including the Moving Worlds specification for VRML 2.0. 12 | 13 | Sunrize aims to provide you with powerful tools to compose complex objects and create exciting, animated and interactive worlds. Use existing 3D modelling programs such as Blender or Maya to create polygonal or NURBS objects that can be easily imported into Sunrize and then arranged and made interactive. Use X_ITE to publish your content on the web. 14 | 15 | ## Where to Go? 16 | 17 | - [A Quick Look at the User Interface](../a-quick-look-at-the-user-interface/) 18 | - [Using the Outline Editor](../using-the-outline-editor/) 19 | - [Selecting and Grouping Objects](../selecting-and-grouping-objects/) 20 | - [Creating Group Hierarchies](../creating-group-hierarchies/) 21 | - [Creating Routes Between Fields](../creating-routes-between-fields/) 22 | - [Cloning Objects](../cloning-objects/) 23 | - [Editing Prototypes](../editing-prototypes/) 24 | - [Imported and Exported Nodes](../imported-and-exported-nodes/) 25 | - [Snapping and Alignment](../snapping-and-alignment/) 26 | - [Using the Script Editor](../using-the-script-editor/) 27 | 28 | It might also be of interest for you [how to navigate in a the scene](/x_ite/tutorials/how-to-navigate-in-a-scene/). 29 | 30 | ## Conventions Used 31 | 32 | Choose *File > Save* means to choose Save from the File pull-down menu. 33 | 34 | *Ctrl-u* means to press the *Ctrl* key and the *u* key at the same time. 35 | 36 | To *click* means to quickly press and release the left mouse button. 37 | 38 | To *drag* means to press and hold down the indicated mouse button (the left button if none is indicated). 39 | 40 | To *click-middle* means to click the middle mouse button. 41 | 42 | To *click-right* means to click the right mouse button. 43 | 44 | ![smarty-bubbles](/assets/img/documentation/smarty-bubbles.jpg) 45 |
Editing »Smarty Bubbles« example in Sunrize 46 | {: .small } 47 | -------------------------------------------------------------------------------- /docs/_posts/documentation/using-the-outline-editor.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Using the Outline Editor 3 | date: 2024-01-12 4 | nav: documentation 5 | categories: [documentation] 6 | tags: [Outline Editor] 7 | --- 8 | The Outline Editor lets you 9 | 10 | - browse and edit the X3D source file for your scene 11 | - edit field values 12 | - create routes between fields 13 | - make precise selections within the scene file 14 | 15 | It shows the entire scene hierarchy, including nodes, fields, field values and types, as well as the routes between events. Node type names are in boldface type. Field types and field names are in roman type. Routes are shown to the right of fields and events. 16 | 17 | ![Outline Editor](/assets/img/documentation/sidebar-outline-editor.png){: .w-50 .normal } 18 | 19 | When you select an object in the main window, the Outline Editor highlights the parts of the X3D file that define those objects. Clones (multiple instances) of an object are indicated with the notation \[N\], where N indicates how many instances of a node have been created in the file. Edits to one instance affect all instances of the object. If you select an object that has multiple instances, all are highlighted. 20 | 21 | Each node or field has a small expander arrow to its left. When the arrow is clicked once, the information is in its condensed form. **When the arrow is *Shift*-clicked, the information is in its expanded version.** Click the arrow next to a node to reveal the fields within that node. Click the arrow next to a field name to reveal the field's values. Each node type has a particular icon that is associated with it. 22 | 23 | Each node shows a context menu while hovering the mouse over the node or a field of the node. The node must not be selected just move the mouse over the node and right click. There are various operations what you can do depending on the type of the node (extern proto, proto, node). 24 | 25 | ![Context menu of a node](/assets/img/documentation/outliner-node-context-menu.png){: .w-50 .normal } 26 |
Context menu of a node 27 | {: .small } 28 | 29 | ## See Also 30 | 31 | - [Keyboard Shortcuts and Tricks](../a-quick-look-at-the-user-interface/#keyboard-shortcuts-and-tricks) 32 | -------------------------------------------------------------------------------- /docs/_posts/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sunrize — A Multi-Platform X3D Editor 3 | date: 2023-04-20 4 | nav: main 5 | categories: [] 6 | tags: [Getting Started] 7 | permalink: / 8 | --- 9 | [![NPM Version](https://img.shields.io/npm/v/sunrize)](https://www.npmjs.com/package/sunrize) 10 | [![NPM Downloads](https://img.shields.io/npm/dm/sunrize)](https://npmtrends.com/sunrize) 11 | [![DeepScan grade](https://deepscan.io/api/teams/23540/projects/26817/branches/855450/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=23540&pid=26817&bid=855450) 12 | 13 | ## Introduction 14 | 15 | Sunrize is an easy-to-use editor for X3D files that is based on the [X_ITE](/x_ite/) framework. The Outline Editor allows for intuitive scene editing, while the Script Editor provides comprehensive editing of [Script](/x_ite/components/scripting/script/) and [ComposedShader](/x_ite/components/shaders/composedshader/) nodes. 16 | 17 | ![Image of Sunrize Editor](/assets/img/sunrize.avif) 18 | 19 | [ Support us on Patreon](https://patreon.com/X_ITE){: .patreon } 20 | 21 | ## Run from Console 22 | 23 | First you need to install both Node.js and npm on your system. To accomplish this, you can use a [Node installer](https://nodejs.org/en/download/) (Windows), or use [Homebrew](https://brew.sh) to install node (macos), or use your Linux package manager. 24 | 25 | Then you can run Sunrize without installing it using npm's **npx** command: 26 | 27 | ```console 28 | $ npx sunrize@latest [files] 29 | ``` 30 | 31 | >**Note:** The first time, it may take a while for Sunrize to start. 32 | {: .prompt-info } 33 | 50 | -------------------------------------------------------------------------------- /docs/_tabs/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Documentation 3 | date: 2024-01-08 4 | icon: fas fa-graduation-cap 5 | order: 1 6 | redirect_to: /documentation/overview/ 7 | --- 8 | -------------------------------------------------------------------------------- /docs/_tabs/tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: tags 3 | icon: fas fa-tags 4 | order: 3 5 | --- 6 | -------------------------------------------------------------------------------- /docs/_tabs/x_ite.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: X_ITE 3 | date: 2023-11-20 4 | icon: fas fa-play 5 | order: 2 6 | redirect_to: https://create3000.github.io/x_ite/ 7 | --- 8 | -------------------------------------------------------------------------------- /docs/assets/img/documentation/add-new-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/add-new-field.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/add-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/add-reference.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/angle-layout-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/angle-layout-tool.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/arrow.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/cloning-objects-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/cloning-objects-1.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/cloning-objects-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/cloning-objects-2.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/cone-with-manipulators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/cone-with-manipulators.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/console.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/earth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/earth-1.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/earth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/earth-2.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/export-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/export-node.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-1.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-2.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-3.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-outline-editor-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-outline-editor-1.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-outline-editor-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-outline-editor-2.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot-shin-thigh-outline-editor-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot-shin-thigh-outline-editor-3.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot1.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/foot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/foot2.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/hand.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/import-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/import-node.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/imported-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/imported-node.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/look-at-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/look-at-selection.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/outliner-node-context-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/outliner-node-context-menu.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/play.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/prototype-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/prototype-editor.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/prototypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/prototypes.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/remove-export-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/remove-export-node.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/script-editor-glsl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/script-editor-glsl.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/script-editor-javascript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/script-editor-javascript.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/sidebar-outline-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/sidebar-outline-editor.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/smarty-bubbles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/smarty-bubbles.jpg -------------------------------------------------------------------------------- /docs/assets/img/documentation/snap-target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/snap-target.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/straighten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/straighten.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/transform-connectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/transform-connectors.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/transform-detailed-routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/transform-detailed-routes.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/transform-detailed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/transform-detailed.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/transform-multiple-routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/transform-multiple-routes.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/transform-route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/transform-route.png -------------------------------------------------------------------------------- /docs/assets/img/documentation/unlink-clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/documentation/unlink-clone.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /docs/assets/img/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/favicon.ico -------------------------------------------------------------------------------- /docs/assets/img/favicons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/favicons/mstile-150x150.png -------------------------------------------------------------------------------- /docs/assets/img/icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/assets/img/icons/xmark.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/logo.png -------------------------------------------------------------------------------- /docs/assets/img/sunrize.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/sunrize.avif -------------------------------------------------------------------------------- /docs/assets/img/sunrize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/docs/assets/img/sunrize.png -------------------------------------------------------------------------------- /docs/assets/js/links.js: -------------------------------------------------------------------------------- 1 | $("a[href='/sunrize/documentation/']") .attr ("href", "/sunrize/documentation/overview/"); 2 | $("a[href='/sunrize/x_ite/']") .attr ("href", "/x_ite/"); 3 | -------------------------------------------------------------------------------- /docs/google3696ee938394d7b6.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google3696ee938394d7b6.html -------------------------------------------------------------------------------- /forge.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "packagerConfig": { 3 | "icon": "./src/assets/images/icon.png", 4 | "dir": "./src", 5 | "ignore": "^/(?!src|package\\.json|node_modules)", 6 | "certificateFile": "./build/certificate.pfx", 7 | "certificatePassword": process .env .CERT_PASSWORD, 8 | "extendInfo": "./src/assets/Info.plist", 9 | "osxSign": { 10 | "optionsForFile": (filePath) => { 11 | // Here, we keep it simple and return a single entitlements.plist file. 12 | // You can use this callback to map different sets of entitlements 13 | // to specific files in your packaged app. 14 | return { 15 | "entitlements": "src/assets/Entitlements.plist" 16 | }; 17 | } 18 | } 19 | }, 20 | "makers": [ 21 | { 22 | "name": "@electron-forge/maker-squirrel" 23 | }, 24 | { 25 | "name": "@electron-forge/maker-dmg" 26 | }, 27 | { 28 | "name": "@electron-forge/maker-deb" 29 | }, 30 | { 31 | "name": "@electron-forge/maker-rpm" 32 | } 33 | ], 34 | "publishers": [ 35 | { 36 | "name": "@electron-forge/publisher-github", 37 | "config": { 38 | "repository": { 39 | "owner": "create3000", 40 | "name": "sunrize" 41 | }, 42 | "prerelease": false, 43 | "draft": false 44 | } 45 | } 46 | ] 47 | }; 48 | -------------------------------------------------------------------------------- /src/Application/ActionKeys.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const $ = require ("jquery"); 4 | 5 | module .exports = new class ActionKeys 6 | { 7 | None = 0; 8 | Shift = 0b0001; 9 | Control = 0b0010; 10 | Alt = 0b0100; 11 | Option = 0b0100; 12 | AltGraph = 0b1000; 13 | Command = 0b1000; 14 | 15 | CommandOrControl = process .platform === "darwin" 16 | ? this .Command 17 | : this .Control; 18 | 19 | value = 0; 20 | 21 | constructor () 22 | { 23 | $(window) 24 | .on ("keydown", this .onkeydown .bind (this)) 25 | .on ("keyup", this .onkeyup .bind (this)); 26 | } 27 | 28 | onkeydown (event) 29 | { 30 | // console .log (event .key) 31 | 32 | const value = this .value; 33 | 34 | switch (event .key) 35 | { 36 | case "Shift": 37 | { 38 | this .value |= this .Shift; 39 | break; 40 | } 41 | case "Control": 42 | { 43 | this .value |= this .Control; 44 | break; 45 | } 46 | case "Alt": // Alt/Option 47 | { 48 | this .value |= this .Alt; 49 | break; 50 | } 51 | case "Meta": // AltGr/Command 52 | { 53 | this .value |= this .AltGraph; 54 | break; 55 | } 56 | } 57 | 58 | if (this .value === value) 59 | return; 60 | 61 | this .#processInterests (); 62 | } 63 | 64 | onkeyup (event) 65 | { 66 | //console .log (event .key) 67 | 68 | const value = this .value; 69 | 70 | switch (event .key) 71 | { 72 | case "Shift": 73 | { 74 | this .value &= ~this .Shift; 75 | break; 76 | } 77 | case "Control": 78 | { 79 | this .value &= ~this .Control; 80 | break; 81 | } 82 | case "Alt": // Alt/Option 83 | { 84 | this .value &= ~this .Alt; 85 | break; 86 | } 87 | case "Meta": // AltGr/Command 88 | { 89 | this .value &= ~this .AltGraph; 90 | break; 91 | } 92 | } 93 | 94 | if (this .value === value) 95 | return; 96 | 97 | this .#processInterests (); 98 | } 99 | 100 | #interests = new Map (); 101 | 102 | addInterest (key, callback) 103 | { 104 | this .#interests .set (key, callback); 105 | } 106 | 107 | removeInterest (key) 108 | { 109 | this .#interests .delete (key); 110 | } 111 | 112 | #processInterests () 113 | { 114 | for (const callback of this .#interests .values ()) 115 | callback (this .value); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/Application/CSS.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const $ = require ("jquery"); 4 | 5 | // CSS 6 | 7 | const colorScheme = window .matchMedia ("(prefers-color-scheme: dark)"); 8 | 9 | colorScheme .addEventListener ("change", event => changeColorScheme (event)); 10 | 11 | changeColorScheme (colorScheme); 12 | 13 | function changeColorScheme (event) 14 | { 15 | $("body") 16 | .removeClass (["light", "dark"]) 17 | .addClass (event .matches ? "dark" : "light"); 18 | } 19 | 20 | module .exports = { colorScheme }; 21 | -------------------------------------------------------------------------------- /src/Application/Footer.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | Tabs = require ("../Controls/Tabs"), 5 | Console = require ("../Editors/Console"), 6 | _ = require ("./GetText") 7 | 8 | module .exports = class Footer extends Tabs 9 | { 10 | constructor (element) 11 | { 12 | super (element, "bottom") 13 | 14 | this .setup () 15 | } 16 | 17 | addTabs () 18 | { 19 | this .addTextTab ("console", _("Console")) 20 | this .addTextTab ("script-editor", _("Script Editor")) 21 | 22 | if (process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT") 23 | this .addTextTab ("animation-editor", _("Animation Editor")) 24 | 25 | this .console = new Console (this .getPanel ("console")) 26 | } 27 | 28 | initTab (panel) 29 | { 30 | switch (panel .attr ("id")) 31 | { 32 | case "script-editor": 33 | { 34 | const ScriptEditor = require ("../Editors/ScriptEditor") 35 | 36 | this .scriptEditor = new ScriptEditor (panel) 37 | break 38 | } 39 | case "animation-editor": 40 | { 41 | const AnimationEditor = require ("../Editors/AnimationEditor") 42 | 43 | this .animationEditor = new AnimationEditor (panel) 44 | break 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Application/GetText.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | function gettext (string) 4 | { 5 | return string; 6 | } 7 | 8 | gettext .locale = "en"; 9 | 10 | module .exports = gettext; 11 | -------------------------------------------------------------------------------- /src/Application/Sidebar.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | OutlineEditor = require ("../Editors/OutlineEditor"), 5 | Tabs = require ("../Controls/Tabs"), 6 | _ = require ("./GetText") 7 | 8 | module .exports = class Sidebar extends Tabs 9 | { 10 | constructor (element) 11 | { 12 | super (element, "bottom") 13 | 14 | this .setup () 15 | } 16 | 17 | addTabs () 18 | { 19 | if (process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT") 20 | this .addIconTab ("file-manager", "description", _("File Manager")) 21 | 22 | this .addIconTab ("outline-editor", "list", _("Outline Editor")) 23 | 24 | if (process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT") 25 | this .addIconTab ("node-inspector", "visibility", _("Node Inspector")) 26 | 27 | this .outlineEditor = new OutlineEditor (this .getPanel ("outline-editor")) 28 | } 29 | 30 | configure () 31 | { 32 | super .configure ({ active: 1 }) 33 | } 34 | 35 | initTab (panel) 36 | { 37 | switch (panel .attr ("id")) 38 | { 39 | case "file-manager": 40 | { 41 | const FileManager = require ("../Editors/FileManager") 42 | 43 | this .fileManger = new FileManager (panel) 44 | break 45 | } 46 | case "node-inspector": 47 | { 48 | const NodeInspector = require ("../Editors/NodeInspector") 49 | 50 | this .nodeInspector = new NodeInspector (panel) 51 | break 52 | } 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/Application/Template.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | fs = require ("fs"), 5 | path = require ("path"), 6 | url = require ("url"); 7 | 8 | class Template 9 | { 10 | static #templates = new Set (); 11 | static #stats = new Map (); 12 | 13 | static create (template) 14 | { 15 | const 16 | filename = this .filename (template), 17 | dirname = path .dirname (template), 18 | stats = fs .statSync (dirname); 19 | 20 | this .#templates .add (template); 21 | this .#stats .set (dirname, stats); 22 | 23 | const file = fs .readFileSync (template) 24 | .toString () 25 | .replace (/(url\()(.*?)(\))/sg, Template .resolve .bind (null, template)) 26 | .replace (/(href=")(.*?)(")/sg, Template .resolve .bind (null, template)); 27 | 28 | fs .writeFileSync (filename, file); 29 | fs .utimesSync (dirname, stats .atime, stats .mtime); 30 | 31 | return filename; 32 | } 33 | 34 | static removeAll () 35 | { 36 | for (const template of new Set (this .#templates)) 37 | this .remove (template); 38 | } 39 | 40 | static remove (template) 41 | { 42 | const 43 | dirname = path .dirname (template), 44 | stats = this .#stats .get (dirname); 45 | 46 | fs .unlinkSync (this .filename (template)); 47 | fs .utimesSync (dirname, stats .atime, stats .mtime); 48 | 49 | this .#templates .delete (template); 50 | } 51 | 52 | static filename (template) 53 | { 54 | const 55 | dirname = path .dirname (template), 56 | basename = path .basename (template), 57 | filename = path .resolve (dirname, basename .replace (/-template/, "")); 58 | 59 | return filename; 60 | } 61 | 62 | static resolve (template, all, begin, filename, end) 63 | { 64 | const match = filename .match (/^.*?\/node_modules\/(.*?)$/); 65 | 66 | if (match) 67 | return begin + url .pathToFileURL (require .resolve (match [1])) + end; 68 | 69 | const resolved = new URL (filename, url .pathToFileURL (template)); 70 | 71 | if (resolved .protocol === "file:") 72 | return begin + resolved + end; 73 | 74 | return all; 75 | } 76 | } 77 | 78 | module .exports = Template; 79 | -------------------------------------------------------------------------------- /src/Application/Window.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Document = require ("./Document"); 4 | 5 | module .exports = new class Window extends Document 6 | { 7 | constructor () 8 | { 9 | super (); 10 | 11 | // Setup 12 | 13 | this .setup (); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /src/Bits/Algorithm.js: -------------------------------------------------------------------------------- 1 | module .exports = { 2 | cmp: (a, b) => a < b ? -1 : a > b ? 1 : 0, 3 | 4 | clamp: (num, min, max) => Math .min (Math .max (num, min), max), 5 | }; 6 | -------------------------------------------------------------------------------- /src/Bits/Highlight.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const $ = require ("jquery"); 4 | 5 | /** 6 | * Animate element. 7 | * @param {string|Array} classes 8 | * @param {number} duration 9 | * @returns {JQuery} 10 | */ 11 | $.fn.highlight = function (classes = "highlight", duration = 1000) 12 | { 13 | this .addClass (classes); 14 | setTimeout (() => this .removeClass (classes), duration); 15 | return this; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Bits/MimeTypes.js: -------------------------------------------------------------------------------- 1 | const mime = require ("mime-types"); 2 | 3 | mime .add = function (mimeType, extensions) 4 | { 5 | this .types [extensions [0]] = mimeType; 6 | this .extensions [mimeType] = extensions; 7 | } 8 | 9 | mime .add ("image/jpeg", ["jpg"]); 10 | mime .add ("image/ktx2", ["ktx2"]); 11 | mime .add ("x-shader/x-vertex", ["vs"]); 12 | mime .add ("x-shader/x-fragment", ["fs"]); 13 | 14 | module .exports = mime; 15 | -------------------------------------------------------------------------------- /src/Bits/Validate.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const $ = require ("jquery"); 4 | 5 | /** 6 | * 7 | * @param {RegExp} regex 8 | * @param {Function} error 9 | * @returns {JQuery} 10 | */ 11 | $.fn.validate = function (regex, error) 12 | { 13 | this .off (".validate"); 14 | 15 | let lastValue = this .val (); 16 | 17 | this .on ("keydown.validate", event => 18 | { 19 | if (event .key .length > 1) 20 | return; 21 | 22 | const 23 | start = this .prop ("selectionStart"), 24 | end = this .prop ("selectionEnd"), 25 | value = this .val () .substring (0, start) + event .key + this .val () .substring (end); 26 | 27 | if (value .match (regex)) 28 | return; 29 | 30 | event .preventDefault (); 31 | 32 | if (typeof error === "function") 33 | error .call (this, event); 34 | }) 35 | .on ("keyup.validate", () => 36 | { 37 | // https://stackoverflow.com/questions/44962941/html-text-input-element-disable-mac-double-space-to-insert-period 38 | 39 | if (this .val () .match (regex)) 40 | return; 41 | 42 | const 43 | start = this .prop ("selectionStart"), 44 | end = this .prop ("selectionEnd"); 45 | 46 | this 47 | .val (lastValue) 48 | .prop ("selectionStart", start) 49 | .prop ("selectionEnd", end); 50 | }) 51 | .on ("change.validate", () => 52 | { 53 | lastValue = this .val (); 54 | }); 55 | 56 | return this; 57 | }; 58 | -------------------------------------------------------------------------------- /src/Bits/X3DUOM.js: -------------------------------------------------------------------------------- 1 | const 2 | $ = require ("jquery"), 3 | fs = require ("fs"), 4 | path = require ("path"), 5 | X3D = require ("../X3D"); 6 | 7 | const 8 | X3DUOM = $($.parseXML (fs .readFileSync (path .join (__dirname, "..", "assets", "X3DUOM.xml"), "utf-8"))), 9 | X_ITE = $($.parseXML (fs .readFileSync (X3D .X3DUOM_PATH, "utf-8"))); 10 | 11 | X3DUOM .find ("AbstractNodeTypes") .append (X_ITE .find ("AbstractNodeTypes")); 12 | X3DUOM .find ("ConcreteNodes") .append (X_ITE .find ("ConcreteNode")); 13 | 14 | // emissiveColor fix 15 | X3DUOM .find ("AbstractNodeType[name=X3DOneSidedMaterialNode]") 16 | .append (X3DUOM .find ("field[name=emissiveColor]") .first () .clone ()); 17 | 18 | module .exports = X3DUOM; 19 | -------------------------------------------------------------------------------- /src/Components.js: -------------------------------------------------------------------------------- 1 | // Geometry2D 2 | require ("./Components/Geometry2D/Arc2D"); 3 | require ("./Components/Geometry2D/ArcClose2D"); 4 | require ("./Components/Geometry2D/Circle2D"); 5 | require ("./Components/Geometry2D/Disk2D"); 6 | require ("./Components/Geometry2D/Polyline2D"); 7 | require ("./Components/Geometry2D/Polypoint2D"); 8 | require ("./Components/Geometry2D/Rectangle2D"); 9 | require ("./Components/Geometry2D/TriangleSet2D"); 10 | 11 | // Geometry3D 12 | require ("./Components/Geometry3D/Box"); 13 | require ("./Components/Geometry3D/Cone"); 14 | require ("./Components/Geometry3D/Cylinder"); 15 | require ("./Components/Geometry3D/ElevationGrid"); 16 | require ("./Components/Geometry3D/Extrusion"); 17 | require ("./Components/Geometry3D/IndexedFaceSet"); 18 | require ("./Components/Geometry3D/Sphere"); 19 | 20 | // NURBS 21 | require ("./Components/NURBS/NurbsCurve"); 22 | require ("./Components/NURBS/NurbsSweptSurface"); 23 | require ("./Components/NURBS/NurbsSwungSurface"); 24 | require ("./Components/NURBS/X3DNurbsSurfaceGeometryNode"); 25 | 26 | // Rendering 27 | require ("./Components/Rendering/IndexedLineSet"); 28 | require ("./Components/Rendering/LineSet"); 29 | require ("./Components/Rendering/X3DComposedGeometryNode"); 30 | require ("./Components/Rendering/X3DGeometryNode"); 31 | 32 | // Text 33 | require ("./Components/Text/Text"); 34 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Arc2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Arc2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedLineSet (executionContext, 8 | { 9 | polyline: true, 10 | }); 11 | 12 | geometry ._metadata = this ._metadata; 13 | 14 | return geometry; 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/ArcClose2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .ArcClose2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedFaceSet (executionContext, { texCoord: true }); 8 | 9 | geometry ._metadata = this ._metadata; 10 | geometry ._solid = this ._solid; 11 | 12 | return geometry; 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Circle2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Circle2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | browser = this .getBrowser (), 9 | geometry = browser .getCircle2DOptions () .getGeometry () .copy (executionContext), 10 | radius = this ._radius .getValue (); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 14 | 15 | for (const [i, point] of geometry ._coord .point .entries ()) 16 | geometry ._coord .point [i] = point .multiply (radius); 17 | 18 | geometry ._coord .getValue () .setup (); 19 | geometry .setup (); 20 | 21 | return geometry; 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Disk2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Disk2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | innerRadius = Math .min (Math .abs (this ._innerRadius .getValue ()), Math .abs (this ._outerRadius .getValue ())), 9 | outerRadius = Math .max (Math .abs (this ._innerRadius .getValue ()), Math .abs (this ._outerRadius .getValue ())); 10 | 11 | if (innerRadius === outerRadius) 12 | { 13 | // Point 14 | 15 | if (outerRadius === 0) 16 | { 17 | const geometry = executionContext .createNode ("PointSet", false); 18 | 19 | geometry ._coord = executionContext .createNode ("Coordinate", false); 20 | 21 | geometry ._coord .point .push (new X3D .SFVec3f ()); 22 | 23 | geometry ._coord .getValue () .setup (); 24 | geometry .setup (); 25 | 26 | return geometry; 27 | } 28 | 29 | // Circle 30 | 31 | const 32 | browser = this .getBrowser (), 33 | geometry = browser .getCircle2DOptions () .getGeometry () .copy (executionContext); 34 | 35 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 36 | 37 | for (const [i, point] of geometry ._coord .point .entries ()) 38 | geometry ._coord .point [i] = point .multiply (outerRadius); 39 | 40 | geometry ._coord .getValue () .setup (); 41 | geometry .setup (); 42 | 43 | return geometry; 44 | } 45 | 46 | const geometry = this .toIndexedFaceSet (executionContext, { texCoord: true }); 47 | 48 | geometry ._metadata = this ._metadata; 49 | geometry ._solid = this ._solid; 50 | 51 | return geometry; 52 | }, 53 | }); 54 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Polyline2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Polyline2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedLineSet (executionContext, 8 | { 9 | polyline: true, 10 | }); 11 | 12 | geometry ._metadata = this ._metadata; 13 | 14 | return geometry; 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Polypoint2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Polypoint2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = executionContext .createNode ("PointSet", false); 8 | 9 | geometry ._metadata = this ._metadata; 10 | geometry ._coord = executionContext .createNode ("Coordinate", false); 11 | 12 | for (const point of this ._point) 13 | geometry ._coord .point .push (new X3D .SFVec3f (... point, 0)); 14 | 15 | geometry ._coord .getValue () .setup (); 16 | geometry .setup (); 17 | 18 | return geometry; 19 | }, 20 | }); 21 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/Rectangle2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Rectangle2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | browser = this .getBrowser (), 9 | geometry = browser .getRectangle2DOptions () .getGeometry () .copy (executionContext), 10 | size1_2 = new X3D .SFVec3f (... this ._size .divide (2), 1); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._solid = this ._solid; 14 | 15 | geometry ._texCoord = geometry ._texCoord .getValue () .copy (executionContext); 16 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 17 | 18 | for (const [i, point] of geometry ._coord .point .entries ()) 19 | geometry ._coord .point [i] = point .multVec (size1_2); 20 | 21 | geometry ._texCoord .getValue () .setup (); 22 | geometry ._coord .getValue () .setup (); 23 | geometry .setup (); 24 | 25 | return geometry; 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/Components/Geometry2D/TriangleSet2D.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .TriangleSet2D .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | texCoords = this .getTexCoords (), 9 | vertices = this .getVertices (), 10 | geometry = executionContext .createNode ("IndexedFaceSet", false); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._solid = this ._solid; 14 | 15 | geometry ._texCoord = executionContext .createNode ("TextureCoordinate", false); 16 | geometry ._coord = executionContext .createNode ("Coordinate", false); 17 | 18 | for (let i = 0, length = vertices .length / 12; i < length; ++ i) 19 | geometry ._coordIndex .push (i * 3, i * 3 + 1, i * 3 + 2, -1); 20 | 21 | for (let i = 0, length = vertices .length; i < length; i += 4) 22 | { 23 | geometry ._texCoord .point .push (new X3D .SFVec2f (texCoords [i], texCoords [i + 1])); 24 | geometry ._coord .point .push (new X3D .SFVec3f (vertices [i], vertices [i + 1], 0)); 25 | } 26 | 27 | geometry ._texCoord .getValue () .setup (); 28 | geometry ._coord .getValue () .setup (); 29 | geometry .setup (); 30 | 31 | return geometry; 32 | }, 33 | }); 34 | -------------------------------------------------------------------------------- /src/Components/Geometry3D/Box.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Box .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | browser = this .getBrowser (), 9 | geometry = browser .getBoxOptions () .getGeometry () .copy (executionContext), 10 | size1_2 = this ._size .divide (2); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._solid = this ._solid; 14 | 15 | geometry ._texCoord = geometry ._texCoord .getValue () .copy (executionContext); 16 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 17 | 18 | for (const [i, point] of geometry ._coord .point .entries ()) 19 | geometry ._coord .point [i] = point .multVec (size1_2); 20 | 21 | geometry ._texCoord .getValue () .setup (); 22 | geometry ._coord .getValue () .setup (); 23 | geometry .setup (); 24 | 25 | return geometry; 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/Components/Geometry3D/Cone.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Cone .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | browser = this .getBrowser (), 9 | geometry = browser .getConeOptions () .getSideGeometry () .copy (executionContext), 10 | radius = this ._bottomRadius .getValue (), 11 | height1_2 = this ._height .getValue () / 2; 12 | 13 | geometry ._metadata = this ._metadata; 14 | geometry ._coordIndex = [ ]; 15 | geometry ._normalIndex = [ ]; 16 | geometry ._solid = this ._solid; 17 | geometry ._creaseAngle = Math .PI; 18 | 19 | geometry ._texCoord = geometry ._texCoord .getValue () .copy (executionContext); 20 | geometry ._normal = null; 21 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 22 | 23 | for (const point of geometry ._coord .point) 24 | { 25 | point .x *= radius; 26 | point .y *= height1_2; 27 | point .z *= radius; 28 | } 29 | 30 | if (this ._side .getValue ()) 31 | { 32 | const last = geometry ._coord .point .length - 1; 33 | 34 | for (const index of browser .getConeOptions () .getSideGeometry () ._coordIndex) 35 | { 36 | if (index < 0 || index !== last) 37 | { 38 | geometry ._coordIndex .push (index); 39 | } 40 | else 41 | { 42 | geometry ._coordIndex .push (geometry ._coord .point .length); 43 | geometry ._coord .point .push (geometry ._coord .point [index]); 44 | } 45 | } 46 | } 47 | else 48 | { 49 | geometry ._texCoordIndex .length = 0; 50 | } 51 | 52 | if (this ._bottom .getValue ()) 53 | { 54 | for (const index of browser .getConeOptions () .getBottomGeometry () ._texCoordIndex) 55 | geometry ._texCoordIndex .push (index); 56 | 57 | for (const index of browser .getConeOptions () .getBottomGeometry () ._coordIndex) 58 | { 59 | if (index < 0) 60 | { 61 | geometry ._coordIndex .push (-1); 62 | } 63 | else 64 | { 65 | geometry ._coordIndex .push (geometry ._coord .point .length); 66 | geometry ._coord .point .push (geometry ._coord .point [index]); 67 | } 68 | } 69 | } 70 | 71 | // geometry .optimize (); 72 | 73 | geometry ._texCoord .getValue () .setup (); 74 | geometry ._coord .getValue () .setup (); 75 | geometry .setup (); 76 | 77 | return geometry; 78 | }, 79 | }); 80 | -------------------------------------------------------------------------------- /src/Components/Geometry3D/ElevationGrid.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .ElevationGrid .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedFaceSet (executionContext, 8 | { 9 | fogCoord: !!this ._fogCoord .getValue (), 10 | color: !!this ._color .getValue (), 11 | texCoord: true, 12 | tangent: !!this ._tangent .getValue (), 13 | normal: !!this ._normal .getValue (), 14 | }); 15 | 16 | geometry ._metadata = this ._metadata; 17 | geometry ._solid = this ._solid; 18 | geometry ._ccw = this ._ccw; 19 | geometry ._creaseAngle = this ._creaseAngle; 20 | 21 | return geometry; 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /src/Components/Geometry3D/Sphere.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Sphere .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const 8 | browser = this .getBrowser (), 9 | geometry = browser .getSphereOptions () .getGeometry () .copy (executionContext), 10 | radius = this ._radius .getValue (); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._solid = this ._solid; 14 | 15 | geometry ._texCoord = geometry ._texCoord .getValue () .copy (executionContext); 16 | geometry ._coord = geometry ._coord .getValue () .copy (executionContext); 17 | 18 | for (const [i, point] of geometry ._coord .point .entries ()) 19 | geometry ._coord .point [i] = point .multiply (radius); 20 | 21 | geometry ._texCoord .getValue () .setup (); 22 | geometry ._coord .getValue () .setup (); 23 | geometry .setup (); 24 | 25 | return geometry; 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/Components/Grouping/StaticGroup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("../../X3D"); 4 | 5 | function StaticGroup (executionContext) 6 | { 7 | X3D .X3DChildNode .call (this, executionContext); 8 | X3D .X3DBoundedObject .call (this, executionContext); 9 | 10 | this .addType (X3D .X3DConstants .StaticGroup); 11 | 12 | // Private properties 13 | 14 | this .groupNode = new X3D .Group (this .getExecutionContext ()); 15 | } 16 | 17 | Object .assign (Object .setPrototypeOf (StaticGroup .prototype, X3D .X3DChildNode .prototype), 18 | X3D .X3DBoundedObject .prototype, 19 | { 20 | initialize () 21 | { 22 | X3D .X3DChildNode .prototype .initialize .call (this); 23 | X3D .X3DBoundedObject .prototype .initialize .call (this); 24 | 25 | this ._bboxSize .addFieldInterest (this .groupNode ._bboxSize); 26 | this ._bboxCenter .addFieldInterest (this .groupNode ._bboxCenter); 27 | this ._children .addFieldInterest (this .groupNode ._children); 28 | 29 | this .groupNode ._bboxSize = this ._bboxSize; 30 | this .groupNode ._bboxCenter = this ._bboxCenter; 31 | this .groupNode ._children = this ._children; 32 | this .groupNode .setPrivate (true); 33 | this .groupNode .setup (); 34 | 35 | this .connectChildNode (this .groupNode, [X3D .TraverseType .CAMERA]); 36 | }, 37 | getBBox (bbox, shadows) 38 | { 39 | return this .groupNode .getBBox (bbox, shadows); 40 | }, 41 | traverse (type, renderObject) 42 | { 43 | this .groupNode .traverse (type, renderObject); 44 | }, 45 | dispose () 46 | { 47 | X3D .X3DBoundedObject .prototype .dispose .call (this); 48 | X3D .X3DChildNode .prototype .dispose .call (this); 49 | }, 50 | }); 51 | 52 | Object .defineProperties (StaticGroup, 53 | { 54 | typeName: 55 | { 56 | value: X3D .StaticGroup .typeName, 57 | enumerable: true, 58 | }, 59 | componentInfo: 60 | { 61 | value: X3D .StaticGroup .componentInfo, 62 | enumerable: true, 63 | }, 64 | containerField: 65 | { 66 | value: X3D .StaticGroup .containerField, 67 | enumerable: true, 68 | }, 69 | specificationRange: 70 | { 71 | value: X3D .StaticGroup .specificationRange, 72 | enumerable: true, 73 | }, 74 | fieldDefinitions: 75 | { 76 | value: X3D .StaticGroup .fieldDefinitions, 77 | enumerable: true, 78 | }, 79 | }); 80 | 81 | module .exports = StaticGroup; 82 | -------------------------------------------------------------------------------- /src/Components/Grouping/Switch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("../../X3D"); 4 | 5 | function Switch (executionContext) 6 | { 7 | X3D .Switch .call (this, executionContext); 8 | 9 | this .editChild = null; 10 | } 11 | 12 | Object .assign (Object .setPrototypeOf (Switch .prototype, X3D .Switch .prototype), 13 | { 14 | getEditChild () 15 | { 16 | return this .editChild; 17 | }, 18 | setEditChild (childNode) 19 | { 20 | this .editChild = childNode; 21 | 22 | this .set_children__ (); 23 | 24 | this .getBrowser () .addBrowserEvent (); 25 | }, 26 | addChild (childNode) 27 | { 28 | X3D .Switch .prototype .addChild .call (this, this .editChild ?.getTool () ?? this .editChild ?? childNode); 29 | }, 30 | }); 31 | 32 | Object .assign (Switch, X3D .Switch); 33 | 34 | module .exports = Switch; 35 | -------------------------------------------------------------------------------- /src/Components/NURBS/NurbsCurve.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .NurbsCurve .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedLineSet (executionContext, 8 | { 9 | double: !!X3D .X3DCast (X3D .X3DConstants .CoordinateDouble, this ._controlPoint), 10 | polyline: true, 11 | }); 12 | 13 | geometry ._metadata = this ._metadata; 14 | 15 | return geometry; 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /src/Components/NURBS/NurbsSweptSurface.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .NurbsSweptSurface .prototype, 4 | { 5 | traverse (type, renderObject) 6 | { 7 | this .getTrajectoryCurve () ?.traverse (type, renderObject); 8 | }, 9 | toPrimitive (executionContext = this .getExecutionContext ()) 10 | { 11 | const geometry = this .toIndexedFaceSet (executionContext, 12 | { 13 | double: true, 14 | texCoord: true, 15 | }); 16 | 17 | geometry ._metadata = this ._metadata; 18 | geometry ._solid = this ._solid; 19 | geometry ._ccw = this ._ccw; 20 | geometry ._creaseAngle = Math .PI; 21 | 22 | return geometry; 23 | }, 24 | }); 25 | -------------------------------------------------------------------------------- /src/Components/NURBS/NurbsSwungSurface.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .NurbsSwungSurface .prototype, 4 | { 5 | traverse (type, renderObject) 6 | { 7 | this .getTrajectoryCurve () ?.traverse (type, renderObject); 8 | }, 9 | toPrimitive (executionContext = this .getExecutionContext ()) 10 | { 11 | const geometry = this .toIndexedFaceSet (executionContext, 12 | { 13 | double: true, 14 | texCoord: true, 15 | }); 16 | 17 | geometry ._metadata = this ._metadata; 18 | geometry ._solid = this ._solid; 19 | geometry ._ccw = this ._ccw; 20 | geometry ._creaseAngle = Math .PI; 21 | 22 | return geometry; 23 | }, 24 | }); 25 | -------------------------------------------------------------------------------- /src/Components/NURBS/X3DNurbsSurfaceGeometryNode.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .X3DNurbsSurfaceGeometryNode .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedFaceSet (executionContext, 8 | { 9 | double: !!X3D .X3DCast (X3D .X3DConstants .CoordinateDouble, this ._controlPoint), 10 | texCoord: true, 11 | }); 12 | 13 | geometry ._metadata = this ._metadata; 14 | geometry ._solid = this ._solid; 15 | geometry ._creaseAngle = Math .PI; 16 | 17 | return geometry; 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Components/Navigation/Collision.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("../../X3D"); 4 | 5 | function Collision (executionContext) 6 | { 7 | X3D .Collision .call (this, executionContext); 8 | 9 | this .proxyDisplay = false; 10 | } 11 | 12 | Object .assign (Object .setPrototypeOf (Collision .prototype, X3D .Collision .prototype), 13 | { 14 | getProxyDisplay () 15 | { 16 | return this .proxyDisplay; 17 | }, 18 | setProxyDisplay (proxyDisplay) 19 | { 20 | this .proxyDisplay = proxyDisplay; 21 | 22 | this .set_collisionObjects__ (); 23 | }, 24 | set_proxy__ () 25 | { 26 | this .pointingObjects .delete (this .proxyNode); 27 | this .visibleObjects .delete (this .proxyNode); 28 | 29 | X3D .Collision .prototype .set_proxy__ .call (this); 30 | }, 31 | set_pointingObjects__ () 32 | { 33 | if (this .proxyNode) 34 | { 35 | if (this .proxyDisplay) 36 | this .pointingObjects .add (this .proxyNode); 37 | else 38 | this .pointingObjects .delete (this .proxyNode); 39 | } 40 | 41 | X3D .Collision .prototype .set_pointingObjects__ .call (this); 42 | 43 | this .getBrowser () .addBrowserEvent (); 44 | }, 45 | set_collisionObjects__ () 46 | { 47 | this .set_pointingObjects__ (); 48 | this .set_visibleObjects__ (); 49 | 50 | X3D .Collision .prototype .set_collisionObjects__ .call (this); 51 | }, 52 | set_visibleObjects__ () 53 | { 54 | if (this .proxyNode) 55 | { 56 | if (this .proxyDisplay) 57 | this .visibleObjects .add (this .proxyNode); 58 | else 59 | this .visibleObjects .delete (this .proxyNode); 60 | } 61 | 62 | X3D .Collision .prototype .set_visibleObjects__ .call (this); 63 | 64 | this .getBrowser () .addBrowserEvent (); 65 | }, 66 | }); 67 | 68 | Object .assign (Collision, X3D .Collision); 69 | 70 | module .exports = Collision; 71 | -------------------------------------------------------------------------------- /src/Components/Navigation/LOD.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("../../X3D"); 4 | 5 | function LOD (executionContext) 6 | { 7 | X3D .LOD .call (this, executionContext); 8 | 9 | this .editChild = null; 10 | } 11 | 12 | Object .assign (Object .setPrototypeOf (LOD .prototype, X3D .LOD .prototype), 13 | { 14 | getEditChild () 15 | { 16 | return this .editChild; 17 | }, 18 | setEditChild (childNode) 19 | { 20 | this .editChild = childNode; 21 | 22 | this .set_children__ (); 23 | 24 | this .getBrowser () .addBrowserEvent (); 25 | }, 26 | addChild (childNode) 27 | { 28 | X3D .LOD .prototype .addChild .call (this, this .editChild ?.getTool () ?? this .editChild ?? childNode); 29 | }, 30 | }); 31 | 32 | Object .assign (LOD, X3D .LOD); 33 | 34 | module .exports = LOD; 35 | -------------------------------------------------------------------------------- /src/Components/Rendering/IndexedLineSet.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .IndexedLineSet .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext) 6 | { 7 | const geometry = executionContext .createNode ("PointSet", false); 8 | 9 | geometry ._metadata = this ._metadata; 10 | geometry ._attrib = this ._attrib; 11 | geometry ._fogCoord = this ._fogCoord; 12 | 13 | if (this ._colorPerVertex .getValue ()) 14 | geometry ._color = this ._color; 15 | 16 | geometry ._tangent = this ._tangent; 17 | geometry ._normal = this ._normal; 18 | geometry ._coord = this ._coord; 19 | 20 | geometry .setup (); 21 | 22 | return geometry; 23 | }, 24 | }); 25 | -------------------------------------------------------------------------------- /src/Components/Rendering/LineSet.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .LineSet .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext) 6 | { 7 | const geometry = executionContext .createNode ("IndexedLineSet", false); 8 | 9 | geometry ._metadata = this ._metadata; 10 | geometry ._attrib = this ._attrib; 11 | geometry ._fogCoord = this ._fogCoord; 12 | geometry ._color = this ._color; 13 | geometry ._tangent = this ._tangent; 14 | geometry ._normal = this ._normal; 15 | geometry ._coord = this ._coord; 16 | 17 | let index = 0; 18 | 19 | for (const length of this ._vertexCount) 20 | { 21 | if (length < 2) 22 | continue; 23 | 24 | for (let i = 0; i < length; ++ i, ++ index) 25 | geometry ._coordIndex .push (index); 26 | 27 | geometry ._coordIndex .push (-1); 28 | } 29 | 30 | geometry .setup (); 31 | 32 | return geometry; 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /src/Components/Rendering/X3DComposedGeometryNode.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .X3DComposedGeometryNode .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext) 6 | { 7 | const geometry = executionContext .createNode ("IndexedFaceSet", false); 8 | 9 | geometry ._metadata = this ._metadata; 10 | geometry ._solid = this ._solid; 11 | geometry ._ccw = this ._ccw; 12 | geometry ._creaseAngle = Math .PI; 13 | geometry ._colorPerVertex = this ._colorPerVertex; 14 | geometry ._normalPerVertex = this ._normalPerVertex; 15 | 16 | geometry ._attrib = this ._attrib; 17 | geometry ._fogCoord = this ._fogCoord; 18 | geometry ._color = this ._color; 19 | geometry ._tangent = this ._tangent; 20 | geometry ._normal = this ._normal; 21 | geometry ._coord = this ._coord; 22 | 23 | let 24 | verticesPerPolygon = this .getVerticesPerPolygon (), 25 | numVertices = this .getNumVertices (); 26 | 27 | // Set size to a multiple of vertexCount. 28 | numVertices -= numVertices % verticesPerPolygon; 29 | 30 | for (let i = 0; i < numVertices; ++ i) 31 | { 32 | const index = this .getPolygonIndex (i); 33 | 34 | geometry ._coordIndex .push (index); 35 | 36 | if (i % verticesPerPolygon === verticesPerPolygon - 1) 37 | geometry ._coordIndex .push (-1); 38 | } 39 | 40 | geometry .setup (); 41 | 42 | return geometry; 43 | }, 44 | }); 45 | -------------------------------------------------------------------------------- /src/Components/Text/Text.js: -------------------------------------------------------------------------------- 1 | const X3D = require ("../../X3D"); 2 | 3 | Object .assign (X3D .Text .prototype, 4 | { 5 | toPrimitive (executionContext = this .getExecutionContext ()) 6 | { 7 | const geometry = this .toIndexedFaceSet (executionContext, 8 | { 9 | texCoord: true, 10 | }); 11 | 12 | geometry ._metadata = this ._metadata; 13 | geometry ._solid = this ._solid; 14 | 15 | return geometry; 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /src/Controls/AudioPreviewPopover.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | $ = require ("jquery"), 5 | path = require ("path"), 6 | X3D = require ("../X3D"), 7 | Editor = require ("../Undo/Editor"), 8 | UndoManager = require("../Undo/UndoManager"), 9 | _ = require ("../Application/GetText"); 10 | 11 | require ("./Popover"); 12 | 13 | $.fn.audioPreviewPopover = async function (node) 14 | { 15 | // Create content. 16 | 17 | const preview = $("
") 24 | .css ("width", "30vh") 25 | .appendTo (preview); 26 | 27 | for (const url of node ._url) 28 | { 29 | $("") 30 | .attr ("src", new URL (url, node .getExecutionContext () .worldURL)) 31 | .appendTo (audio); 32 | } 33 | } 34 | 35 | loadNow (); 36 | 37 | // Reload handling. 38 | 39 | const _url = Symbol (); 40 | 41 | node ._url .addFieldCallback (_url, loadNow); 42 | 43 | this .data ("preview", { loadNow }); 44 | 45 | // Create tooltip. 46 | 47 | const tooltip = this .popover ({ 48 | preview: true, 49 | content: preview, 50 | show: { 51 | modal: false, 52 | }, 53 | style: { 54 | classes: "qtip-tipsy qtip-preview qtip-audio", 55 | }, 56 | events: { 57 | hide: (event, api) => 58 | { 59 | node ._url .removeFieldCallback (_url); 60 | 61 | this .removeData ("preview"); 62 | 63 | $(".tree-view") .off (".preview"); 64 | 65 | api .destroy (true); 66 | }, 67 | }, 68 | }); 69 | 70 | $(".tree-view") .on ("scroll.preview", () => this .qtip ("reposition")); 71 | 72 | return this; 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /src/Controls/Dialog.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | $ = require ("jquery"), 5 | Interface = require ("../Application/Interface") 6 | 7 | module .exports = class Dialog extends Interface 8 | { 9 | initialize () 10 | { 11 | // Create window and handle resize and move. 12 | 13 | this .element = $("
") .dialog ({ 14 | classes: { 15 | "ui-dialog": "dialog", 16 | }, 17 | modal: true, 18 | autoOpen: false, 19 | show: true, 20 | draggable: false, 21 | minHeight : 100, 22 | open: () => 23 | { 24 | this .element .dialog ("widget") 25 | .nextAll (".ui-widget-overlay") 26 | .on ("click", () => this .close ()); 27 | 28 | this .onopen (); 29 | }, 30 | close: () => 31 | { 32 | this .onclose (); 33 | }, 34 | }); 35 | 36 | this .element .dialog ("widget") 37 | .draggable ({ 38 | drag: (event, ui) => this .config .file .position = { my: `left+${ui .position .left} top+${ui .position .top}`, at: "left top" }, 39 | }) 40 | .resizable({ 41 | resize: (event, ui) => this .config .file .size = [ui .size .width, ui .size .height], 42 | }) 43 | .find (".ui-dialog-titlebar") .remove (); 44 | } 45 | 46 | configure (defaults = { }) 47 | { 48 | // Set default config values. 49 | 50 | this .config .file .setDefaultValues (Object .assign ({ 51 | position: undefined, 52 | size: [400, 250], 53 | }, 54 | defaults)); 55 | } 56 | 57 | open () 58 | { 59 | this .element .dialog ({ 60 | position: { ... this .config .file .position, of: $("body") }, 61 | minWidth: this .config .file .getDefaultValue ("size") [0], 62 | minHeight: this .config .file .getDefaultValue ("size") [1], 63 | width: this .config .file .size [0], 64 | height: this .config .file .size [1], 65 | }) 66 | .dialog ("open"); 67 | } 68 | 69 | isOpen () 70 | { 71 | return this .element .dialog ("isOpen"); 72 | } 73 | 74 | close () 75 | { 76 | this .element .dialog ("close"); 77 | } 78 | 79 | onopen () { } 80 | onclose () { } 81 | }; 82 | -------------------------------------------------------------------------------- /src/Controls/ExportNodePopover.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | $ = require ("jquery"), 5 | electron = require ("electron"), 6 | Editor = require ("../Undo/Editor"), 7 | _ = require ("../Application/GetText"); 8 | 9 | require ("./Popover"); 10 | require ("../Bits/Validate"); 11 | 12 | $.fn.exportNodePopover = function (node, oldExportedName) 13 | { 14 | // Create content. 15 | 16 | const scene = node .getExecutionContext (); 17 | 18 | const nameInput = $("") 19 | .attr ("placeholder", _("Enter exported name")) 20 | .val (oldExportedName ?? scene .getUniqueExportName (node .getName ())); 21 | 22 | // Create tooltip. 23 | 24 | const tooltip = this .popover ({ 25 | content: nameInput, 26 | events: { 27 | show: (event, api) => 28 | { 29 | nameInput .off () .validate (Editor .Id, () => 30 | { 31 | electron .shell .beep (); 32 | nameInput .highlight (); 33 | }) 34 | .on ("keydown.exportNodePopover", event => 35 | { 36 | if (event .key !== "Enter") 37 | return; 38 | 39 | event .preventDefault (); 40 | 41 | api .toggle (false); 42 | 43 | if (!nameInput .val ()) 44 | return; 45 | 46 | if (oldExportedName && oldExportedName === nameInput .val ()) 47 | return; 48 | 49 | const exportedName = scene .getUniqueExportName (nameInput .val ()); 50 | 51 | Editor .updateExportedNode (scene, exportedName, oldExportedName, node); 52 | }); 53 | 54 | setTimeout (() => nameInput .trigger ("select"), 1); 55 | }, 56 | }, 57 | }) 58 | 59 | return this; 60 | }; 61 | 62 | -------------------------------------------------------------------------------- /src/Controls/ImportNodePopover.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | $ = require ("jquery"), 5 | electron = require ("electron"), 6 | Editor = require ("../Undo/Editor"), 7 | _ = require ("../Application/GetText"); 8 | 9 | require ("./Popover"); 10 | require ("../Bits/Validate"); 11 | 12 | $.fn.importNodePopover = function (inlineNode, exportedName, oldImportedName) 13 | { 14 | // Create content. 15 | 16 | const executionContext = inlineNode .getExecutionContext (); 17 | 18 | const nameInput = $("") 19 | .attr ("placeholder", _("Enter imported name")) 20 | .val (oldImportedName ?? executionContext .getUniqueImportName (exportedName)); 21 | 22 | // Create tooltip. 23 | 24 | const tooltip = this .popover ({ 25 | content: nameInput, 26 | events: { 27 | show: (event, api) => 28 | { 29 | nameInput .off () .validate (Editor .Id, () => 30 | { 31 | electron .shell .beep (); 32 | nameInput .highlight (); 33 | }) 34 | .on ("keydown.importNodePopover", event => 35 | { 36 | if (event .key !== "Enter") 37 | return; 38 | 39 | event .preventDefault (); 40 | 41 | api .toggle (false); 42 | 43 | if (!nameInput .val ()) 44 | return; 45 | 46 | if (oldImportedName && oldImportedName === nameInput .val ()) 47 | return; 48 | 49 | const importedName = executionContext .getUniqueImportName (nameInput .val ()); 50 | 51 | Editor .updateImportedNode (executionContext, inlineNode, exportedName, importedName, oldImportedName); 52 | }); 53 | 54 | setTimeout (() => nameInput .trigger ("select"), 1); 55 | }, 56 | }, 57 | }) 58 | 59 | return this; 60 | }; 61 | 62 | -------------------------------------------------------------------------------- /src/Controls/Popover.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const $ = require ("jquery"); 4 | 5 | require ("qtip2"); 6 | 7 | $.fn.qtip.zindex = 1000; // Results in 1000 and 1001. 8 | 9 | $.fn.popover = function (options) 10 | { 11 | $("[data-hasqtip]") .qtip ?.("hide") .qtip ("destroy", true); 12 | 13 | if (!options .preview) 14 | $(".show-preview.on") .removeClass ("on") .addClass ("off"); 15 | 16 | return this .qtip ($.extend (true, 17 | { 18 | position: { 19 | my: "top right", 20 | at: "bottom left", 21 | viewport: $("body"), 22 | effect: false, 23 | }, 24 | style: { 25 | classes: "qtip-tipsy", 26 | }, 27 | show: { 28 | ready: true, 29 | modal: true, 30 | solo: true, 31 | delay: 0, 32 | }, 33 | hide: { 34 | event: "click", 35 | }, 36 | events: { 37 | hide (event, api) 38 | { 39 | api .destroy (true); 40 | }, 41 | }, 42 | }, 43 | options)); 44 | }; 45 | -------------------------------------------------------------------------------- /src/Controls/RenameNodePopover.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | $ = require ("jquery"), 5 | _ = require ("../Application/GetText"); 6 | 7 | require ("./Popover"); 8 | require ("./RenameNodeInput"); 9 | 10 | $.fn.renameNodePopover = function (node) 11 | { 12 | // Create content. 13 | 14 | const nameInput = $("") 15 | .attr ("placeholder", _("Enter name")) 16 | .renameNodeInput (node); 17 | 18 | // Create tooltip. 19 | 20 | const tooltip = this .popover ({ 21 | content: nameInput, 22 | events: { 23 | show: (event, api) => 24 | { 25 | nameInput .off (".renameNodePopover") .on ("keydown.renameNodePopover", (event) => 26 | { 27 | if (event .key !== "Enter") 28 | return; 29 | 30 | api .toggle (false); 31 | }) 32 | 33 | setTimeout (() => nameInput .trigger ("select"), 1); 34 | }, 35 | }, 36 | }); 37 | 38 | return this; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /src/Controls/Tabs.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | $ = require ("jquery"), 5 | Interface = require ("../Application/Interface") 6 | 7 | module .exports = class Tabs extends Interface 8 | { 9 | constructor (element, orientation) 10 | { 11 | super (`Sunrize.Tabs.${element .attr ("id")}.`) 12 | 13 | this .element = element 14 | this .orientation = orientation 15 | this .tabs = $("
    ") .appendTo (this .element) 16 | } 17 | 18 | initialize () 19 | { 20 | this .addTabs () 21 | 22 | this .element .tabs () 23 | this .element .tabs ("option", "classes.ui-tabs", this .orientation) 24 | this .element .on ("tabsactivate", () => this .tabActivated ()) 25 | } 26 | 27 | addTabs () { } 28 | 29 | configure (defaults = { }) 30 | { 31 | this .config .file .setDefaultValues (Object .assign ({ active: 0 }, defaults)) 32 | 33 | if (this .element .tabs ("option", "active") === this .config .file .active) 34 | this .tabActivated () 35 | else 36 | this .element .tabs ("option", "active", this .config .file .active) 37 | } 38 | 39 | tabActivated () 40 | { 41 | const 42 | active = this .element .tabs ("option", "active"), 43 | panel = $(this .element .find (`.tabs-panel`) .get (active)) 44 | 45 | this .config .file .active = active 46 | 47 | if (panel .data ("Tabs.initialized")) 48 | return 49 | 50 | panel .data ("Tabs.initialized", true) 51 | this .initTab (panel) 52 | } 53 | 54 | addTextTab (id, title) 55 | { 56 | const tab = $("
  • ") 57 | .append ($("") 58 | .attr ("href", `#${id}-tab`) 59 | .attr ("title", title) 60 | .text (title)) 61 | .appendTo (this .tabs) 62 | 63 | this .addPanel (id) 64 | } 65 | 66 | addIconTab (id, icon, title) 67 | { 68 | $("
  • ") 69 | .append ($("") 70 | .attr ("href", `#${id}-tab`) 71 | .attr ("title", title) 72 | .append ($("") 73 | .addClass ("material-icons") 74 | .text (icon))) 75 | .appendTo (this .tabs) 76 | 77 | this .addPanel (id) 78 | } 79 | 80 | addPanel (id) 81 | { 82 | $("
    ") 83 | .attr ("id", `${id}-tab`) 84 | .append ($("
    ") 85 | .attr ("id", id) 86 | .addClass (["tabs-panel", id])) 87 | .appendTo (this .element) 88 | } 89 | 90 | getPanel (id) 91 | { 92 | return this .element .find (`.tabs-panel.${id}`) 93 | } 94 | 95 | initTab (panel) { } 96 | } 97 | -------------------------------------------------------------------------------- /src/Editors/AnimationEditor.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | Interface = require ("../Application/Interface") 5 | 6 | module .exports = class AnimationEditor extends Interface 7 | { 8 | constructor (element) 9 | { 10 | super (`Sunrize.AnimationEditor.${element .attr ("id")}.`) 11 | 12 | this .animationEditor = element 13 | 14 | this .animationEditor .text ("Animation Editor") 15 | 16 | this .setup () 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Editors/FileManager.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | Interface = require ("../Application/Interface") 5 | 6 | module .exports = class FileManager extends Interface 7 | { 8 | constructor (element) 9 | { 10 | super (`Sunrize.FileManager.${element .attr ("id")}.`) 11 | 12 | this .fileManager = element 13 | 14 | this .fileManager .text ("File Manager") 15 | 16 | this .setup () 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Editors/LibraryPane.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module .exports = class LibraryPane 4 | { 5 | #library; 6 | 7 | constructor (library) 8 | { 9 | this .#library = library; 10 | } 11 | 12 | get config () 13 | { 14 | return this .#library .config; 15 | } 16 | 17 | get browser () 18 | { 19 | return this .#library .browser; 20 | } 21 | 22 | get executionContext () 23 | { 24 | return this .#library .executionContext; 25 | } 26 | 27 | get node () 28 | { 29 | return this .#library .node; 30 | } 31 | 32 | get field () 33 | { 34 | return this .#library .field; 35 | } 36 | 37 | get element () 38 | { 39 | return this .#library .element; 40 | } 41 | 42 | get output () 43 | { 44 | return this .#library .output; 45 | } 46 | 47 | get importX3D () 48 | { 49 | return this .#library .importX3D; 50 | } 51 | 52 | get expandToAndSelectNode () 53 | { 54 | return this .#library .expandToAndSelectNode; 55 | } 56 | 57 | open () { } 58 | }; 59 | -------------------------------------------------------------------------------- /src/Editors/NodeInspector.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | Interface = require ("../Application/Interface"); 5 | 6 | module .exports = class NodeInspector extends Interface 7 | { 8 | constructor (element) 9 | { 10 | super (`Sunrize.NodeInspector.${element .attr ("id")}.`); 11 | 12 | this .nodeInspector = element; 13 | 14 | this .nodeInspector .text ("Node Inspector"); 15 | 16 | this .setup (); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /src/Fields.js: -------------------------------------------------------------------------------- 1 | require ("./Fields/SFStringInput"); 2 | require ("./Fields/MFStringTextArea"); 3 | -------------------------------------------------------------------------------- /src/Fields/MFStringTextArea.js: -------------------------------------------------------------------------------- 1 | const 2 | $ = require ("jquery"), 3 | X3D = require ("../X3D"), 4 | Editor = require ("../Undo/Editor") 5 | 6 | $.fn.MFStringTextArea = function (node, field) 7 | { 8 | if (arguments .length === 0) 9 | { 10 | this .off ("change.MFStringTextArea") 11 | this .data ("field.MFStringTextArea") .removeFieldCallback (this .get (0)) 12 | } 13 | else 14 | { 15 | if (typeof field === "string") 16 | field = node .getField (field) 17 | 18 | this .data ("field.MFStringTextArea", field) 19 | 20 | this .val (field .join ("\n")) .on ("change.MFStringTextArea", () => 21 | { 22 | Editor .setFieldValue (node .getExecutionContext (), node, field, new X3D .MFString (...this .val () .split ("\n"))) 23 | }) 24 | 25 | field .addFieldCallback (this .get (0), () => 26 | { 27 | this .val (field .join ("\n")) 28 | }) 29 | } 30 | 31 | return this 32 | } 33 | -------------------------------------------------------------------------------- /src/Fields/SFStringInput.js: -------------------------------------------------------------------------------- 1 | const 2 | $ = require ("jquery"), 3 | Editor = require ("../Undo/Editor") 4 | 5 | $.fn.SFStringInput = function (node, field) 6 | { 7 | if (arguments .length === 0) 8 | { 9 | this .off ("change.SFStringInput") 10 | this .data ("field.SFStringInput") .removeFieldCallback (this .get (0)) 11 | } 12 | else 13 | { 14 | if (typeof field === "string") 15 | field = node .getField (field) 16 | 17 | this .data ("field.SFStringInput", field) 18 | 19 | this .val (field .getValue ()) .on ("change.SFStringInput", () => 20 | { 21 | Editor .setFieldValue (node .getExecutionContext (), node, field, this .val ()) 22 | }) 23 | 24 | field .addFieldCallback (this .get (0), () => 25 | { 26 | this .val (field .getValue ()) 27 | this .trigger ("blur") 28 | }) 29 | } 30 | 31 | return this 32 | } 33 | -------------------------------------------------------------------------------- /src/Parser/AudioParser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3D = require ("../X3D"), 5 | url = require ("url"), 6 | path = require ("path"); 7 | 8 | class AudioParser extends X3D .X3DParser 9 | { 10 | constructor (scene) 11 | { 12 | super (scene); 13 | } 14 | 15 | getEncoding () 16 | { 17 | return "ARRAY_BUFFER"; 18 | } 19 | 20 | setInput (input) 21 | { } 22 | 23 | isValid () 24 | { 25 | const worldURL = new URL (this .getScene () .worldURL); 26 | 27 | if (!worldURL .pathname .match (/\.(?:mp3|wav|oga|ogg)$/i)) 28 | return; 29 | 30 | return true; 31 | } 32 | 33 | parseIntoScene (resolve, reject) 34 | { 35 | this .audio () 36 | .then (resolve) 37 | .catch (reject); 38 | } 39 | 40 | async audio () 41 | { 42 | const 43 | browser = this .getBrowser (), 44 | scene = this .getScene (); 45 | 46 | scene .setEncoding ("AUDIO"); 47 | scene .setProfile (browser .getProfile ("Interchange")); 48 | scene .addComponent (browser .getComponent ("Sound", 1)); 49 | 50 | await this .loadComponents (); 51 | 52 | // Rectangle 53 | 54 | const 55 | soundNode = scene .createNode ("Sound"), 56 | audioClipNode = scene .createNode ("AudioClip"); 57 | 58 | audioClipNode .url = new X3D .MFString (this .getURL (scene .worldURL)); 59 | audioClipNode .loop = true; 60 | 61 | soundNode .source = audioClipNode; 62 | 63 | scene .rootNodes .push (soundNode); 64 | 65 | // Name 66 | 67 | const 68 | worldURL = new URL (scene .worldURL), 69 | name = worldURL .pathname .match (/([^\/]+)\.[^.]+$/); 70 | 71 | if (name) 72 | { 73 | audioClipNode .description = decodeURIComponent (name [1]); 74 | 75 | scene .addNamedNode (this .sanitizeName (decodeURIComponent (name [1])), soundNode); 76 | } 77 | 78 | return scene; 79 | } 80 | 81 | getURL (worldURL) 82 | { 83 | try 84 | { 85 | return encodeURIComponent (path .basename (url .fileURLToPath (worldURL))); 86 | } 87 | catch 88 | { 89 | return worldURL; 90 | } 91 | } 92 | } 93 | 94 | module .exports = AudioParser; 95 | -------------------------------------------------------------------------------- /src/Tools.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | fs = require ("fs"), 5 | path = require ("path"), 6 | X3D = require ("./X3D"); 7 | 8 | const _tool = Symbol .for ("Sunrize.tool"); 9 | 10 | Object .assign (X3D .X3DNode .prototype, 11 | { 12 | getTool () 13 | { 14 | return this .getUserData (_tool); 15 | }, 16 | addTool (action = "createOnDemand") 17 | { 18 | // Prevent creation of tool inside protos. 19 | if (this .getExecutionContext () .getOuterNode () instanceof X3D .X3DProtoDeclaration) 20 | return this; 21 | 22 | const module = path .resolve (__dirname, "Tools", this .constructor .componentInfo .name, this .constructor .typeName + "Tool.js"); 23 | 24 | if (!fs .existsSync (module)) 25 | return this; 26 | 27 | const Tool = require (module); 28 | 29 | if (!Tool [action]) 30 | return this; 31 | 32 | return this .getUserData (_tool) ?? new Tool (this); 33 | }, 34 | removeTool (action = "createOnDemand") 35 | { 36 | return this .getTool () ?.removeTool (action) ?? this; 37 | }, 38 | }); 39 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/CADAssemblyTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class CADAssemblyTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREEN 10 | } 11 | 12 | module .exports = CADAssemblyTool 13 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/CADFaceTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class CADFaceTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .BROWN 10 | } 11 | 12 | module .exports = CADFaceTool 13 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/CADLayerTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class CADLayerTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_YELLOW 10 | } 11 | 12 | module .exports = CADLayerTool 13 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/CADPartTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class CADPartTool extends X3DTransformNodeTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN 10 | } 11 | 12 | module .exports = CADPartTool 13 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/IndexedQuadSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class IndexedQuadSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = IndexedQuadSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/CADGeometry/QuadSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class QuadSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = QuadSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Core/ToolColors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("../../X3D"); 4 | 5 | module .exports = class ToolColors 6 | { 7 | static GREEN = new X3D .Color3 (0.35, 1, 0.7); // Transform 8 | static YELLOW = new X3D .Color3 (1, 1, 0.35); // Switch 9 | static LILA = new X3D .Color3 (0.7, 0.35, 1); // Anchor 10 | static PINK = new X3D .Color3 (1, 0.35, 0.7); // Billboard 11 | static VIOLET = new X3D .Color3 (0.5, 0.175, 0.35); // 12 | static RED = new X3D .Color3 (1, 0.35, 0.35); // Collision 13 | static CYAN = new X3D .Color3 (0.35, 1, 1); // LOD 14 | 15 | static WHITE = new X3D .Color3 (1, 1, 1); // Inline 16 | static ORANGE = new X3D .Color3 (1, 0.7, 0.35); // Shape 17 | static BLUE = new X3D .Color3 (0.35, 0.7, 1); // Normals, Edges, Other 18 | static LIME = new X3D .Color3 (0.35, 1, 0.35); // ScreenGroup 19 | static ROSE = new X3D .Color3 (1, 0.7, 0.7); // PickableGroup 20 | 21 | static DARK_GREEN = new X3D .Color3 (0.175, 0.5, 0.35); // Group, CADAssembly 22 | static DARK_YELLOW = new X3D .Color3 (0.7, 0.7, 0.35); // CADLayer 23 | static BROWN = new X3D .Color3 (0.5, 0.35, 0); // CADFace 24 | static DARK_CYAN = new X3D .Color3 (0.175, 0.5, 0.5); // GeoLOD 25 | static DARK_BLUE = new X3D .Color3 (0.175, 0.35, 1); // 26 | static DARK_RED = new X3D .Color3 (0.5, 0.175, 0.175); // 27 | static DARK_ORANGE = new X3D .Color3 (0.5, 0.35, 0.175); // VolumeData 28 | 29 | static LIGHT_GREY = new X3D .Color3 (0.90, 0.90, 0.90); // Hull 30 | static GREY = new X3D .Color3 (0.7, 0.7, 0.7); // 31 | static DARK_GREY = new X3D .Color3 (0.35, 0.35, 0.35); // StaticGroup 32 | 33 | static PROXIMITY_SENSOR = new X3D .Color3 (0.5, 0, 1); 34 | static TRANSFORM_SENSOR = new X3D .Color3 (0, 1, 0); 35 | static VISIBILITY_SENSOR = new X3D .Color3 (1, 0, 0); 36 | }; 37 | -------------------------------------------------------------------------------- /src/Tools/Core/X3DBaseTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const handler = 4 | { 5 | get (target, key) 6 | { 7 | if (key in target) 8 | return target [key]; 9 | 10 | const property = target .node [key]; 11 | 12 | if (typeof property === "function") 13 | return property .bind (target .node); 14 | 15 | return property; 16 | }, 17 | set (target, key, value) 18 | { 19 | if (key in target) 20 | target [key] = value; 21 | else 22 | target .node [key] = value; 23 | 24 | return true; 25 | }, 26 | has (target, key) 27 | { 28 | return key in target .node; 29 | }, 30 | ownKeys (target) 31 | { 32 | return Object .keys (target .node); 33 | }, 34 | getOwnPropertyDescriptor (target, key) 35 | { 36 | return Object .getOwnPropertyDescriptor (target .node, key); 37 | }, 38 | getPrototypeOf (target) 39 | { 40 | return Object .getPrototypeOf (target .node); 41 | }, 42 | } 43 | 44 | class X3DBaseTool 45 | { 46 | constructor (node) 47 | { 48 | const proxy = new Proxy (this, handler); 49 | 50 | this .node = node; 51 | 52 | return proxy; 53 | } 54 | 55 | valueOf () 56 | { 57 | return this .node .valueOf (); 58 | } 59 | } 60 | 61 | module .exports = X3DBaseTool; 62 | -------------------------------------------------------------------------------- /src/Tools/Core/X3DChildNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNodeTool = require ("./X3DNodeTool"); 4 | 5 | class X3DChildNodeTool extends X3DNodeTool 6 | { 7 | isPointingObject () 8 | { 9 | return true; 10 | } 11 | 12 | isVisibleObject () 13 | { 14 | return true; 15 | } 16 | } 17 | 18 | module .exports = X3DChildNodeTool; 19 | -------------------------------------------------------------------------------- /src/Tools/Core/X3DPrototypeInstanceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNodeTool = require ("./X3DNodeTool"); 4 | 5 | class X3DPrototypeInstanceTool extends X3DNodeTool 6 | { 7 | constructor (node) 8 | { 9 | super (node) 10 | 11 | try 12 | { 13 | const tool = this .node .getInnerNode () .addTool (); 14 | 15 | tool .toolPointingEnabled = false; 16 | } 17 | catch 18 | { } 19 | } 20 | 21 | disposeTool () 22 | { 23 | try 24 | { 25 | this .node .getInnerNode () .removeTool (); 26 | } 27 | catch 28 | { } 29 | 30 | super .disposeTool (); 31 | } 32 | 33 | getInnerNode () 34 | { 35 | return this .node .getInnerNode (); 36 | } 37 | } 38 | 39 | module .exports = X3DPrototypeInstanceTool; 40 | -------------------------------------------------------------------------------- /src/Tools/EnvironmentalSensor/ProximitySensorTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DEnvironmentalSensorNodeTool = require ("./X3DEnvironmentalSensorNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class ProximitySensorTool extends X3DEnvironmentalSensorNodeTool 8 | { 9 | toolBoxColor = ToolColors .PROXIMITY_SENSOR; 10 | } 11 | 12 | module .exports = ProximitySensorTool; 13 | -------------------------------------------------------------------------------- /src/Tools/EnvironmentalSensor/TransformSensorTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DEnvironmentalSensorNodeTool = require ("./X3DEnvironmentalSensorNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class TransformSensorTool extends X3DEnvironmentalSensorNodeTool 8 | { 9 | toolBoxColor = ToolColors .TRANSFORM_SENSOR; 10 | } 11 | 12 | module .exports = TransformSensorTool; 13 | -------------------------------------------------------------------------------- /src/Tools/EnvironmentalSensor/VisibilitySensorTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DEnvironmentalSensorNodeTool = require ("./X3DEnvironmentalSensorNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class VisibilitySensorTool extends X3DEnvironmentalSensorNodeTool 8 | { 9 | toolBoxColor = ToolColors .VISIBILITY_SENSOR; 10 | } 11 | 12 | module .exports = VisibilitySensorTool; 13 | -------------------------------------------------------------------------------- /src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class X3DEnvironmentalSensorNodeTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DEnvironmentalSensorNodeTool.x3d"); 12 | 13 | this .tool .getField ("size") .addReference (this .node ._size); 14 | this .tool .getField ("center") .addReference (this .node ._center); 15 | 16 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 17 | 18 | this .tool .boxColor = this .toolBoxColor; 19 | } 20 | 21 | beginUndo () 22 | { 23 | this .undoSaveInitialValues (["size", "center"]); 24 | } 25 | 26 | isBoundedObject () 27 | { 28 | return true; 29 | } 30 | 31 | getBBox (bbox, shadows) 32 | { 33 | if (shadows) 34 | return bbox .set (); 35 | 36 | return bbox .set (this ._size .getValue (), this ._center .getValue ()); 37 | } 38 | } 39 | 40 | module .exports = X3DEnvironmentalSensorNodeTool; 41 | -------------------------------------------------------------------------------- /src/Tools/Geometry2D/Polyline2DTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLineGeometryNodeTool = require ("../Rendering/X3DLineGeometryNodeTool"); 4 | 5 | class Polyline2DTool extends X3DLineGeometryNodeTool { } 6 | 7 | module .exports = Polyline2DTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geometry2D/Polypoint2DTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLineGeometryNodeTool = require ("../Rendering/X3DLineGeometryNodeTool"); 4 | 5 | class Polypoint2DTool extends X3DLineGeometryNodeTool { } 6 | 7 | module .exports = Polypoint2DTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geometry2D/TriangleSet2DTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class TriangleSet2DTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = TriangleSet2DTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geometry3D/ElevationGridTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class ElevationGridTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = ElevationGridTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geometry3D/ExtrusionTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class ExtrusionTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = ExtrusionTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geometry3D/IndexedFaceSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class IndexedFaceSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = IndexedFaceSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Geospatial/GeoElevationGridTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class GeoElevationGridTool extends X3DGeometryNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .linewidthScaleFactor = 1; 12 | } 13 | } 14 | 15 | module .exports = GeoElevationGridTool; 16 | -------------------------------------------------------------------------------- /src/Tools/Geospatial/GeoLODTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"), 6 | X3D = require ("../../X3D"); 7 | 8 | class GeoLODTool extends X3DBoundedObjectTool 9 | { 10 | toolBBoxColor = ToolColors .DARK_CYAN; 11 | 12 | async initializeTool () 13 | { 14 | await super .initializeTool (); 15 | 16 | this .tool .centerDisplay = true; 17 | } 18 | 19 | static #center = new X3D .Vector3 (); 20 | 21 | reshapeTool () 22 | { 23 | if (!this .tool) 24 | return console .warn ("reshapeTool called, although already disposed.", this .getBrowser () .displayEvents () .hasInterest ("reshapeTool", this)); 25 | 26 | super .reshapeTool (); 27 | 28 | const center = this .node .getCoord (this .node ._center, GeoLODTool .#center); 29 | 30 | if (!this .tool .center .getValue () .equals (center)) 31 | this .tool .center = center; 32 | } 33 | } 34 | 35 | module .exports = GeoLODTool; 36 | -------------------------------------------------------------------------------- /src/Tools/Geospatial/GeoLocationTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class GeoLocationTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREEN; 10 | } 11 | 12 | module .exports = GeoLocationTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Geospatial/GeoTransformTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class GeoTransformTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN; 10 | } 11 | 12 | module .exports = GeoTransformTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Geospatial/GeoViewpointTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DViewpointNodeTool = require ("../Navigation/X3DViewpointNodeTool"); 4 | 5 | class GeoViewpointTool extends X3DViewpointNodeTool 6 | { 7 | #changing = { position: false, orientation: false }; 8 | 9 | async initializeTool () 10 | { 11 | await super .initializeTool (); 12 | 13 | this .node ._position .addInterest ("set_node_position", this); 14 | this .tool .getField ("position") .addInterest ("set_tool_position", this); 15 | 16 | this .node ._orientation .addInterest ("set_node_orientation", this); 17 | this .tool .getField ("orientation") .addInterest ("set_tool_orientation", this); 18 | 19 | this .set_node_position (); 20 | this .set_node_orientation (); 21 | } 22 | 23 | set_node_position () 24 | { 25 | if (this .#changing .position) 26 | { 27 | this .#changing .position = false; 28 | return; 29 | } 30 | 31 | this .#changing .position = true; 32 | 33 | this .tool .position = this .node .getPosition (); 34 | } 35 | 36 | set_tool_position () 37 | { 38 | if (this .#changing .position) 39 | { 40 | this .#changing .position = false; 41 | return; 42 | } 43 | 44 | this .#changing .position = true; 45 | 46 | this .node .setPosition (this .tool .getField ("position") .getValue ()); 47 | } 48 | 49 | set_node_orientation () 50 | { 51 | if (this .#changing .orientation) 52 | { 53 | this .#changing .orientation = false; 54 | return; 55 | } 56 | 57 | this .#changing .orientation = true; 58 | 59 | this .tool .orientation = this .node .getOrientation (); 60 | } 61 | 62 | set_tool_orientation () 63 | { 64 | if (this .#changing .orientation) 65 | { 66 | this .#changing .orientation = false; 67 | return; 68 | } 69 | 70 | this .#changing .orientation = true; 71 | 72 | this .node .setOrientation (this .tool .getField ("orientation") .getValue ()); 73 | } 74 | } 75 | 76 | module .exports = GeoViewpointTool; 77 | -------------------------------------------------------------------------------- /src/Tools/Grids/AngleGridTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DGridNodeTool = require ("./X3DGridNodeTool"), 5 | X3D = require ("../../X3D"); 6 | 7 | class AngleGridTool extends X3DGridNodeTool 8 | { 9 | async initializeTool () 10 | { 11 | await super .initializeTool (__dirname, "AngleGridTool.x3d"); 12 | } 13 | 14 | getSnapPosition (position, snapY) 15 | { 16 | const 17 | offset = Math .PI / 2, 18 | translation = position .copy (); 19 | 20 | // Calculate snapping radius and snapping angle 21 | 22 | const 23 | complex = new X3D .Complex (translation .x, translation .z), 24 | phi = 2 * Math .PI / this .tool .dimension [1], 25 | radius = complex .magnitude, 26 | angle = complex .angle; 27 | 28 | let 29 | snapRadius = Math .round (radius), 30 | snapAngle = Math .round ((angle - offset) / phi) * phi + offset; 31 | 32 | if (Math .abs (snapRadius - radius) > Math .abs (this .tool .snapDistance)) 33 | snapRadius = radius; 34 | 35 | if (Math .abs (snapAngle - angle) > Math .abs (this .tool .snapDistance * phi) || this .tool .dimension [1] === 0) 36 | snapAngle = angle; 37 | 38 | const snapPolar = X3D .Complex .Polar (snapRadius, snapAngle); 39 | 40 | translation .x = snapPolar .real; 41 | translation .z = snapPolar .imag; 42 | 43 | const y = this .getSnapPositionY (translation .y); 44 | 45 | if (snapY) 46 | { 47 | if (Math .abs (y - translation .y) < Math .abs (this .tool .snapDistance)) 48 | translation .y = y; 49 | } 50 | 51 | if (snapRadius === radius && snapAngle === angle && translation .y !== y) 52 | return position; 53 | 54 | return translation; 55 | } 56 | 57 | getSnapPositionWithNormal (position, direction) 58 | { 59 | return position; 60 | } 61 | 62 | getSnapPositionY (position) 63 | { 64 | const 65 | o = this .tool .dimension [2] % 2 * 0.5, // Add a half scale if dimension is odd. 66 | p = Math .round (position), 67 | p1 = p - o, 68 | p2 = p + o; 69 | 70 | return Math .abs (p1 - position) < Math .abs (p2 - position) ? p1 : p2; 71 | } 72 | } 73 | 74 | module .exports = AngleGridTool; 75 | -------------------------------------------------------------------------------- /src/Tools/Grids/GridTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGridNodeTool = require ("./X3DGridNodeTool"); 4 | 5 | class GridTool extends X3DGridNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (__dirname, "GridTool.x3d"); 10 | } 11 | 12 | getSnapPosition (position) 13 | { 14 | const translation = position .copy (); 15 | 16 | for (let i = 0; i < 3; ++ i) 17 | { 18 | const value = this .getSnapPositionForAxis (i, position); 19 | 20 | if (Math .abs (value - translation [i]) < Math .abs (this .tool .snapDistance)) 21 | translation [i] = value; 22 | } 23 | 24 | return translation; 25 | } 26 | 27 | getSnapPositionForAxis (axis, position) 28 | { 29 | const 30 | o = this .tool .dimension [axis] % 2 * 0.5, // Add a half scale if dimension is odd. 31 | p = Math .round (position [axis]), 32 | p1 = p - o, 33 | p2 = p + o; 34 | 35 | return Math .abs (p1 - position [axis]) < Math .abs (p2 - position [axis]) ? p1 : p2; 36 | } 37 | 38 | getSnapPositionWithNormal (position, direction) 39 | { 40 | for (let i = 0; i < 3; ++ i) 41 | { 42 | const translation = this .getSnapPositionWithNormalForAxis (i, position, direction); 43 | 44 | if (translation .distance (position) < Math .abs (this .tool .snapDistance)) 45 | return translation; 46 | } 47 | 48 | return position; 49 | } 50 | 51 | getSnapPositionWithNormalForAxis (axis, position, direction) 52 | { 53 | const 54 | value = this .getSnapPositionForAxis (axis, position), 55 | t = (value - position [axis]) / direction [axis]; 56 | 57 | return position .copy () .add (direction .copy () .multiply (t)); 58 | } 59 | } 60 | 61 | module .exports = GridTool; 62 | -------------------------------------------------------------------------------- /src/Tools/Grouping/BooleanSwitch.x3d: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/Tools/Grouping/GroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("./X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class GroupTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREEN; 10 | } 11 | 12 | module .exports = GroupTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Grouping/StaticGroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("./X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class StaticGroupTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREY 10 | } 11 | 12 | module .exports = StaticGroupTool 13 | -------------------------------------------------------------------------------- /src/Tools/Grouping/SwitchTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("./X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class SwitchTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .YELLOW 10 | } 11 | 12 | module .exports = SwitchTool 13 | -------------------------------------------------------------------------------- /src/Tools/Grouping/TransformTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DTransformNodeTool = require ("./X3DTransformNodeTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class TransformTool extends X3DTransformNodeTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN 10 | } 11 | 12 | module .exports = TransformTool 13 | -------------------------------------------------------------------------------- /src/Tools/Grouping/X3DBoundedObjectTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DChildNodeTool = require ("../Core/X3DChildNodeTool"), 5 | X3D = require ("../../X3D"); 6 | 7 | class X3DBoundedObjectTool extends X3DChildNodeTool 8 | { 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DBoundedObjectTool.x3d"); 12 | 13 | this .getBrowser () .displayEvents () .addInterest ("reshapeTool", this); 14 | 15 | this .tool .bboxDisplay = true; 16 | this .tool .bboxColor = this .toolBBoxColor; 17 | } 18 | 19 | disposeTool () 20 | { 21 | this .getBrowser () .displayEvents () .removeInterest ("reshapeTool", this); 22 | 23 | super .disposeTool (); 24 | } 25 | 26 | static #box = new X3D .Box3 (); 27 | 28 | reshapeTool () 29 | { 30 | if (!this .tool) 31 | return console .warn ("reshapeTool called, although already disposed.", this .getBrowser () .displayEvents () .hasInterest ("reshapeTool", this)); 32 | 33 | const 34 | bbox = this .node .getBBox (X3DBoundedObjectTool .#box), 35 | bboxSize = bbox .size, 36 | bboxCenter = bbox .center; 37 | 38 | if (!this .tool .bboxSize .getValue () .equals (bboxSize)) 39 | this .tool .bboxSize = bboxSize; 40 | 41 | if (!this .tool .bboxCenter .getValue () .equals (bboxCenter)) 42 | this .tool .bboxCenter = bboxCenter; 43 | } 44 | } 45 | 46 | module .exports = X3DBoundedObjectTool; 47 | -------------------------------------------------------------------------------- /src/Tools/HAnim/HAnimHumanoidTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class HAnimHumanoidTool extends X3DTransformNodeTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN 10 | } 11 | 12 | module .exports = HAnimHumanoidTool 13 | -------------------------------------------------------------------------------- /src/Tools/HAnim/HAnimJointTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class HAnimJointTool extends X3DTransformNodeTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN 10 | } 11 | 12 | module .exports = HAnimJointTool 13 | -------------------------------------------------------------------------------- /src/Tools/HAnim/HAnimSegmentTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class HAnimSegmentTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREEN 10 | } 11 | 12 | module .exports = HAnimSegmentTool 13 | -------------------------------------------------------------------------------- /src/Tools/HAnim/HAnimSiteTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class HAnimSiteTool extends X3DTransformNodeTool 8 | { 9 | toolBBoxColor = ToolColors .GREEN 10 | } 11 | 12 | module .exports = HAnimSiteTool 13 | -------------------------------------------------------------------------------- /src/Tools/Layering/LayerTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const X3DLayerNodeTool = require ("./X3DLayerNodeTool") 4 | 5 | class LayerTool extends X3DLayerNodeTool { } 6 | 7 | module .exports = LayerTool 8 | -------------------------------------------------------------------------------- /src/Tools/Layering/X3DActiveLayerNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class X3DActiveLayerNodeTool extends X3DChildNodeTool 6 | { 7 | toolLayerNode = null; 8 | 9 | constructor (executionContext) 10 | { 11 | const node = executionContext .createNode ("Group", false); 12 | 13 | node .setup (); 14 | 15 | super (node); 16 | } 17 | 18 | async initializeTool (... args) 19 | { 20 | await super .loadTool ("tool", ... args); 21 | 22 | this .getBrowser () ._activeLayer .addInterest ("set_activeLayer", this); 23 | 24 | this ._visible .addInterest ("set_visible", this); 25 | 26 | this .set_visible (); 27 | this .set_activeLayer (); 28 | } 29 | 30 | disposeTool () 31 | { 32 | this .getBrowser () ._activeLayer .removeInterest ("set_activeLayer", this); 33 | 34 | this .disconnectTool (); 35 | this .removeFromLayer (this .toolLayerNode); 36 | 37 | super .disposeTool (); 38 | } 39 | 40 | set_visible () 41 | { 42 | if (this ._visible .getValue ()) 43 | this .connectTool (); 44 | else 45 | this .disconnectTool (); 46 | } 47 | 48 | set_activeLayer () 49 | { 50 | this .removeFromLayer (this .toolLayerNode); 51 | 52 | this .toolLayerNode = this .getBrowser () .getActiveLayer (); 53 | 54 | this .addToLayer (this .toolLayerNode); 55 | this .configureTool (); 56 | } 57 | 58 | addToLayer (layerNode) 59 | { 60 | if (!layerNode) 61 | return; 62 | 63 | layerNode .getGroups () ._children .push (this); 64 | } 65 | 66 | removeFromLayer (layerNode) 67 | { 68 | if (!layerNode) 69 | return; 70 | 71 | const index = layerNode .getGroups () ._children .findIndex (node => node .getValue () === this); 72 | 73 | if (index > -1) 74 | layerNode .getGroups () ._children .splice (index, 1); 75 | } 76 | 77 | connectTool () { } 78 | 79 | disconnectTool () { } 80 | 81 | configureTool () { } 82 | } 83 | 84 | module .exports = X3DActiveLayerNodeTool; 85 | -------------------------------------------------------------------------------- /src/Tools/Layering/X3DLayerNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNodeTool = require ("../Core/X3DNodeTool"); 4 | 5 | class X3DLayerNodeTool extends X3DNodeTool 6 | { 7 | constructor (node) 8 | { 9 | super (node); 10 | 11 | this .node .getGroups () ._children [0] .getValue () .addTool (); 12 | } 13 | 14 | disposeTool () 15 | { 16 | this .node .getGroups () ._children [0] .getValue () .removeTool (); 17 | 18 | super .disposeTool (); 19 | } 20 | } 21 | 22 | module .exports = X3DLayerNodeTool; 23 | -------------------------------------------------------------------------------- /src/Tools/Layout/LayoutGroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class LayoutGroupTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_GREEN; 10 | } 11 | 12 | module .exports = LayoutGroupTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Layout/LayoutLayerTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLayerNodeTool = require ("../Layering/X3DLayerNodeTool"); 4 | 5 | class LayoutLayerTool extends X3DLayerNodeTool { } 6 | 7 | module .exports = LayoutLayerTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Layout/ScreenGroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class ScreenGroupTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .LIME; 10 | } 11 | 12 | module .exports = ScreenGroupTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Lighting/DirectionalLightTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLightNodeTool = require ("./X3DLightNodeTool"); 4 | 5 | class DirectionalLightTool extends X3DLightNodeTool 6 | { 7 | #changing = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .initializeTool (); 12 | 13 | this .tool .getField ("location") .addInterest ("set_location", this); 14 | this .tool .getField ("direction") .addReference (this .node ._direction); 15 | 16 | this .addMetaDataCallback (this, "DirectionalLight/location", this .set_meta_location .bind (this)); 17 | this .getMetaData ("DirectionalLight/location", this .tool .location); 18 | 19 | this .tool .type = 0; 20 | } 21 | 22 | disposeTool () 23 | { 24 | this .removeMetaDataCallback (this, "DirectionalLight/location"); 25 | 26 | super .disposeTool (); 27 | } 28 | 29 | beginUndo () 30 | { 31 | this .undoSaveInitialValues (["location", "direction"]); 32 | } 33 | 34 | set_location () 35 | { 36 | this .#changing = true; 37 | 38 | this .setMetaData ("DirectionalLight/location", this .tool .location); 39 | } 40 | 41 | set_meta_location () 42 | { 43 | if (this .#changing) 44 | { 45 | this .#changing = false; 46 | return; 47 | } 48 | 49 | this .getMetaData ("DirectionalLight/location", this .tool .location); 50 | } 51 | } 52 | 53 | module .exports = DirectionalLightTool; 54 | -------------------------------------------------------------------------------- /src/Tools/Lighting/PointLightTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLightNodeTool = require ("./X3DLightNodeTool"); 4 | 5 | class PointLightTool extends X3DLightNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .getField ("location") .addReference (this .node ._location); 12 | 13 | this .tool .type = 1; 14 | } 15 | 16 | beginUndo () 17 | { 18 | this .undoSaveInitialValues (["location"]); 19 | } 20 | } 21 | 22 | module .exports = PointLightTool; 23 | -------------------------------------------------------------------------------- /src/Tools/Lighting/SpotLightTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLightNodeTool = require ("./X3DLightNodeTool"); 4 | 5 | class SpotLightTool extends X3DLightNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .getField ("location") .addReference (this .node ._location); 12 | this .tool .getField ("direction") .addReference (this .node ._direction); 13 | this .tool .getField ("beamWidth") .addReference (this .node ._beamWidth); 14 | this .tool .getField ("cutOffAngle") .addReference (this .node ._cutOffAngle); 15 | 16 | this .tool .type = 2; 17 | } 18 | 19 | beginUndo () 20 | { 21 | this .undoSaveInitialValues (["location", "direction"]); 22 | } 23 | } 24 | 25 | module .exports = SpotLightTool; 26 | -------------------------------------------------------------------------------- /src/Tools/Lighting/X3DLightNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class X3DLightNodeTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DLightNodeTool.x3d"); 12 | 13 | this .tool .getField ("on") .addReference (this .node ._on); 14 | this .tool .getField ("color") .addReference (this .node ._color); 15 | this .tool .getField ("intensity") .addReference (this .node ._intensity); 16 | 17 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 18 | } 19 | 20 | isBoundedObject () 21 | { 22 | return true; 23 | } 24 | 25 | getBBox (bbox, shadows) 26 | { 27 | return this .getToolBBox (bbox, shadows); 28 | } 29 | } 30 | 31 | module .exports = X3DLightNodeTool; 32 | -------------------------------------------------------------------------------- /src/Tools/NURBS/NurbsCurveTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DParametricGeometryNodeTool = require ("./X3DParametricGeometryNodeTool"), 5 | X3DLineGeometryNodeTool = require ("../Rendering/X3DLineGeometryNodeTool"); 6 | 7 | class NurbsCurveTool extends X3DParametricGeometryNodeTool (X3DLineGeometryNodeTool) 8 | { 9 | async initializeTool () 10 | { 11 | await super .initializeTool (); 12 | 13 | this .set_toolRebuildParametricGeometry (); 14 | } 15 | 16 | set_toolRebuildParametricGeometry () 17 | { 18 | this .parametricGeometryNodeTool .uDimension = this .node ._controlPoint .getValue () ?._point .length ?? 0; 19 | this .parametricGeometryNodeTool .vDimension = 1; 20 | 21 | super .set_toolRebuildParametricGeometry (); 22 | } 23 | } 24 | 25 | module .exports = NurbsCurveTool; 26 | -------------------------------------------------------------------------------- /src/Tools/NURBS/NurbsPatchSurfaceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNurbsSurfaceGeometryNodeTool = require ("./X3DNurbsSurfaceGeometryNodeTool"); 4 | 5 | class NurbsPatchSurfaceTool extends X3DNurbsSurfaceGeometryNodeTool { } 6 | 7 | module .exports = NurbsPatchSurfaceTool; 8 | -------------------------------------------------------------------------------- /src/Tools/NURBS/NurbsSweptSurfaceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class NurbsSweptSurfaceTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = NurbsSweptSurfaceTool; 8 | -------------------------------------------------------------------------------- /src/Tools/NURBS/NurbsSwungSurfaceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class NurbsSwungSurfaceTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = NurbsSwungSurfaceTool; 8 | -------------------------------------------------------------------------------- /src/Tools/NURBS/NurbsTrimmedSurfaceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNurbsSurfaceGeometryNodeTool = require ("./X3DNurbsSurfaceGeometryNodeTool"); 4 | 5 | class NurbsTrimmedSurfaceTool extends X3DNurbsSurfaceGeometryNodeTool { } 6 | 7 | module .exports = NurbsTrimmedSurfaceTool; 8 | -------------------------------------------------------------------------------- /src/Tools/NURBS/X3DNurbsSurfaceGeometryNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"), 5 | X3DParametricGeometryNodeTool = require ("./X3DParametricGeometryNodeTool");; 6 | 7 | class X3DNurbsSurfaceGeometryNodeTool extends X3DParametricGeometryNodeTool (X3DGeometryNodeTool) 8 | { 9 | async initializeTool () 10 | { 11 | await super .initializeTool (); 12 | 13 | this .parametricGeometryNodeTool .getField ("uDimension") .addReference (this .node ._uDimension); 14 | this .parametricGeometryNodeTool .getField ("vDimension") .addReference (this .node ._vDimension); 15 | 16 | this .set_toolRebuildParametricGeometry (); 17 | } 18 | } 19 | 20 | 21 | module .exports = X3DNurbsSurfaceGeometryNodeTool; 22 | -------------------------------------------------------------------------------- /src/Tools/NURBS/X3DParametricGeometryNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const ToolColors = require ("../Core/ToolColors"); 4 | 5 | const X3DParametricGeometryNodeTool = Base => class extends Base 6 | { 7 | async initializeTool () 8 | { 9 | await Promise .all ([ 10 | super .initializeTool (), 11 | super .loadTool ("parametricGeometryNodeTool", __dirname, "X3DParametricGeometryNodeTool.x3d"), 12 | ]); 13 | 14 | this .node ._rebuild .addInterest ("set_toolRebuildParametricGeometry", this); 15 | 16 | this .parametricGeometryNodeTool .hullColor = ToolColors .LIGHT_GREY; 17 | this .parametricGeometryNodeTool .controlPointColor = ToolColors .DARK_BLUE; 18 | 19 | this .parametricGeometryNodeTool .getField ("controlPoint") .addReference (this .node ._controlPoint); 20 | 21 | this .addExternalNode (this .node ._controlPoint); 22 | } 23 | 24 | disposeTool () 25 | { 26 | this .node ._rebuild .removeInterest ("set_toolRebuildParametricGeometry", this); 27 | 28 | super .disposeTool (); 29 | } 30 | 31 | set_toolRebuildParametricGeometry () 32 | { 33 | const 34 | uDimension = this .parametricGeometryNodeTool .uDimension, 35 | vDimension = this .parametricGeometryNodeTool .vDimension, 36 | hullIndex = [ ]; 37 | 38 | // Generate u connections. 39 | 40 | if (uDimension > 1) 41 | { 42 | for (let v = 0; v < vDimension; ++ v) 43 | { 44 | for (let u = 0; u < uDimension; ++ u) 45 | hullIndex .push (v * uDimension + u); 46 | 47 | hullIndex .push (-1); 48 | } 49 | } 50 | 51 | // Generate v connections. 52 | 53 | if (vDimension > 1) 54 | { 55 | for (let u = 0; u < uDimension; ++ u) 56 | { 57 | for (let v = 0; v < vDimension; ++ v) 58 | hullIndex .push (v * uDimension + u); 59 | 60 | hullIndex .push (-1); 61 | } 62 | } 63 | 64 | this .parametricGeometryNodeTool .set_hullIndex = hullIndex; 65 | } 66 | }; 67 | 68 | module .exports = X3DParametricGeometryNodeTool; 69 | -------------------------------------------------------------------------------- /src/Tools/Navigation/BillboardTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class BillboardTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .PINK; 10 | 11 | async initializeTool () 12 | { 13 | await super .initializeTool (); 14 | 15 | this .tool .getField ("axisOfRotation") .addReference (this .node ._axisOfRotation); 16 | 17 | this .tool .centerDisplay = true; 18 | } 19 | } 20 | 21 | module .exports = BillboardTool; 22 | -------------------------------------------------------------------------------- /src/Tools/Navigation/CollisionTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | const 8 | _set_enabled = Symbol (); 9 | 10 | class CollisionTool extends X3DBoundedObjectTool 11 | { 12 | toolBBoxColor = ToolColors .RED; 13 | 14 | async initializeTool () 15 | { 16 | await super .initializeTool (); 17 | 18 | this .node ._enabled .addInterest (_set_enabled, this); 19 | 20 | this [_set_enabled] (); 21 | } 22 | 23 | disposeTool () 24 | { 25 | this .node ._enabled .removeInterest (_set_enabled, this); 26 | 27 | super .disposeTool (); 28 | } 29 | 30 | [_set_enabled] () 31 | { 32 | this .tool .bboxStyle = this .node ._enabled .getValue () ? 1 : 2; 33 | } 34 | } 35 | 36 | module .exports = CollisionTool; 37 | -------------------------------------------------------------------------------- /src/Tools/Navigation/LODTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class LODTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .CYAN; 10 | 11 | async initializeTool () 12 | { 13 | await super .initializeTool (); 14 | 15 | this .tool .getField ("center") .addReference (this .node ._center); 16 | 17 | this .tool .centerDisplay = true; 18 | } 19 | } 20 | 21 | module .exports = LODTool; 22 | -------------------------------------------------------------------------------- /src/Tools/Navigation/OrthoViewpointTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DViewpointNodeTool = require ("./X3DViewpointNodeTool"); 4 | 5 | class OrthoViewpointTool extends X3DViewpointNodeTool 6 | { 7 | toolType = 1; 8 | 9 | async initializeTool () 10 | { 11 | await super .initializeTool (); 12 | 13 | this .tool .getField ("position") .addReference (this .node ._position); 14 | this .tool .getField ("orientation") .addReference (this .node ._orientation); 15 | } 16 | } 17 | 18 | module .exports = OrthoViewpointTool; 19 | -------------------------------------------------------------------------------- /src/Tools/Navigation/ViewpointGroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DEnvironmentalSensorNodeTool = require ("../EnvironmentalSensor/X3DEnvironmentalSensorNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class ViewpointGroupTool extends X3DEnvironmentalSensorNodeTool 8 | { 9 | toolBoxColor = ToolColors .PROXIMITY_SENSOR; 10 | } 11 | 12 | module .exports = ViewpointGroupTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Navigation/ViewpointTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DViewpointNodeTool = require ("./X3DViewpointNodeTool"); 4 | 5 | class ViewpointTool extends X3DViewpointNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .getField ("position") .addReference (this .node ._position); 12 | this .tool .getField ("orientation") .addReference (this .node ._orientation); 13 | } 14 | } 15 | 16 | module .exports = ViewpointTool; 17 | -------------------------------------------------------------------------------- /src/Tools/Navigation/X3DViewpointNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class X3DViewpointNodeTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | toolType = 0; 10 | 11 | async initializeTool () 12 | { 13 | await super .loadTool ("tool", __dirname, "X3DViewpointNodeTool.x3d"); 14 | 15 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 16 | 17 | this .node ._isBound .addFieldInterest (this .tool .getField ("bound")); 18 | 19 | this .tool .type = this .toolType; 20 | this .tool .bound = this .node ._isBound; 21 | } 22 | 23 | disposeTool () 24 | { 25 | this .node ._isBound .removeFieldInterest (this .tool .getField ("bound")); 26 | 27 | super .disposeTool (); 28 | } 29 | 30 | beginUndo () 31 | { 32 | this .undoSaveInitialValues (["position", "orientation"]); 33 | } 34 | 35 | isBoundedObject () 36 | { 37 | return true; 38 | } 39 | 40 | getBBox (bbox, shadows) 41 | { 42 | return this .getToolBBox (bbox, shadows); 43 | } 44 | } 45 | 46 | module .exports = X3DViewpointNodeTool; 47 | -------------------------------------------------------------------------------- /src/Tools/Networking/AnchorTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class AnchorTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .LILA 10 | } 11 | 12 | module .exports = AnchorTool 13 | -------------------------------------------------------------------------------- /src/Tools/Networking/InlineTool.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors") 6 | 7 | class InlineTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .WHITE 10 | } 11 | 12 | module .exports = InlineTool 13 | -------------------------------------------------------------------------------- /src/Tools/ParticleSystems/ParticleSystemTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class ParticleSystemTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .ORANGE; 10 | } 11 | 12 | module .exports = ParticleSystemTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Picking/PickableGroupTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class PickableGroupTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .ROSE; 10 | } 11 | 12 | module .exports = PickableGroupTool; 13 | -------------------------------------------------------------------------------- /src/Tools/Rendering/IndexedLineSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLineGeometryNodeTool = require ("./X3DLineGeometryNodeTool"); 4 | 5 | class IndexedLineSetTool extends X3DLineGeometryNodeTool { } 6 | 7 | module .exports = IndexedLineSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/IndexedTriangleFanSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class IndexedTriangleFanSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = IndexedTriangleFanSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/IndexedTriangleSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class IndexedTriangleSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = IndexedTriangleSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/IndexedTriangleStripSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class IndexedTriangleStripSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = IndexedTriangleStripSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/LineSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLineGeometryNodeTool = require ("./X3DLineGeometryNodeTool"); 4 | 5 | class LineSetTool extends X3DLineGeometryNodeTool { } 6 | 7 | module .exports = LineSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/PointSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DLineGeometryNodeTool = require ("./X3DLineGeometryNodeTool"); 4 | 5 | class PointSetTool extends X3DLineGeometryNodeTool { } 6 | 7 | module .exports = PointSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/TriangleFanSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class TriangleFanSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = TriangleFanSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/TriangleSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class TriangleSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = TriangleSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/TriangleStripSetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"); 4 | 5 | class TriangleStripSetTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = TriangleStripSetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/Rendering/X3DGeometryNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DNodeTool = require ("../Core/X3DNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class X3DGeometryNodeTool extends X3DNodeTool 8 | { 9 | async initializeTool (type) 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DGeometryNodeTool.x3d"); 12 | 13 | this .tool .linesColor = ToolColors .BLUE; 14 | 15 | if (type === "CUSTOM") 16 | return; 17 | 18 | this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this); 19 | 20 | this .tool .linesCoord = this .getToolScene () .createNode ("CoordinateDouble"); 21 | 22 | this .set_toolRebuildGeometry (); 23 | } 24 | 25 | disposeTool () 26 | { 27 | this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this); 28 | 29 | super .disposeTool (); 30 | } 31 | 32 | set_toolRebuildGeometry () 33 | { 34 | const 35 | points = this .node .getVertices () .filter ((_, i) => i % 4 < 3), 36 | numPoints = points .length / 3; 37 | 38 | if (numPoints !== this .tool .linesCoord .point .length) 39 | { 40 | const coordIndex = [ ]; 41 | 42 | for (let i = 0; i < numPoints; i += 3) 43 | coordIndex .push (i, i + 1, i + 2, i, -1); 44 | 45 | this .tool .set_linesCoordIndex = coordIndex; 46 | } 47 | 48 | this .tool .linesCoord .point = points; 49 | } 50 | } 51 | 52 | module .exports = X3DGeometryNodeTool; 53 | -------------------------------------------------------------------------------- /src/Tools/Rendering/X3DLineGeometryNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class X3DLineGeometryNodeTool extends X3DGeometryNodeTool 8 | { 9 | async initializeTool (type) 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DLineGeometryNodeTool.x3d"); 12 | 13 | this .tool .pointsColor = ToolColors .BLUE; 14 | 15 | if (type === "CUSTOM") 16 | return; 17 | 18 | this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this); 19 | 20 | this .tool .pointsCoord = this .getToolScene () .createNode ("CoordinateDouble"); 21 | 22 | this .set_toolRebuildGeometry (); 23 | } 24 | 25 | disposeTool () 26 | { 27 | this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this); 28 | 29 | super .disposeTool (); 30 | } 31 | 32 | set_toolRebuildGeometry () 33 | { 34 | const points = this .node .getVertices () .filter ((_, i) => i % 4 < 3); 35 | 36 | this .tool .pointsCoord .point = points; 37 | } 38 | } 39 | 40 | module .exports = X3DLineGeometryNodeTool; 41 | -------------------------------------------------------------------------------- /src/Tools/Rendering/X3DPointGeometryNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DGeometryNodeTool = require ("./X3DGeometryNodeTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class X3DPointGeometryNodeTool extends X3DGeometryNodeTool 8 | { 9 | async initializeTool (type) 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DPointGeometryNodeTool.x3d"); 12 | 13 | this .tool .pointsColor = ToolColors .BLUE; 14 | 15 | if (type === "CUSTOM") 16 | return; 17 | 18 | this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this); 19 | 20 | this .tool .pointsCoord = this .getToolScene () .createNode ("CoordinateDouble"); 21 | 22 | this .set_toolRebuildGeometry (); 23 | } 24 | 25 | disposeTool () 26 | { 27 | this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this); 28 | 29 | super .disposeTool (); 30 | } 31 | 32 | set_toolRebuildGeometry () 33 | { 34 | const points = this .node .getVertices () .filter ((_, i) => i % 4 < 3); 35 | 36 | this .tool .pointsCoord .point = points; 37 | } 38 | } 39 | 40 | module .exports = X3DPointGeometryNodeTool; 41 | -------------------------------------------------------------------------------- /src/Tools/Rendering/X3DPointGeometryNodeTool.x3d: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/Tools/RigidBodyPhysics/CollidableOffsetTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNBodyCollidableNodeTool = require ("./X3DNBodyCollidableNodeTool"); 4 | 5 | class CollidableOffsetTool extends X3DNBodyCollidableNodeTool { } 6 | 7 | module .exports = CollidableOffsetTool; 8 | -------------------------------------------------------------------------------- /src/Tools/RigidBodyPhysics/CollidableShapeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DNBodyCollidableNodeTool = require ("./X3DNBodyCollidableNodeTool"); 4 | 5 | class CollidableShapeTool extends X3DNBodyCollidableNodeTool { } 6 | 7 | module .exports = CollidableShapeTool; 8 | -------------------------------------------------------------------------------- /src/Tools/RigidBodyPhysics/X3DNBodyCollidableNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | const _set_enabled = Symbol (); 8 | 9 | class X3DNBodyCollidableNodeTool extends X3DBoundedObjectTool 10 | { 11 | toolBBoxColor = ToolColors .DARK_RED; 12 | 13 | async initializeTool () 14 | { 15 | await super .initializeTool (); 16 | 17 | this .node ._enabled .addInterest (_set_enabled, this); 18 | 19 | this [_set_enabled] (); 20 | } 21 | 22 | disposeTool () 23 | { 24 | this .node ._enabled .removeInterest (_set_enabled, this); 25 | 26 | super .disposeTool (); 27 | } 28 | 29 | [_set_enabled] () 30 | { 31 | this .tool .bboxStyle = this .node ._enabled .getValue () ? 1 : 2; 32 | } 33 | } 34 | 35 | module .exports = X3DNBodyCollidableNodeTool; 36 | -------------------------------------------------------------------------------- /src/Tools/Shaders/TextureShader.x3d: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 47 | 48 | 50 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/Tools/Shape/ShapeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class ShapeTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .ORANGE; 10 | } 11 | 12 | module .exports = ShapeTool; 13 | -------------------------------------------------------------------------------- /src/Tools/SnapTool/SnapSource.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DSnapNodeTool = require ("./X3DSnapNodeTool"), 5 | ActionKeys = require ("../../Application/ActionKeys"), 6 | X3D = require ("../../X3D"); 7 | 8 | class SnapSource extends X3DSnapNodeTool 9 | { 10 | toolModifiers = ActionKeys .Option; 11 | 12 | async initializeTool () 13 | { 14 | await super .initializeTool (); 15 | 16 | this .tool .normal = new X3D .Vector3 (0, -1, 0); 17 | this .tool .type = "SNAP_SOURCE"; 18 | } 19 | } 20 | 21 | module .exports = SnapSource; 22 | -------------------------------------------------------------------------------- /src/Tools/Sound/ListenerPointSourceTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class ListenerPointSourceTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "ListenerPointSourceTool.x3d"); 12 | 13 | this .tool .getField ("position") .addReference (this .node ._position); 14 | this .tool .getField ("orientation") .addReference (this .node ._orientation); 15 | 16 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 17 | } 18 | 19 | beginUndo () 20 | { 21 | this .undoSaveInitialValues (["position", "orientation"]); 22 | } 23 | 24 | isBoundedObject () 25 | { 26 | return true; 27 | } 28 | 29 | getBBox (bbox, shadows) 30 | { 31 | return this .getToolBBox (bbox, shadows); 32 | } 33 | } 34 | 35 | module .exports = ListenerPointSourceTool; 36 | -------------------------------------------------------------------------------- /src/Tools/Sound/SoundTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DChildNodeTool = require ("../Core/X3DChildNodeTool"), 5 | _ = require ("../../Application/GetText"); 6 | 7 | class SoundTool extends X3DChildNodeTool 8 | { 9 | static createOnSelection = false; 10 | 11 | async initializeTool () 12 | { 13 | await super .loadTool ("tool", __dirname, "SoundTool.x3d"); 14 | 15 | this .tool .getField ("location") .addReference (this .node ._location); 16 | this .tool .getField ("direction") .addReference (this .node ._direction); 17 | this .tool .getField ("minBack") .addReference (this .node ._minBack); 18 | this .tool .getField ("minFront") .addReference (this .node ._minFront); 19 | this .tool .getField ("maxBack") .addReference (this .node ._maxBack); 20 | this .tool .getField ("maxFront") .addReference (this .node ._maxFront); 21 | 22 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 23 | } 24 | 25 | beginUndo () 26 | { 27 | this .undoSaveInitialValues (["location", "direction", "minBack", "minFront", "maxBack", "maxFront"]); 28 | } 29 | 30 | getUndoDescription (activeTool, name) 31 | { 32 | switch (activeTool) 33 | { 34 | case "MIN_BACK": 35 | { 36 | if (name) 37 | return _("Translate field »minBack« of Node %s »%s«"); 38 | 39 | return _("Translate »minBack« of Node %s"); 40 | } 41 | case "MIN_FRONT": 42 | { 43 | if (name) 44 | return _("Translate field »minFront of Node %s »%s«"); 45 | 46 | return _("Translate »minFront« of Node %s"); 47 | } 48 | case "MAX_BACK": 49 | { 50 | if (name) 51 | return _("Translate field »maxBack« of Node %s »%s«"); 52 | 53 | return _("Translate »maxBack« of Node %s"); 54 | } 55 | case "MAX_FRONT": 56 | { 57 | if (name) 58 | return _("Translate field »maxFront« of Node %s »%s«"); 59 | 60 | return _("Translate »maxFront of Node %s"); 61 | } 62 | default: 63 | { 64 | return super .getUndoDescription (activeTool, name); 65 | } 66 | } 67 | } 68 | 69 | isBoundedObject () 70 | { 71 | return true; 72 | } 73 | 74 | getBBox (bbox, shadows) 75 | { 76 | return this .getToolBBox (bbox, shadows); 77 | } 78 | } 79 | 80 | module .exports = SoundTool; 81 | -------------------------------------------------------------------------------- /src/Tools/Sound/SpatialSoundTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class SpatialSoundTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "SpatialSoundTool.x3d"); 12 | 13 | this .tool .getField ("location") .addReference (this .node ._location); 14 | this .tool .getField ("direction") .addReference (this .node ._direction); 15 | this .tool .getField ("coneInnerAngle") .addReference (this .node ._coneInnerAngle); 16 | this .tool .getField ("coneOuterAngle") .addReference (this .node ._coneOuterAngle); 17 | this .tool .getField ("referenceDistance") .addReference (this .node ._referenceDistance); 18 | 19 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 20 | } 21 | 22 | beginUndo () 23 | { 24 | this .undoSaveInitialValues (["location", "direction"]); 25 | } 26 | 27 | isBoundedObject () 28 | { 29 | return true; 30 | } 31 | 32 | getBBox (bbox, shadows) 33 | { 34 | return this .getToolBBox (bbox, shadows); 35 | } 36 | } 37 | 38 | module .exports = SpatialSoundTool; 39 | -------------------------------------------------------------------------------- /src/Tools/Text/TextTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"); 4 | 5 | class TextTool extends X3DGeometryNodeTool { } 6 | 7 | module .exports = TextTool; 8 | -------------------------------------------------------------------------------- /src/Tools/TextureProjection/TextureProjectorParallelTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DTextureProjectorNodeTool = require ("./X3DTextureProjectorNodeTool"); 4 | 5 | class TextureProjectorParallelTool extends X3DTextureProjectorNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .getField ("parallelFieldOfView") .addReference (this .node ._fieldOfView); 12 | this .tool .getField ("parallelNearDistance") .addReference (this .node ._nearDistance); 13 | this .tool .getField ("parallelFarDistance") .addReference (this .node ._farDistance); 14 | 15 | this .node ._aspectRatio .addFieldInterest (this .tool .getField ("parallelAspectRatio")); 16 | 17 | this .tool .parallelAspectRatio = this .node ._aspectRatio; 18 | } 19 | 20 | disposeTool () 21 | { 22 | this .node ._aspectRatio .removeFieldInterest (this .tool .getField ("parallelAspectRatio")); 23 | 24 | super .disposeTool (); 25 | } 26 | } 27 | 28 | module .exports = TextureProjectorParallelTool; 29 | -------------------------------------------------------------------------------- /src/Tools/TextureProjection/TextureProjectorTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DTextureProjectorNodeTool = require ("./X3DTextureProjectorNodeTool"); 4 | 5 | class TextureProjectorTool extends X3DTextureProjectorNodeTool 6 | { 7 | async initializeTool () 8 | { 9 | await super .initializeTool (); 10 | 11 | this .tool .getField ("perspectiveFieldOfView") .addReference (this .node ._fieldOfView); 12 | this .tool .getField ("perspectiveNearDistance") .addReference (this .node ._nearDistance); 13 | this .tool .getField ("perspectiveFarDistance") .addReference (this .node ._farDistance); 14 | 15 | this .node ._aspectRatio .addFieldInterest (this .tool .getField ("perspectiveAspectRatio")); 16 | 17 | this .tool .perspectiveAspectRatio = this .node ._aspectRatio; 18 | } 19 | 20 | disposeTool () 21 | { 22 | this .node ._aspectRatio .removeFieldInterest (this .tool .getField ("perspectiveAspectRatio")); 23 | 24 | super .disposeTool (); 25 | } 26 | } 27 | 28 | module .exports = TextureProjectorTool; 29 | -------------------------------------------------------------------------------- /src/Tools/TextureProjection/X3DTextureProjectorNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DChildNodeTool = require ("../Core/X3DChildNodeTool"); 4 | 5 | class X3DTextureProjectorNodeTool extends X3DChildNodeTool 6 | { 7 | static createOnSelection = false; 8 | 9 | async initializeTool () 10 | { 11 | await super .loadTool ("tool", __dirname, "X3DTextureProjectorNodeTool.x3d"); 12 | 13 | this .tool .getField ("on") .addReference (this .node ._on); 14 | this .tool .getField ("location") .addReference (this .node ._location); 15 | this .tool .getField ("direction") .addReference (this .node ._direction); 16 | this .tool .getField ("upVector") .addReference (this .node ._upVector); 17 | this .tool .getField ("texture") .addReference (this .node ._texture); 18 | 19 | this .tool .getField ("isActive") .addInterest ("handleUndo", this); 20 | 21 | this .addExternalNode (this .node ._texture); 22 | } 23 | 24 | beginUndo () 25 | { 26 | this .undoSaveInitialValues (["location", "direction", "upVector"]); 27 | } 28 | 29 | isBoundedObject () 30 | { 31 | return true; 32 | } 33 | 34 | getBBox (bbox, shadows) 35 | { 36 | return this .getToolBBox (bbox, shadows); 37 | } 38 | } 39 | 40 | module .exports = X3DTextureProjectorNodeTool; 41 | -------------------------------------------------------------------------------- /src/Tools/VolumeRendering/IsoSurfaceVolumeDataTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DVolumeDataNodeTool = require ("./X3DVolumeDataNodeTool"); 4 | 5 | class IsoSurfaceVolumeDataTool extends X3DVolumeDataNodeTool { } 6 | 7 | module .exports = IsoSurfaceVolumeDataTool; 8 | -------------------------------------------------------------------------------- /src/Tools/VolumeRendering/SegmentedVolumeDataTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DVolumeDataNodeTool = require ("./X3DVolumeDataNodeTool"); 4 | 5 | class SegmentedVolumeDataTool extends X3DVolumeDataNodeTool { } 6 | 7 | module .exports = SegmentedVolumeDataTool; 8 | -------------------------------------------------------------------------------- /src/Tools/VolumeRendering/VolumeDataTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3DVolumeDataNodeTool = require ("./X3DVolumeDataNodeTool"); 4 | 5 | class VolumeDataTool extends X3DVolumeDataNodeTool { } 6 | 7 | module .exports = VolumeDataTool; 8 | -------------------------------------------------------------------------------- /src/Tools/VolumeRendering/X3DVolumeDataNodeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class X3DVolumeDataNodeTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .DARK_ORANGE; 10 | } 11 | 12 | module .exports = X3DVolumeDataNodeTool; 13 | -------------------------------------------------------------------------------- /src/Tools/X_ITE/InstancedShapeTool.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const 4 | X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"), 5 | ToolColors = require ("../Core/ToolColors"); 6 | 7 | class InstancedShapeTool extends X3DBoundedObjectTool 8 | { 9 | toolBBoxColor = ToolColors .ORANGE; 10 | } 11 | 12 | module .exports = InstancedShapeTool; 13 | -------------------------------------------------------------------------------- /src/X3D.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const X3D = require ("x_ite/x_ite.min.js"); 4 | 5 | X3D .TYPE_SCRIPT_PATH = require .resolve ("x_ite/x_ite.d.ts"); 6 | X3D .X3DUOM_PATH = require .resolve ("x_ite/X3DUOM.xml"); 7 | 8 | module .exports = X3D; 9 | -------------------------------------------------------------------------------- /src/assets/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.allow-jit 6 | 7 | com.apple.security.device.audio-input 8 | 9 | com.apple.security.device.bluetooth 10 | 11 | com.apple.security.device.camera 12 | 13 | com.apple.security.device.print 14 | 15 | com.apple.security.device.usb 16 | 17 | com.apple.security.personal-information.location 18 | 19 | com.apple.security.personal-information.addressbook 20 | 21 | com.apple.security.personal-information.calendars 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/assets/html/application-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/assets/html/application.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | window .addEventListener ("DOMContentLoaded", () => 4 | { 5 | require ("../../Application/Tabs"); 6 | }); 7 | -------------------------------------------------------------------------------- /src/assets/html/window-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    12 |
    13 |
    14 |
    15 |
    16 | 24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 |
    31 |
    32 |
    33 |
    34 | 35 |
    36 |
    37 | 38 | 39 | -------------------------------------------------------------------------------- /src/assets/html/window.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | window .addEventListener ("DOMContentLoaded", () => 4 | { 5 | const electron = require ("electron"); 6 | 7 | electron .ipcRenderer .on ("activate", () => require ("../../Application/Window")); 8 | }); 9 | -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/AccessTypes.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/AccessTypes.xcf -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/initializeOnly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/initializeOnly.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOnly.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOnly.0.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOnly.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOnly.1.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOnly.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOnly.2.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOnly.active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOnly.active.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOnly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOnly.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.0.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.1.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.0.2.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.0.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.1.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.1.2.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.0.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.1.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.2.2.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/inputOutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/inputOutput.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/outputOnly.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/outputOnly.0.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/outputOnly.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/outputOnly.1.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/outputOnly.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/outputOnly.2.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/outputOnly.active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/outputOnly.active.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/AccessTypes/outputOnly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/AccessTypes/outputOnly.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/Fields/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/OutlineEditor/Fields/none.png -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/Values/FALSE.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 42 | 46 | 47 | 49 | 50 | 52 | image/svg+xml 53 | 55 | 56 | 57 | 58 | 59 | 63 | 68 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/assets/images/OutlineEditor/Values/TRUE.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 42 | 46 | 47 | 49 | 50 | 52 | image/svg+xml 53 | 55 | 56 | 57 | 58 | 59 | 63 | 68 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/assets/images/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/icon.icns -------------------------------------------------------------------------------- /src/assets/images/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/icon.ico -------------------------------------------------------------------------------- /src/assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/create3000/sunrize/d5dda34986eb5de92900a01661f21b4d408f3d89/src/assets/images/icon.png -------------------------------------------------------------------------------- /src/assets/themes/prompt-template.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | @import url(system-colors.css); 3 | 4 | body { 5 | overflow: hidden !important; 6 | background-color: var(--background-color); 7 | color: var(--text-color); 8 | } 9 | 10 | #container { 11 | overflow: hidden !important; 12 | } 13 | 14 | ::placeholder { 15 | color: var(--system-gray2); 16 | } 17 | 18 | ::selection { 19 | color: var(--system-gray0); 20 | background: var(--system-gray4); 21 | } 22 | 23 | #label { 24 | font-size: 80% !important; 25 | } 26 | 27 | input { 28 | border: 1px solid var(--system-gray3) !important; 29 | background: none !important; 30 | color: var(--text-color) !important; 31 | } 32 | 33 | #ok { 34 | background-color: var(--system-red) !important; 35 | } 36 | 37 | #cancel { 38 | border: 1px solid var(--system-gray3) !important; 39 | background-color: transparent !important; 40 | color: var(--text-color) !important; 41 | } 42 | 43 | #buttons > button, 44 | #buttons > input[type=submit] { 45 | border-radius: 7px !important; 46 | padding: 0.3em 1.8em !important; 47 | width: 100px !important; 48 | } 49 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | if (process .argv .length > 2) 4 | { 5 | process .argv = process .argv .concat (JSON .parse (atob (process .argv .pop ()))); 6 | process .chdir (process .argv .pop ()); 7 | } 8 | 9 | const app = require ("./Application/Application") .run (); 10 | -------------------------------------------------------------------------------- /tests/NULL.x3d: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 29 | 32 | 33 | 34 | 35 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tests/TestCase 1.x3d: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 17 | 19 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------