Search in sources :

Example 1 with EllipsoidSurfaceAppearance

use of org.cesiumjs.cs.scene.apperances.EllipsoidSurfaceAppearance in project gwt-cs by iSergio.

the class Materials method createPrimitives.

public void createPrimitives(Scene scene) {
    PrimitiveOptions primitiveOptions = new PrimitiveOptions();
    GeometryInstanceOptions geometryInstanceOptions = new GeometryInstanceOptions();
    RectangleGeometryOptions rectangleGeometryOptions = new RectangleGeometryOptions();
    rectangleGeometryOptions.rectangle = Rectangle.fromDegrees(-120.0, 20.0, -60.0, 40.0);
    rectangleGeometryOptions.vertexFormat = EllipsoidSurfaceAppearance.VERTEX_FORMAT();
    geometryInstanceOptions.geometry = RectangleGeometry.createGeometry(new RectangleGeometry(rectangleGeometryOptions));
    primitiveOptions.geometryInstances = new GeometryInstance[] { new GeometryInstance(geometryInstanceOptions) };
    EllipsoidSurfaceAppearanceOptions ellipsoidSurfaceAppearanceOptions = new EllipsoidSurfaceAppearanceOptions();
    ellipsoidSurfaceAppearanceOptions.aboveGround = false;
    primitiveOptions.asynchronous = false;
    primitiveOptions.appearance = new EllipsoidSurfaceAppearance(ellipsoidSurfaceAppearanceOptions);
    rectangle = (Primitive) scene.primitives().add(new Primitive(primitiveOptions));
    primitiveOptions = new PrimitiveOptions();
    geometryInstanceOptions = new GeometryInstanceOptions();
    rectangleGeometryOptions = new RectangleGeometryOptions();
    rectangleGeometryOptions.rectangle = Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0);
    rectangleGeometryOptions.vertexFormat = EllipsoidSurfaceAppearance.VERTEX_FORMAT();
    geometryInstanceOptions.geometry = RectangleGeometry.createGeometry(new RectangleGeometry(rectangleGeometryOptions));
    primitiveOptions.geometryInstances = new GeometryInstance[] { new GeometryInstance(geometryInstanceOptions) };
    ellipsoidSurfaceAppearanceOptions = new EllipsoidSurfaceAppearanceOptions();
    ellipsoidSurfaceAppearanceOptions.aboveGround = false;
    primitiveOptions.appearance = new EllipsoidSurfaceAppearance(ellipsoidSurfaceAppearanceOptions);
    primitiveOptions.show = false;
    primitiveOptions.asynchronous = false;
    worldRectangle = (Primitive) scene.primitives().add(new Primitive(primitiveOptions));
    PolylineCollection polylines = (PolylineCollection) scene.primitives().add(new PolylineCollection());
    PolylineOptions polylineOptions = new PolylineOptions();
    PolylinePipelineOptions polylinePipelineOptions = new PolylinePipelineOptions();
    polylinePipelineOptions.positions = Cartesian3.fromDegreesArray(new double[] { -110.0, 42.0, -85.0, 36.0, -100.0, 25.0, -77.0, 12.0 });
    polylineOptions.positions = PolylinePipeline.generateCartesianArc(polylinePipelineOptions);
    polylineOptions.width = 10.0;
    polylineOptions.show = false;
    polyline = polylines.add(polylineOptions);
}
Also used : PolylinePipelineOptions(org.cesiumjs.cs.core.options.PolylinePipelineOptions) Primitive(org.cesiumjs.cs.scene.Primitive) GeometryInstanceOptions(org.cesiumjs.cs.core.options.GeometryInstanceOptions) RectangleGeometryOptions(org.cesiumjs.cs.core.geometry.options.RectangleGeometryOptions) GeometryInstance(org.cesiumjs.cs.core.geometry.GeometryInstance) RectangleGeometry(org.cesiumjs.cs.core.geometry.RectangleGeometry) PolylineCollection(org.cesiumjs.cs.collections.PolylineCollection) PrimitiveOptions(org.cesiumjs.cs.scene.options.PrimitiveOptions) EllipsoidSurfaceAppearance(org.cesiumjs.cs.scene.apperances.EllipsoidSurfaceAppearance) EllipsoidSurfaceAppearanceOptions(org.cesiumjs.cs.scene.apperances.options.EllipsoidSurfaceAppearanceOptions) PolylineOptions(org.cesiumjs.cs.scene.options.PolylineOptions)

Aggregations

PolylineCollection (org.cesiumjs.cs.collections.PolylineCollection)1 GeometryInstance (org.cesiumjs.cs.core.geometry.GeometryInstance)1 RectangleGeometry (org.cesiumjs.cs.core.geometry.RectangleGeometry)1 RectangleGeometryOptions (org.cesiumjs.cs.core.geometry.options.RectangleGeometryOptions)1 GeometryInstanceOptions (org.cesiumjs.cs.core.options.GeometryInstanceOptions)1 PolylinePipelineOptions (org.cesiumjs.cs.core.options.PolylinePipelineOptions)1 Primitive (org.cesiumjs.cs.scene.Primitive)1 EllipsoidSurfaceAppearance (org.cesiumjs.cs.scene.apperances.EllipsoidSurfaceAppearance)1 EllipsoidSurfaceAppearanceOptions (org.cesiumjs.cs.scene.apperances.options.EllipsoidSurfaceAppearanceOptions)1 PolylineOptions (org.cesiumjs.cs.scene.options.PolylineOptions)1 PrimitiveOptions (org.cesiumjs.cs.scene.options.PrimitiveOptions)1