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

main.cesium.CylinderOutlineGeometry.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 the outline of a cylinder.
 * ```
 * // create cylinder geometry
 * const cylinder = new CylinderOutlineGeometry({
 *     length: 200000,
 *     topRadius: 80000,
 *     bottomRadius: 200000,
 * });
 * const geometry = CylinderOutlineGeometry.createGeometry(cylinder);
 * ```
 * @see Online Documentation
 */
external class CylinderOutlineGeometry(options: ConstructorOptions) {
    /**
     * @property [length] The length of the cylinder.
     * @property [topRadius] The radius of the top of the cylinder.
     * @property [bottomRadius] The radius of the bottom of the cylinder.
     * @property [slices] The number of edges around the perimeter of the cylinder.
     *   Default value - `128`
     * @property [numberOfVerticalLines] Number of lines to draw between the top and bottom surfaces of the cylinder.
     *   Default value - `16`
     */
    interface ConstructorOptions {
        var length: Int
        var topRadius: Double
        var bottomRadius: Double
        var slices: Int?
        var numberOfVerticalLines: Int?
    }

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

        /**
         * 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
         */
        override fun pack(
            value: CylinderOutlineGeometry,
            array: Array,
            startingIndex: Int?,
        ): 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 CylinderOutlineGeometry instance if one was not provided.
         * @see Online Documentation
         */
        override fun unpack(
            array: Array,
            startingIndex: Int?,
            result: CylinderOutlineGeometry?,
        ): CylinderOutlineGeometry

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy