Commit ea3aec3e authored by iSergio's avatar iSergio
Browse files

Cesium3DTileset now has a splitDirection property, allowing the tileset to...

Cesium3DTileset now has a splitDirection property, allowing the tileset to only be drawn on the left or right side of the screen. This is useful for visual comparison of tilesets.
parent 0c6c783c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import org.cesiumjs.cs.js.JsObject;
import org.cesiumjs.cs.promise.Promise;
import org.cesiumjs.cs.scene.enums.Cesium3DTileColorBlendMode;
import org.cesiumjs.cs.scene.enums.ClassificationType;
import org.cesiumjs.cs.scene.enums.SplitDirection;
import org.cesiumjs.cs.scene.experimental.CustomShader;
import org.cesiumjs.cs.scene.options.Cesium3DTilesetOptions;

@@ -423,6 +424,12 @@ public class Cesium3DTileset {
     */
    @JsProperty
    public Cartesian3[] sphericalHarmonicCoefficients;
    /**
     * The SplitDirection to apply to this tileset.
     * Default: {@link SplitDirection#NONE()}
     */
    @JsProperty
    public Number splitDirection;
    /**
     * The style, defined using the 3D Tiles Styling language, applied to each
     * feature in the tileset. Assign undefined to remove the style, which will
+7 −0
Original line number Diff line number Diff line
@@ -140,7 +140,9 @@ public class Scene {
    /**
     * Gets or sets the position of the Imagery splitter within the viewport. Valid
     * values are between 0.0 and 1.0.
     * @deprecated Use splitPosition instead.
     */
    @Deprecated
    @JsProperty
    public double imagerySplitPosition;
    /**
@@ -302,6 +304,11 @@ public class Scene {
     */
    @JsProperty
    public Cartesian3[] sphericalHarmonicCoefficients;
    /**
     * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.
     */
    @JsProperty
    public double splitPosition;
    /**
     * The Sun. Default: undefined
     */
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 iSergio, 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.enums;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 * The direction to display a primitive or ImageryLayer relative to the {@link org.cesiumjs.cs.scene.Scene#splitPosition}.
 *
 * @enum {Number}
 *
 * @see org.cesiumjs.cs.scene.ImageryLayer#splitDirection
 * @see org.cesiumjs.cs.scene.Cesium3DTileset#splitDirection
 */
@JsType(isNative = true, namespace = "Cesium", name = "SplitDirection")
public class SplitDirection {
    /**
     * Display the primitive or ImageryLayer to the left of the {@link org.cesiumjs.cs.scene.Scene#splitPosition}.
     */
    @JsProperty(name = "LEFT")
    public final native Number LEFT();
    /**
     *  Always display the primitive or ImageryLayer.
     */
    @JsProperty(name = "NONE")
    public final native Number NONE();

    /**
     * Display the primitive or ImageryLayer to the right of the {@link org.cesiumjs.cs.scene.Scene#splitPosition}.
     */
    @JsProperty(name = "RIGHT")
    public final native Number RIGHT();

    @JsConstructor
    private SplitDirection() {}
}
+15 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import org.cesiumjs.cs.promise.Promise;
import org.cesiumjs.cs.scene.Cesium3DTileset;
import org.cesiumjs.cs.scene.PointCloudShading;
import org.cesiumjs.cs.scene.enums.ClassificationType;
import org.cesiumjs.cs.scene.enums.SplitDirection;
import org.cesiumjs.cs.scene.experimental.CustomShader;

/**
@@ -329,7 +330,7 @@ public class Cesium3DTilesetOptions {
     * Default: 0
     */
    @JsProperty
    public double featureIdIndex;
    public double featureIdLabel;
    /**
     * 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.
@@ -337,7 +338,19 @@ public class Cesium3DTilesetOptions {
     * Default: 0
     */
    @JsProperty
    public double instanceFeatureIdIndex;
    public double instanceFeatureIdLabel;
    /**
     * Whether to display the credits of this tileset on screen.
     * Default: false
     */
    @JsProperty
    public boolean showCreditsOnScreen;
    /**
     * The SplitDirection split to apply to this tileset.
     * Default: {@link SplitDirection#NONE()}
     */
    @JsProperty
    public Number splitDirection;
    /**
     * The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's
     * specified variable value.