Skip to content

Commit

Permalink
Update declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
porotkin committed Jan 3, 2025
1 parent a000a90 commit be4dccb
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cesium.engine

import cesium.engine.BoundingSphere.Companion.transform
import js.array.ReadonlyArray

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ external class Cesium3DTileset(
* @property [pointCloudShading] Options for constructing a [PointCloudShading] object to control point attenuation based on geometric error and lighting.
* @property [lightColor] The light color when shading models. When `undefined` the scene's light color is used instead.
* @property [imageBasedLighting] The properties for managing image-based lighting for this tileset.
* @property [environmentMapOptions] The properties for managing dynamic environment maps on this tileset.
* @property [backFaceCulling] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
* Default value - `true`
* @property [enableShowOutline] Whether to enable outlines for models using the [CESIUM_primitive_outline](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline) extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.
Expand Down Expand Up @@ -1091,6 +1092,7 @@ external class Cesium3DTileset(
var pointCloudShading: Any?
var lightColor: Cartesian3?
var imageBasedLighting: ImageBasedLighting?
var environmentMapOptions: DynamicEnvironmentMapManager.ConstructorOptions?
var backFaceCulling: Boolean?
var enableShowOutline: Boolean?
var showOutline: Boolean?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ external class DynamicEnvironmentMapManager(
* @property [enabled] If true, the environment map and related properties will continue to update.
* Default value - `true`
* @property [mipmapLevels] The number of mipmap levels to generate for specular maps. More mipmap levels will produce a higher resolution specular reflection.
* Default value - `10`
* Default value - `7`
* @property [maximumSecondsDifference] The maximum amount of elapsed seconds before a new environment map is created.
* Default value - `3600`
* @property [maximumPositionEpsilon] The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results.
Expand Down
28 changes: 28 additions & 0 deletions cesium-kotlin/src/jsMain/kotlin/cesium/engine/ITwinData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,32 @@ external object ITwinData {
type: ITwinPlatform.RealityDataType? = definedExternally,
rootDocument: String? = definedExternally,
): Promise<Cesium3DTileset>

/**
* Create a data source of the correct type for the specified reality data id.
* This function only works for KML and GeoJSON type data.
*
* If the `type` or `rootDocument` are not provided this function
* will first request the full metadata for the specified reality data to fill these values.
* @param [iTwinId] The id of the iTwin to load data from
* @param [realityDataId] The id of the reality data to load
* @param [type] The type of this reality data
* @param [rootDocument] The path of the root document for this reality data
* @see <a href="https://cesium.com/docs/cesiumjs-ref-doc/ITwinData.html#.createDataSourceForRealityDataId">Online Documentation</a>
*/
@JsAsync
suspend fun createDataSourceForRealityDataId(
iTwinId: String,
realityDataId: String,
type: ITwinPlatform.RealityDataType? = definedExternally,
rootDocument: String? = definedExternally,
): Any /* GeoJsonDataSource | KmlDataSource */

@JsName("createDataSourceForRealityDataId")
fun createDataSourceForRealityDataIdAsync(
iTwinId: String,
realityDataId: String,
type: ITwinPlatform.RealityDataType? = definedExternally,
rootDocument: String? = definedExternally,
): Promise<Any /* GeoJsonDataSource | KmlDataSource */>
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ external object ITwinPlatform {
interface ExportType

/**
* Types of Reality data
* Types of Reality data. This is a partial list of types we know we can support
*/
interface RealityDataType

Expand Down
2 changes: 1 addition & 1 deletion cesium-kotlin/src/jsMain/kotlin/cesium/engine/Model.kt
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ private constructor() {
*
* The given name may be the name of a glTF extension, like `"EXT_example_extension"`.
* If the specified extension was present in the root of the underlying glTF asset,
* and a loder for the specified extension has processed the extension data, then
* and a loader for the specified extension has processed the extension data, then
* this will return the model representation of the extension.
* @param [extensionName] The name of the extension
* @return The object, or `undefined`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ external class ModelGraphics {
*/
var imageBasedLightingFactor: Property?

/**
* Gets or sets the [DynamicEnvironmentMapManager.ConstructorOptions] to apply to this model. This is represented as an [PropertyBag].
* @see <a href="https://cesium.com/docs/cesiumjs-ref-doc/ModelGraphics.html#environmentMapOptions">Online Documentation</a>
*/
var environmentMapOptions: PropertyBag

/**
* A property specifying the [Cartesian3] light color when shading the model. When `undefined` the scene's light color is used instead.
* @see <a href="https://cesium.com/docs/cesiumjs-ref-doc/ModelGraphics.html#lightColor">Online Documentation</a>
Expand Down
2 changes: 2 additions & 0 deletions cesium-kotlin/src/jsMain/kotlin/cesium/engine/Plane.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package cesium.engine

import cesium.engine.Plane.Companion.transform

/**
* A plane in Hessian Normal Form defined by
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cesium.engine

import cesium.engine.Quaternion.Companion.convertPackedArrayForInterpolation
import js.array.ReadonlyArray

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

package cesium.engine

import cesium.engine.RequestScheduler.requestsByServer


/**
* The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
* to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
Expand Down
1 change: 1 addition & 0 deletions cesium-kotlin/src/jsMain/kotlin/cesium/engine/Resource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package cesium.engine

import cesium.engine.Resource.Companion.options
import js.buffer.ArrayBuffer
import js.objects.JsPlainObject
import js.promise.Promise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package cesium.widgets

import cesium.engine.Clock
import cesium.engine.ClockRange
import web.dom.Element

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

package cesium.widgets

import cesium.engine.*
import cesium.engine.Cartesian2
import cesium.engine.Cartesian3

/**
* A function that converts the world position of an object to a screen space position.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package cesium.widgets

import cesium.engine.*
import cesium.engine.JulianDate

/**
* A function that formats a date for display.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package cesium.widgets

import cesium.engine.*

/**
* A function that handles the result of a successful geocode.
* @param [viewModel] The view model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package cesium.widgets

import cesium.engine.*
import cesium.engine.JulianDate

/**
* A function that formats a time for display.
Expand Down
2 changes: 0 additions & 2 deletions cesium-kotlin/src/jsMain/kotlin/cesium/widgets/ViewerMixin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package cesium.widgets

import cesium.engine.*

/**
* A function that augments a Viewer instance with additional functionality.
* @param [viewer] The viewer instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package cesium.widgets

import cesium.engine.*
import cesium.engine.Proxy
import js.objects.JsPlainObject
import web.dom.Element

Expand Down

0 comments on commit be4dccb

Please sign in to comment.