Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Automatically generated - do not modify!
@file:Suppress(
"NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)
package cesium
/**
* A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both [Primitive] and [GroundPrimitive].
* ```
* // 1. create a polygon from points
* var polygon = new PolygonGeometry({
* polygonHierarchy : new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* )
* });
* var geometry = PolygonGeometry.createGeometry(polygon);
*
* // 2. create a nested polygon with holes
* var polygonWithHole = new PolygonGeometry({
* polygonHierarchy : new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -109.0, 30.0,
* -95.0, 30.0,
* -95.0, 40.0,
* -109.0, 40.0
* ]),
* [new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -107.0, 31.0,
* -107.0, 39.0,
* -97.0, 39.0,
* -97.0, 31.0
* ]),
* [new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -105.0, 33.0,
* -99.0, 33.0,
* -99.0, 37.0,
* -105.0, 37.0
* ]),
* [new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -103.0, 34.0,
* -101.0, 34.0,
* -101.0, 36.0,
* -103.0, 36.0
* ])
* )]
* )]
* )]
* )
* });
* var geometry = PolygonGeometry.createGeometry(polygonWithHole);
*
* // 3. create extruded polygon
* var extrudedPolygon = new PolygonGeometry({
* polygonHierarchy : new PolygonHierarchy(
* Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* ),
* extrudedHeight: 300000
* });
* var geometry = PolygonGeometry.createGeometry(extrudedPolygon);
* ```
* @see Online Documentation
*/
@JsName("\$cesium__PolygonGeometry")
external class PolygonGeometry(options: ConstructorOptions) {
/**
* @property [polygonHierarchy] A polygon hierarchy that can include holes.
* @property [height] The distance in meters between the polygon and the ellipsoid surface.
* Default value - `0.0`
* @property [extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.
* @property [vertexFormat] The vertex attributes to be computed.
* Default value - [VertexFormat.DEFAULT]
* @property [stRotation] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* Default value - `0.0`
* @property [ellipsoid] The ellipsoid to be used as a reference.
* Default value - [Ellipsoid.WGS84]
* @property [granularity] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* Default value - [Math.RADIANS_PER_DEGREE]
* @property [perPositionHeight] Use the height of options.positions for each position instead of using options.height to determine the height.
* Default value - `false`
* @property [closeTop] When false, leaves off the top of an extruded polygon open.
* Default value - `true`
* @property [closeBottom] When false, leaves off the bottom of an extruded polygon open.
* Default value - `true`
* @property [arcType] The type of line the polygon edges must follow. Valid options are [ArcType.GEODESIC] and [ArcType.RHUMB].
* Default value - [ArcType.GEODESIC]
*/
interface ConstructorOptions {
var polygonHierarchy: PolygonHierarchy
var height: Double?
var extrudedHeight: Double?
var vertexFormat: VertexFormat?
var stRotation: Double?
var ellipsoid: Ellipsoid?
var granularity: Double?
var perPositionHeight: Boolean?
var closeTop: Boolean?
var closeBottom: Boolean?
var arcType: ArcType?
}
/**
* The number of elements used to pack the object into an array.
* @see Online Documentation
*/
val packedLength: Int
companion object {
/**
* A description of a polygon from an array of positions. Polygon geometry can be rendered with both [Primitive] and [GroundPrimitive].
* ```
* // create a polygon from points
* var polygon = PolygonGeometry.fromPositions({
* positions : Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* });
* var geometry = PolygonGeometry.createGeometry(polygon);
* ```
* @see Online Documentation
*/
fun fromPositions(options: FromPositionsOptions): PolygonGeometry
/**
* @property [positions] An array of positions that defined the corner points of the polygon.
* @property [height] The height of the polygon.
* Default value - `0.0`
* @property [extrudedHeight] The height of the polygon extrusion.
* @property [vertexFormat] The vertex attributes to be computed.
* Default value - [VertexFormat.DEFAULT]
* @property [stRotation] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* Default value - `0.0`
* @property [ellipsoid] The ellipsoid to be used as a reference.
* Default value - [Ellipsoid.WGS84]
* @property [granularity] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* Default value - [Math.RADIANS_PER_DEGREE]
* @property [perPositionHeight] Use the height of options.positions for each position instead of using options.height to determine the height.
* Default value - `false`
* @property [closeTop] When false, leaves off the top of an extruded polygon open.
* Default value - `true`
* @property [closeBottom] When false, leaves off the bottom of an extruded polygon open.
* Default value - `true`
* @property [arcType] The type of line the polygon edges must follow. Valid options are [ArcType.GEODESIC] and [ArcType.RHUMB].
* Default value - [ArcType.GEODESIC]
*/
interface FromPositionsOptions {
var positions: Array
var height: Double?
var extrudedHeight: Double?
var vertexFormat: VertexFormat?
var stRotation: Double?
var ellipsoid: Ellipsoid?
var granularity: Double?
var perPositionHeight: Boolean?
var closeTop: Boolean?
var closeBottom: Boolean?
var arcType: ArcType?
}
/**
* Stores the provided instance into the provided array.
* @param [value] The value to pack.
* @param [array] The array to pack into.
* @param [startingIndex] The index into the array at which to start packing the elements.
* Default value - `0`
* @return The array that was packed into
* @see Online Documentation
*/
fun pack(
value: PolygonGeometry,
array: Array,
startingIndex: Int? = definedExternally,
): Array
/**
* Retrieves an instance from a packed array.
* @param [array] The packed array.
* @param [startingIndex] The starting index of the element to be unpacked.
* Default value - `0`
* @param [result] The object into which to store the result.
* @see Online Documentation
*/
fun unpack(
array: Array,
startingIndex: Int? = definedExternally,
result: PolygonGeometry? = definedExternally,
)
/**
* Returns the bounding rectangle given the provided options
* @param [result] An object in which to store the result.
* @return The result rectangle
* @see Online Documentation
*/
fun computeRectangle(
options: ComputeRectangleOptions,
result: Rectangle? = definedExternally,
): Rectangle
/**
* @property [polygonHierarchy] A polygon hierarchy that can include holes.
* @property [granularity] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
* Default value - [Math.RADIANS_PER_DEGREE]
* @property [arcType] The type of line the polygon edges must follow. Valid options are [ArcType.GEODESIC] and [ArcType.RHUMB].
* Default value - [ArcType.GEODESIC]
* @property [ellipsoid] The ellipsoid to be used as a reference.
* Default value - [Ellipsoid.WGS84]
*/
interface ComputeRectangleOptions {
var polygonHierarchy: PolygonHierarchy
var granularity: Double?
var arcType: ArcType?
var ellipsoid: Ellipsoid?
}
/**
* Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
* @param [polygonGeometry] A description of the polygon.
* @return The computed vertices and indices.
* @see Online Documentation
*/
fun createGeometry(polygonGeometry: PolygonGeometry): Geometry?
}
}