protected void computeQuadSize(DrawContext dc) {
    if (this.positions == null) return;

    Iterator<? extends Position> iterator = this.positions.iterator();

    Position pos1 = iterator.next();
    Position pos2 = iterator.next();

    Angle angularDistance = LatLon.greatCircleDistance(pos1, pos2);
    double length = angularDistance.radians * dc.getGlobe().getRadius();

    this.quad.setWidth(length);
  }
Beispiel #2
0
  protected List<Position> computePathPositions(
      Position startPosition, Position endPosition, Angle delta) {
    Angle dist = LatLon.greatCircleDistance(startPosition, endPosition);
    dist = dist.multiply(0.6);

    Angle azimuth = LatLon.greatCircleAzimuth(startPosition, endPosition);

    LatLon locA = LatLon.greatCircleEndPosition(startPosition, azimuth.add(delta), dist);

    dist = dist.multiply(0.9);
    LatLon locB = LatLon.greatCircleEndPosition(startPosition, azimuth.subtract(delta), dist);

    return Arrays.asList(startPosition, new Position(locA, 0), new Position(locB, 0), endPosition);
  }
  /**
   * Create the circles used to draw this graphic.
   *
   * @param dc Current draw context.
   */
  protected void createShapes(DrawContext dc) {
    if (this.positions == null) return;

    this.rings = new ArrayList<SurfaceCircle>();

    Iterator<? extends Position> iterator = this.positions.iterator();

    Position center = iterator.next();
    double globeRadius = dc.getGlobe().getRadius();

    while (iterator.hasNext()) {
      SurfaceCircle ring = this.createCircle();
      ring.setCenter(center);

      Position pos = iterator.next();
      Angle radius = LatLon.greatCircleDistance(center, pos);

      double radiusMeters = radius.radians * globeRadius;
      ring.setRadius(radiusMeters);

      this.rings.add(ring);
    }
  }