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

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

There is a newer version: 1.90.0-10
Show newest version
// Automatically generated - do not modify!

package cesium

/**
 * A point feature of a [Cesium3DTileset].
 *
 * Provides access to a feature's properties stored in the tile's batch table, as well
 * as the ability to show/hide a feature and change its point properties
 *
 * Modifications to a `Cesium3DTilePointFeature` object have the lifetime of the tile's
 * content.  If the tile's content is unloaded, e.g., due to it going out of view and needing
 * to free space in the cache for visible tiles, listen to the [Cesium3DTileset.tileUnload] event to save any
 * modifications. Also listen to the [Cesium3DTileset.tileVisible] event to reapply any modifications.
 *
 * Do not construct this directly.  Access it through [Cesium3DTileContent.getFeature]
 * or picking using [Scene.pick] and [Scene.pickPosition].
 * ```
 * // On mouse over, display all the properties for a feature in the console log.
 * handler.setInputAction(function(movement) {
 *     var feature = scene.pick(movement.endPosition);
 *     if (feature instanceof Cesium3DTilePointFeature) {
 *         var propertyNames = feature.getPropertyNames();
 *         var length = propertyNames.length;
 *         for (var i = 0; i < length; ++i) {
 *             var propertyName = propertyNames[i];
 *             console.log(propertyName + ': ' + feature.getProperty(propertyName));
 *         }
 *     }
 * }, ScreenSpaceEventType.MOUSE_MOVE);
 * ```
 * @see Online Documentation
 */
@JsName("\$cesium__Cesium3DTilePointFeature")
external class Cesium3DTilePointFeature {
    /**
     * Gets or sets if the feature will be shown. This is set for all features
     * when a style's show is evaluated.
     * @see Online Documentation
     */
    var show: Boolean

    /**
     * Gets or sets the color of the point of this feature.
     *
     * Only applied when `image` is `undefined`.
     * @see Online Documentation
     */
    var color: Color

    /**
     * Gets or sets the point size of this feature.
     *
     * Only applied when `image` is `undefined`.
     * @see Online Documentation
     */
    var pointSize: Double

    /**
     * Gets or sets the point outline color of this feature.
     *
     * Only applied when `image` is `undefined`.
     * @see Online Documentation
     */
    var pointOutlineColor: Color

    /**
     * Gets or sets the point outline width in pixels of this feature.
     *
     * Only applied when `image` is `undefined`.
     * @see Online Documentation
     */
    var pointOutlineWidth: Double

    /**
     * Gets or sets the label color of this feature.
     *
     * The color will be applied to the label if `labelText` is defined.
     * @see Online Documentation
     */
    var labelColor: Color

    /**
     * Gets or sets the label outline color of this feature.
     *
     * The outline color will be applied to the label if `labelText` is defined.
     * @see Online Documentation
     */
    var labelOutlineColor: Color

    /**
     * Gets or sets the outline width in pixels of this feature.
     *
     * The outline width will be applied to the point if `labelText` is defined.
     * @see Online Documentation
     */
    var labelOutlineWidth: Double

    /**
     * Gets or sets the font of this feature.
     *
     * Only applied when the `labelText` is defined.
     * @see Online Documentation
     */
    var font: String

    /**
     * Gets or sets the fill and outline style of this feature.
     *
     * Only applied when `labelText` is defined.
     * @see Online Documentation
     */
    var labelStyle: LabelStyle

    /**
     * Gets or sets the text for this feature.
     * @see Online Documentation
     */
    var labelText: String

    /**
     * Gets or sets the background color of the text for this feature.
     *
     * Only applied when `labelText` is defined.
     * @see Online Documentation
     */
    var backgroundColor: Color

    /**
     * Gets or sets the background padding of the text for this feature.
     *
     * Only applied when `labelText` is defined.
     * @see Online Documentation
     */
    var backgroundPadding: Cartesian2

    /**
     * Gets or sets whether to display the background of the text for this feature.
     *
     * Only applied when `labelText` is defined.
     * @see Online Documentation
     */
    var backgroundEnabled: Boolean

    /**
     * Gets or sets the near and far scaling properties for this feature.
     * @see Online Documentation
     */
    var scaleByDistance: NearFarScalar

    /**
     * Gets or sets the near and far translucency properties for this feature.
     * @see Online Documentation
     */
    var translucencyByDistance: NearFarScalar

    /**
     * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
     * @see Online Documentation
     */
    var distanceDisplayCondition: DistanceDisplayCondition

    /**
     * Gets or sets the height offset in meters of this feature.
     * @see Online Documentation
     */
    var heightOffset: Double

    /**
     * Gets or sets whether the anchor line is displayed.
     *
     * Only applied when `heightOffset` is defined.
     * @see Online Documentation
     */
    var anchorLineEnabled: Boolean

    /**
     * Gets or sets the color for the anchor line.
     *
     * Only applied when `heightOffset` is defined.
     * @see Online Documentation
     */
    var anchorLineColor: Color

    /**
     * Gets or sets the image of this feature.
     * @see Online Documentation
     */
    var image: String

    /**
     * Gets or sets the distance where depth testing will be disabled.
     * @see Online Documentation
     */
    var disableDepthTestDistance: Double

    /**
     * Gets or sets the horizontal origin of this point, which determines if the point is
     * to the left, center, or right of its anchor position.
     * @see Online Documentation
     */
    var horizontalOrigin: HorizontalOrigin

    /**
     * Gets or sets the vertical origin of this point, which determines if the point is
     * to the bottom, center, or top of its anchor position.
     * @see Online Documentation
     */
    var verticalOrigin: VerticalOrigin

    /**
     * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
     * to the left, center, or right of its anchor position.
     * @see Online Documentation
     */
    var labelHorizontalOrigin: HorizontalOrigin

    /**
     * Get or sets the vertical origin of this point's text, which determines if the point's text is
     * to the bottom, center, top, or baseline of it's anchor point.
     * @see Online Documentation
     */
    var labelVerticalOrigin: VerticalOrigin

    /**
     * Gets the tileset containing the feature.
     * @see Online Documentation
     */
    val tileset: Cesium3DTileset

    /**
     * All objects returned by [Scene.pick] have a `primitive` property. This returns
     * the tileset containing the feature.
     * @see Online Documentation
     */
    val primitive: Cesium3DTileset

    /**
     * Returns whether the feature contains this property. This includes properties from this feature's
     * class and inherited classes when using a batch table hierarchy.
     * @param [name] The case-sensitive name of the property.
     * @return Whether the feature contains this property.
     * @see Online Documentation
     */
    fun hasProperty(name: String): Boolean

    /**
     * Returns an array of property names for the feature. This includes properties from this feature's
     * class and inherited classes when using a batch table hierarchy.
     * @param [results] An array into which to store the results.
     * @return The names of the feature's properties.
     * @see Online Documentation
     */
    fun getPropertyNames(results: Array? = definedExternally): Array

    /**
     * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
     * class and inherited classes when using a batch table hierarchy.
     * ```
     * // Display all the properties for a feature in the console log.
     * var propertyNames = feature.getPropertyNames();
     * var length = propertyNames.length;
     * for (var i = 0; i < length; ++i) {
     *     var propertyName = propertyNames[i];
     *     console.log(propertyName + ': ' + feature.getProperty(propertyName));
     * }
     * ```
     * @param [name] The case-sensitive name of the property.
     * @return The value of the property or `undefined` if the feature does not have this property.
     * @see Online Documentation
     */
    fun getProperty(name: String): Any

    /**
     * Sets the value of the feature's property with the given name.
     *
     * If a property with the given name doesn't exist, it is created.
     * ```
     * var height = feature.getProperty('Height'); // e.g., the height of a building
     * ```
     * ```
     * var name = 'clicked';
     * if (feature.getProperty(name)) {
     *     console.log('already clicked');
     * } else {
     *     feature.setProperty(name, true);
     *     console.log('first click');
     * }
     * ```
     * @param [name] The case-sensitive name of the property.
     * @param [value] The value of the property that will be copied.
     * @see Online Documentation
     */
    fun setProperty(
        name: String,
        value: Any,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy