Search in sources :

Example 26 with ConstantPositionProperty

use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.

the class Billboards method setBillboardProperties.

private void setBillboardProperties() {
    BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
    // default: undefined
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
    // default
    billboardGraphicsOptions.show = new ConstantProperty<>(true);
    // default: (0, 0)
    billboardGraphicsOptions.pixelOffset = new ConstantProperty<>(new Cartesian2(0, -50));
    // default
    billboardGraphicsOptions.eyeOffset = new ConstantProperty<>(new Cartesian3(0, 0, 0));
    // default
    billboardGraphicsOptions.horizontalOrigin = new ConstantProperty<>(HorizontalOrigin.CENTER());
    // default: CENTER
    billboardGraphicsOptions.verticalOrigin = new ConstantProperty<>(VerticalOrigin.BOTTOM());
    // default: 1.0
    billboardGraphicsOptions.scale = new ConstantProperty<>(2.0);
    // default: WHITE
    billboardGraphicsOptions.color = new ConstantProperty<>(Color.LIME());
    // default: 0.0
    billboardGraphicsOptions.rotation = new ConstantProperty<>(Math.PI_OVER_FOUR());
    // default
    billboardGraphicsOptions.alignedAxis = new ConstantProperty<>(Cartesian3.ZERO());
    // default: undefined
    billboardGraphicsOptions.width = new ConstantProperty<>(100);
    // default: undefined
    billboardGraphicsOptions.height = new ConstantProperty<>(25);
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) BillboardGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions) BillboardGraphics(org.cesiumjs.cs.datasources.graphics.BillboardGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 27 with ConstantPositionProperty

use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.

the class Models3D method createModel.

private void createModel(String url, double height) {
    csVPanel.getViewer().entities().removeAll();
    ModelGraphicsOptions modelGraphicsOptions = new ModelGraphicsOptions();
    modelGraphicsOptions.uri = new ConstantProperty<>(url);
    modelGraphicsOptions.minimumPixelSize = new ConstantProperty<>(128);
    modelGraphicsOptions.maximumScale = new ConstantProperty<>(20000);
    ModelGraphics modelGraphics = new ModelGraphics(modelGraphicsOptions);
    Cartesian3 position = Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
    double heading = Math.toRadians(135);
    double pitch = 0;
    double roll = 0;
    Quaternion orientation = Transforms.headingPitchRollQuaternion(position, new org.cesiumjs.cs.core.HeadingPitchRoll(heading, pitch, roll));
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.name = url;
    entityOptions.position = new ConstantPositionProperty(position);
    entityOptions.orientation = new ConstantProperty<>(orientation);
    entityOptions.model = modelGraphics;
    csVPanel.getViewer().trackedEntity = csVPanel.getViewer().entities().add(entityOptions);
    ;
}
Also used : ModelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.ModelGraphicsOptions) Cartesian3(org.cesiumjs.cs.core.Cartesian3) Quaternion(org.cesiumjs.cs.core.Quaternion) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) ModelGraphics(org.cesiumjs.cs.datasources.graphics.ModelGraphics) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 28 with ConstantPositionProperty

use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.

the class Shadows method setLocation.

public void setLocation(Location location) {
    double lon = location.lon;
    double lat = location.lat;
    double height = location.height;
    for (int i = 0; i < csVPanel.getViewer().entities().values().length; ++i) {
        Entity entity = csVPanel.getViewer().entities().values()[i];
        entity.position = new ConstantPositionProperty(Cartesian3.fromRadians(lon, lat, height + JsObject.getNumber(entity, "height").doubleValue()));
    }
    csVPanel.getViewer().clock().currentTime = new JulianDate(location.date);
    csVPanel.getViewer().clock().multiplier = 1.0;
}
Also used : JulianDate(org.cesiumjs.cs.core.JulianDate) Entity(org.cesiumjs.cs.datasources.Entity) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty)

Aggregations

ConstantPositionProperty (org.cesiumjs.cs.datasources.properties.ConstantPositionProperty)28 EntityOptions (org.cesiumjs.cs.datasources.options.EntityOptions)27 Entity (org.cesiumjs.cs.datasources.Entity)16 BillboardGraphics (org.cesiumjs.cs.datasources.graphics.BillboardGraphics)12 BillboardGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions)12 LabelGraphics (org.cesiumjs.cs.datasources.graphics.LabelGraphics)8 LabelGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions)8 ModelGraphics (org.cesiumjs.cs.datasources.graphics.ModelGraphics)6 ModelGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.ModelGraphicsOptions)6 ViewerPanel (org.cesiumjs.cs.widgets.ViewerPanel)6 HTML (com.google.gwt.user.client.ui.HTML)5 ConstantProperty (org.cesiumjs.cs.datasources.properties.ConstantProperty)5 ColorMaterialProperty (org.cesiumjs.cs.datasources.properties.ColorMaterialProperty)4 ViewerOptions (org.cesiumjs.cs.widgets.options.ViewerOptions)4 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)3 ClippingPlaneCollection (org.cesiumjs.cs.collections.ClippingPlaneCollection)3 ClippingPlaneCollectionOptions (org.cesiumjs.cs.collections.options.ClippingPlaneCollectionOptions)3 Cartesian3 (org.cesiumjs.cs.core.Cartesian3)3 NearFarScalar (org.cesiumjs.cs.core.NearFarScalar)3 JsImage (org.cesiumjs.cs.js.JsImage)3