surfacesectorgeometry.java

来自「world wind java sdk 源码」· Java 代码 · 共 60 行

JAVA
60
字号
/*Copyright (C) 2001, 2008 United States Governmentas represented by the Administrator of theNational Aeronautics and Space Administration.All Rights Reserved.*/package gov.nasa.worldwind.render;import gov.nasa.worldwind.geom.*;import gov.nasa.worldwind.util.Logging;import java.awt.*;import java.util.ArrayList;/** * @author tag * @version $Id: SurfaceSectorGeometry.java 7434 2008-11-08 21:27:45Z tgaskins $ */public class SurfaceSectorGeometry extends SurfacePolygonGeometry{    public SurfaceSectorGeometry(Sector sector, Color color, Color borderColor)    {        super(makePositions(sector), color, borderColor);    }    public SurfaceSectorGeometry(Sector sector)    {        super(makePositions(sector), null, null);    }    public void setSector(Sector sector)    {        this.setPositions(makePositions(sector));    }    public Sector getSector()    {        return this.getSectors().get(0); // TODO: coallesce split sectors into one?    }    private static Iterable<LatLon> makePositions(Sector sector)    {        if (sector == null)        {            String message = Logging.getMessage("nullValue.SectorIsNull");            Logging.logger().severe(message);            throw new IllegalArgumentException(message);        }        ArrayList<LatLon> positions = new ArrayList<LatLon>(5);        positions.add(new LatLon(sector.getMinLatitude(), sector.getMinLongitude()));        positions.add(new LatLon(sector.getMinLatitude(), sector.getMaxLongitude()));        positions.add(new LatLon(sector.getMaxLatitude(), sector.getMaxLongitude()));        positions.add(new LatLon(sector.getMaxLatitude(), sector.getMinLongitude()));        positions.add(new LatLon(sector.getMinLatitude(), sector.getMinLongitude()));        return positions;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?