1 line
26 KiB
Plaintext
1 line
26 KiB
Plaintext
|
{"version":3,"file":"createWallOutlineGeometry.js","sources":["../../../../Source/Core/WallOutlineGeometry.js","../../../../Source/WorkersES6/createWallOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\n\nconst scratchCartesian3Position1 = new Cartesian3();\nconst scratchCartesian3Position2 = new Cartesian3();\n\n/**\n * A description of a wall outline. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @alias WallOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number[]} [options.maximumHeights] An array parallel to <code>positions</code> that give the maximum height of the\n * wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {Number[]} [options.minimumHeights] An array parallel to <code>positions</code> that give the minimum height of the\n * wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n *\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\n *\n * @see WallGeometry#createGeometry\n * @see WallGeometry#fromConstantHeight\n *\n * @example\n * // create a wall outline that spans from ground level to 10000 meters\n * const wall = new Cesium.WallOutlineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n * 19.0, 47.0, 10000.0,\n * 19.0, 48.0, 10000.0,\n * 20.0, 48.0, 10000.0,\n * 20.0, 47.0, 10000.0,\n * 19.0, 47.0, 10000.0\n * ])\n * });\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\n */\nfunction WallOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const wallPositions = options.positions;\n const maximumHeights = options.maximumHeights;\n const minimumHeights = options.minimumHeights;\n\n //>>includeStart('debug', pragmas.debug);\n if (!defined(wallPositions)) {\n throw new DeveloperError(\"options.positions is required.\");\n }\n if (\n defined(maximumHeights) &&\n maximumHeights.length !== wallPositions.length\n ) {\n throw new DeveloperError(\n \"options.positions and options.maximumHeights must have the same length.\"\n );\n }\n if (\n defined(minimumHeights) &&\n minimumHeights.length !== wallPositions.length\n ) {\n throw new DeveloperError(\n \"options.positions and options.minimumHeights must have the same length.\"\n );\n }\n //>>includeEnd('debug');\n\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n this._positions = wallPositions;\n this._minimumHeights = minimumHeights;\n this._maximumHei
|