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 {CircleOutlineGeometry} [result] The object into which to store the result.\n * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.\n */\nCircleOutlineGeometry.unpack = function (array, startingIndex, result) {\n const ellipseGeometry = EllipseOutlineGeometry.unpack(\n array,\n startingIndex,\n scratchEllipseGeometry\n );\n scratchOptions.center = Cartesian3.clone(\n ellipseGeometry._center,\n scratchOptions.center\n );\n scratchOptions.ellipsoid = Ellipsoid.clone(\n ellipseGeometry._ellipsoid,\n scratchOptions.ellipsoid\n );\n scratchOptions.height = ellipseGeometry._height;\n scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\n scratchOptions.granularity = ellipseGeometry._granularity;\n scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipseGeometry._semiMajorAxis;\n return new CircleOutlineGeometry(scratchOptions);\n }\n\n scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\n scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\n result._ellipseGeometry = new EllipseOutlineGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {CircleOutlineGeometry} circleGeometry A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCircleOutlineGeometry.createGeometry = function (circleGeometry) {\n return EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);\n};\nexport default CircleOutlineGeometry;\n","import Cartesian3 from \"../Core/Cartesian3.js\";\nimport CircleOutlineGeometry from \"../Core/CircleOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\n\nfunction createCircleOutlineGeometry(circleGeometry, offset) {\n if (defined(offset)) {\n circleGeometry = CircleOutlineGeometry.unpack(circleGeometry, offset);\n }\n circleGeometry._ellipseGeometry._center = Cartesian3.clone(\n circleGeometry._ellipseGeometry._center\n );\n circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone(\n circleGeometry._ellipseGeometry._ellipsoid\n );\n return CircleOutlineGeometry.createGeometry(circleGeometry);\n}\nexport default createCircleOutlineGeometry;\n"],"names":["defaultValue","Check","EllipseOutlineGeometry","Cartesian3","Ellipsoid","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAOA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;E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