Examples of Globe


Examples of gov.nasa.worldwind.globes.Globe

        protected Vec4 getSurfacePoint(LatLon latlon, double elevation)
        {
            Vec4 point = null;

            SceneController sc = this.getApp().getWwd().getSceneController();
            Globe globe = this.getApp().getWwd().getModel().getGlobe();

            if (sc.getTerrain() != null)
            {
                point = sc.getTerrain().getSurfacePoint(
                    latlon.getLatitude(), latlon.getLongitude(), elevation * sc.getVerticalExaggeration());
            }

            if (point == null)
            {
                double e = globe.getElevation(latlon.getLatitude(), latlon.getLongitude());
                point = globe.computePointFromPosition(
                    latlon.getLatitude(), latlon.getLongitude(), (e + elevation) * sc.getVerticalExaggeration());
            }

            return point;
        }
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        }

        protected Vec4 getPoint(LatLon latlon, double elevation)
        {
            SceneController sc = this.getApp().getWwd().getSceneController();
            Globe globe = this.getApp().getWwd().getModel().getGlobe();
            double e = globe.getElevation(latlon.getLatitude(), latlon.getLongitude());
            return globe.computePointFromPosition(
                latlon.getLatitude(), latlon.getLongitude(), (e + elevation) * sc.getVerticalExaggeration());
        }
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    *
    * @return the terrain surface point the view would be looking at in the viewport center.
    */
   protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
   {
      Globe globe = wwd.getModel().getGlobe();
      // Compute transform to be applied to north pointing Y so that it would point in the view direction
      // Move coordinate system to view center point
      Matrix transform = globe.computeSurfaceOrientationAtPosition(view.getCenterPosition());
      // Rotate so that the north pointing axes Y will point in the look at direction
      transform = transform.multiply(Matrix.fromRotationZ(heading.multiply(-1)));
      transform = transform.multiply(Matrix.fromRotationX(Angle.NEG90.add(pitch)));
      // Compute forward vector
      Vec4 forward = Vec4.UNIT_Y.transformBy4(transform);
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    // *** Metric accessors ***

    public double getLength()
    {
        Globe globe = this.wwd.getModel().getGlobe();

        if (this.line != null)
            return this.line.getLength(globe);

        if (this.surfaceShape != null)
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        return -1;
    }

    public double getArea()
    {
        Globe globe = this.wwd.getModel().getGlobe();

        if (this.surfaceShape != null)
            return this.surfaceShape.getArea(globe, this.followTerrain);

        return -1;
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

                // Add a control point with a leader to the top of the shape.
                this.addControlPointWithLeader(Position.ZERO, CONTROL_TYPE_REGULAR_SHAPE, NORTH_LEADER,
                    CONTROL_TYPE_LEADER_ORIGIN, NORTH);
            }

            Globe globe = this.getWwd().getModel().getGlobe();

            // Update control points positions
            for (Renderable r : this.controlPoints)
            {
                ControlPoint cp = (ControlPoint) r;
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        }
    }

    protected void updateControlPointWithLeader(ControlPointWithLeader cp, LatLon controlLocation)
    {
        Globe globe = this.getWwd().getModel().getGlobe();

        String leaderControl = cp.getStringValue(CONTROL_TYPE_LEADER_ORIGIN);
        if (leaderControl == null)
            return;
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        }
    }

    protected void updatePositionsFromShape()
    {
        Globe globe = this.wwd.getModel().getGlobe();

        this.positions.clear();

        Iterable<? extends LatLon> locations = this.surfaceShape.getLocations(globe);
        if (locations != null)
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    {
        Vec4 surfacePoint = this.wwd.getSceneController().getTerrain().getSurfacePoint(
            pos.getLatitude(), pos.getLongitude());
        if (surfacePoint == null)
        {
            Globe globe = this.wwd.getModel().getGlobe();
            surfacePoint = globe.computePointFromPosition(pos.getLatitude(), pos.getLongitude(),
                globe.getElevation(pos.getLatitude(), pos.getLongitude()));
        }

        return this.wwd.getView().project(surfacePoint);
    }
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    }

    public static List<LatLon> s_createSquareInViewport(WorldWindow wwd, Position position, Angle heading,
        double sizeInMeters)
    {
        Globe globe = wwd.getModel().getGlobe();
        Matrix transform = Matrix.IDENTITY;
        transform = transform.multiply(globe.computeSurfaceOrientationAtPosition(position));
        transform = transform.multiply(Matrix.fromRotationZ(heading.multiply(-1)));

        double widthOver2 = sizeInMeters / 2.0;
        double heightOver2 = sizeInMeters / 2.0;
        Vec4[] points = new Vec4[]
            {
                new Vec4(-widthOver2, -heightOver2, 0.0).transformBy4(transform), // lower left
                new Vec4(widthOver2, -heightOver2, 0.0).transformBy4(transform), // lower right
                new Vec4(widthOver2, heightOver2, 0.0).transformBy4(transform), // upper right
                new Vec4(-widthOver2, heightOver2, 0.0).transformBy4(transform// upper left
            };

        LatLon[] locations = new LatLon[points.length];
        for (int i = 0; i < locations.length; i++)
        {
            locations[i] = new LatLon(globe.computePositionFromPoint(points[i]));
        }

        return Arrays.asList(locations);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.