| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 | /* This file is automatically rebuilt by the Cesium build process. */define(['./Matrix2-69c32d33', './RuntimeError-c581ca93', './defaultValue-94c3e563', './EllipseGeometry-ff9222ba', './VertexFormat-e46f29d6', './ComponentDatatype-b1ea011a', './WebGLConstants-7dccdc96', './GeometryOffsetAttribute-3e8c299c', './Transforms-323408fe', './_commonjsHelpers-3aae1032-f55dc0c4', './combine-761d9c3f', './EllipseGeometryLibrary-84444adb', './GeometryAttribute-cb73bb3f', './GeometryAttributes-7df9bef6', './GeometryInstance-f69fd420', './GeometryPipeline-e27e35f8', './AttributeCompression-3cfab808', './EncodedCartesian3-b1f97f8a', './IndexDatatype-c4099fe9', './IntersectionTests-d5d945ac', './Plane-069b6800'], (function (Matrix2, RuntimeError, defaultValue, EllipseGeometry, VertexFormat, ComponentDatatype, WebGLConstants, GeometryOffsetAttribute, Transforms, _commonjsHelpers3aae1032, combine, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryPipeline, AttributeCompression, EncodedCartesian3, IndexDatatype, IntersectionTests, Plane) { 'use strict';  /**   * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.   *   * @alias CircleGeometry   * @constructor   *   * @param {Object} options Object with the following properties:   * @param {Cartesian3} options.center The circle's center point in the fixed frame.   * @param {Number} options.radius The radius in meters.   * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.   * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.   * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.   * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.   * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.   * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.   *   * @exception {DeveloperError} radius must be greater than zero.   * @exception {DeveloperError} granularity must be greater than zero.   *   * @see CircleGeometry.createGeometry   * @see Packable   *   * @example   * // Create a circle.   * const circle = new Cesium.CircleGeometry({   *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),   *   radius : 100000.0   * });   * const geometry = Cesium.CircleGeometry.createGeometry(circle);   */  function CircleGeometry(options) {    options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);    const radius = options.radius;    //>>includeStart('debug', pragmas.debug);    RuntimeError.Check.typeOf.number("radius", radius);    //>>includeEnd('debug');    const ellipseGeometryOptions = {      center: options.center,      semiMajorAxis: radius,      semiMinorAxis: radius,      ellipsoid: options.ellipsoid,      height: options.height,      extrudedHeight: options.extrudedHeight,      granularity: options.granularity,      vertexFormat: options.vertexFormat,      stRotation: options.stRotation,      shadowVolume: options.shadowVolume,    };    this._ellipseGeometry = new EllipseGeometry.EllipseGeometry(ellipseGeometryOptions);    this._workerName = "createCircleGeometry";  }  /**   * The number of elements used to pack the object into an array.   * @type {Number}   */  CircleGeometry.packedLength = EllipseGeometry.EllipseGeometry.packedLength;  /**   * Stores the provided instance into the provided array.   *   * @param {CircleGeometry} value The value to pack.   * @param {Number[]} array The array to pack into.   * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.   *   * @returns {Number[]} The array that was packed into   */  CircleGeometry.pack = function (value, array, startingIndex) {    //>>includeStart('debug', pragmas.debug);    RuntimeError.Check.typeOf.object("value", value);    //>>includeEnd('debug');    return EllipseGeometry.EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);  };  const scratchEllipseGeometry = new EllipseGeometry.EllipseGeometry({    center: new Matrix2.Cartesian3(),    semiMajorAxis: 1.0,    semiMinorAxis: 1.0,  });  const scratchOptions = {    center: new Matrix2.Cartesian3(),    radius: undefined,    ellipsoid: Matrix2.Ellipsoid.clone(Matrix2.Ellipsoid.UNIT_SPHERE),    height: undefined,    extrudedHeight: undefined,    granularity: undefined,    vertexFormat: new VertexFormat.VertexFormat(),    stRotation: undefined,    semiMajorAxis: undefined,    semiMinorAxis: undefined,    shadowVolume: undefined,  };  /**   * Retrieves an instance from a packed array.   *   * @param {Number[]} array The packed array.   * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.   * @param {CircleGeometry} [result] The object into which to store the result.   * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.   */  CircleGeometry.unpack = function (array, startingIndex, result) {    const ellipseGeometry = EllipseGeometry.EllipseGeometry.unpack(      array,      startingIndex,      scratchEllipseGeometry    );    scratchOptions.center = Matrix2.Cartesian3.clone(      ellipseGeometry._center,      scratchOptions.center    );    scratchOptions.ellipsoid = Matrix2.Ellipsoid.clone(      ellipseGeometry._ellipsoid,      scratchOptions.ellipsoid    );    scratchOptions.height = ellipseGeometry._height;    scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;    scratchOptions.granularity = ellipseGeometry._granularity;    scratchOptions.vertexFormat = VertexFormat.VertexFormat.clone(      ellipseGeometry._vertexFormat,      scratchOptions.vertexFormat    );    scratchOptions.stRotation = ellipseGeometry._stRotation;    scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;    if (!defaultValue.defined(result)) {      scratchOptions.radius = ellipseGeometry._semiMajorAxis;      return new CircleGeometry(scratchOptions);    }    scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;    scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;    result._ellipseGeometry = new EllipseGeometry.EllipseGeometry(scratchOptions);    return result;  };  /**   * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.   *   * @param {CircleGeometry} circleGeometry A description of the circle.   * @returns {Geometry|undefined} The computed vertices and indices.   */  CircleGeometry.createGeometry = function (circleGeometry) {    return EllipseGeometry.EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);  };  /**   * @private   */  CircleGeometry.createShadowVolume = function (    circleGeometry,    minHeightFunc,    maxHeightFunc  ) {    const granularity = circleGeometry._ellipseGeometry._granularity;    const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;    const minHeight = minHeightFunc(granularity, ellipsoid);    const maxHeight = maxHeightFunc(granularity, ellipsoid);    return new CircleGeometry({      center: circleGeometry._ellipseGeometry._center,      radius: circleGeometry._ellipseGeometry._semiMajorAxis,      ellipsoid: ellipsoid,      stRotation: circleGeometry._ellipseGeometry._stRotation,      granularity: granularity,      extrudedHeight: minHeight,      height: maxHeight,      vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,      shadowVolume: true,    });  };  Object.defineProperties(CircleGeometry.prototype, {    /**     * @private     */    rectangle: {      get: function () {        return this._ellipseGeometry.rectangle;      },    },    /**     * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.     * @private     */    textureCoordinateRotationPoints: {      get: function () {        return this._ellipseGeometry.textureCoordinateRotationPoints;      },    },  });  function createCircleGeometry(circleGeometry, offset) {    if (defaultValue.defined(offset)) {      circleGeometry = CircleGeometry.unpack(circleGeometry, offset);    }    circleGeometry._ellipseGeometry._center = Matrix2.Cartesian3.clone(      circleGeometry._ellipseGeometry._center    );    circleGeometry._ellipseGeometry._ellipsoid = Matrix2.Ellipsoid.clone(      circleGeometry._ellipseGeometry._ellipsoid    );    return CircleGeometry.createGeometry(circleGeometry);  }  return createCircleGeometry;}));
 |