Package gov.nasa.worldwind

Examples of gov.nasa.worldwind.View


    //*************************************************************

    @Override
    protected void moveControlPoint(GfrMrkMoveHoriz controlPoint, Point lastMousePoint, Point moveToPoint)
    {
        View view = super._wwd.getView();
        Globe globe = super._wwd.getModel().getGlobe();

        Position refPos = controlPoint.getPosition();
        if (refPos == null)
            return;

        Line ray = view.computeRayFromScreenPoint(moveToPoint.getX(), moveToPoint.getY());
        Line previousRay = view.computeRayFromScreenPoint(lastMousePoint.getX(), lastMousePoint.getY());

        Vec4 vec = AirspaceEditorUtil.intersectGlobeAt(super._wwd, refPos.getElevation(), ray);
        Vec4 previousVec = AirspaceEditorUtil.intersectGlobeAt(super._wwd, refPos.getElevation(), previousRay);

        if (vec == null || previousVec == null)
View Full Code Here


    {
        // Intersect a ray through each mouse point, with a geoid passing through the reference elevation.
        // If either ray fails to intersect the geoid, then ignore this event. Use the difference between the two
        // intersected positions to move the control point's location.

        View view = this._wwd.getView();
        Globe globe = this._wwd.getModel().getGlobe();

        Position refPos = this._pol_.getReferencePosition();
        if (refPos == null)
            return;

        Line ray = view.computeRayFromScreenPoint(mousePoint.getX(), mousePoint.getY());
        Line previousRay = view.computeRayFromScreenPoint(previousMousePoint.getX(), previousMousePoint.getY());

        Vec4 vec = AirspaceEditorUtil.intersectGlobeAt(this._wwd, refPos.getElevation(), ray);
        Vec4 previousVec = AirspaceEditorUtil.intersectGlobeAt(this._wwd, refPos.getElevation(), previousRay);

        if (vec == null || previousVec == null)
View Full Code Here

        SegmentPlaneAttributes.GeometryAttributes attributes = segmentPlane.getAttributes().getGeometryAttributes(key);
        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);
View Full Code Here

            return true;
        }

        public double getSizeInPixels(DrawContext dc)
        {
            View view = dc.getView();
            Vec4 centerPoint = getSurfacePoint(dc, this.sector.getCentroid().getLatitude(),
                this.sector.getCentroid().getLongitude());
            double distance = view.getEyePoint().distanceTo3(centerPoint);
            double tileSizeMeter = this.sector.getDeltaLatRadians() * dc.getGlobe().getRadius();
            return tileSizeMeter / view.computePixelSizeAtDistance(distance);
        }
View Full Code Here

        return _INT_NONE_;
    }
  
   private void _dragWholeShape_(DragSelectEvent dragEvent, Movable dragObject)
    {
        View view = super._glcWwd.getView();
        EllipsoidalGlobe globe = (EllipsoidalGlobe) super._glcWwd.getModel().getGlobe();

        // Compute ref-point position in screen coordinates.
        Position refPos = dragObject.getReferencePosition();
        if (refPos == null)
            return;

        Vec4 refPoint = globe.computePointFromPosition(refPos);
        Vec4 screenRefPoint = view.project(refPoint);

        // Compute screen-coord delta since last event.
        int dx = dragEvent.getPickPoint().x - dragEvent.getPreviousPickPoint().x;
        int dy = dragEvent.getPickPoint().y - dragEvent.getPreviousPickPoint().y;

        // Find intersection of screen coord ref-point with globe.
        double x = screenRefPoint.x + dx;
        double y = dragEvent.getMouseEvent().getComponent().getSize().height - screenRefPoint.y + dy - 1;
        Line ray = view.computeRayFromScreenPoint(x, y);
        Intersection inters[] = globe.intersect(ray, refPos.getElevation());

        if (inters != null)
        {
            // Intersection with globe. Move reference point to the intersection point.
View Full Code Here

      if (!this.isArrowheadSmall(dc, midPoint, 1))
      {
         // Compute the size of the arrowhead in pixels to ensure that the arrow does not exceed the maximum
         // screen size.
         View view = dc.getView();
         double midpointDistance = view.getEyePoint().distanceTo3(midPoint);
         double pixelSize = view.computePixelSizeAtDistance(midpointDistance);
         if (arrowLength / pixelSize > this.maxScreenSize)
         {
            arrowLength = this.maxScreenSize * pixelSize;
            arrowBase = arrowLength * this.getArrowAngle().tanHalfAngle();
         }
View Full Code Here

   

    @Override
    protected void moveControlPoint(GfrMrkMoveHoriz controlPoint, Point lastMousePoint, Point moveToPoint)
    {
        View view = super._wwd.getView();
        Globe globe = super._wwd.getModel().getGlobe();

        Position refPos = controlPoint.getPosition();
        if (refPos == null)
            return;

        Line ray = view.computeRayFromScreenPoint(moveToPoint.getX(), moveToPoint.getY());
        Line previousRay = view.computeRayFromScreenPoint(lastMousePoint.getX(), lastMousePoint.getY());

        Vec4 vec = AirspaceEditorUtil.intersectGlobeAt(super._wwd, refPos.getElevation(), ray);
        Vec4 previousVec = AirspaceEditorUtil.intersectGlobeAt(super._wwd, refPos.getElevation(), previousRay);

        if (vec == null || previousVec == null)
View Full Code Here

            return;

        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

TOP

Related Classes of gov.nasa.worldwind.View

Copyright © 2018 www.massapicom. 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.