main.cesium.CoplanarPolygonGeometry.kt Maven / Gradle / Ivy
// Automatically generated - do not modify!
@file:Suppress(
"NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)
package cesium
/**
* A description of a polygon composed of arbitrary coplanar positions.
* ```
* var polygonGeometry = new CoplanarPolygonGeometry({
* polygonHierarchy: new PolygonHierarchy(
* Cartesian3.fromDegreesArrayHeights([
* -90.0, 30.0, 0.0,
* -90.0, 30.0, 300000.0,
* -80.0, 30.0, 300000.0,
* -80.0, 30.0, 0.0
* ]))
* });
* ```
* @see Online Documentation
*/
@JsName("\$cesium__CoplanarPolygonGeometry")
external class CoplanarPolygonGeometry(options: ConstructorOptions) {
/**
* @property [polygonHierarchy] A polygon hierarchy that can include holes.
* @property [stRotation] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* Default value - `0.0`
* @property [vertexFormat] The vertex attributes to be computed.
* Default value - [VertexFormat.DEFAULT]
* @property [ellipsoid] The ellipsoid to be used as a reference.
* Default value - [Ellipsoid.WGS84]
*/
interface ConstructorOptions {
var polygonHierarchy: PolygonHierarchy
var stRotation: Double?
var vertexFormat: VertexFormat?
var ellipsoid: Ellipsoid?
}
/**
* The number of elements used to pack the object into an array.
* @see Online Documentation
*/
val packedLength: Int
companion object {
/**
* A description of a coplanar polygon from an array of positions.
* ```
* // create a polygon from points
* var polygon = CoplanarPolygonGeometry.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): CoplanarPolygonGeometry
/**
* @property [positions] An array of positions that defined the corner points of the polygon.
* @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]
*/
interface FromPositionsOptions {
var positions: Array
var vertexFormat: VertexFormat?
var stRotation: Double?
var ellipsoid: Ellipsoid?
}
/**
* 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: CoplanarPolygonGeometry,
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.
* @return The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
* @see Online Documentation
*/
fun unpack(
array: Array,
startingIndex: Int? = definedExternally,
result: CoplanarPolygonGeometry? = definedExternally,
): CoplanarPolygonGeometry
/**
* Computes the geometric representation of an arbitrary coplanar 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: CoplanarPolygonGeometry): Geometry?
}
}