/** * 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 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 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 dates The dates at which the value is specified. * @param values The values corresponding to each date. */ public final void writePositionPropertyCartographicDegrees(List<JulianDate> dates, List<Cartographic> values) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartographicDegrees(dates, values); } finally { DisposeHelper.dispose(writer); } } }
/** * 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 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 writePositionPropertyCartographicDegrees(List<JulianDate> dates, List<Cartographic> values, int startIndex, int length) { { cesiumlanguagewriter.PositionCesiumWriter writer = openPositionProperty(); try { writer.writeCartographicDegrees(dates, values, startIndex, length); } finally { DisposeHelper.dispose(writer); } } }
@Test public void runExample() throws IOException { StringWriter stringWriter = new StringWriter(); CesiumOutputStream output = new CesiumOutputStream(stringWriter); output.setPrettyFormatting(true); CesiumStreamWriter stream = new CesiumStreamWriter(); try (PacketCesiumWriter packet = stream.openPacket(output)) { packet.writeId("Test"); try (BillboardCesiumWriter billboard = packet.openBillboardProperty()) { billboard.writeColorProperty(123, 67, 0, 255); billboard.writeImageProperty(URI.create("http://cesiumjs.org/images/CesiumHeaderLogo.png"), CesiumResourceBehavior.EMBED); } try (PositionCesiumWriter position = packet.openPositionProperty()) { position.writeCartographicDegrees(new Cartographic(-75.0, 45.0, 100.0)); } } stringWriter.close(); System.out.println(stringWriter.toString()); } }