import Cartesian2 from "../Core/Cartesian2.js";
import Cartesian3 from "../Core/Cartesian3.js";
import Check from "../Core/Check.js";
import Color from "../Core/Color.js";
import defaultValue from "../Core/defaultValue.js";
import defined from "../Core/defined.js";
/**
 * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.
 * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.
 * and {@link CloudCollection#remove}.
 * 
 * 
 * 

 * Example cumulus clouds
 * 
Gets or sets the scale of the cumulus cloud billboard in meters.
   * The scale property will affect the size of the billboard,
   * but not the cloud's actual appearance.
   * 
   * 
   * | * *cloud.scale = new Cesium.Cartesian2(12, 8);*
  * | * *cloud.scale = new Cesium.Cartesian2(24, 10);*
  * | 
   * 
To modify the cloud's appearance, modify its maximumSize
   * and slice properties.
   * @memberof CumulusCloud.prototype
   * @type {Cartesian2}
   *
   * @see CumulusCloud#maximumSize
   * @see CumulusCloud#slice
   */
  scale: {
    get: function () {
      return this._scale;
    },
    set: function (value) {
      //>>includeStart('debug', pragmas.debug)
      Check.typeOf.object("value", value);
      //>>includeEnd('debug');
      const scale = this._scale;
      if (!Cartesian2.equals(scale, value)) {
        Cartesian2.clone(value, scale);
        makeDirty(this, SCALE_INDEX);
      }
    },
  },
  /**
   * Gets or sets the maximum size of the cumulus cloud rendered on the billboard.
   * This defines a maximum ellipsoid volume that the cloud can appear in.
   * Rather than guaranteeing a specific size, this specifies a boundary for the
   * cloud to appear in, and changing it can affect the shape of the cloud.
   * Changing the z-value of maximumSize has the most dramatic effect
   * on the cloud's appearance because it changes the depth of the cloud, and thus the
   * positions at which the cloud-shaping texture is sampled.
   * 
   *
   * To modify the billboard's actual size, modify the cloud's scale property.
   * @memberof CumulusCloud.prototype
   * @type {Cartesian3}
   *
   * @see CumulusCloud#scale
   */
  maximumSize: {
    get: function () {
      return this._maximumSize;
    },
    set: function (value) {
      //>>includeStart('debug', pragmas.debug)
      Check.typeOf.object("value", value);
      //>>includeEnd('debug');
      const maximumSize = this._maximumSize;
      if (!Cartesian3.equals(maximumSize, value)) {
        Cartesian3.clone(value, maximumSize);
        makeDirty(this, MAXIMUM_SIZE_INDEX);
      }
    },
  },
  /**
   * Sets the color of the cloud
   * @memberof CumulusCloud.prototype
   * @type {Color}
   * @default Color.WHITE
   */
  color: {
    get: function () {
      return this._color;
    },
    set: function (value) {
      //>>includeStart('debug', pragmas.debug)
      Check.typeOf.object("value", value);
      //>>includeEnd('debug');
      const color = this._color;
      if (!Color.equals(color, value)) {
        Color.clone(value, color);
        makeDirty(this, COLOR_INDEX);
      }
    },
  },
  /**
   * Gets or sets the "slice" of the cloud that is rendered on the billboard, i.e.
   * the specific cross-section of the cloud chosen for the billboard's appearance.
   * Given a value between 0 and 1, the slice specifies how deeply into the cloud
   * to intersect based on its maximum size in the z-direction.
   * 
   * 
   * | *cloud.slice = 0.32;
  | *cloud.slice = 0.5;
  | *cloud.slice = 0.6;
  | 
   * 
   * Due to the nature in which this slice is calculated,
   * values below 0.2 may result in cross-sections that are too small,
   * and the edge of the ellipsoid will be visible. Similarly, values above 0.7
   * will cause the cloud to appear smaller. Values outside the range [0.1, 0.9]
   * should be avoided entirely because they do not produce desirable results.
   *
   * 
   * 
   * | *cloud.slice = 0.08;
  | *cloud.slice = 0.8;
  | 
   * 
If slice is set to a negative number, the cloud will not render a cross-section.
   * Instead, it will render the outside of the ellipsoid that is visible. For clouds with
   * small values of `maximumSize.z`, this can produce good-looking results, but for larger
   * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.
   *
   * 
   * 
   * | * *cloud.slice = -1.0;cloud.maximumSize.z = 18;
*
  * | * *cloud.slice = -1.0;cloud.maximumSize.z = 30;
*
  | 
   * 
   * 
   * 
   * | *cloud.brightness = 1.0;
  | *cloud.brightness = 0.6;
  | *cloud.brightness = 0.0;
  | 
   *