All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.cesium.PolylineVolumeOutlineGeometry.kt Maven / Gradle / Ivy

// Automatically generated - do not modify!

@file:JsModule("cesium")

@file:Suppress(
    "NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)

package cesium

/**
 * A description of a polyline with a volume (a 2D shape extruded along a polyline).
 * ```
 * function computeCircle(radius) {
 *   const positions = [];
 *   for (let i = 0; i < 360; i++) {
 *     const radians = Math.toRadians(i);
 *     positions.push(new Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
 *   }
 *   return positions;
 * }
 *
 * const volumeOutline = new PolylineVolumeOutlineGeometry({
 *   polylinePositions : Cartesian3.fromDegreesArray([
 *     -72.0, 40.0,
 *     -70.0, 35.0
 *   ]),
 *   shapePositions : computeCircle(100000.0)
 * });
 * ```
 * @see Online Documentation
 */
external class PolylineVolumeOutlineGeometry(options: ConstructorOptions) {
    /**
     * @property [polylinePositions] An array of positions that define the center of the polyline volume.
     * @property [shapePositions] An array of positions that define the shape to be extruded along the polyline
     * @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 [cornerType] Determines the style of the corners.
     *   Default value - [CornerType.ROUNDED]
     */
    interface ConstructorOptions {
        var polylinePositions: Array
        var shapePositions: Array
        var ellipsoid: Ellipsoid?
        var granularity: Double?
        var cornerType: CornerType?
    }

    /**
     * The number of elements used to pack the object into an array.
     * @see Online Documentation
     */
    val packedLength: Int

    companion object {
        /**
         * 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: PolylineVolumeOutlineGeometry,
            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 PolylineVolumeOutlineGeometry instance if one was not provided.
         * @see Online Documentation
         */
        fun unpack(
            array: Array,
            startingIndex: Int? = definedExternally,
            result: PolylineVolumeOutlineGeometry? = definedExternally,
        ): PolylineVolumeOutlineGeometry

        /**
         * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
         * @param [polylineVolumeOutlineGeometry] A description of the polyline volume outline.
         * @return The computed vertices and indices.
         * @see Online Documentation
         */
        fun createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry?
    }
}

inline fun PolylineVolumeOutlineGeometry(
    block: PolylineVolumeOutlineGeometry.ConstructorOptions.() -> Unit,
): PolylineVolumeOutlineGeometry {
    val options: PolylineVolumeOutlineGeometry.ConstructorOptions = js("({})")
    block(options)
    return PolylineVolumeOutlineGeometry(options)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy