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

1 line
17 KiB
Plaintext
Raw Normal View History

2022-07-05 16:56:29 +08:00
{"version":3,"file":"createCylinderOutlineGeometry.js","sources":["../../../../Source/Core/CylinderOutlineGeometry.js","../../../../Source/WorkersES6/createCylinderOutlineGeometry.js"],"sourcesContent":["import arrayFill from \"./arrayFill.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst radiusScratch = new Cartesian2();\n\n/**\n * A description of the outline of a cylinder.\n *\n * @alias CylinderOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.length The length of the cylinder.\n * @param {Number} options.topRadius The radius of the top of the cylinder.\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.\n *\n * @exception {DeveloperError} options.length must be greater than 0.\n * @exception {DeveloperError} options.topRadius must be greater than 0.\n * @exception {DeveloperError} options.bottomRadius must be greater than 0.\n * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderOutlineGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderOutlineGeometry({\n * length: 200000,\n * topRadius: 80000,\n * bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);\n */\nfunction CylinderOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const length = options.length;\n const topRadius = options.topRadius;\n const bottomRadius = options.bottomRadius;\n const slices = defaultValue(options.slices, 128);\n const numberOfVerticalLines = Math.max(\n defaultValue(options.numberOfVerticalLines, 16),\n 0\n );\n\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"options.positions\", length);\n Check.typeOf.number(\"options.topRadius\", topRadius);\n Check.typeOf.number(\"options.bottomRadius\", bottomRadius);\n Check.typeOf.number.greaterThanOrEquals(\"options.slices\", slices, 3);\n if (\n defined(options.offsetAttribute) &&\n options.offsetAttribute === GeometryOffsetAttribute.TOP\n ) {\n throw new DeveloperError(\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n );\n }\n //>>includeEnd('debug');\n\n this._length = length;\n this._topRadius = topRadius;\n this._bottomRadius = bottomRadius;\n this._slices = slices;\n this._numberOfVerticalLines = numberOfVerticalLines;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createCylinderOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCylinderOutlineGeometry.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderOutlineGeometry} 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