Worldwind public release 0.2
[worldwind-tracker.git] / gov / nasa / worldwind / geom / SurfaceQuadrilateral.java
blob546ddeafbd0c99aca2e2c2ff01414d8e7c1b29eb
1 /*
2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
5 All Rights Reserved.
6 */
7 package gov.nasa.worldwind.geom;
9 import gov.nasa.worldwind.*;
11 import java.awt.*;
12 import java.awt.image.*;
13 import java.util.*;
15 /**
16 * @author tag
17 * @version $Id: SurfaceQuadrilateral.java 1680 2007-05-02 00:30:25Z tgaskins $
19 public class SurfaceQuadrilateral extends SurfacePolygon
22 public SurfaceQuadrilateral(Sector sector, Color color, Color borderColor)
24 super(makePositions(sector), color, borderColor);
27 public SurfaceQuadrilateral(Sector sector)
29 super(makePositions(sector), null, null);
32 private static Iterable<LatLon> makePositions(Sector sector)
34 if (sector == null)
36 String message = WorldWind.retrieveErrMsg("nullValue.SectorIsNull");
37 WorldWind.logger().log(java.util.logging.Level.FINE, message);
38 throw new IllegalArgumentException(message);
41 ArrayList<LatLon> positions = new ArrayList<LatLon>(5);
43 positions.add(0, new LatLon(sector.getMinLatitude(), sector.getMinLongitude()));
44 positions.add(1, new LatLon(sector.getMinLatitude(), sector.getMaxLongitude()));
45 positions.add(2, new LatLon(sector.getMaxLatitude(), sector.getMaxLongitude()));
46 positions.add(3, new LatLon(sector.getMaxLatitude(), sector.getMinLongitude()));
47 positions.add(4, new LatLon(sector.getMinLatitude(), sector.getMinLongitude()));
49 return positions;