StyleCommandsNeeded.js 682 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * An enum describing what commands (opaque or translucent) are required by
  3. * a {@link Cesium3DTileStyle}.
  4. *
  5. * @enum {number}
  6. * @private
  7. */
  8. const StyleCommandsNeeded = {
  9. ALL_OPAQUE: 0,
  10. ALL_TRANSLUCENT: 1,
  11. OPAQUE_AND_TRANSLUCENT: 2,
  12. };
  13. /**
  14. * @private
  15. */
  16. StyleCommandsNeeded.getStyleCommandsNeeded = function (
  17. featuresLength,
  18. translucentFeaturesLength
  19. ) {
  20. if (translucentFeaturesLength === 0) {
  21. return StyleCommandsNeeded.ALL_OPAQUE;
  22. } else if (translucentFeaturesLength === featuresLength) {
  23. return StyleCommandsNeeded.ALL_TRANSLUCENT;
  24. }
  25. return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;
  26. };
  27. export default Object.freeze(StyleCommandsNeeded);