/** * Copies this instance and returns the copy. * @return The copy. */ @Override public PositionCesiumWriter clone() { return new PositionCesiumWriter(this); }
/** * Writes the value expressed as a {@code cartesian}, which is the position specified as a three-dimensional Cartesian value, {@code [X, Y, Z]}, in meters relative to the {@code referenceFrame}. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writeCartesian(List<JulianDate> dates, List<Cartesian> values) { writeCartesian(dates, values, 0, dates.size()); }
/** * Writes the value expressed as a {@code cartographicDegrees}, which is the position specified in Cartographic WGS84 coordinates, {@code [Longitude, Latitude, Height]}, where Longitude and Latitude are in degrees and Height is in meters. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writeCartographicDegrees(List<JulianDate> dates, List<Cartographic> values) { writeCartographicDegrees(dates, values, 0, dates.size()); }
/** * Writes the value expressed as a {@code cartographicDegrees}, which is the position specified in Cartographic WGS84 coordinates, {@code [Longitude, Latitude, Height]}, where Longitude and Latitude are in degrees and Height is in meters. * @param dates The dates at which the value is specified. * @param values The position corresponding to each date. * @param startIndex The index of the first element to write. * @param length The number of elements to write. */ public final void writeCartographicDegrees(List<JulianDate> dates, List<Cartographic> values, int startIndex, int length) { final String PropertyName = CartographicDegreesPropertyName; openIntervalIfNecessary(); CesiumWritingHelper.writeCartographic(getOutput(), PropertyName, dates, values, startIndex, length); }
try { cesiumlanguagewriter.CesiumIntervalListWriter<cesiumlanguagewriter.PositionCesiumWriter> intervalListWriter = positionWriter.openMultipleIntervals(); try { interval.writeInterval(interval1); interval.writeCartesian(interval1Position); } finally { DisposeHelper.dispose(interval); interval.writeCartographicRadians(interval2SampleDates, interval2SamplePositions); } finally { DisposeHelper.dispose(interval);
@Test public final void cartographicRadiansValueWritesEmptyArrayAndDoesNotWriteEpochWhenGivenAnEmptyCollection() { { final PacketCesiumWriter usingExpression_8 = (getPacket()); try { { PositionCesiumWriter position = getPacket().openPositionProperty(); try { { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); ArrayList<cesiumlanguagewriter.Cartographic> positions = new ArrayList<cesiumlanguagewriter.Cartographic>(); interval.writeCartographicRadians(dates, positions); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(position); } } } finally { DisposeHelper.dispose(usingExpression_8); } } Assert.assertEquals("{\"position\":{\"cartographicRadians\":[]}}", getStringWriter().toString()); }
@Test public final void cartesianValueWritesEmptyArrayAndDoesNotWriteEpochWhenGivenAnEmptyCollection() { { final PacketCesiumWriter usingExpression_7 = (getPacket()); try { { PositionCesiumWriter position = getPacket().openPositionProperty(); try { { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); ArrayList<cesiumlanguagewriter.Cartesian> positions = new ArrayList<cesiumlanguagewriter.Cartesian>(); interval.writeCartesian(dates, positions); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(position); } } } finally { DisposeHelper.dispose(usingExpression_7); } } Assert.assertEquals("{\"position\":{\"cartesian\":[]}}", getStringWriter().toString()); }
/** * Writes the value expressed as a {@code cartographicRadians}, which is the position specified in Cartographic WGS84 coordinates, {@code [Longitude, Latitude, Height]}, where Longitude and Latitude are in radians and Height is in meters. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writeCartographicRadians(List<JulianDate> dates, List<Cartographic> values) { writeCartographicRadians(dates, values, 0, dates.size()); }
@Test public final void referenceFrameValueWritesReferenceFrameProperty() { { final PacketCesiumWriter usingExpression_0 = (getPacket()); try { { PositionCesiumWriter position = getPacket().openPositionProperty(); try { { PositionCesiumWriter interval = position.openInterval(); try { interval.writeReferenceFrame("myReferenceFrame"); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(position); } } } finally { DisposeHelper.dispose(usingExpression_0); } } Assert.assertEquals("{\"position\":{\"referenceFrame\":\"myReferenceFrame\"}}", getStringWriter().toString()); }
/** * Writes the value expressed as a {@code cartesianVelocity}, which is the position and velocity specified as a three-dimensional Cartesian value and its derivative, {@code [X, Y, Z, dX, dY, dZ]}, in meters relative to the {@code referenceFrame}. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writeCartesianVelocity(List<JulianDate> dates, List<Motion1<Cartesian>> values) { writeCartesianVelocity(dates, values, 0, dates.size()); }
/** * Writes the value expressed as a {@code cartographicRadians}, which is the position specified in Cartographic WGS84 coordinates, {@code [Longitude, Latitude, Height]}, where Longitude and Latitude are in radians and Height is in meters. * @param dates The dates at which the value is specified. * @param values The position corresponding to each date. * @param startIndex The index of the first element to write. * @param length The number of elements to write. */ public final void writeCartographicRadians(List<JulianDate> dates, List<Cartographic> values, int startIndex, int length) { final String PropertyName = CartographicRadiansPropertyName; openIntervalIfNecessary(); CesiumWritingHelper.writeCartographic(getOutput(), PropertyName, dates, values, startIndex, length); }
try { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); dates.add(startDate.addSeconds(120.0)); positions.add(new Cartographic(7.0, 8.0, 9.0)); interval.writeCartographicRadians(dates, positions, 1, 1); } finally { DisposeHelper.dispose(interval);
try { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); dates.add(startDate.addSeconds(120.0)); positions.add(new Cartesian(7.0, 8.0, 9.0)); interval.writeCartesian(dates, positions, 1, 1); } finally { DisposeHelper.dispose(interval);
/** * Writes a value for the {@code position} property as a {@code cartographicRadians} value. The {@code position} property specifies the position of the object in the world. The position has no direct visual representation, but it is used to locate billboards, labels, and other graphical items attached to the object. * @param value The interval. */ public final void writePositionPropertyCartographicRadians(@Nonnull Cartographic value) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartographicRadians(value); } finally { DisposeHelper.dispose(writer); } } }
/** * Writes a value for the {@code position} property as a {@code cartesianVelocity} value. The {@code position} property specifies the position of the object in the world. The position has no direct visual representation, but it is used to locate billboards, labels, and other graphical items attached to the object. * @param value The value. */ public final void writePositionPropertyCartesianVelocity(@Nonnull Motion1<Cartesian> value) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartesianVelocity(value); } finally { DisposeHelper.dispose(writer); } } }
/** * Writes the value expressed as a {@code cartesian}, which is the position specified as a three-dimensional Cartesian value, {@code [X, Y, Z]}, in meters relative to the {@code referenceFrame}. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. * @param startIndex The index of the first element to write. * @param length The number of elements to write. */ public final void writeCartesian(List<JulianDate> dates, List<Cartesian> values, int startIndex, int length) { final String PropertyName = CartesianPropertyName; openIntervalIfNecessary(); CesiumWritingHelper.writeCartesian3(getOutput(), PropertyName, dates, values, startIndex, length); }
try { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); dates.add(startDate.addSeconds(60.0)); positions.add(new Cartographic(4.4, 5.5, 6.6)); interval.writeCartographicRadians(dates, positions); } finally { DisposeHelper.dispose(interval);
try { PositionCesiumWriter interval = position.openInterval(); try { ArrayList<cesiumlanguagewriter.JulianDate> dates = new ArrayList<cesiumlanguagewriter.JulianDate>(); dates.add(startDate.addSeconds(60.0)); positions.add(new Cartesian(4.4, 5.5, 6.6)); interval.writeCartesian(dates, positions); } finally { DisposeHelper.dispose(interval);
/** * Writes a value for the {@code position} property as a {@code cartographicDegrees} value. The {@code position} property specifies the position of the object in the world. The position has no direct visual representation, but it is used to locate billboards, labels, and other graphical items attached to the object. * @param value The interval. */ public final void writePositionPropertyCartographicDegrees(@Nonnull Cartographic value) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartographicDegrees(value); } finally { DisposeHelper.dispose(writer); } } }
/** * Writes a value for the {@code position} property as a {@code cartographicRadians} value. The {@code position} property specifies the position of the object in the world. The position has no direct visual representation, but it is used to locate billboards, labels, and other graphical items attached to the object. * @param dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writePositionPropertyCartographicRadians(List<JulianDate> dates, List<Cartographic> values) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartographicRadians(dates, values); } finally { DisposeHelper.dispose(writer); } } }