Examples of Vec4


Examples of gov.nasa.worldwind.geom.Vec4

            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)
        {
            return;
        }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

        Position secondVertex = this._lstMarkerControlPoints.get(1).getPosition();

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

        // Get cartesian points for the vertices
        Vec4 firstPoint = globe.computePointFromPosition(firstVertex);
        Vec4 secondPoint = globe.computePointFromPosition(secondVertex);

        // Find the midpoint of the line segment that connects the vertices
        Vec4 halfwayPoint = firstPoint.add3(secondPoint).divide3(2.0);

        Position halfwayPosition = globe.computePositionFromPoint(halfwayPoint);
       
        this._lstMarkerControlPoints.add(new GfrMrkMoveVert(halfwayPosition, halfwayPoint,
            this._bmaControlHeight, this._lstMarkerControlPoints.size()));
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

            return;
        }

        this._san.setText(displayString);

        Vec4 screenPoint = this._computeAnnotationPosition_(pos);
        if (screenPoint != null)
            this._san.setScreenPoint(new Point((int) screenPoint.x, (int) screenPoint.y));

        this._san.getAttributes().setVisible(true);
    }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

    // ----
    // beg private

    private Vec4 _computeAnnotationPosition_(Position pos)
    {
        Vec4 surfacePoint = this._wwd.getSceneController().getTerrain().getSurfacePoint(
            pos.getLatitude(), pos.getLongitude());
       
        if (surfacePoint == null)
        {
            Globe globe = this._wwd.getModel().getGlobe();
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

      //}
   }

   protected Position computeSurfacePosition(LatLon latLon)
   {
      Vec4 surfacePoint = wwd.getSceneController().getTerrain().getSurfacePoint(latLon.getLatitude(),
              latLon.getLongitude());
      if (surfacePoint != null)
         return wwd.getModel().getGlobe().computePositionFromPoint(surfacePoint);
      else
         return new Position(latLon, wwd.getModel().getGlobe().getElevation(latLon.getLatitude(),
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

         return;
      }

      this.annotation.setText(displayString);

      Vec4 screenPoint = this.computeAnnotationPosition(pos);
      if (screenPoint != null)
         this.annotation.setScreenPoint(new Point((int) screenPoint.x, (int) screenPoint.y));

      this.annotation.getAttributes().setVisible(true);
   }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

      return displayString;
   }

   protected Vec4 computeAnnotationPosition(Position pos)
   {
      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(),
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

            this.locationOffset = Vec4.ZERO;

        // Compute appropriate offset
        int x = (int) this.locationOffset.x - (refPoint.x - targetPoint.x);
        int y = (int) this.locationOffset.y - (refPoint.y - targetPoint.y);
        this.locationOffset = new Vec4(x, y, 0);

        // Compensate for rounding errors
        Point computedPoint = this.computeLocation(this.wwd.getView().getViewport());
        x += targetPoint.x - computedPoint.x;
        y += targetPoint.y - computedPoint.y;
        this.locationOffset = new Vec4(x, y, 0);

        if (this.snapToCorners)
            this.snapToCorners();
    }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

        // Snap to edges
        x = Math.abs(x) < 16 ? 0 : x;
        y = Math.abs(y) < 16 ? 0 : y;

        this.position = newPos;
        this.locationOffset = new Vec4(x, y, 0);
    }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Vec4

    protected void determineLabelLocation(DrawContext dc)
    {
        // Reuse the current label location if its inside the view frustum and the label is completely visible when
        // placed there. Otherwise we find a new location that maximizes the label's visible area and is closest to the
        // current location.
        Vec4 lastPoint = this.getLabelPoint(dc);
        if (lastPoint != null && dc.getView().getFrustumInModelCoordinates().contains(lastPoint))
        {
            // Project the current location's model point into screen coordinates, and place the label at the
            // projected point. We do this to measure the label's visible area when placed at that point.
            Vec4 screenPoint = dc.getView().project(lastPoint);
            this.setLabelLocation(dc, screenPoint);

            // If the label is completely visible, just reuse its current location.
            if (this.isLabelCompletelyVisible(dc))
                return;
        }

        this.labelLocationIndex = -1;

        if (this.getLocations() == null)
            return;

        double maxArea = 0;
        double minDistance = Double.MAX_VALUE;
        int locationIndex = -1;

        for (LatLon ll : this.getLocations())
        {
            ++locationIndex;

            if (ll == null)
                continue;

            // Compute the specified location's point in model coordinates. Ignore locations who's model coordinate
            // point cannot be computed for any reason, or are outside the view frustum.
            Vec4 point = this.computePoint(dc, ll);
            if (point == null || !dc.getView().getFrustumInModelCoordinates().contains(point))
                continue;

            // Project the specified location's model point into screen coordinates, and place the label at the
            // projected point. We do this to measure the label's visible area when placed at that point.
            Vec4 screenPoint = dc.getView().project(point);
            this.setLabelLocation(dc, screenPoint);

            // Find the location that maximizes the label's visible area.
            double area = this.getLabelVisibleArea(dc);
            if (maxArea < area)
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.