1 line
9.8 KiB
Plaintext
1 line
9.8 KiB
Plaintext
|
{"version":3,"file":"createCircleOutlineGeometry.js","sources":["../../../../Source/Core/CircleOutlineGeometry.js","../../../../Source/WorkersES6/createCircleOutlineGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipseOutlineGeometry from \"./EllipseOutlineGeometry.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\n\n/**\n * A description of the outline of a circle on the ellipsoid.\n *\n * @alias CircleOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\n * @param {Number} options.radius The radius in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\n * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\n * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.\n * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.\n *\n * @exception {DeveloperError} radius must be greater than zero.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see CircleOutlineGeometry.createGeometry\n * @see Packable\n *\n * @example\n * // Create a circle.\n * const circle = new Cesium.CircleOutlineGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n * radius : 100000.0\n * });\n * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);\n */\nfunction CircleOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const radius = options.radius;\n\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"radius\", radius);\n //>>includeEnd('debug');\n\n const ellipseGeometryOptions = {\n center: options.center,\n semiMajorAxis: radius,\n semiMinorAxis: radius,\n ellipsoid: options.ellipsoid,\n height: options.height,\n extrudedHeight: options.extrudedHeight,\n granularity: options.granularity,\n numberOfVerticalLines: options.numberOfVerticalLines,\n };\n this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions);\n this._workerName = \"createCircleOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCircleOutlineGeometry.packedLength = EllipseOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CircleOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCircleOutlineGeometry.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n //>>includeEnd('debug');\n return EllipseOutlineGeometry.pack(\n value._ellipseGeometry,\n array,\n startingIndex\n );\n};\n\nconst scratchEllipseGeometry = new EllipseOutlineGeometry({\n center: new Cartesian3(),\n semiMajorAxis: 1.0,\n semiMinorAxis: 1.0,\n});\nconst scratchOptions = {\n center: new Cartesian3(),\n radius: undefined,\n ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\n height: undefined,\n extrudedHeight: undefined,\n granularity: undefined,\n numberOfVerticalLines: undefined,\n semiMajorAxis: undefined,\n semiMinorAxis: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CircleOutlineGeomet
|