qd-changjing/public/static/Build/CesiumUnminified/Workers/createSphereOutlineGeometry...

1 line
7.5 KiB
Plaintext

{"version":3,"file":"createSphereOutlineGeometry.js","sources":["../../../../Source/Core/SphereOutlineGeometry.js","../../../../Source/WorkersES6/createSphereOutlineGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipsoidOutlineGeometry from \"./EllipsoidOutlineGeometry.js\";\n\n/**\n * A description of the outline of a sphere.\n *\n * @alias SphereOutlineGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.radius=1.0] The radius of the sphere.\n * @param {Number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines).\n * @param {Number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines).\n * @param {Number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .\n *\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\n *\n * @example\n * const sphere = new Cesium.SphereOutlineGeometry({\n * radius : 100.0,\n * stackPartitions : 6,\n * slicePartitions: 5\n * });\n * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);\n */\nfunction SphereOutlineGeometry(options) {\n const radius = defaultValue(options.radius, 1.0);\n const radii = new Cartesian3(radius, radius, radius);\n const ellipsoidOptions = {\n radii: radii,\n stackPartitions: options.stackPartitions,\n slicePartitions: options.slicePartitions,\n subdivisions: options.subdivisions,\n };\n\n this._ellipsoidGeometry = new EllipsoidOutlineGeometry(ellipsoidOptions);\n this._workerName = \"createSphereOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nSphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SphereOutlineGeometry} 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 */\nSphereOutlineGeometry.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n //>>includeEnd('debug');\n\n return EllipsoidOutlineGeometry.pack(\n value._ellipsoidGeometry,\n array,\n startingIndex\n );\n};\n\nconst scratchEllipsoidGeometry = new EllipsoidOutlineGeometry();\nconst scratchOptions = {\n radius: undefined,\n radii: new Cartesian3(),\n stackPartitions: undefined,\n slicePartitions: undefined,\n subdivisions: 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 {SphereOutlineGeometry} [result] The object into which to store the result.\n * @returns {SphereOutlineGeometry} The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.\n */\nSphereOutlineGeometry.unpack = function (array, startingIndex, result) {\n const ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(\n array,\n startingIndex,\n scratchEllipsoidGeometry\n );\n scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\n scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\n scratchOptions.subdivisions = ellipsoidGeometry._subdivisions;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipsoidGeometry._radii.x;\n return new SphereOutlineGeometry(scratchOptions);\n }\n\n Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\n result._ellipsoidGeometry = new EllipsoidOutlineGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.\n *\n * @param {SphereOutlineGeometry} sphereGeometry A description of the sphere outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSphereOutlineGeometry.createGeometry = function (sphereGeometry) {\n return EllipsoidOutlineGeometry.createGeometry(\n sphereGeometry._ellipsoidGeometry\n );\n};\nexport default SphereOutlineGeometry;\n","import defined from \"../Core/defined.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\n\nfunction createSphereOutlineGeometry(sphereGeometry, offset) {\n if (defined(offset)) {\n sphereGeometry = SphereOutlineGeometry.unpack(sphereGeometry, offset);\n }\n return SphereOutlineGeometry.createGeometry(sphereGeometry);\n}\nexport default createSphereOutlineGeometry;\n"],"names":["defaultValue","Cartesian3","EllipsoidOutlineGeometry","Check","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,qBAAqB,CAAC,OAAO,EAAE;EACxC,EAAE,MAAM,MAAM,GAAGA,iBAAY,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;EACnD,EAAE,MAAM,KAAK,GAAG,IAAIC,kBAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;EACvD,EAAE,MAAM,gBAAgB,GAAG;EAC3B,IAAI,KAAK,EAAE,KAAK;EAChB,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,YAAY,EAAE,OAAO,CAAC,YAAY;EACtC,GAAG,CAAC;AACJ;EACA,EAAE,IAAI,CAAC,kBAAkB,GAAG,IAAIC,iDAAwB,CAAC,gBAAgB,CAAC,CAAC;EAC3E,EAAE,IAAI,CAAC,WAAW,GAAG,6BAA6B,CAAC;EACnD,CAAC;AACD;EACA;EACA;EACA;EACA;EACA,qBAAqB,CAAC,YAAY,GAAGA,iDAAwB,CAAC,YAAY,CAAC;AAC3E;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB,CAAC,IAAI,GAAG,UAAU,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