Examples of Globe


Examples of gov.nasa.worldwind.globes.Globe

     *
     * @return Positions along the arc.
     */
    protected List<Position> computeArcPositions(DrawContext dc, ArcData arcData)
    {
        Globe globe = dc.getGlobe();

        Angle da = arcData.arcAngle.divide(this.intervals);
        double globeRadius = globe.getRadiusAt(arcData.center.getLatitude(), arcData.center.getLongitude());
        double radiusRadians = arcData.radius / globeRadius;

        // Compute the arc positions
        int intervals = this.getIntervals();
        List<Position> positions = new ArrayList<Position>(intervals);
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        SegmentPlaneAttributes.GeometryAttributes attributes = segmentPlane.getAttributes().getGeometryAttributes(
            SegmentPlane.PLANE_BORDER);

        View view = dc.getView();
        Globe globe = dc.getGlobe();
        double[] altitudes = segmentPlane.getPlaneAltitudes();
        LatLon[] locations = segmentPlane.getPlaneLocations();
        int mask = segmentPlane.getBorderMask();

        Vec4 p1 = globe.computePointFromPosition(locations[0].getLatitude(), locations[0].getLongitude(),
            altitudes[0]);
        Vec4 p2 = globe.computePointFromPosition(locations[0].getLatitude(), locations[0].getLongitude(),
            altitudes[1]);
        Vec4 referencePoint = p1.add3(p2).divide3(2.0);

        double size = this.computeObjectSize(view, globe, segmentPlane, SegmentPlane.PLANE_BORDER, referencePoint,
            dc.isPickingMode());
        double height = altitudes[1] - altitudes[0];

        GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
        OGLStackHandler oglsh = new OGLStackHandler();
        oglsh.pushModelview(gl);
        try
        {
            if ((mask & SegmentPlane.LEFT) != 0)
            {
                Matrix modelview = view.getModelviewMatrix();
                modelview = modelview.multiply(globe.computeSurfaceOrientationAtPosition(
                    locations[0].getLatitude(), locations[0].getLongitude(), altitudes[0]));

                this.drawBorder(dc, renderInfo, modelview, size, height);
            }
        }
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

     * @param pathCount  Number of leg paths to create. The {@code paths} array must have length of at least {@code
     *                   startIndex + pathCount}.
     */
    protected void createLegs(DrawContext dc, ArcData arcData, Path[] paths, int startIndex, int pathCount)
    {
        Globe globe = dc.getGlobe();

        Vec4 p1 = globe.computePointFromPosition(this.position1);
        Vec4 pMid = globe.computePointFromLocation(arcData.midpoint);

        //     __\
        //     ___\
        //     ____|Mid___\ Pt. 1
        //     ____|      /
        //     ___/
        //       /
        //  ^ Legs^

        // The end point of each leg will be computed by adding an offset in the direction of the arrow to a point on
        // the arc.
        Vec4 vOffset = pMid.subtract3(p1);
        vOffset = vOffset.normalize3().multiply3(vOffset.getLength3() * this.getLegLength());

        Angle da = arcData.arcAngle.divide(pathCount);
        double globeRadius = globe.getRadiusAt(arcData.center.getLatitude(), arcData.center.getLongitude());
        double radiusRadians = arcData.radius / globeRadius;

        for (int i = 0; i < pathCount; i++)
        {
            double angle = (i + 0.5) * da.radians + arcData.startAngle.radians;

            LatLon ll = LatLon.greatCircleEndPosition(arcData.center, angle, radiusRadians);

            Vec4 start = globe.computePointFromLocation(ll);
            Vec4 end = start.add3(vOffset);

            paths[startIndex + i] = this.createPath(TacticalGraphicUtil.asPositionList(globe, start, end));
        }
    }
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        RenderInfo renderInfo, java.awt.Point pickPoint, Layer layer)
    {
        if (!this.bindGeometryAttributesAsLine(dc, segmentPlane, SegmentPlane.ALTIMETER, true))
            return;

        Globe globe = dc.getGlobe();
        Position position = segmentPlane.getSegmentPositions()[1];
        double surfaceElevation = this.computeSurfaceElevation(dc.getSurfaceGeometry(), globe,
            position.getLatitude(), position.getLongitude());

        Vec4 v1 = globe.computePointFromPosition(position.getLatitude(), position.getLongitude(),
            position.getElevation());
        Vec4 v2 = globe.computePointFromPosition(position.getLatitude(), position.getLongitude(),
            surfaceElevation);
        Vec4 referenceCenter = v1;
        v1 = v1.subtract3(referenceCenter);
        v2 = v2.subtract3(referenceCenter);
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    {
        if (!this.bindLabelAttributes(dc, segmentPlane, SegmentPlane.ALTIMETER))
            return;

        SectorGeometryList sgl = dc.getSurfaceGeometry();
        Globe globe = dc.getGlobe();
        Position position = segmentPlane.getSegmentPositions()[1];
        double surfaceElevation = this.computeSurfaceElevation(sgl, globe,
            position.getLatitude(), position.getLongitude());
        double height = position.getElevation() - surfaceElevation;
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    protected void drawControlPoints(DrawContext dc, SegmentPlane segmentPlane, RenderInfo renderInfo,
        java.awt.Point pickPoint, Layer layer)
    {
        SectorGeometryList sgl = dc.getSurfaceGeometry();
        Globe globe = dc.getGlobe();

        // Draw user-defined control points.
        for (SegmentPlane.ControlPoint controlPoint : segmentPlane.getControlPoints())
        {
            Position pos = this.computeControlPointPosition(sgl, globe, segmentPlane, controlPoint);
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

     *
     * @return Positions that define the arrowhead.
     */
    protected List<Position> computeArrowheadPositions(DrawContext dc, Position tip, ArcData arcData)
    {
        Globe globe = dc.getGlobe();
        //             _
        //        A\    | 1/2 width
        // ________B\  _|
        //          /
        //       C/
        //        | |
        //       Length

        Vec4 pB = globe.computePointFromPosition(tip);

        double baseLength = LatLon.greatCircleDistance(arcData.midpoint, tip).radians * globe.getRadius();
        double arrowLength = baseLength * this.getArrowLength();

        // Find the point at the base of the arrowhead
        Vec4 arrowBase = pB.add3(arcData.direction.normalize3().multiply3(arrowLength));

        Vec4 normal = globe.computeSurfaceNormalAtPoint(arrowBase);

        // Compute the length of the arrowhead
        double arrowHalfWidth = arrowLength * this.getArrowAngle().tanHalfAngle();

        // Compute a vector perpendicular to the segment and the normal vector
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

        if (attributes == null || !attributes.isVisible())
            return;

        GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
        View view = dc.getView();
        Globe globe = dc.getGlobe();

        Vec4 point = globe.computePointFromPosition(controlPointInfo.position);
        double minSize = this.getMinObjectSize();
        double maxSize = this.computeMaxSizeForPixels(globe, segmentPlane);
        double sizeScale = this.computeSizeForPixels(view, point, 1.0, minSize, maxSize);

        // Apply the control point offset in the local coordinate system at the control point's position. Treat offset
        // coordinates as pixel sizes, so the final coordinate must also be scaled by the eye distance. Use the
        // original point to compute the scale factor, so that the offset doesn't change the control point's size.
        Matrix transformToPosition = globe.computeSurfaceOrientationAtPosition(controlPointInfo.position);
        Vec4 offset = attributes.getOffset();
        offset = offset.multiply3(sizeScale);
        offset = offset.transformBy3(transformToPosition);

        // Add the adjusted offset to the Cartesian point, and recompute the control point's offset geographic position.
        point = point.add3(offset);
        controlPointInfo.position = globe.computePositionFromPoint(point);

        if (dc.isPickingMode())
        {
            PickedObject po = this.bindPickableObject(dc, controlPointInfo.controlPoint,
                controlPointInfo.controlPoint.getKey());
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

    {
        if (!this.bindLabelAttributes(dc, segmentPlane, SegmentPlane.HORIZONTAL_AXIS_LABELS))
            return;

        SectorGeometryList sgl = dc.getSurfaceGeometry();
        Globe globe = dc.getGlobe();
        double[] gridCellSizes = segmentPlane.getGridCellDimensions();
        int[] gridCellCounts = new int[2];
        double[] gridCellParams = new double[2];
        this.computePlaneParameterization(globe, segmentPlane, gridCellCounts, gridCellParams);
View Full Code Here

Examples of gov.nasa.worldwind.globes.Globe

            return;

        double[] gridCellSizes = segmentPlane.getGridCellDimensions();

        SectorGeometryList sgl = dc.getSurfaceGeometry();
        Globe globe = dc.getGlobe();
        int[] gridCellCounts = new int[2];
        double[] gridCellParams = new double[2];
        this.computePlaneParameterization(globe, segmentPlane, gridCellCounts, gridCellParams);

        int vStacks = gridCellCounts[1];
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.