├── COPYRIGHT.txt ├── LICENSE.txt ├── README-FIRST.txt ├── README-build.html ├── THIRDPARTY-LICENSE-DISTANCE.txt ├── THIRDPARTY-LICENSE-FIST.txt ├── THIRDPARTY-LICENSE-MAINFRAME.txt ├── build.xml └── src ├── META-INF └── services │ └── javax.media.j3d.GeometryService └── com └── sun └── j3d ├── ExceptionStrings.properties ├── audioengines ├── AudioEngine.java ├── AudioEngine3D.java ├── AudioEngine3DL2.java ├── AudioEngineThread.java ├── AuralParameters.java ├── Sample.java ├── javasound │ ├── JSAuralParameters.java │ ├── JSChannel.java │ ├── JSClip.java │ ├── JSDirectionalSample.java │ ├── JSMidi.java │ ├── JSPositionalSample.java │ ├── JSSample.java │ ├── JSStream.java │ ├── JSThread.java │ ├── JavaSoundMixer.java │ └── package.html └── package.html ├── exp └── swing │ ├── JCanvas3D.java │ ├── impl │ └── AutoOffScreenCanvas3D.java │ └── package.html ├── internal ├── BufferWrapper.java ├── ByteBufferWrapper.java ├── Distance.java ├── DoubleBufferWrapper.java ├── FastVector.java ├── FloatBufferWrapper.java ├── HashCodeUtil.java └── J3dUtilsI18N.java ├── loaders ├── IncorrectFormatException.java ├── Loader.java ├── LoaderBase.java ├── ParsingErrorException.java ├── Scene.java ├── SceneBase.java ├── lw3d │ ├── DebugOutput.java │ ├── EnvelopeHandler.java │ ├── FloatValueInterpolator.java │ ├── ImageScaler.java │ ├── J3dLwoParser.java │ ├── LWOBFileReader.java │ ├── LightIntensityPathInterpolator.java │ ├── Lw3dLoader.java │ ├── LwLightObject.java │ ├── LwoParser.java │ ├── LwoSurface.java │ ├── LwoTexture.java │ ├── LwsBackground.java │ ├── LwsCamera.java │ ├── LwsEnvelope.java │ ├── LwsEnvelopeFrame.java │ ├── LwsEnvelopeLightIntensity.java │ ├── LwsFog.java │ ├── LwsFrame.java │ ├── LwsLight.java │ ├── LwsMotion.java │ ├── LwsObject.java │ ├── LwsPrimitive.java │ ├── ParserObject.java │ ├── SequenceLine.java │ ├── SequenceReader.java │ ├── ShapeHolder.java │ ├── SwitchPathInterpolator.java │ ├── TargaReader.java │ ├── TextfileParser.java │ └── package.html ├── objectfile │ ├── DefaultMaterials.java │ ├── ObjectFile.java │ ├── ObjectFileMaterials.java │ ├── ObjectFileParser.java │ ├── RgbFile.java │ └── package.html └── package.html └── utils ├── applet ├── JMainFrame.java ├── MainFrame.java └── package.html ├── audio ├── DistanceAttenuation.java └── package.html ├── behaviors ├── interpolators │ ├── CubicSplineCurve.java │ ├── CubicSplineSegment.java │ ├── KBCubicSplineCurve.java │ ├── KBCubicSplineSegment.java │ ├── KBKeyFrame.java │ ├── KBRotPosScaleSplinePathInterpolator.java │ ├── KBSplinePathInterpolator.java │ ├── RotPosScaleTCBSplinePathInterpolator.java │ ├── TCBKeyFrame.java │ ├── TCBSplinePathInterpolator.java │ └── package.html ├── keyboard │ ├── KeyNavigator.java │ ├── KeyNavigatorBehavior.java │ └── package.html ├── mouse │ ├── MouseBehavior.java │ ├── MouseBehaviorCallback.java │ ├── MouseRotate.java │ ├── MouseTranslate.java │ ├── MouseWheelZoom.java │ ├── MouseZoom.java │ └── package.html ├── picking │ ├── Intersect.java │ ├── PickMouseBehavior.java │ ├── PickObject.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html ├── sensor │ ├── Mouse6DPointerBehavior.java │ ├── SensorBeamEcho.java │ ├── SensorButtonListener.java │ ├── SensorEvent.java │ ├── SensorEventAgent.java │ ├── SensorGnomonEcho.java │ ├── SensorInputAdaptor.java │ ├── SensorReadListener.java │ └── package.html └── vp │ ├── OrbitBehavior.java │ ├── ViewPlatformAWTBehavior.java │ ├── ViewPlatformBehavior.java │ ├── WandViewBehavior.java │ └── package.html ├── compression ├── CommandStream.java ├── CompressedGeometryFile.java ├── CompressionStream.java ├── CompressionStreamColor.java ├── CompressionStreamElement.java ├── CompressionStreamNormal.java ├── CompressionStreamVertex.java ├── GeometryCompressor.java ├── HuffmanNode.java ├── HuffmanTable.java ├── MeshBuffer.java └── package.html ├── geometry ├── BBox.java ├── Basic.java ├── BottleNeck.java ├── Box.java ├── Bridge.java ├── Clean.java ├── ColorCube.java ├── Cone.java ├── Cylinder.java ├── Degenerate.java ├── Desperate.java ├── Distance.java ├── EarClip.java ├── Edge.java ├── EdgeTable.java ├── GeomBuffer.java ├── GeometryInfo.java ├── GeometryInfoGenerator.java ├── GeometryServiceImpl.java ├── Heap.java ├── HeapNode.java ├── Left.java ├── ListNode.java ├── NoHash.java ├── NormalGenerator.java ├── Numerics.java ├── Orientation.java ├── PntNode.java ├── Primitive.java ├── Project.java ├── Quadrics.java ├── Simple.java ├── Sphere.java ├── Stripifier.java ├── StripifierStats.java ├── Text2D.java ├── Triangle.java ├── Triangulator.java ├── compression │ ├── CommandStream.java │ ├── CompressedGeometryData.java │ ├── CompressedGeometryFile.java │ ├── CompressedGeometryRetained.java │ ├── CompressionStream.java │ ├── CompressionStreamColor.java │ ├── CompressionStreamElement.java │ ├── CompressionStreamNormal.java │ ├── CompressionStreamVertex.java │ ├── GeneralizedStrip.java │ ├── GeneralizedStripFlags.java │ ├── GeneralizedVertexList.java │ ├── GeometryCompressor.java │ ├── GeometryDecompressor.java │ ├── GeometryDecompressorShape3D.java │ ├── HuffmanNode.java │ ├── HuffmanTable.java │ ├── MeshBuffer.java │ └── package.html └── package.html ├── image ├── ImageException.java ├── TextureLoader.java └── package.html ├── pickfast ├── PickCanvas.java ├── PickIntersection.java ├── PickTool.java ├── behaviors │ ├── PickMouseBehavior.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html └── package.html ├── picking ├── PickCanvas.java ├── PickIntersection.java ├── PickResult.java ├── PickTool.java ├── behaviors │ ├── PickMouseBehavior.java │ ├── PickRotateBehavior.java │ ├── PickTranslateBehavior.java │ ├── PickZoomBehavior.java │ ├── PickingCallback.java │ └── package.html └── package.html ├── scenegraph ├── io │ ├── NamedObjectException.java │ ├── ObjectNotLoadedException.java │ ├── SceneGraphFileReader.java │ ├── SceneGraphFileWriter.java │ ├── SceneGraphIO.java │ ├── SceneGraphObjectReferenceControl.java │ ├── SceneGraphStateProvider.java │ ├── SceneGraphStreamReader.java │ ├── SceneGraphStreamWriter.java │ ├── UnresolvedBehavior.java │ ├── UnsupportedUniverseException.java │ ├── doc-files │ │ └── extensibility.html │ ├── package.html │ ├── retained │ │ ├── Controller.java │ │ ├── J3fInputStream.java │ │ ├── J3fOutputStream.java │ │ ├── PositionInputStream.java │ │ ├── PositionOutputStream.java │ │ ├── RandomAccessFileControl.java │ │ ├── SGIORuntimeException.java │ │ ├── StreamControl.java │ │ ├── SymbolTable.java │ │ └── SymbolTableData.java │ └── state │ │ ├── com │ │ └── sun │ │ │ └── j3d │ │ │ └── utils │ │ │ ├── behaviors │ │ │ ├── interpolators │ │ │ │ ├── KBRotPosScaleSplinePathInterpolatorState.java │ │ │ │ └── RotPosScaleTCBSplinePathInterpolatorState.java │ │ │ └── mouse │ │ │ │ └── MouseBehaviorState.java │ │ │ ├── geometry │ │ │ ├── BoxState.java │ │ │ ├── ColorCubeState.java │ │ │ ├── ConeState.java │ │ │ ├── CylinderState.java │ │ │ ├── PrimitiveState.java │ │ │ ├── SphereState.java │ │ │ └── Text2DState.java │ │ │ ├── image │ │ │ ├── ImageComponent2DURL.java │ │ │ ├── ImageComponent2DURLIOListener.java │ │ │ └── ImageComponent2DURLState.java │ │ │ └── universe │ │ │ ├── PlatformGeometryState.java │ │ │ ├── SimpleUniverseState.java │ │ │ └── ViewerAvatarState.java │ │ └── javax │ │ └── media │ │ └── j3d │ │ ├── AlphaState.java │ │ ├── AlternateAppearanceState.java │ │ ├── AmbientLightState.java │ │ ├── AppearanceState.java │ │ ├── AuralAttributesState.java │ │ ├── BackgroundSoundState.java │ │ ├── BackgroundState.java │ │ ├── BehaviorState.java │ │ ├── BillboardState.java │ │ ├── BoundingLeafState.java │ │ ├── BranchGroupState.java │ │ ├── ClipState.java │ │ ├── ColorInterpolatorState.java │ │ ├── ColoringAttributesState.java │ │ ├── CompressedGeometryState.java │ │ ├── ConeSoundState.java │ │ ├── DecalGroupState.java │ │ ├── DepthComponentFloatState.java │ │ ├── DepthComponentIntState.java │ │ ├── DepthComponentNativeState.java │ │ ├── DirectionalLightState.java │ │ ├── DistanceLODState.java │ │ ├── ExponentialFogState.java │ │ ├── FogState.java │ │ ├── Font3DState.java │ │ ├── GeometryArrayState.java │ │ ├── GeometryState.java │ │ ├── GeometryStripArrayState.java │ │ ├── GroupState.java │ │ ├── ImageComponent2DState.java │ │ ├── ImageComponent3DState.java │ │ ├── ImageComponentState.java │ │ ├── IndexedGeometryArrayState.java │ │ ├── IndexedGeometryStripArrayState.java │ │ ├── IndexedLineArrayState.java │ │ ├── IndexedLineStripArrayState.java │ │ ├── IndexedPointArrayState.java │ │ ├── IndexedQuadArrayState.java │ │ ├── IndexedTriangleArrayState.java │ │ ├── IndexedTriangleFanArrayState.java │ │ ├── IndexedTriangleStripArrayState.java │ │ ├── InterpolatorState.java │ │ ├── LODState.java │ │ ├── LeafState.java │ │ ├── LightState.java │ │ ├── LineArrayState.java │ │ ├── LineAttributesState.java │ │ ├── LineStripArrayState.java │ │ ├── LinearFogState.java │ │ ├── LinkState.java │ │ ├── MaterialState.java │ │ ├── MediaContainerState.java │ │ ├── ModelClipState.java │ │ ├── MorphState.java │ │ ├── NodeComponentState.java │ │ ├── NodeState.java │ │ ├── NullSceneGraphObjectState.java │ │ ├── OrderedGroupState.java │ │ ├── OrientedShape3DState.java │ │ ├── PathInterpolatorState.java │ │ ├── PointAttributesState.java │ │ ├── PointLightState.java │ │ ├── PointSoundState.java │ │ ├── PolygonAttributesState.java │ │ ├── PositionInterpolatorState.java │ │ ├── PositionPathInterpolatorState.java │ │ ├── QuadArrayState.java │ │ ├── RasterState.java │ │ ├── RenderingAttributesState.java │ │ ├── RotPosPathInterpolatorState.java │ │ ├── RotPosScalePathInterpolatorState.java │ │ ├── RotationInterpolatorState.java │ │ ├── RotationPathInterpolatorState.java │ │ ├── ScaleInterpolatorState.java │ │ ├── SceneGraphObjectState.java │ │ ├── Shape3DState.java │ │ ├── SharedGroupState.java │ │ ├── SoundState.java │ │ ├── SoundscapeState.java │ │ ├── SpotLightState.java │ │ ├── SwitchState.java │ │ ├── SwitchValueInterpolatorState.java │ │ ├── TexCoordGenerationState.java │ │ ├── Text3DState.java │ │ ├── Texture2DState.java │ │ ├── Texture3DState.java │ │ ├── TextureAttributesState.java │ │ ├── TextureCubeMapState.java │ │ ├── TextureState.java │ │ ├── TextureUnitStateState.java │ │ ├── TransformGroupState.java │ │ ├── TransformInterpolatorState.java │ │ ├── TransparencyAttributesState.java │ │ ├── TransparencyInterpolatorState.java │ │ ├── TriangleArrayState.java │ │ ├── TriangleFanArrayState.java │ │ ├── TriangleStripArrayState.java │ │ └── ViewPlatformState.java └── transparency │ ├── SimpleDistanceComparator.java │ ├── TransparencySortController.java │ └── package.html ├── shader ├── StringIO.java └── package.html └── universe ├── ConfigCommand.java ├── ConfigContainer.java ├── ConfigDevice.java ├── ConfigObject.java ├── ConfigPhysicalBody.java ├── ConfigPhysicalEnvironment.java ├── ConfigScreen.java ├── ConfigSensor.java ├── ConfigSexpression.java ├── ConfigView.java ├── ConfigViewPlatform.java ├── ConfigViewPlatformBehavior.java ├── ConfiguredUniverse.java ├── LocaleFactory.java ├── MultiTransformGroup.java ├── PlatformGeometry.java ├── SimpleUniverse.java ├── ViewInfo.java ├── Viewer.java ├── ViewerAvatar.java ├── ViewingPlatform.java ├── doc-files ├── config-examples.html ├── config-syntax.html ├── j3d1x1-behavior.html ├── j3d1x1-stereo.html ├── j3d1x1-vr.html ├── j3d1x1-window.html ├── j3d1x1.html ├── j3d1x2-flat.html ├── j3d1x2-rot30.html ├── j3d1x3-cave-vr.html ├── j3d1x3-cave.html ├── j3d1x3-rot45.html └── j3d2x2-flat.html └── package.html /COPYRIGHT.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hharrison/java3d-utils/0d39448522b11731a8d03e4a944c235478b14de0/COPYRIGHT.txt -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistribution of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistribution in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | Neither the name of Sun Microsystems, Inc. or the names of 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | This software is provided "AS IS," without a warranty of any 20 | kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 21 | WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 23 | EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 24 | NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 25 | USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 26 | DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 27 | ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 28 | CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 29 | REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 30 | INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGES. 32 | 33 | You acknowledge that this software is not designed, licensed or 34 | intended for use in the design, construction, operation or 35 | maintenance of any nuclear facility. 36 | -------------------------------------------------------------------------------- /README-FIRST.txt: -------------------------------------------------------------------------------- 1 | The source code for the j3d-core-utils project is copyrighted code 2 | that is licensed to individuals or companies who download or otherwise 3 | access the code. 4 | 5 | The copyright notice for this project is in COPYRIGHT.txt 6 | 7 | The source code license information for this project is in LICENSE.txt 8 | 9 | Additional information and license restrictions for third party source 10 | code are found in the THIRDPARTY-LICENSE-*.txt files. 11 | 12 | Instructions for building this project are in README-build.html 13 | -------------------------------------------------------------------------------- /README-build.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 49 | 51 | README-build: build instructions for the j3d-core-utils project 52 | 53 | 54 |

Building 55 | j3d-core-utils

56 |

The j3d-core-utils project is built as part of the j3d-core 57 | project. See the README-build.html 58 | file in the "j3d-core" directory for instructions.
59 |

60 | 61 | 62 | -------------------------------------------------------------------------------- /THIRDPARTY-LICENSE-FIST.txt: -------------------------------------------------------------------------------- 1 | The following additional information pertains to third party software 2 | included as part of this product. No additional restrictions are 3 | placed on this source code, except that this attribution must be 4 | distributed with the source code. 5 | 6 | com/sun/j3d/utils/geometry/ 7 | BBox.java, Basic.java, BottleNeck.java, Bridge.java, 8 | Clean.java, Degenerate.java, Desperate.java, Distance.java, 9 | EarClip.java, Heap.java, HeapNode.java, Left.java, 10 | ListNode.java, NoHash.java, Numerics.java, Orientation.java, 11 | PntNode.java, Project.java, Simple.java, Stripifier.java, 12 | StripifierStats.java, Triangle.java, Triangulator.java 13 | 14 | The reference to Fast Industrial Strength Triangulation (FIST) code 15 | in this release by Sun Microsystems is related to Sun's rewrite of 16 | an early version of FIST. FIST was originally created by Martin 17 | Held and Joseph Mitchell at Stony Brook University and is 18 | incorporated by Sun under an agreement with The Research Foundation 19 | of SUNY (RFSUNY). The current version of FIST is available for 20 | commercial use under a license agreement with RFSUNY on behalf of 21 | the authors and Stony Brook University. Please contact the Office 22 | of Technology Licensing at Stony Brook, phone 631-632-9009, for 23 | licensing information. 24 | -------------------------------------------------------------------------------- /THIRDPARTY-LICENSE-MAINFRAME.txt: -------------------------------------------------------------------------------- 1 | The following additional provisions apply to third party software 2 | included as part of this product. 3 | 4 | com/sun/j3d/utils/applet/ 5 | MainFrame.java - run an Applet as an application in AWT Frame 6 | JMainFrame.java - run an Applet as an application in Swing JFrame 7 | 8 | Copyright (C) 1996 by Jef Poskanzer . All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY 21 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY 24 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /src/META-INF/services/javax.media.j3d.GeometryService: -------------------------------------------------------------------------------- 1 | com.sun.j3d.utils.geometry.GeometryServiceImpl 2 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/JSAuralParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.audioengines.javasound; 41 | 42 | 43 | /** 44 | * The AudioDevice dependent sound node and aural attribute node parameters. 45 | * These are explicitly maintained for HaeSoundMixer 46 | */ 47 | 48 | public class JSAuralParameters extends com.sun.j3d.audioengines.AuralParameters { 49 | 50 | /** 51 | * Reverb Parameters 52 | * 53 | * dirty flag checked and cleared by render() 54 | */ 55 | static int REFLECTION_COEFF_CHANGED = 1; 56 | static int REVERB_DELAY_CHANGED = 2; 57 | static int REVERB_ORDER_CHANGED = 4; 58 | 59 | int reverbDirty = 0xFFFF; 60 | int lastReverbSpeed = 0; // TODO: NOT used yet 61 | boolean reverbFlag = false; // previously refered to as reverbOn 62 | int reverbType = 1; // Reverb type 1 equals NONE in JavaSound engine 63 | 64 | 65 | JSAuralParameters() { 66 | super(); 67 | reverbDirty = 0xFFFF; 68 | lastReverbSpeed = 0; 69 | reverbType = 1; 70 | reverbFlag = false; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/JSMidi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.audioengines.javasound; 41 | 42 | /** 43 | * The JSMidi class defines audio output methods that call the JavaSound 44 | * API methods for MIDI sounds. 45 | * 46 | *

47 | * NOTE: This class is not yet implemented. 48 | */ 49 | 50 | class JSMidi extends JSChannel { 51 | private static boolean warningReported = false; 52 | 53 | JSMidi() { 54 | // Report a "not implemented" warning message 55 | if (!warningReported) { 56 | System.err.println("***"); 57 | System.err.println("*** WARNING: JavaSoundMixer: MIDI sound not implemented"); 58 | System.err.println("***"); 59 | warningReported = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/JSStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.audioengines.javasound; 41 | 42 | /** 43 | * The JSStream class defines audio output methods that call the JavaSound 44 | * API methods for streams. 45 | * 46 | *

47 | * NOTE: This class is not yet implemented. 48 | */ 49 | 50 | class JSStream extends JSChannel { 51 | private static boolean warningReported = false; 52 | 53 | JSStream() { 54 | // Report a "not implemented" warning message 55 | if (!warningReported) { 56 | System.err.println("***"); 57 | System.err.println("*** WARNING: JavaSoundMixer: Streaming (uncached) audio not implemented"); 58 | System.err.println("***"); 59 | warningReported = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/javasound/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.audioengines.javasound 7 | 8 | 9 |

Provides a JavaSound-based implementation of a Java 3D audio device.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/audioengines/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.audioengines 7 | 8 | 9 |

Provides abstract classes for creating Java 3D audio devices.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/exp/swing/impl/AutoOffScreenCanvas3D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.exp.swing.impl; 41 | 42 | /** 43 | * Tagging interface for Java 3D off-screen Canvas3D objects that are 44 | * automatically rendered. This is used internally by the JCanvas3D 45 | * implementation. 46 | *

47 | * NOTE: this is an experimental interface, which is not intended for use 48 | * by applications. 49 | * 50 | * @author pepe 51 | * 52 | * @since Java 3D 1.5 53 | */ 54 | public interface AutoOffScreenCanvas3D extends javax.media.j3d.AutoOffScreenCanvas3D {} 55 | -------------------------------------------------------------------------------- /src/com/sun/j3d/exp/swing/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.exp.swing 7 | 8 | 9 |

EXPERIMENTAL: Provides a lightweight JCanvas3D class. 10 | Note that the API in this package is highly experimental and 11 | subject to change at any time.

12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/internal/J3dUtilsI18N.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.internal; 41 | 42 | import java.util.MissingResourceException; 43 | import java.util.ResourceBundle; 44 | 45 | 46 | public class J3dUtilsI18N { 47 | static public String getString(String key) { 48 | String s; 49 | try { 50 | s = ResourceBundle.getBundle("com.sun.j3d.ExceptionStrings").getString(key); 51 | } 52 | catch (MissingResourceException e) { 53 | System.err.println("J3dUtilsI18N: Error looking up: " + key); 54 | s = key; 55 | } 56 | return s; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/IncorrectFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders; 41 | 42 | 43 | /** 44 | * Exception used to indicate that a file of the incorrect 45 | * type was passed to a loader. 46 | */ 47 | public class IncorrectFormatException extends RuntimeException { 48 | 49 | public IncorrectFormatException() { 50 | super(); 51 | } 52 | 53 | public IncorrectFormatException(String s) { 54 | super(s); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/ParsingErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders; 41 | 42 | 43 | /** 44 | * Exception used to indicate that the loader encountered 45 | * a problem parsing the specified file. 46 | */ 47 | public class ParsingErrorException extends RuntimeException { 48 | 49 | public ParsingErrorException() { 50 | super(); 51 | } 52 | 53 | public ParsingErrorException(String s) { 54 | super(s); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/DebugOutput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | 43 | /** 44 | * This class has utility functions for printing out debugging information. 45 | */ 46 | 47 | class DebugOutput { 48 | 49 | int validOutput = 0; 50 | final static int TRACE = 1, VALUES = 2, MISC = 4, LINE_TRACE = 8; 51 | final static int NONE = 0, EXCEPTION = 16, TIME = 32, WARNING = 64; 52 | 53 | DebugOutput(int outputTypes) { 54 | validOutput = outputTypes; 55 | } 56 | 57 | void setValidOutput(int outputTypes) { 58 | validOutput = outputTypes; 59 | } 60 | 61 | int getValidOutput() { 62 | return validOutput; 63 | } 64 | 65 | void print(int outputType, String theOutput) { 66 | if ((outputType & validOutput) > 0) { 67 | System.out.print(theOutput); 68 | } 69 | } 70 | 71 | void println(int outputType, String theOutput) { 72 | if ((outputType & validOutput) > 0) 73 | System.out.println(theOutput); 74 | } 75 | 76 | } 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/LwsPrimitive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | 43 | 44 | import java.util.Vector; 45 | 46 | import javax.media.j3d.TransformGroup; 47 | 48 | /** 49 | * This is an interface which is implemented by LwsObject, 50 | * LwsFog, LwsBackground, LwsLight, etc. It provides a generic method 51 | * for objects to access some of the common data in these classes. 52 | */ 53 | 54 | interface LwsPrimitive { 55 | 56 | // interface from which other Lws types (Object, Camera, etc.) 57 | // inherit methods 58 | 59 | public Vector getObjectBehaviors(); 60 | 61 | public TransformGroup getObjectNode(); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/ParserObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.loaders.lw3d; 41 | 42 | /** 43 | * This class is a superclass of the binary parsing classes. It provides 44 | * some basic debugging utilities. 45 | */ 46 | 47 | class ParserObject { 48 | 49 | 50 | final static int TRACE = DebugOutput.TRACE, VALUES = DebugOutput.VALUES; 51 | final static int MISC = DebugOutput.MISC, LINE_TRACE = DebugOutput.LINE_TRACE; 52 | final static int NONE = DebugOutput.NONE, EXCEPTION = DebugOutput.EXCEPTION; 53 | final static int TIME = DebugOutput.TIME, WARNING = DebugOutput.WARNING; 54 | 55 | protected DebugOutput debugPrinter; 56 | 57 | 58 | ParserObject() { 59 | debugPrinter = new DebugOutput(EXCEPTION); 60 | } 61 | 62 | ParserObject(int debugVals) { 63 | this(); 64 | debugPrinter.setValidOutput(debugVals); 65 | } 66 | 67 | 68 | protected void debugOutputLn(int outputType, String theOutput) { 69 | if (theOutput.equals("")) 70 | debugPrinter.println(outputType, theOutput); 71 | else 72 | debugPrinter.println(outputType, 73 | getClass().getName() + "::" + theOutput); 74 | } 75 | 76 | protected void debugOutput(int outputType, String theOutput) { 77 | debugPrinter.print(outputType, theOutput); 78 | } 79 | 80 | 81 | 82 | } 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/lw3d/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.loaders.lw3d 7 | 8 | 9 |

Provides a Java 3D loader for Lightwave 3D scene files.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/objectfile/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.loaders.objectfile 7 | 8 | 9 |

Provides a Java 3D loader for Wavefront .obj files.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/loaders/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.loaders 7 | 8 | 9 |

Provides interfaces and abstract classes for writing Java 3D loaders.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/applet/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.applet 7 | 8 | 9 |

Provides utility classes for running applets as stand-alone 10 | applications.

11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/audio/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.audio 7 | 8 | 9 |

Provides audio utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/interpolators/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.interpolators 7 | 8 | 9 |

Provides spline-based interpolation behaviors.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/keyboard/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.keyboard 7 | 8 | 9 |

Provides keyboard navigation utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/mouse/MouseBehaviorCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.mouse; 41 | 42 | import javax.media.j3d.Transform3D; 43 | 44 | /** 45 | * The MouseBehaviorCallback interface allows a class to be notified 46 | * when the transform is changed by one of the MouseBehaviors. The 47 | * class that is interested in transform changes implements this 48 | * interface, and the object created with that class is registered 49 | * with the desired subclass of MouseBehavior using the 50 | * setupCallback method. When the transform changes, the 51 | * registered object's transformChanged method is 52 | * invoked. 53 | */ 54 | 55 | public interface MouseBehaviorCallback { 56 | 57 | public final static int ROTATE=0; 58 | public final static int TRANSLATE=1; 59 | public final static int ZOOM=2; 60 | 61 | /** 62 | * Classes implementing this interface that are registered with 63 | * one of the MouseBehaviors will be called every time the 64 | * behavior updates the Transform 65 | * @param type will be one of ROTATE, TRANSLATE or ZOOM 66 | */ 67 | public void transformChanged( int type, Transform3D transform ); 68 | } 69 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/mouse/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.mouse 7 | 8 | 9 |

Provides mouse navigation utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/picking/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.picking; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * @deprecated As of Java 3D version 1.2, replaced by 46 | * com.sun.j3d.utils.picking.behaviors.PickingCallback 47 | * 48 | * @see com.sun.j3d.utils.picking.behaviors.PickingCallback 49 | */ 50 | 51 | public interface PickingCallback { 52 | 53 | public final static int ROTATE=0; 54 | public final static int TRANSLATE=1; 55 | public final static int ZOOM=2; 56 | 57 | /** 58 | * The user made a selection but nothing was 59 | * actually picked 60 | */ 61 | public final static int NO_PICK=3; 62 | 63 | /** 64 | * Called by the Pick Behavior with which this callback 65 | * is registered each time the Picked object is moved 66 | */ 67 | public void transformChanged( int type, TransformGroup tg ); 68 | } 69 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/picking/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.picking 7 | 8 | 9 |

Deprecated: Use com.sun.j3d.utils.pickfast.behaviors 11 | instead.

12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/sensor/SensorInputAdaptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.sensor ; 41 | 42 | /** 43 | * The adaptor which receives sensor button and read events. The methods 44 | * in this class are empty; the ones of interest should be overridden by 45 | * classes extending this adaptor. 46 | * 47 | * @since Java 3D 1.3 48 | */ 49 | public class SensorInputAdaptor 50 | implements SensorButtonListener, SensorReadListener { 51 | 52 | @Override 53 | public void pressed(SensorEvent e) { 54 | } 55 | 56 | @Override 57 | public void released(SensorEvent e) { 58 | } 59 | 60 | @Override 61 | public void dragged(SensorEvent e) { 62 | } 63 | 64 | @Override 65 | public void clicked(SensorEvent e) { 66 | } 67 | 68 | @Override 69 | public void read(SensorEvent e) { 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/sensor/SensorReadListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.behaviors.sensor ; 41 | 42 | /** 43 | * This defines the interface for handling a sensor's read events in 44 | * conjuction with a SensorEventAgent instance. 45 | *

46 | * The events passed to this listener's methods are ephemeral; they 47 | * are only valid until the listener has returned. If a listener needs to 48 | * retain the event it must be copied using the 49 | * SensorEvent(SensorEvent) constructor. 50 | * 51 | * @see SensorEvent 52 | * @see SensorEventAgent 53 | * @see SensorButtonListener 54 | * @since Java 3D 1.3 55 | */ 56 | public interface SensorReadListener { 57 | /** 58 | * This method is called each time the dispatchEvents 59 | * method of SensorEventAgent is called and none of a 60 | * sensor's buttons have been handled by a button listener. The 61 | * sensor read value has not necessarily changed since the last read 62 | * event. 63 | * 64 | * @param e the sensor event 65 | */ 66 | public void read(SensorEvent e) ; 67 | } 68 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/sensor/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.sensor 7 | 8 | 9 |

Provides 6DOF sensor behavior classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/behaviors/vp/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.behaviors.vp 7 | 8 | 9 |

Provides ViewPlatform navigation utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/compression/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.compression 7 | 8 | 9 |

Deprecated: Use com.sun.j3d.utils.geometry.compression 11 | instead.

12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/Distance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | class Distance extends Object { 58 | int ind; 59 | double dist; 60 | 61 | Distance() { 62 | } 63 | 64 | void copy(Distance d) { 65 | ind = d.ind; 66 | dist = d.dist; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/Edge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.geometry; 41 | 42 | // Class created so that the two vertex indices that make up an 43 | // edge can be hashed. 44 | class Edge { 45 | 46 | public int v1; 47 | public int v2; 48 | private static final int HASHCONST = 0xEDCBA987; 49 | 50 | @Override 51 | public int hashCode() 52 | { 53 | return ((v1 * HASHCONST) << 2) ^ (v2 * HASHCONST); 54 | } // end of Edge.hashCode 55 | 56 | @Override 57 | public boolean equals(Object x) 58 | { 59 | if (!(x instanceof Edge)) return false; 60 | Edge e = (Edge)x; 61 | return (v1 == e.v1) && (v2 == e.v2); 62 | } // End of Edge.equals 63 | 64 | @Override 65 | public String toString() 66 | { 67 | return "(" + v1 + ", " + v2 + ")"; 68 | } // End of toString 69 | 70 | public Edge(int a, int b) 71 | { 72 | v1 = a; 73 | v2 = b; 74 | } 75 | 76 | public Edge(Edge e) 77 | { 78 | v1 = e.v1; 79 | v2 = e.v2; 80 | } 81 | 82 | public Edge() 83 | { 84 | } 85 | } // end of class Edge 86 | 87 | // End of file Edge.java 88 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/GeometryServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.sun.j3d.utils.geometry; 3 | 4 | import java.util.ArrayList; 5 | 6 | import javax.media.j3d.GeometryArray; 7 | import javax.media.j3d.GeometryService; 8 | import javax.vecmath.Point3f; 9 | 10 | /** 11 | * Default implementation of the {@link GeometryService} service interface. 12 | * 13 | * @author Curtis Rueden 14 | */ 15 | public class GeometryServiceImpl implements GeometryService { 16 | 17 | @Override 18 | public int triangulateIslands(final int[][] islandCounts, 19 | final Point3f[][] outVerts, final int[] contourCounts, 20 | final ArrayList triangData) 21 | { 22 | int vertOffset = 0; 23 | final NormalGenerator ng = new NormalGenerator(); 24 | for (int i = 0; i < islandCounts.length; i++) { 25 | contourCounts[0] = islandCounts[i].length; 26 | final GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY); 27 | gi.setCoordinates(outVerts[i]); 28 | gi.setStripCounts(islandCounts[i]); 29 | gi.setContourCounts(contourCounts); 30 | ng.generateNormals(gi); 31 | 32 | final GeometryArray ga = gi.getGeometryArray(false, false, false); 33 | vertOffset += ga.getVertexCount(); 34 | 35 | triangData.add(ga); 36 | } 37 | return vertOffset; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/HeapNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | class HeapNode { 58 | int index, prev, next; 59 | double ratio; 60 | 61 | HeapNode() { 62 | } 63 | 64 | void copy(HeapNode hNode) { 65 | index = hNode.index; 66 | prev = hNode.prev; 67 | next = hNode.next; 68 | ratio = hNode.ratio; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/Left.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | class Left extends Object { 58 | int ind; 59 | int index; 60 | 61 | Left() { 62 | } 63 | 64 | void copy(Left l) { 65 | ind = l.ind; 66 | index = l.index; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/ListNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | class ListNode { 58 | int index; 59 | int prev; 60 | int next; 61 | int convex; 62 | int vcntIndex; // Vertex, Color, Normal, Texture Index 63 | 64 | 65 | 66 | ListNode(int ind) { 67 | index = ind; 68 | prev = -1; 69 | next = -1; 70 | convex = 0; 71 | vcntIndex = -1; 72 | } 73 | 74 | void setCommonIndex(int comIndex) { 75 | vcntIndex = comIndex; 76 | 77 | } 78 | 79 | int getCommonIndex() { 80 | return vcntIndex; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/PntNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | // Placeholder list 58 | class PntNode extends Object { 59 | int pnt; 60 | int next; 61 | 62 | PntNode() { 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/Triangle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | // ---------------------------------------------------------------------- 41 | // 42 | // The reference to Fast Industrial Strength Triangulation (FIST) code 43 | // in this release by Sun Microsystems is related to Sun's rewrite of 44 | // an early version of FIST. FIST was originally created by Martin 45 | // Held and Joseph Mitchell at Stony Brook University and is 46 | // incorporated by Sun under an agreement with The Research Foundation 47 | // of SUNY (RFSUNY). The current version of FIST is available for 48 | // commercial use under a license agreement with RFSUNY on behalf of 49 | // the authors and Stony Brook University. Please contact the Office 50 | // of Technology Licensing at Stony Brook, phone 631-632-9009, for 51 | // licensing information. 52 | // 53 | // ---------------------------------------------------------------------- 54 | 55 | package com.sun.j3d.utils.geometry; 56 | 57 | class Triangle extends Object { 58 | int v1, v2, v3; // This store the index into the list array. 59 | // Not the index into vertex pool yet! 60 | 61 | Triangle(int a, int b, int c) { 62 | v1=a; v2=b; v3=c; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/compression/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.geometry.compression 7 | 8 | 9 |

Provides compressed geometry utility classes. 10 | This package supersedes the javax.media.j3d.CompressedGeometry class and 11 | the com.sun.j3d.utils.compression package.

12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/geometry/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.geometry 7 | 8 | 9 |

Provides geometry construction, triangulation, and optimization 10 | utility classes.

11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/image/ImageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.image; 41 | 42 | 43 | /** 44 | * Exception used to indicate that the texture loader encountered 45 | * a problem loading the specified image file. 46 | */ 47 | public class ImageException extends RuntimeException { 48 | 49 | public ImageException() { 50 | super(); 51 | } 52 | 53 | public ImageException(String s) { 54 | super(s); 55 | } 56 | 57 | public ImageException(Throwable t) { 58 | super(t); 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/image/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.image 7 | 8 | 9 |

Provides texture image utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/pickfast/behaviors/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.pickfast.behaviors; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * The PickingCallback interface allows a class to be notified when a 46 | * picked object is moved. The class that is interested in object 47 | * movement implements this interface, and the object created with 48 | * that class is registered with the desired subclass of 49 | * PickMouseBehavior using the setupCallback method. 50 | * When the picked object moves, the registered object's 51 | * transformChanged method is invoked. 52 | */ 53 | 54 | public interface PickingCallback { 55 | 56 | public final static int ROTATE=0; 57 | public final static int TRANSLATE=1; 58 | public final static int ZOOM=2; 59 | 60 | /** 61 | * The user made a selection but nothing was 62 | * actually picked 63 | */ 64 | public final static int NO_PICK=3; 65 | 66 | /** 67 | * Called by the Pick Behavior with which this callback 68 | * is registered each time the Picked object is moved 69 | */ 70 | public void transformChanged( int type, TransformGroup tg ); 71 | } 72 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/pickfast/behaviors/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.pickfast.behaviors 7 | 8 | 9 |

Provides picking behaviors for the new core picking methods.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/pickfast/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.pickfast 7 | 8 | 9 |

Provides picking utility classes for the new core picking methods.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/picking/behaviors/PickingCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.picking.behaviors; 41 | 42 | import javax.media.j3d.TransformGroup; 43 | 44 | /** 45 | * The PickingCallback interface allows a class to be notified when a 46 | * picked object is moved. The class that is interested in object 47 | * movement implements this interface, and the object created with 48 | * that class is registered with the desired subclass of 49 | * PickMouseBehavior using the setupCallback method. 50 | * When the picked object moves, the registered object's 51 | * transformChanged method is invoked. 52 | */ 53 | 54 | public interface PickingCallback { 55 | 56 | public final static int ROTATE=0; 57 | public final static int TRANSLATE=1; 58 | public final static int ZOOM=2; 59 | 60 | /** 61 | * The user made a selection but nothing was 62 | * actually picked 63 | */ 64 | public final static int NO_PICK=3; 65 | 66 | /** 67 | * Called by the Pick Behavior with which this callback 68 | * is registered each time the Picked object is moved 69 | */ 70 | public void transformChanged( int type, TransformGroup tg ); 71 | } 72 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/picking/behaviors/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.picking.behaviors 7 | 8 | 9 |

OBSOLETE: provides picking behaviors for the old picking 10 | methods.

11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/picking/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.picking 7 | 8 | 9 |

OBSOLETE: provides picking utility classes for the old 10 | picking methods.

11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/NamedObjectException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * An error has occurred while processing a named object 44 | */ 45 | public class NamedObjectException extends java.lang.Exception { 46 | 47 | /** 48 | * Creates new NoSuchNameException without detail message. 49 | */ 50 | public NamedObjectException() { 51 | } 52 | 53 | 54 | /** 55 | * Constructs an NoSuchNameException with the specified detail message. 56 | * @param msg the detail message. 57 | */ 58 | public NamedObjectException(String msg) { 59 | super(msg); 60 | } 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/ObjectNotLoadedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * The named object has not been loaded so it's instance can not be returned 44 | */ 45 | public class ObjectNotLoadedException extends java.lang.Exception { 46 | 47 | /** 48 | * Creates new ObjectNotLoadedException without detail message. 49 | */ 50 | public ObjectNotLoadedException() { 51 | } 52 | 53 | 54 | /** 55 | * Constructs an ObjectNotLoadedException with the specified detail message. 56 | * @param msg the detail message. 57 | */ 58 | public ObjectNotLoadedException(String msg) { 59 | super(msg); 60 | } 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/SceneGraphObjectReferenceControl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * Provides and resolves references to SceneGraphObjects to enable 44 | * persistant references in user defined SceneGraphObjects implementing 45 | * the SceneGraphIO interface. 46 | */ 47 | public interface SceneGraphObjectReferenceControl { 48 | 49 | /** 50 | * Add a reference to the scenegraph object specified and return 51 | * the nodeID for the object 52 | * 53 | * Use only during the save cycle 54 | */ 55 | public int addReference( javax.media.j3d.SceneGraphObject object ); 56 | 57 | /** 58 | * Given a nodeID return the corresponding scene graph object. 59 | * 60 | * Use only during the load cycle 61 | */ 62 | public javax.media.j3d.SceneGraphObject resolveReference( int nodeID ); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/SceneGraphStateProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState; 43 | 44 | /** 45 | * This interface allows developers to provide their own custom IO control for 46 | * subclasses of SceneGraphObjects. As the Scene Graph is being saved any 47 | * SceneGraphObject in the graph that implements this interface must provide 48 | * it's state class which is responsible for saving the entire state of 49 | * that object. 50 | */ 51 | public interface SceneGraphStateProvider { 52 | 53 | /** 54 | * Returns the State class 55 | * 56 | * @return Class that will perform the IO for the SceneGraphObject 57 | */ 58 | public Class getStateClass(); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/UnresolvedBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * This Behavior is used in place of any behaviors which can not 44 | * be instantiated when a scene graph is read. This behavior is 45 | * always disabled when it initalizes. It just provides an indicator 46 | * in the scene graph that a Behavior is missing. 47 | * 48 | * This normally means the Behavior is not present in the classpath. 49 | */ 50 | public class UnresolvedBehavior extends javax.media.j3d.Behavior { 51 | 52 | @Override 53 | public void initialize() { 54 | setEnable(false); 55 | } 56 | 57 | @Override 58 | public void processStimulus(java.util.Enumeration enumeration) { 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/UnsupportedUniverseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io; 41 | 42 | /** 43 | * Thrown if the VirtualUniverse subclass is not supported 44 | * by the writeUniverse calls. 45 | * 46 | * Currently only com.sun.j3d.utils.universe.SimpleUniverse is supported 47 | */ 48 | public class UnsupportedUniverseException extends java.lang.Exception { 49 | 50 | /** 51 | * Creates new UnsupportedUniverseException without detail message. 52 | */ 53 | public UnsupportedUniverseException() { 54 | } 55 | 56 | 57 | /** 58 | * Constructs an UnsupportedUniverseException with the specified detail message. 59 | * @param msg the detail message. 60 | */ 61 | public UnsupportedUniverseException(String msg) { 62 | super(msg); 63 | } 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/retained/PositionOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.retained; 41 | 42 | import java.io.IOException; 43 | 44 | class PositionOutputStream extends java.io.OutputStream { 45 | 46 | private long pos = 0; 47 | private java.io.OutputStream stream; 48 | 49 | public PositionOutputStream( java.io.OutputStream stream ) { 50 | this.stream = stream; 51 | } 52 | 53 | @Override 54 | public void write(int p1) throws IOException { 55 | pos++; 56 | stream.write(p1); 57 | } 58 | 59 | @Override 60 | public void write( byte[] b ) throws IOException { 61 | pos+= b.length; 62 | stream.write( b ); 63 | } 64 | 65 | @Override 66 | public void write( byte[] b, int off, int len ) throws IOException { 67 | pos+= len; 68 | stream.write( b, off, len ); 69 | } 70 | 71 | /** 72 | * Move the file pointer to the specified position. 73 | * The position MUST be greater or equal to the current position 74 | */ 75 | public void seekForward( long position ) throws IOException { 76 | if (pos>position) 77 | throw new SGIORuntimeException( "Seeking Backward "+pos +" "+position ); 78 | else 79 | for(int i=0; i< (int)(position-pos); i++) 80 | stream.write(0); 81 | 82 | pos = position; 83 | } 84 | 85 | public long getFilePointer() { 86 | return pos; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/retained/SGIORuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.retained; 41 | 42 | /** 43 | * This RuntimeException encapsulates a number of RuntimeErrors in the 44 | * IO system. 45 | * 46 | * This exception is always wrapped and thrown to the user as an IOException. In 47 | * the future this exception will be removed and the code will throw IOExceptions 48 | * internally instead. 49 | */ 50 | public class SGIORuntimeException extends java.lang.RuntimeException { 51 | 52 | /** 53 | * Constructs a new instance of SGIORuntimeException 54 | * without a detail message. 55 | */ 56 | public SGIORuntimeException() { 57 | } 58 | 59 | 60 | /** 61 | * Constructs an instance of SGIORuntimeException 62 | * with the specified detail message. 63 | * 64 | * @param msg the detail message. 65 | */ 66 | public SGIORuntimeException(String msg) { 67 | super(msg); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/behaviors/mouse/MouseBehaviorState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.behaviors.mouse; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.TransformGroup; 47 | 48 | import com.sun.j3d.utils.behaviors.mouse.MouseBehavior; 49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 51 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BehaviorState; 52 | 53 | public class MouseBehaviorState extends BehaviorState { 54 | 55 | private int target=0; 56 | 57 | public MouseBehaviorState(SymbolTableData symbol,Controller control) { 58 | super( symbol, control ); 59 | } 60 | 61 | @Override 62 | public void writeObject( DataOutput out ) throws IOException { 63 | super.writeObject( out ); 64 | 65 | out.writeInt( control.getSymbolTable().addReference( ((MouseBehavior)node).getTransformGroup() ) ); 66 | } 67 | 68 | @Override 69 | public void readObject( DataInput in ) throws IOException { 70 | super.readObject( in ); 71 | 72 | target = in.readInt(); 73 | } 74 | 75 | @Override 76 | public void buildGraph() { 77 | ((MouseBehavior)node).setTransformGroup( 78 | (TransformGroup)control.getSymbolTable().getJ3dNode( target ) ); 79 | 80 | super.buildGraph(); // This must be the last call in the method 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/geometry/PrimitiveState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.geometry; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import com.sun.j3d.utils.geometry.Primitive; 47 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 48 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 49 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState; 50 | 51 | public class PrimitiveState extends GroupState { 52 | 53 | protected int primflags; 54 | 55 | public PrimitiveState( SymbolTableData symbol, Controller control ) { 56 | super( symbol, control ); 57 | 58 | } 59 | 60 | @Override 61 | public void writeConstructorParams( DataOutput out ) throws IOException { 62 | super.writeConstructorParams( out ); 63 | 64 | out.writeInt( ((Primitive)node).getPrimitiveFlags() ); 65 | } 66 | 67 | @Override 68 | public void readConstructorParams( DataInput in ) throws IOException { 69 | super.readConstructorParams(in); 70 | 71 | primflags = in.readInt(); 72 | } 73 | 74 | @Override 75 | public void buildGraph() { 76 | super.buildGraph(); // This must be the last call in the method 77 | } 78 | 79 | /** 80 | * Returns true if the groups children should be saved. 81 | * 82 | * This is overridden by 'black box' groups such a geometry primitives 83 | */ 84 | @Override 85 | protected boolean processChildren() { 86 | return false; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/image/ImageComponent2DURLIOListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.image; 41 | 42 | /** 43 | * The listener interface which is called when a ImageComponent2DURL is 44 | * loaded from the scenegraph file 45 | */ 46 | public interface ImageComponent2DURLIOListener { 47 | 48 | /** 49 | * The listener method which is called when a ImageComponent2DURL is 50 | * loaded from the scenegraph file. 51 | * 52 | * This method must return a valid ImageComponent2DURL, the returned object 53 | * will be placed in the scene graph. 54 | * 55 | * @param format The image format from ImageComponent 56 | * @param width The image width from ImageComponent 57 | * @param height The image height from ImageComponent 58 | * @param byReference The byReference flag from ImageComponent 59 | * @param yUp The yUp flag from ImageComponent 60 | * @param url The URL for the image component 61 | */ 62 | public ImageComponent2DURL createImageComponent( 63 | int format, int width, int height, boolean byReference, boolean yUp, 64 | java.net.URL url ); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/universe/PlatformGeometryState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.universe; 41 | 42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 44 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BranchGroupState; 45 | import com.sun.j3d.utils.universe.PlatformGeometry; 46 | 47 | public class PlatformGeometryState extends BranchGroupState { 48 | 49 | public PlatformGeometryState(SymbolTableData symbol,Controller control) { 50 | super(symbol, control); 51 | } 52 | 53 | 54 | @Override 55 | protected javax.media.j3d.SceneGraphObject createNode() { 56 | return new PlatformGeometry(); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/com/sun/j3d/utils/universe/ViewerAvatarState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.com.sun.j3d.utils.universe; 41 | 42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 44 | import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.BranchGroupState; 45 | import com.sun.j3d.utils.universe.ViewerAvatar; 46 | 47 | public class ViewerAvatarState extends BranchGroupState { 48 | 49 | public ViewerAvatarState(SymbolTableData symbol,Controller control) { 50 | super(symbol, control); 51 | } 52 | 53 | @Override 54 | protected javax.media.j3d.SceneGraphObject createNode() { 55 | return new ViewerAvatar(); 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/AmbientLightState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import javax.media.j3d.AmbientLight; 43 | 44 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 45 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 46 | 47 | public class AmbientLightState extends LightState { 48 | 49 | public AmbientLightState( SymbolTableData symbol, Controller control ) { 50 | super( symbol, control ); 51 | } 52 | @Override 53 | protected javax.media.j3d.SceneGraphObject createNode() { 54 | return new AmbientLight(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BackgroundSoundState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.BackgroundSound; 47 | import javax.media.j3d.SceneGraphObject; 48 | 49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 51 | 52 | public class BackgroundSoundState extends SoundState { 53 | 54 | public BackgroundSoundState(SymbolTableData symbol,Controller control) { 55 | super( symbol, control ); 56 | 57 | } 58 | 59 | @Override 60 | public void writeObject( DataOutput out ) throws IOException { 61 | super.writeObject( out ); 62 | } 63 | 64 | @Override 65 | public void readObject( DataInput in ) throws IOException { 66 | super.readObject( in ); 67 | } 68 | 69 | @Override 70 | protected SceneGraphObject createNode() { 71 | return new BackgroundSound(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BoundingLeafState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.BoundingLeaf; 47 | import javax.media.j3d.SceneGraphObject; 48 | 49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 51 | 52 | public abstract class BoundingLeafState extends SceneGraphObjectState { 53 | 54 | public BoundingLeafState(SymbolTableData symbol,Controller control) { 55 | super(symbol, control); 56 | } 57 | 58 | @Override 59 | public void writeObject( DataOutput out ) throws 60 | IOException { 61 | 62 | super.writeObject( out ); 63 | 64 | control.writeBounds( out, ((BoundingLeaf)node).getRegion() ); 65 | } 66 | 67 | @Override 68 | public void readObject( DataInput in ) throws 69 | IOException { 70 | super.readObject(in); 71 | 72 | ((BoundingLeaf)node).setRegion( control.readBounds(in) ); 73 | } 74 | 75 | @Override 76 | protected SceneGraphObject createNode() { 77 | return new BoundingLeaf(); 78 | } 79 | 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/BranchGroupState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import javax.media.j3d.BranchGroup; 43 | import javax.media.j3d.SceneGraphObject; 44 | 45 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 46 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 47 | 48 | public class BranchGroupState extends GroupState { 49 | 50 | /** Creates new BranchGroupState */ 51 | public BranchGroupState( SymbolTableData symbol, Controller control ) { 52 | super( symbol, control ); 53 | } 54 | 55 | @Override 56 | protected SceneGraphObject createNode() { 57 | return new BranchGroup(); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ColoringAttributesState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.ColoringAttributes; 47 | import javax.media.j3d.SceneGraphObject; 48 | import javax.vecmath.Color3f; 49 | 50 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 51 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 52 | 53 | public class ColoringAttributesState extends NodeComponentState { 54 | 55 | public ColoringAttributesState( SymbolTableData symbol, Controller control ) { 56 | super(symbol, control); 57 | } 58 | 59 | @Override 60 | public void writeObject( DataOutput out ) throws IOException { 61 | super.writeObject( out ); 62 | ColoringAttributes attr = (ColoringAttributes)node; 63 | Color3f clr = new Color3f(); 64 | attr.getColor( clr ); 65 | control.writeColor3f( out, clr ); 66 | out.writeInt( attr.getShadeModel() ); 67 | } 68 | 69 | @Override 70 | public void readObject( DataInput in ) throws IOException { 71 | super.readObject( in ); 72 | ColoringAttributes attr = (ColoringAttributes)node; 73 | attr.setColor( control.readColor3f(in) ); 74 | attr.setShadeModel( in.readInt() ); 75 | } 76 | 77 | @Override 78 | protected SceneGraphObject createNode() { 79 | return new ColoringAttributes(); 80 | } 81 | 82 | 83 | } 84 | 85 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/DecalGroupState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import javax.media.j3d.DecalGroup; 43 | import javax.media.j3d.SceneGraphObject; 44 | 45 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 46 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 47 | 48 | public class DecalGroupState extends GroupState { 49 | 50 | /** Creates new BranchGroupState */ 51 | public DecalGroupState(SymbolTableData symbol,Controller control) { 52 | super( symbol, control ); 53 | } 54 | 55 | @Override 56 | protected SceneGraphObject createNode() { 57 | return new DecalGroup(); 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/DirectionalLightState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.DirectionalLight; 47 | import javax.vecmath.Vector3f; 48 | 49 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 50 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 51 | 52 | public class DirectionalLightState extends LightState { 53 | 54 | public DirectionalLightState( SymbolTableData symbol, Controller control ) { 55 | super( symbol, control ); 56 | 57 | } 58 | 59 | @Override 60 | public void writeObject( DataOutput out ) throws IOException { 61 | super.writeObject( out ); 62 | Vector3f dir = new Vector3f(); 63 | ((DirectionalLight)node).getDirection( dir ); 64 | 65 | control.writeVector3f( out, dir ); 66 | } 67 | 68 | @Override 69 | public void readObject( DataInput in ) throws IOException { 70 | super.readObject( in ); 71 | ((DirectionalLight)node).setDirection( control.readVector3f(in) ); 72 | } 73 | 74 | @Override 75 | protected javax.media.j3d.SceneGraphObject createNode() { 76 | return new DirectionalLight(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ExponentialFogState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.ExponentialFog; 47 | 48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 50 | 51 | public class ExponentialFogState extends FogState { 52 | 53 | public ExponentialFogState(SymbolTableData symbol,Controller control) { 54 | super( symbol, control ); 55 | } 56 | 57 | @Override 58 | public void writeObject( DataOutput out ) throws IOException { 59 | super.writeObject( out ); 60 | 61 | out.writeFloat( ((ExponentialFog)node).getDensity() ); 62 | } 63 | 64 | @Override 65 | public void readObject( DataInput in ) throws IOException { 66 | super.readObject( in ); 67 | 68 | ((ExponentialFog)node).setDensity( in.readFloat() ); 69 | } 70 | 71 | @Override 72 | protected javax.media.j3d.SceneGraphObject createNode() { 73 | return new ExponentialFog(); 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/GeometryState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 43 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 44 | 45 | public abstract class GeometryState extends NodeComponentState { 46 | 47 | public GeometryState( SymbolTableData symbol, Controller control ) { 48 | super(symbol, control); 49 | } 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/GeometryStripArrayState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.GeometryStripArray; 47 | 48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 50 | 51 | public abstract class GeometryStripArrayState extends GeometryArrayState { 52 | 53 | protected int[] stripVertexCounts; 54 | 55 | public GeometryStripArrayState( SymbolTableData symbol, Controller control ) { 56 | super( symbol, control ); 57 | } 58 | 59 | @Override 60 | protected void writeConstructorParams( DataOutput out ) throws 61 | IOException { 62 | super.writeConstructorParams( out ); 63 | 64 | stripVertexCounts = new int[((GeometryStripArray)node).getNumStrips()]; 65 | ((GeometryStripArray)node).getStripVertexCounts( stripVertexCounts ); 66 | 67 | out.writeInt(stripVertexCounts.length); 68 | for(int i=0; i1) 63 | ((NodeComponent)this.node).setDuplicateOnCloneTree(in.readBoolean()); 64 | 65 | } 66 | 67 | @Override 68 | public void writeObject( DataOutput out ) throws IOException { 69 | super.writeObject(out); 70 | out.writeBoolean(((NodeComponent)this.node).getDuplicateOnCloneTree()); 71 | } 72 | 73 | /** 74 | * Called when this component reference count is incremented. 75 | * Allows this component to update the reference count of any components 76 | * that it references. 77 | */ 78 | public void addSubReference() { 79 | } 80 | 81 | } 82 | 83 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/NodeState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.Node; 47 | 48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 50 | 51 | public class NodeState extends SceneGraphObjectState { 52 | 53 | public NodeState( SymbolTableData symbol, Controller control ) { 54 | super(symbol, control); 55 | } 56 | 57 | @Override 58 | public void writeObject( DataOutput out ) throws 59 | IOException { 60 | 61 | super.writeObject( out ); 62 | 63 | control.writeBounds( out, ((Node)node).getBounds() ); 64 | 65 | out.writeBoolean( ((Node)node).getPickable() ); 66 | out.writeBoolean( ((Node)node).getCollidable() ); 67 | out.writeBoolean( ((Node)node).getBoundsAutoCompute() ); 68 | 69 | } 70 | 71 | @Override 72 | public void readObject( DataInput in ) throws 73 | IOException { 74 | super.readObject(in); 75 | 76 | ((Node)node).setBounds( control.readBounds(in) ); 77 | 78 | ((Node)node).setPickable( in.readBoolean() ); 79 | ((Node)node).setCollidable( in.readBoolean() ); 80 | ((Node)node).setBoundsAutoCompute( in.readBoolean() ); 81 | } 82 | 83 | 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/OrderedGroupState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; 41 | 42 | import java.io.DataInput; 43 | import java.io.DataOutput; 44 | import java.io.IOException; 45 | 46 | import javax.media.j3d.OrderedGroup; 47 | 48 | import com.sun.j3d.utils.scenegraph.io.retained.Controller; 49 | import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData; 50 | 51 | public class OrderedGroupState extends GroupState { 52 | 53 | /** Creates new BranchGroupState */ 54 | public OrderedGroupState(SymbolTableData symbol,Controller control) { 55 | super( symbol, control ); 56 | } 57 | 58 | @Override 59 | public void writeObject( DataOutput out ) throws IOException { 60 | super.writeObject( out ); 61 | 62 | int[] childIndexOrder = ((OrderedGroup)node).getChildIndexOrder(); 63 | out.writeInt( childIndexOrder.length ); 64 | for ( int i=0;i { 53 | 54 | /** Creates a new instance of SimpleDistanceComparator */ 55 | public SimpleDistanceComparator() { 56 | } 57 | 58 | /** 59 | * Compares its two arguments for order. Returns a negative integer, zero, 60 | * or a positive integer as the first argument is less than (closer to the viewer), 61 | * equal to, or greater than (further from the viewer) the second argument. 62 | * 63 | * The compare method will be called with 2 objects of type 64 | * TransparencySortGeom and it's result should indicate which object is 65 | * closer to the viewer. Object1 < Object2 if it is to be considered closer 66 | * and rendered after. 67 | * 68 | * @param t1 TransparencySortGeom object 1 69 | * @param t2 TransparencySortGeom object 2 70 | * 71 | */ 72 | @Override 73 | public int compare(TransparencySortGeom t1, TransparencySortGeom t2) { 74 | double f = t1.getDistanceSquared()-t2.getDistanceSquared(); 75 | if (f<0) 76 | return -1; 77 | if (f==0) 78 | return 0; 79 | 80 | return 1; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/scenegraph/transparency/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.scenegraph.transparency 7 | 8 | 9 |

Provides transparency sorting utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/shader/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.shader 7 | 8 | 9 |

Provides shader utility classes.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/ConfigDevice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe ; 41 | import javax.media.j3d.InputDevice; 42 | 43 | /** 44 | * Mostly empty now; ConfigObject provides all required methods. 45 | */ 46 | class ConfigDevice extends ConfigObject { 47 | /** 48 | * The corresponding Java 3D core InputDevice instance. 49 | */ 50 | InputDevice j3dInputDevice ; 51 | 52 | /** 53 | * Instantiate an InputDevice of the given class name. 54 | * 55 | * @return the InputDevice, or null if error 56 | */ 57 | InputDevice createInputDevice() { 58 | j3dInputDevice = (InputDevice)createTargetObject() ; 59 | return j3dInputDevice ; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/LocaleFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.HiResCoord; 43 | import javax.media.j3d.Locale; 44 | import javax.media.j3d.VirtualUniverse; 45 | 46 | /** 47 | * This interface defines a factory for creating Locale objects in a 48 | * SimpleUniverse. Implementations of the createLocale methods in 49 | * this interface should construct a new Locale object from the 50 | * specified parameters. This class is used by the SimpleUniverse 51 | * class to construct the default Locale used to hold the view and 52 | * content branch graphs. 53 | * 54 | * @see Locale 55 | * @see ConfiguredUniverse 56 | * @see SimpleUniverse 57 | * 58 | * @since Java 3D 1.3 59 | */ 60 | public interface LocaleFactory { 61 | /** 62 | * Creates a new Locale object at the specified high resolution 63 | * coordinate in the specified universe. 64 | * 65 | * @param universe the VirtualUniverse in which to create the Locale 66 | * @param hiRes the high resolution coordinate that defines the origin 67 | * of the Locale 68 | */ 69 | public Locale createLocale(VirtualUniverse universe, HiResCoord hiRes); 70 | 71 | /** 72 | * Creates a new Locale object at (0, 0, 0) in the specified universe. 73 | * 74 | * @param universe the VirtualUniverse in which to create the Locale 75 | */ 76 | public Locale createLocale(VirtualUniverse universe); 77 | } 78 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/PlatformGeometry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.BranchGroup; 43 | 44 | /** 45 | * This class holds any geometry that should be associated with the 46 | * ViewingPlatform object. To create a scene with a dashboard, for 47 | * instance, a programmer would place the dashboard geometry under 48 | * the PlatformGeometry node. 49 | * 50 | * @see ViewingPlatform 51 | */ 52 | public class PlatformGeometry extends BranchGroup { 53 | 54 | /** 55 | * Constructs an instance of the PlatformGeometry node. 56 | */ 57 | public PlatformGeometry() { 58 | setCapability(ALLOW_DETACH); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/ViewerAvatar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistribution of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 25 | * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 26 | * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 27 | * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 28 | * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, 29 | * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND 30 | * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR 31 | * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that this software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | * 38 | */ 39 | 40 | package com.sun.j3d.utils.universe; 41 | 42 | import javax.media.j3d.BranchGroup; 43 | 44 | /** 45 | * This class holds geomtry that should be associated with the View's 46 | * avatar. An avatar is how the user's "virtual self" appears in the 47 | * virtual world. 48 | * 49 | * @see Viewer 50 | */ 51 | public class ViewerAvatar extends BranchGroup { 52 | 53 | /** 54 | * Constructs an instance of the ViewerAvatar node. 55 | */ 56 | public ViewerAvatar() { 57 | setCapability(ALLOW_DETACH); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1-stereo.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 | j3d1x1-stereo config file 50 | 51 | 52 | 53 |
54 | /*
55 |  ************************************************************************
56 |  *  
57 |  * Java 3D configuration file for single fullscreen stereo desktop
58 |  * configuration with no head tracking.
59 |  *  
60 |  ************************************************************************
61 |  */
62 | 
63 | (NewScreen center 0)
64 | (ScreenProperty center WindowSize NoBorderFullScreen)
65 | 
66 | // Define the physical body.
67 | //
68 | // The head origin is halfway between the eyes, with X extending to the right,
69 | // Y up, and positive Z extending into the skull.
70 | // 
71 | (NewPhysicalBody SiteUser)
72 | 
73 | // Set the interpupilary distance.  This sets the LeftEyePosition and
74 | // RightEyePosition to offsets of half this distance along both directions of
75 | // the X axis.
76 | // 
77 | (PhysicalBodyProperty SiteUser StereoEyeSeparation 0.066)
78 | 
79 | // Create a view using the defined screen and physical body.
80 | //
81 | (NewView view0)
82 | (ViewProperty view0 Screen       center)
83 | (ViewProperty view0 PhysicalBody SiteUser)
84 | 
85 | // Enable stereo viewing.
86 | // 
87 | (ViewProperty view0 StereoEnable true)
88 | 
89 | 90 | 91 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1-window.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 | j3d1x1-window config file 50 | 51 | 52 | 53 |
54 | /*
55 |  ************************************************************************
56 |  *  
57 |  * Java 3D configuration file for a conventional single screen, windowed
58 |  * desktop configuration.
59 |  *  
60 |  ************************************************************************
61 |  */
62 | 
63 | (NewWindow window1 0)
64 | (WindowProperty window1 WindowSize (700.0 700.0))
65 | 
66 | (NewView view1)
67 | (ViewProperty view1 Window window1)
68 | 
69 | 70 | 71 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/doc-files/j3d1x1.html: -------------------------------------------------------------------------------- 1 | 46 | 47 | 48 | 49 | j3d1x1 config file 50 | 51 | 52 | 53 |
54 | /*
55 |  ************************************************************************
56 |  *  
57 |  * Java 3D configuration file for a single fullscreen desktop configuration.
58 |  *  
59 |  ************************************************************************
60 |  */
61 | 
62 | (NewWindow big 0)
63 | (WindowProperty big WindowSize NoBorderFullScreen)
64 | 
65 | (NewView view0)
66 | (ViewProperty view0 Window big)
67 | 
68 | 69 | 70 | -------------------------------------------------------------------------------- /src/com/sun/j3d/utils/universe/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | com.sun.j3d.utils.universe 7 | 8 | 9 |

Provides utility classes for setting up the Java 3D universe, 10 | including the viewing configuration.

11 | 12 | 13 | --------------------------------------------------------------------------------