/** * 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)); }
/** * Indicates whether another object is exactly equal to this instance. * @param obj The object to compare to this instance. * @return {@code true} if {@code obj} is an instance of this type and represents the same value as this instance; otherwise, {@code false}. */ @Override public boolean equals(Object obj) { return obj instanceof NearFarScalar && equalsType((NearFarScalar) obj); }
/** * Writes a {@link NearFarScalar} value as an array in NearDistance, NearValue, FarDistance, FarValue order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeNearFarScalar(CesiumOutputStream output, @Nonnull NearFarScalar value) { output.writeStartSequence(); output.writeValue(value.getNearDistance()); output.writeValue(value.getNearValue()); output.writeValue(value.getFarDistance()); output.writeValue(value.getFarValue()); output.writeEndSequence(); }
output.writeValue(epoch.secondsDifference(dates.get(i))); NearFarScalar value = values.get(i); output.writeValue(value.getNearDistance()); output.writeValue(value.getNearValue()); output.writeValue(value.getFarDistance()); output.writeValue(value.getFarValue()); output.writeLineBreak();
/** * 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)); }
/** * Returns {@code true} if the two instances are exactly equal. * @param left The instance to compare to {@code right}. * @param right The instance to compare to {@code left}. * @return {@code true} if {@code left} represents the same value as {@code right}; otherwise, {@code false}. */ @CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean ==(NearFarScalar,NearFarScalar)'") public static boolean equals(@Nonnull NearFarScalar left, @Nonnull NearFarScalar right) { return left.equalsType(right); }
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 {
/** * Returns {@code true} if the two instances are not exactly equal. * @param left The instance to compare to {@code right}. * @param right The instance to compare to {@code left}. * @return {@code true} if {@code left} does not represent the same value as {@code right}; otherwise, {@code false}. */ @CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean !=(NearFarScalar,NearFarScalar)'") public static boolean notEquals(@Nonnull NearFarScalar left, @Nonnull NearFarScalar right) { return !left.equalsType(right); }
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()); }