/** * Writes the value expressed as a {@code nearFarScalar}, which is the value specified as four values {@code [NearDistance, NearValue, FarDistance, FarValue]}, with distances in eye coordinates in meters. * @param nearDistance The lower bound of the camera distance range. * @param nearValue The value to use at the lower bound of the camera distance range. * @param farDistance The upper bound of the camera distance range. * @param farValue The value to use at the upper bound of the camera distance range. */ public final void writeNearFarScalar(double nearDistance, double nearValue, double farDistance, double farValue) { writeNearFarScalar(new NearFarScalar(nearDistance, nearValue, farDistance, farValue)); }
/** * Writes the value expressed as a {@code nearFarScalar}, which is the property specified as four values {@code [NearDistance, NearValue, FarDistance, FarValue]}. * @param nearDistance The lower bound of the camera distance range. * @param nearValue The value to use at the lower bound of the camera distance range. * @param farDistance The upper bound of the camera distance range. * @param farValue The value to use at the upper bound of the camera distance range. */ public final void writeNearFarScalar(double nearDistance, double nearValue, double farDistance, double farValue) { writeNearFarScalar(new NearFarScalar(nearDistance, nearValue, farDistance, farValue)); }
ArrayList<cesiumlanguagewriter.NearFarScalar> values = new ArrayList<cesiumlanguagewriter.NearFarScalar>(); dates.add(startDate); values.add(new NearFarScalar(100.0, 1.0, 200.0, 2.0)); dates.add(startDate.addSeconds(60.0)); values.add(new NearFarScalar(200.0, 1.0, 300.0, 2.0)); scaleByDistance.writeNearFarScalar(dates, values); } finally {
ArrayList<cesiumlanguagewriter.NearFarScalar> values = new ArrayList<cesiumlanguagewriter.NearFarScalar>(); dates.add(startDate); values.add(new NearFarScalar(100.0, 1.0, 200.0, 2.0)); dates.add(startDate.addSeconds(60.0)); values.add(new NearFarScalar(200.0, 1.0, 300.0, 2.0)); scaleByDistance.writeNearFarScalar(dates, values); } finally {
@Test public final void testTranslucencyByDistanceProperty() { { final PacketCesiumWriter usingExpression_5 = (getPacket()); try { { LabelCesiumWriter label = getPacket().openLabelProperty(); try { { LabelCesiumWriter interval = label.openInterval(); try { interval.writeTranslucencyByDistanceProperty(new NearFarScalar(100.0, 1.0, 200.0, 2.0)); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(label); } } } finally { DisposeHelper.dispose(usingExpression_5); } } Assert.assertEquals("{\"label\":{\"translucencyByDistance\":{\"nearFarScalar\":[100,1,200,2]}}}", getStringWriter().toString()); }
@Test public final void testScaleByDistanceProperty() { { final PacketCesiumWriter usingExpression_2 = (getPacket()); try { { BillboardCesiumWriter billboard = getPacket().openBillboardProperty(); try { { BillboardCesiumWriter interval = billboard.openInterval(); try { interval.writeScaleByDistanceProperty(new NearFarScalar(100.0, 1.0, 200.0, 2.0)); } finally { DisposeHelper.dispose(interval); } } } finally { DisposeHelper.dispose(billboard); } } } finally { DisposeHelper.dispose(usingExpression_2); } } Assert.assertEquals("{\"billboard\":{\"scaleByDistance\":{\"nearFarScalar\":[100,1,200,2]}}}", getStringWriter().toString()); }