Search in sources :

Example 16 with ConstantPositionProperty

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

the class Labels method setRightToLeft.

private void setRightToLeft() {
    Label.enableRightToLeftDetection = true;
    LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
    labelGraphicsOptions.text = new ConstantProperty<>("Master (אדון): Hello\nתלמיד (student): שלום");
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222));
    entityOptions.label = new LabelGraphics(labelGraphicsOptions);
    csVPanel.getViewer().entities().add(entityOptions);
}
Also used : LabelGraphics(org.cesiumjs.cs.datasources.graphics.LabelGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) LabelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 17 with ConstantPositionProperty

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

the class Labels method offsetByDistance.

private void offsetByDistance() {
    final JsImage image = new JsImage();
    image.onload = new JsImage.Listener() {

        @Override
        public void function() {
            BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
            billboardGraphicsOptions.scaleByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 5.0, 1.5e7, 0.5));
            billboardGraphicsOptions.image = new ConstantProperty<>(image);
            LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
            labelGraphicsOptions.text = new ConstantProperty<>("Label on top of scaling billboard");
            labelGraphicsOptions.font = new ConstantProperty<>("20px sans-serif");
            labelGraphicsOptions.showBackground = new ConstantProperty<>(true);
            labelGraphicsOptions.horizontalOrigin = new ConstantProperty<>(HorizontalOrigin.CENTER());
            labelGraphicsOptions.pixelOffset = new ConstantProperty<>(new Cartesian2(0.0, -image.height));
            labelGraphicsOptions.pixelOffsetScaleByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 3.0, 1.5e7, 0.5));
            EntityOptions entityOptions = new EntityOptions();
            entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222));
            entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
            entityOptions.label = new LabelGraphics(labelGraphicsOptions);
            csVPanel.getViewer().entities().add(entityOptions);
        }
    };
    image.src = GWT.getModuleBaseURL() + "images/facility.gif";
}
Also used : JsImage(org.cesiumjs.cs.js.JsImage) ConstantProperty(org.cesiumjs.cs.datasources.properties.ConstantProperty) Cartesian2(org.cesiumjs.cs.core.Cartesian2) BillboardGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions) BillboardGraphics(org.cesiumjs.cs.datasources.graphics.BillboardGraphics) LabelGraphics(org.cesiumjs.cs.datasources.graphics.LabelGraphics) NearFarScalar(org.cesiumjs.cs.core.NearFarScalar) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) LabelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 18 with ConstantPositionProperty

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

the class Labels method setProperties.

private void setProperties() {
    LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
    labelGraphicsOptions.text = new ConstantProperty<>("Philadelphia");
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222, 300000.0));
    entityOptions.label = new LabelGraphics(labelGraphicsOptions);
    Entity entity = csVPanel.getViewer().entities().add(entityOptions);
    entity.label.scale = new ConstantProperty<>(2.0);
    entity.label.showBackground = new ConstantProperty<>(true);
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) LabelGraphics(org.cesiumjs.cs.datasources.graphics.LabelGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) LabelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 19 with ConstantPositionProperty

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

the class Labels method setFont.

private void setFont() {
    LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
    labelGraphicsOptions.text = new ConstantProperty<>("Philadelphia");
    labelGraphicsOptions.font = new ConstantProperty<>("24px Helvetica");
    labelGraphicsOptions.fillColor = new ConstantProperty<>(Color.SKYBLUE());
    labelGraphicsOptions.outlineColor = new ConstantProperty<>(Color.BLACK());
    labelGraphicsOptions.outlineWidth = new ConstantProperty<>(2);
    labelGraphicsOptions.style = new ConstantProperty<>(LabelStyle.FILL_AND_OUTLINE());
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222));
    entityOptions.label = new LabelGraphics(labelGraphicsOptions);
    csVPanel.getViewer().entities().add(entityOptions);
}
Also used : LabelGraphics(org.cesiumjs.cs.datasources.graphics.LabelGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) LabelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 20 with ConstantPositionProperty

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

the class Models3DColoring 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);
    modelGraphicsOptions.color = new ConstantProperty<>(getColor(colorStr, alpha));
    modelGraphicsOptions.colorBlendAmount = new ConstantProperty<>(colorBlendMode);
    modelGraphicsOptions.silhouetteColor = new ConstantProperty<>(silhouetteColor);
    modelGraphicsOptions.silhouetteSize = new ConstantProperty<>(silhouetteSize);
    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;
    org.cesiumjs.cs.core.HeadingPitchRoll hpr = new org.cesiumjs.cs.core.HeadingPitchRoll(heading, pitch, roll);
    Quaternion orientation = Transforms.headingPitchRollQuaternion(position, hpr);
    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 : ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) ModelGraphics(org.cesiumjs.cs.datasources.graphics.ModelGraphics) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions) ModelGraphics(org.cesiumjs.cs.datasources.graphics.ModelGraphics) org.cesiumjs.cs.core(org.cesiumjs.cs.core) ModelGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.ModelGraphicsOptions)

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