亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? slopegenerator.java

?? openmap java寫的開源數字地圖程序. 用applet實現,可以像google map 那樣放大縮小地圖.
?? JAVA
字號:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// // $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/omGraphics/grid/SlopeGenerator.java,v $// $RCSfile: SlopeGenerator.java,v $// $Revision: 1.2.2.5 $// $Date: 2005/12/22 18:42:47 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.omGraphics.grid;import java.awt.Point;import java.awt.Shape;import com.bbn.openmap.LatLonPoint;import com.bbn.openmap.omGraphics.OMGraphic;import com.bbn.openmap.omGraphics.OMGrid;import com.bbn.openmap.omGraphics.OMRaster;import com.bbn.openmap.omGraphics.SinkGraphic;import com.bbn.openmap.proj.Length;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.Debug;/** * The SlopeGenerator is an OMGridGenerator that looks at elevation * data and creates shading images from it. It currently works for * short data only, since that what DTED elevation data is. Making it * work with different data types is on the to-do list. */public class SlopeGenerator implements OMGridGenerator {    protected int contrast = 5;    protected ElevationColors colors = new ColoredShadingColors();    public SlopeGenerator() {}    public SlopeGenerator(ElevationColors elevColors) {        setColors(elevColors);    }    public void setColors(ElevationColors elevColors) {        colors = elevColors;    }    public ElevationColors getColors() {        return colors;    }    public void setContrast(int val) {        if (val > 10 || val < 1) {            val = 5;        }        contrast = val;    }    public int getContrast() {        return contrast;    }    /**     * Called from within generate to create an OMRaster object for     * the OMGrid. This method exists to make it easier to extend this     * class to create an OMRaster as needed.     */    protected OMRaster getRaster(OMGrid grid) {        return new OMRaster(grid.point1.x, grid.point1.y, grid.width, grid.height, new int[grid.width                * grid.height]);    }    protected boolean incomplete = false;    /**     * A method to check if the last image created was a complete one.     * If it was incomplete, then that means some pixels of the image     * were not set because they were outside of the projection.     */    public boolean isIncompleteImage() {        return incomplete;    }    /**     * A more defining API method to get what this SlopeGenerator can     * create. An OMGridGenerator generates an OMGraphic, this method     * lets you specifically ask for an OMRaster if that's what you     * want. If SlopeGenerator is extended so that it doesn't     * necessarily return an OMRaster from generate, this method     * checks for that and will return null if generate returns     * something other than an OMRaster.     *      * @param grid     * @param proj     * @return OMRaster that reflects slope information.     */    public OMRaster generateRasterForProjection(OMGrid grid, Projection proj) {        OMGraphic omg = generate(grid, proj);        if (omg instanceof OMRaster) {            return (OMRaster) omg;        } else {            return null;        }    }    /**     * Called from the OMGrid.generate() method to tell the generator     * to create something to represent the grid contents.     */    public OMGraphic generate(OMGrid grid, Projection proj) {        Shape gridShape = grid.getShape();        // Don't generate the raster if the grid is off-map...        if (gridShape == null                || !gridShape.intersects(0,                        0,                        proj.getWidth(),                        proj.getHeight())) {            if (Debug.debugging("grid")) {                Debug.output("SlopeGenerator: OMGrid does not overlap map, skipping generation.");            }            return SinkGraphic.getSharedInstance();        }        OMRaster raster = getRaster(grid);        incomplete = false;        if (grid.height == 0 || grid.width == 0) {            Debug.message("grid", "SlopeGenerator: grid height/width ZERO!");            return raster;        }        GridData gd = grid.getData();        if (!(gd instanceof GridData.Short)) {            Debug.message("grid",                    "SlopeGenerator: grid doesn't contain short data.");            return SinkGraphic.getSharedInstance();        }        int rows = grid.getRows();        int columns = grid.getColumns();        short[][] data = ((GridData.Short) gd).getData();//        boolean major = grid.getMajor();        double distance = getSlopeRun(grid, getContrast());        // Used for projections of image coordinates. Reused in the        // loops to save memory.        LatLonPoint llp = new LatLonPoint();        Point point = new Point();        ElevationColors colors = getColors();        if (colors == null) {            return SinkGraphic.getSharedInstance();        }        // x is the horizontal pixel being modified        for (short x = 0; x < grid.width; x++) {            // Check to make sure the pixels we're calculating are on            // the map.            int screenx = (int) grid.point1.getX() + x;            if (screenx < 0 || screenx > proj.getWidth()) {                incomplete = true;                continue;            }            for (short y = 0; y < grid.height; y++) {                // Check to make sure the pixels we're calculating are                // on the map.                int screeny = (int) grid.point1.getY() + y;                if (screeny < 0 || screeny > proj.getHeight()) {                    incomplete = true;                    continue;                }                // OK, on the map.                point.setLocation(screenx, screeny);                llp = proj.inverse(point.x, point.y, llp);                int yc = Math.round((llp.getLatitude() - grid.getLatitude())                        / grid.getVerticalResolution());                int xc = Math.round((llp.getLongitude() - grid.getLongitude())                        / grid.getHorizontalResolution());                // If the calculated index is out of the data ranges,                // push it to the end. Don't blow it off, it will                // cause unfilled data pixel lines to appear. You                // only want to blow off pixels that are not on the                // map, or are never going to be on the map.                if (yc < 0)                    yc = 0;                if (yc > rows - 1)                    yc = rows - 1;                if (xc < 0)                    xc = 0;                if (xc > columns - 1)                    xc = columns - 1;                int elevation = 0;                // Otherwise, get the elevation for the data point.                try {                    elevation = (int) data[xc][yc];                } catch (ArrayIndexOutOfBoundsException aioobe) {                    Debug.output("Error Accessing data array:\n\txc: " + xc                            + ", yc: " + yc + " for x: " + x + ", y: " + y);                }                // Slope shading calculations, get the upper left and                // lower right data points.                int xnw = xc - 1;                int xse = xc + 1;                // trying to smooth out the edge of the frame                if (xc == 0 || xnw < 0) {                    xnw = xc;                }                if (xc == columns - 1 || xse > columns - 1) {                    xse = columns - 1;                }                int yse = yc - 1;                int ynw = yc + 1;                //  trying to smooth out the edge of the frame by                // handling the                //  frame limits                if (yse < 0) {                    yse = 0;                }                if (yc == rows - 1 || ynw > rows - 1) {                    ynw = rows - 1;                }                // Get the elevation points for the slope measurement                // points.                try {                    short e2 = data[xse][yse]; // down & right                    // elevation                    short e1 = data[xnw][ynw]; // up and left                    // elevation                    // colormap value darker for negative slopes,                    // brighter for                    // positive slopes.                    // slope relative to nw sun                    double slope = (e2 - e1) / distance;                    raster.setPixel(x, y, colors.getARGB(elevation,                            grid.getUnits(),                            slope));                } catch (ArrayIndexOutOfBoundsException aioobe) {                    Debug.output("Error Accessing data array:\n\txse: " + xse                            + ", yse: " + yse + "\n\txnw: " + xnw + ", ynw: "                            + ynw + "\n\tfor x: " + x + ", y: " + y);                }            }        }        raster.generate(proj);        if (Debug.debugging("grid"))            Debug.output("SlopeGenerator: leaving generate");        return raster;    }    public boolean needGenerateToRender() {        return true;    }    /**     * Method to calculate the run part of the slope (rise over run,     * right?). The rise is calcuated with the elevations of the     * points to the northwest and southeast of the point of concern,     * the run is some factor of the distance between those two posts.     *      * @param grid the OMGrid that contains the data, need to get     *        units.     * @param contrastAdj contrast adjustment from 1-10, 5 being no     *        adjustment. 10 is high contrast, 1 is low contrast.     */    protected double getSlopeRun(OMGrid grid, int contrastAdj) {        double modifier = (double) .045;        for (int h = 0; h < contrastAdj; h++) {            modifier -= .005;        }        // Smaller modifiers result in more contrast. .025, by        // testing and judgement, looks like a good average, and the        // values have been set up to provide that with an adjustment        // of 5. 0 is very high contrast.        float vRes = grid.getVerticalResolution(); // Degrees per data        // point        float hRes = grid.getHorizontalResolution();        float vResRad = Length.DECIMAL_DEGREE.toRadians(vRes);        float hResRad = Length.DECIMAL_DEGREE.toRadians(hRes);        Length units = grid.getUnits();        double vDist = Math.pow(2.0 * (double) units.fromRadians(vResRad), 2);        double hDist = Math.pow(2.0 * (double) units.fromRadians(hResRad), 2);        return modifier * Math.sqrt(vDist + hDist);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区免费| 尤物视频一区二区| 亚洲影视在线播放| 国产一区二区三区在线观看免费 | 欧美精品在线观看一区二区| 久久久精品欧美丰满| 亚洲国产精品久久人人爱| 粉嫩欧美一区二区三区高清影视| 欧美精品精品一区| 亚洲欧美在线观看| 粉嫩绯色av一区二区在线观看| 91精品国产综合久久久蜜臀粉嫩 | 亚洲大型综合色站| 91看片淫黄大片一级在线观看| 26uuu国产电影一区二区| 午夜av区久久| 欧美日韩不卡在线| 亚洲综合一区二区三区| 精品免费日韩av| 日韩中文欧美在线| 91久久精品一区二区三| 国产精品乱码一区二三区小蝌蚪| 激情丁香综合五月| 精品美女被调教视频大全网站| 日日骚欧美日韩| 欧美日韩精品一区二区在线播放| 一区二区三区在线看| 99vv1com这只有精品| 成人免费在线播放视频| 91论坛在线播放| 中文字幕综合网| 色综合天天性综合| 一区二区三区成人| 精品视频一区 二区 三区| 亚洲动漫第一页| 91麻豆精品国产无毒不卡在线观看| 一区二区三区日韩欧美精品| 一本在线高清不卡dvd| 一区二区三区不卡视频在线观看 | 波多野结衣视频一区| 中文字幕一区二区三区四区不卡| 成人精品电影在线观看| 一区二区三区四区不卡在线| 欧美色精品在线视频| 男女激情视频一区| 久久精品亚洲国产奇米99| 成人不卡免费av| 亚洲永久精品大片| 777亚洲妇女| 国产一区不卡视频| 亚洲视频综合在线| 在线不卡a资源高清| 国产在线不卡一卡二卡三卡四卡| 中文幕一区二区三区久久蜜桃| 91丨porny丨户外露出| 婷婷激情综合网| 国产午夜精品一区二区| 色八戒一区二区三区| 老司机免费视频一区二区| 日本一区二区三区四区| 欧美日韩国产片| 国内精品国产成人国产三级粉色| 中文字幕一区二区三区不卡| 9191成人精品久久| 成人av免费观看| 欧美a级理论片| 亚洲欧洲一区二区在线播放| 日韩一区和二区| 99riav一区二区三区| 久久精品国产在热久久| 亚洲精品乱码久久久久| 亚洲精品一区二区三区蜜桃下载| 99这里只有精品| 韩日精品视频一区| 亚洲一区二区三区免费视频| 久久这里只有精品首页| 欧美日韩久久不卡| 97se狠狠狠综合亚洲狠狠| 久久99精品国产麻豆不卡| 亚洲精品videosex极品| 日韩精品一区二| 欧美色图免费看| aaa国产一区| 国产精品一二三四区| 日韩主播视频在线| 亚洲夂夂婷婷色拍ww47| 国产日本亚洲高清| 日韩一区二区在线观看视频 | 一卡二卡欧美日韩| 日本一区二区三级电影在线观看| 欧美精品一级二级| 欧洲视频一区二区| 色综合久久九月婷婷色综合| 国产成人在线看| 国产一区高清在线| 蜜臀av一区二区在线免费观看| 亚洲曰韩产成在线| 亚洲色图视频免费播放| 国产精品久久久久久一区二区三区 | 成人av高清在线| 国产精品亚洲一区二区三区妖精| 日韩有码一区二区三区| 亚洲大片免费看| 香蕉影视欧美成人| 亚洲r级在线视频| 婷婷亚洲久悠悠色悠在线播放| 一区二区三区高清不卡| 亚洲一区二区在线免费观看视频| 中文字幕一区二区视频| 日韩美女久久久| 亚洲女人****多毛耸耸8| 亚洲欧美国产高清| 亚洲综合在线视频| 亚洲国产cao| 亚洲国产精品一区二区www在线| 亚洲啪啪综合av一区二区三区| 亚洲人成精品久久久久| 一区二区三区在线观看国产| 亚洲综合一二三区| 亚洲成a人片在线观看中文| 亚洲成人资源网| 奇米精品一区二区三区在线观看| 男女男精品视频网| 国产成人av电影在线| 99精品国产视频| 欧美在线free| 日韩三级.com| 欧美经典一区二区| 亚洲精品国产a| 五月天视频一区| 国产在线麻豆精品观看| 盗摄精品av一区二区三区| 色综合天天综合在线视频| 精品视频一区二区不卡| 精品国产a毛片| 中文字幕色av一区二区三区| 亚洲成人激情综合网| 国产在线不卡视频| 一本久久综合亚洲鲁鲁五月天 | 精品一区二区三区在线观看| 国产成人亚洲精品青草天美| 91网站最新网址| 欧美日韩国产高清一区| 久久久美女毛片| 亚洲一区二区三区激情| 精品中文字幕一区二区| 91在线视频在线| 69堂成人精品免费视频| 国产欧美一区二区精品久导航 | 亚洲日本中文字幕区| 亚洲6080在线| 99久久综合99久久综合网站| 欧美日韩aaa| 中文字幕亚洲精品在线观看| 日本sm残虐另类| 色偷偷久久人人79超碰人人澡| 91精品国产综合久久福利软件| 中文字幕国产一区| 奇米色777欧美一区二区| 成人av免费网站| 精品国一区二区三区| 一区二区三区四区在线免费观看| 麻豆国产一区二区| 在线视频综合导航| 中文一区在线播放| 久久成人久久鬼色| 欧美日本在线播放| 最新国产精品久久精品| 狠狠色狠狠色综合系列| 欧美三级电影在线看| 亚洲色图视频网| 国产成人超碰人人澡人人澡| 欧美一区二区三区小说| 亚洲一区二区三区自拍| 成人app网站| 久久精品欧美一区二区三区麻豆 | 久久综合久久99| 日韩和欧美一区二区| 日本久久电影网| 最新日韩av在线| 粉嫩av一区二区三区在线播放| 欧美一区三区四区| 亚洲图片一区二区| 在线免费观看日韩欧美| 亚洲精品少妇30p| 色婷婷综合激情| 亚洲精品中文字幕乱码三区| 北条麻妃国产九九精品视频| 久久精品免费在线观看| 激情综合色播激情啊| 日韩精品专区在线影院观看| 美国三级日本三级久久99| 91精品国产品国语在线不卡| 五月天激情综合| 欧美一区二区在线播放| 美腿丝袜在线亚洲一区| 精品国产免费一区二区三区香蕉 | 欧洲av一区二区嗯嗯嗯啊| 亚洲欧洲日本在线| 91麻豆福利精品推荐|