All files / engine/Source/Scene SensorVolumePortionToDisplay.js

33.33% Statements 3/9
0% Branches 0/7
0% Functions 0/2
33.33% Lines 3/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70              1x                                                             1x                             1x                                
import DeveloperError from "../Core/DeveloperError.js";
 
/**
 * Constants used to indicated what part of the sensor volume to display.
 *
 * @enum {number}
 */
const SensorVolumePortionToDisplay = {
  /**
   * 0x0000.  Display the complete sensor volume.
   *
   * @type {number}
   * @constant
   */
  COMPLETE: 0x0000,
  /**
   * 0x0001.  Display the portion of the sensor volume that lies below the true horizon of the ellipsoid.
   *
   * @type {number}
   * @constant
   */
  BELOW_ELLIPSOID_HORIZON: 0x0001,
  /**
   * 0x0002.  Display the portion of the sensor volume that lies above the true horizon of the ellipsoid.
   *
   * @type {number}
   * @constant
   */
  ABOVE_ELLIPSOID_HORIZON: 0x0002,
};
 
/**
 * Validates that the provided value is a valid {@link SensorVolumePortionToDisplay} enumeration value.
 *
 * @param {SensorVolumePortionToDisplay} portionToDisplay The value to validate.
 *
 * @returns {boolean} <code>true</code> if the provided value is a valid enumeration value; otherwise, <code>false</code>.
 */
SensorVolumePortionToDisplay.validate = function (portionToDisplay) {
  return (
    portionToDisplay === SensorVolumePortionToDisplay.COMPLETE ||
    portionToDisplay === SensorVolumePortionToDisplay.BELOW_ELLIPSOID_HORIZON ||
    portionToDisplay === SensorVolumePortionToDisplay.ABOVE_ELLIPSOID_HORIZON
  );
};
 
/**
 * Converts the provided value to its corresponding enumeration string.
 *
 * @param {SensorVolumePortionToDisplay} portionToDisplay The value to be converted to its corresponding enumeration string.
 *
 * @returns {string} The enumeration string corresponding to the value.
 */
SensorVolumePortionToDisplay.toString = function (portionToDisplay) {
  switch (portionToDisplay) {
    case SensorVolumePortionToDisplay.COMPLETE:
      return "COMPLETE";
    case SensorVolumePortionToDisplay.BELOW_ELLIPSOID_HORIZON:
      return "BELOW_ELLIPSOID_HORIZON";
    case SensorVolumePortionToDisplay.ABOVE_ELLIPSOID_HORIZON:
      return "ABOVE_ELLIPSOID_HORIZON";
    default:
      throw new DeveloperError(
        "SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.",
      );
  }
};
 
export default SensorVolumePortionToDisplay;