/** * Provides a generic {@link StringConverter} that scales then rounds a variable when displaying it. * @param toStringScale the scale to apply to values when displaying. * @param numberOfDecimals number of displayed decimals before rounding. * @return a custom StringConverter. */ public static StringConverter<Double> rounding(double toStringScale, int numberOfDecimals) { return rounding(toStringScale, numberOfDecimals, ""); }
public static Affine createAffineFromAxisAngle(AxisAngle axisAngle) { Affine affine = new Affine(); convertAxisAngleToAffine(axisAngle, affine); return affine; }
/** * Update the camera translation after applying a translation offset in the world frame. * @param dx the translation offset along the world x-axis. * @param dy the translation offset along the world y-axis. * @param dz the translation offset along the world z-axis. */ public void updateWorldTranslation(double dx, double dy, double dz) { Vector3D shift = new Vector3D(dx, dy, dz); JavaFXTools.addEquals(translation, shift); }
private void setupControls() { searchRadiusSlider.setLabelFormatter(StringConverterTools.metersToRoundedCentimeters()); maxDistanceFromPlaneSlider.setLabelFormatter(StringConverterTools.metersToRoundedCentimeters()); maxAngleFromPlaneSlider.setLabelFormatter(StringConverterTools.radiansToRoundedDegrees()); minNormalQualitySlider.setLabelFormatter(StringConverterTools.metersToRoundedCentimeters()); maxStandardDeviationSlider.setLabelFormatter(StringConverterTools.rounding(1000.0, 1)); minVolumicDensitySlider.setLabelFormatter(StringConverterTools.rounding(1.0e-6, 2)); }
private void setupControls() { searchRadiusSlider.setLabelFormatter(StringConverterTools.metersToRoundedCentimeters()); maxDistanceFromPlaneSlider.setLabelFormatter(StringConverterTools.metersToRoundedCentimeters()); }
public static Affine convertRigidBodyTransformToAffine(RigidBodyTransform rigidBodyTransform) { Affine ret = new Affine(); convertRigidBodyTransformToAffine(rigidBodyTransform, ret); return ret; }
public static void convertAxisAngleToAffine(AxisAngle axisAngle, Affine affineToPack) { RotationMatrix intermediateMatrix = new RotationMatrix(); intermediateMatrix.set(axisAngle); convertRotationMatrixToAffine(intermediateMatrix, affineToPack); }
private DoubleSpinnerValueFactory createAngleValueFactory(double min, double max, double initialValue, double amountToStepBy) { DoubleSpinnerValueFactory doubleSpinnerValueFactory = new DoubleSpinnerValueFactory(min, max, initialValue, amountToStepBy); doubleSpinnerValueFactory.setConverter(StringConverterTools.radiansToRoundedDegrees()); return doubleSpinnerValueFactory; } }
/** * @return a StringConverter that converts values expressed in meters to be displayed in centimeters. */ public static StringConverter<Double> metersToRoundedMillimeters() { return rounding(1000.0, 0); }
private DoubleSpinnerValueFactory createLengthValueFactory(double min, double max, double initialValue, double amountToStepBy) { DoubleSpinnerValueFactory doubleSpinnerValueFactory = new DoubleSpinnerValueFactory(min, max, initialValue, amountToStepBy); doubleSpinnerValueFactory.setConverter(StringConverterTools.metersToRoundedCentimeters()); return doubleSpinnerValueFactory; }
public static Affine createAffineFromAxisAngle(AxisAngle4d axisAngle) { Affine affine = new Affine(); convertAxisAngleToAffine(axisAngle, affine); return affine; }
/** * Update the camera translation after applying a translation offset in the world frame. * @param dx the translation offset along the world x-axis. * @param dy the translation offset along the world y-axis. * @param dz the translation offset along the world z-axis. */ public void updateWorldTranslation(double dx, double dy, double dz) { Vector3d shift = new Vector3d(dx, dy, dz); JavaFXTools.addEquals(translation, shift); }
public static void convertAxisAngleToAffine(AxisAngle4d axisAngle, Affine affineToPack) { Matrix3d intermediateMatrix = new Matrix3d(); intermediateMatrix.set(axisAngle); convertRotationMatrixToAffine(intermediateMatrix, affineToPack); }
/** * @return a StringConverter that converts values expressed in radians to be displayed in degrees. */ public static StringConverter<Double> radiansToRoundedDegrees() { return rounding(180.0 / Math.PI, 0); }
/** * @return a StringConverter that converts values expressed in meters to be displayed in centimeters. */ public static StringConverter<Double> metersToRoundedCentimeters() { return rounding(100.0, 0); }
/** * @return a StringConverter that converts values expressed in meters to be displayed in centimeters. */ public static StringConverter<Double> metersToRoundedCentimeters() { return rounding(100.0, 0); } /**
/** * Provides a simple formatter for large-scale values. * @param appendK whether to append the suffix 'k' after the displayed number or not, for instance: {@code 100000} will be displayed {@code 100k} when it is {@code true}. * @return reduce large-scale values to display only the thousands, for instance: {@code 100000} will be displayed {@code 100}. */ public static StringConverter<Double> thousandRounding(boolean appendK) { return rounding(0.001, 0, "k"); }
/** * @return a StringConverter that converts values expressed in radians to be displayed in degrees. */ public static StringConverter<Double> radiansToRoundedDegrees() { return rounding(180.0 / Math.PI, 0); }
/** * Provides a simple formatter for large-scale values. * @param appendK whether to append the suffix 'k' after the displayed number or not, for instance: {@code 100000} will be displayed {@code 100k} when it is {@code true}. * @return reduce large-scale values to display only the thousands, for instance: {@code 100000} will be displayed {@code 100}. */ public static StringConverter<Double> thousandRounding(boolean appendK) { return rounding(0.001, 0, "k"); }
/** * Provides a generic {@link StringConverter} that scales then rounds a variable when displaying it. * @param toStringScale the scale to apply to values when displaying. * @param numberOfDecimals number of displayed decimals before rounding. * @return a custom StringConverter. */ public static StringConverter<Double> rounding(double toStringScale, int numberOfDecimals) { return rounding(toStringScale, numberOfDecimals, ""); }