Examples of OMGrid


Examples of com.bbn.openmap.omGraphics.OMGrid

                              LinkProperties propertiesBuffer)
            throws IOException {

        Debug.message("linkdetail", "LinkGrid: reading from link.");

        OMGrid grid = null;
        float lat = 0;
        float lon = 0;
        int x = 0;
        int y = 0;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_OFFSET:
            lat = dis.readFloat();
            lon = dis.readFloat();
            Debug.message("linkdetail", "LinkGrid: Offset Lat/Lon = " + lat
                    + "/" + lon + " with");
            // Fall through...
        case RENDERTYPE_XY:
            x = dis.readInt();
            y = dis.readInt();
            Debug.message("linkdetail", "LinkGrid: x/y = " + x + "/" + y);
            break;
        case RENDERTYPE_LATLON:
        default:
            lat = dis.readFloat();
            lon = dis.readFloat();
            Debug.message("linkdetail", "LinkGrid: Lat/Lon = " + lat + "/"
                    + lon);
        }

        int rows = dis.readInt();
        int columns = dis.readInt();
        float orientation = dis.readFloat();
        float vResolution = dis.readFloat();
        float hResolution = dis.readFloat();
        int major = dis.readByte();

        int length = dis.readInt();

        Debug.message("linkdetail", "LinkGrid details: rows = "
                + rows
                + ", columns = "
                + columns
                + ", orientation = "
                + orientation
                + ", vertical resolution = "
                + vResolution
                + ", horizontal resolution = "
                + hResolution
                + ", major dimension = "
                + (major == LinkGraphicConstants.COLUMN_MAJOR ? "COLUMN_MAJOR"
                        : "ROW_MAJOR") + ", with number of points = " + length);

        int[][] data;
        if (major == LinkGraphicConstants.COLUMN_MAJOR) {
            data = new int[columns][rows];
        } else {
            data = new int[rows][columns];
        }

        for (int i = 0; i < data.length; i++) {
            for (int j = 0; j < data[0].length; j++) {
                data[i][j] = dis.readInt();
                // Debug.message("linkdetail", "LinkGrid reading " +
                // (rows*i + j) + " " +
                // (major !=
                // LinkGraphicConstants.COLUMN_MAJOR?"column":"row")+
                // " " + j + " = " + Integer.toHexString(data[i][j]) +
                // " (" + data[i][j] + ")");
            }
            // Debug.message("linkdetail", "LinkGrid reading " +
            // (major ==
            // LinkGraphicConstants.COLUMN_MAJOR?"column":"row")+
            // " " + i);
        }

        Debug.message("linkdetail", "LinkGrid read all the data.");

        switch (renderType) {
        case RENDERTYPE_OFFSET:
            grid = new OMGrid(lat, lon, x, y, vResolution, hResolution, data);
            break;
        case RENDERTYPE_XY:
            grid = new OMGrid(x, y, vResolution, hResolution, data);
            break;
        case RENDERTYPE_LATLON:
        default:
            grid = new OMGrid(lat, lon, vResolution, hResolution, data);
        }

        Debug.message("linkdetail", "LinkGrid created OMGrid.");

        if (grid != null) {
            grid.setMajor(major == LinkGraphicConstants.COLUMN_MAJOR ? true
                    : false);
            grid.setOrientation(orientation);
            LinkProperties.loadPropertiesIntoOMGraphic(dis, grid, propertiesBuffer);
        }

        Debug.message("linkdetail", "LinkGrid done.");

View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGrid

    public CacheObject load(String key, double lat, double lon, int level) {
        if (frameCache != null) {

            DTEDFrame frame = frameCache.get(lat, lon, level);
            if (frame != null) {
                OMGrid omgrid = frame.getOMGrid();

                // Need to create a unique generator for each OMGrid.
                omgrid.setGenerator(getGenerator());
                return new DTEDCacheObject(key, omgrid);
            }
        }

        return null;
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGrid

     *
     * @param proj EqualArc projection to use to create image.
     * @return raster image to display in OpenMap.
     */
    public OMRaster getOMRaster(EqualArc proj) {
        OMGrid grid = getOMGrid();
        grid.generate(proj);
        SlopeGenerator sg = new SlopeGenerator();
        return sg.generateRasterForProjection(grid, proj);
    }
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.