StyleCommandsNeeded.js 638 B

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