/** * Writes a value for the <code>orientation</code> property as a <code>unitQuaternion</code> * value. The <code>orientation</code> property specifies the orientation of the object in the * world. The orientation has no direct visual representation, but it is used to orient models, * cones, and pyramids attached to the object. * * @param value The value. */ public final void writeOrientationProperty(UnitQuaternion value) { { cesiumlanguagewriter.OrientationCesiumWriter writer = openOrientationProperty(); try { writer.writeUnitQuaternion(value); } finally { DisposeHelper.dispose(writer); } } }
/** * Writes a value for the <code>orientation</code> property as a <code>unitQuaternion</code> * value. The <code>orientation</code> property specifies the orientation of the object in the * world. The orientation has no direct visual representation, but it is used to orient models, * cones, and pyramids attached to the object. * * @param dates The dates at which the rotation is specified. * @param values The values corresponding to each date. */ public final void writeOrientationProperty(List<JulianDate> dates, List<UnitQuaternion> values) { { cesiumlanguagewriter.OrientationCesiumWriter writer = openOrientationProperty(); try { writer.writeUnitQuaternion(dates, values); } finally { DisposeHelper.dispose(writer); } } }
@Test @Ignore public final void sandbox() { JulianDate date = new JulianDate(2451545.0); { StringWriter sw = new StringWriter(); try { CesiumOutputStream output = new CesiumOutputStream(sw); output.setPrettyFormatting(true); CesiumStreamWriter writer = new CesiumStreamWriter(); { PacketCesiumWriter packet = writer.openPacket(output); try { packet.writeId("MyID"); packet.writeAvailability(date, date.addDays(1.0)); { PositionCesiumWriter position = packet.openPositionProperty(); try { { CesiumIntervalListWriter<cesiumlanguagewriter.PositionCesiumWriter> intervalList = position.openMultipleIntervals(); try { { PositionCesiumWriter interval = intervalList.openInterval(); try { interval.writeInterval(new TimeInterval(date, date.addDays(1.0))); interval.writeCartesian(new Cartesian(1.0, 2.0, 3.0)); } finally { DisposeHelper.dispose(interval); } } { PositionCesiumWriter interval = intervalList.openInterval(date.addDays(1.0), date.addDays(2.0)); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); ArrayList<cesiumlanguagewriter.Cartographic> positions = new ArrayList<cesiumlanguagewriter.Cartographic>(); dates.add(date.addDays(1.0)); positions.add(Cartographic.getZero()); dates.add(date.addDays(1.5)); positions.add(new Cartographic(1.0, 0.0, 0.0)); dates.add(date.addDays(2.0)); positions.add(new Cartographic(0.0, 1.0, 0.0)); interval.writeCartographicRadians(dates, positions); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(intervalList); } } } finally { DisposeHelper.dispose(position); } } { OrientationCesiumWriter orientation = packet.openOrientationProperty(); try { { CesiumIntervalListWriter<cesiumlanguagewriter.OrientationCesiumWriter> intervalList = orientation.openMultipleIntervals(); try { { OrientationCesiumWriter interval = intervalList.openInterval(); try { interval.writeAxes("MyMadeUpAxes"); interval.writeInterval(new TimeInterval(date, date.addDays(1.0))); interval.writeUnitQuaternion(new UnitQuaternion(1D, 0D, 0D, 0D)); } finally { DisposeHelper.dispose(interval); } } { OrientationCesiumWriter interval = intervalList.openInterval(); try { interval.writeInterpolationAlgorithm(CesiumInterpolationAlgorithm.LINEAR); interval.writeInterpolationDegree(1); ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); ArrayList<cesiumlanguagewriter.UnitQuaternion> orientations = new ArrayList<cesiumlanguagewriter.UnitQuaternion>(); dates.add(date.addDays(1.0)); orientations.add(UnitQuaternion.getIdentity()); dates.add(date.addDays(1.5)); orientations.add(new UnitQuaternion(0.0, 1.0, 0.0, 0.0)); dates.add(date.addDays(2.0)); orientations.add(new UnitQuaternion(0.0, 0.0, 1.0, 0.0)); interval.writeUnitQuaternion(dates, orientations); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(intervalList); } } } finally { DisposeHelper.dispose(orientation); } } } finally { DisposeHelper.dispose(packet); } } ConsoleHelper.writeLine(sw.toString()); } finally { DisposeHelper.dispose(sw); } } }