Commit 4c996733 authored by iSergio's avatar iSergio
Browse files

Merge branch '1.90' into 'develop'

Version up to 1.90.0

See merge request !27
parents a4b08f6c 6f7c07fe
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
    <parent>
        <artifactId>cesiumjs4gwt</artifactId>
        <groupId>org.cesiumjs</groupId>
        <version>1.89.0</version>
        <version>1.90.0</version>
    </parent>

    <name>CesiumJS GWT Wrapper</name>
+6 −0
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ public class Cesium3DTileFeature extends PickedObject {
     */
    @JsProperty
    public Color color;
    /**
     * Get the feature ID associated with this feature. For 3D Tiles 1.0, the batch ID is returned. For
     * EXT_mesh_features, this is the feature ID from the selected feature ID set.
     */
    @JsProperty(name = "featureId")
    public native double featureId();
    /**
     * Gets a typed array containing the ECEF positions of the polyline.
     * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false or the feature
+23 −0
Original line number Diff line number Diff line
@@ -144,6 +144,29 @@ public class Cesium3DTileset {
     */
    @JsProperty
    public CustomShader customShader;
    /**
     * The index into the list of primitive feature IDs used for picking and styling. For EXT_feature_metadata,
     * feature ID attributes are listed before feature ID textures. If both per-primitive and per-instance feature
     * IDs are present, the instance feature IDs take priority.
     *
     * Default: 0
     */
    @JsProperty
    public double featureIdIndex;
    /**
     * The index into the list of instance feature IDs used for picking and styling. If both per-primitive and
     * per-instance feature IDs are present, the instance feature IDs take priority.
     *
     * Default: 0
     */
    @JsProperty
    public double instanceFeatureIdIndex;
    /**
     * The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's
     * specified variable value.
     */
    @JsProperty
    public String debugHeatmapTilePropertyName;
    /**
     * For debugging only. Determines if only the tiles from last frame should be
     * used for rendering. Defaule: false;
+9 −4
Original line number Diff line number Diff line
@@ -74,17 +74,22 @@ public class ModelExperimental {
    @JsProperty
    public boolean debugShowBoundingVolume;
    /**
     * The index of the feature ID attribute to use for picking features per-instance or per-primitive.
     * The index into the list of primitive feature IDs used for picking and styling. For EXT_feature_metadata,
     * feature ID attributes are listed before feature ID textures. If both per-primitive and per-instance feature
     * IDs are present, the instance feature IDs take priority.
     *
     * Default: 0
     */
    @JsProperty
    public Number featureIdAttributeIndex;
    public double featureIdIndex;
    /**
     * The index of the feature ID texture to use for picking features per-primitive.
     * The index into the list of instance feature IDs used for picking and styling. If both per-primitive and
     * per-instance feature IDs are present, the instance feature IDs take priority.
     *
     * Default: 0
     */
    @JsProperty
    public Number featureIdTextureIndex;
    public double instanceFeatureIdIndex;
    /**
     * When true, this model is ready to render, i.e., the external binary, image, and shader files were downloaded and the WebGL resources were created. This is set to true right before ModelExperimental#readyPromise is resolved.
     * Default: false
+122 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 iserge, Gis4Fun.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.cesiumjs.cs.scene.experimental;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import org.cesiumjs.cs.core.Cartesian2;
import org.cesiumjs.cs.core.Color;
import org.cesiumjs.cs.js.JsArray;
import org.cesiumjs.cs.scene.experimental.options.ModelFeatureOptions;

/**
 * A feature of a {@link ModelExperimental}.
 * Provides access to a feature's properties stored in the model's feature table.
 *
 * Modifications to a ModelFeature object have the lifetime of the model.
 *
 * Do not construct this directly. Access it through picking using {@link org.cesiumjs.cs.scene.Scene#pick}.
 */
@JsType(isNative = true, namespace = "Cesium", name = "ModelFeature")
public class ModelFeature {
    /**
     * Gets or sets the highlight color multiplied with the feature's color. When this is white, the feature's color
     * is not changed. This is set for all features when a style's color is evaluated.
     *
     * Default: {@link Color#WHITE()}
     */
    public Color color;
    /**
     * Get the feature ID associated with this feature. For 3D Tiles 1.0, the batch ID is returned.
     * For EXT_mesh_features, this is the feature ID from the selected feature ID set.
     *
     * <p>Experimental</p>
     * <p>This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's
     *     standard deprecation policy.</p>
     */
    @JsProperty(name = "featureId")
    public native double featureId();
    /**
     * Gets or sets if the feature will be shown. This is set for all features when a style's show is evaluated.
     * Default: true
     */
    @JsProperty
    public boolean show;

    private ModelFeature() {}

    @JsConstructor
    public ModelFeature(ModelFeatureOptions options) {}

    /**
     * Returns a copy of the value of the feature's property with the given name.
     *
     * @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.
     */
    @JsMethod
    public native Object getProperty(String name);

    /**
     * Returns a copy of the feature's property with the given name, examining all the metadata from the
     * EXT_mesh_features and legacy EXT_feature_metadata glTF extensions. Metadata is checked against name from
     * most specific to most general and the first match is returned. Metadata is checked in this order:
     * <p>
     * 1. Feature metadata property by semantic
     * 2. Feature metadata property by property ID
     * </p>
     * <p>See the EXT_mesh_features Extension as well as the previous EXT_feature_metadata Extension for glTF.</p>
     * @param name The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.
     * @return The value of the property or undefined if the feature does not have this property.
     */
    @JsMethod
    public native Object getPropertyInherited(String name);

    /**
     * Returns an array of property names for the feature.
     * @return The names of the feature's properties.
     */
    @JsMethod
    public native String[] getPropertyNames();

    /**
     * Returns an array of property names for the feature.
     * @param results An array into which to store the results.
     * @return The names of the feature's properties.
     */
    @JsMethod
    public native JsArray<String> getPropertyNames(JsArray<String> results);

    /**
     * Returns whether the feature contains this property.
     * @param name The case-sensitive name of the property.
     * @return Whether the feature contains this property.
     */
    @JsMethod
    public native boolean hasProperty(String name);

    /**
     * Sets the value of the feature's property with the given name.
     * @param name The case-sensitive name of the property.
     * @param value The value of the property that will be copied.
     * @return true if the property was set, false otherwise.
     */
    @JsMethod
    public native boolean setProperty(String name, Object value);
}
Loading