Package com.bbn.openmap.CSpecialist

Examples of com.bbn.openmap.CSpecialist.LLPoint


     */
    public SPoly createEdgeSPoly(CoordFloatString coords, LatLonPoint ll1,
                                 LatLonPoint ll2, float dpplat, float dpplon) {
        //      System.out.print(".");
        //      System.out.flush();
        LLPoint pts[] = clipToScreen(coords, ll1.getLatitude(), /* north */
        ll2.getLatitude(), /* south */
        ll2.getLongitude(), /* east */
        ll1.getLongitude(), /* west */
        dpplat, dpplon);

View Full Code Here


     * @return LLPoint[]
     */
    public LLPoint[] clipToScreen(CoordFloatString cfs, float north,
                                  float south, float east, float west,
                                  float dpplat, float dpplon) {
        LLPoint pts[] = new LLPoint[cfs.maxIndex()];
        int lpcount = 0, outcount = 0, elimscale = 0;
        float cfslls[] = cfs.vals;
        int cfstupsize = cfs.tsize;
        for (int i = 0; i < pts.length; i++) {
            float lllon = cfslls[cfstupsize * i];
            float lllat = cfslls[cfstupsize * i + 1];
            if ((lllat < south) || (lllat > north)
                    || ((west < east) && ((lllon < west) || (lllon > east)))
                    || ((west > east) && (lllon < west) && (lllon > east))) {
                outcount++;
                if (((lpcount > 1) && (outcount > 2))
                        || ((lpcount == 1) && (outcount > 1))) {
                    pts[lpcount] = new LLPoint(lllat, lllon); //overwrite
                                                              // previous
                    continue;
                }
            } else {
                outcount = 0;
            }
            if ((lpcount > 0)
                    && (i != (pts.length - 1))
                    && (java.lang.Math.abs(pts[lpcount - 1].lat - lllat) < dpplat)
                    && (java.lang.Math.abs(pts[lpcount - 1].lon - lllon) < dpplon)) {
                elimscale++;
                continue;
            }
            pts[lpcount++] = new LLPoint(lllat, lllon);
        }
        //only 1 point in poly, and it was out of bounds...
        if ((lpcount == 1) && (outcount > 0))
            lpcount = 0;

        if (lpcount != cfs.maxIndex()) {
            LLPoint newpts[] = new LLPoint[lpcount];
            System.arraycopy(pts, 0, newpts, 0, lpcount);
            pts = newpts;
            //System.out.println("Old(" + cfs.maxIndex() +
            //                   ")-area(" + elimarea+")-scale(" + elimscale +
            //                   ") = new(" + pts.length + ")");
View Full Code Here

            float tmp = west;
            west = east;
            east = tmp;
        }

        LLPoint pts[] = new LLPoint[cfs.maxIndex()];
        int lpcount = 0, outcount = 0, elimscale = 0;
        float cfslls[] = cfs.vals;
        int cfstupsize = cfs.tsize;
        for (int i = 0; i < pts.length; i++) {
            float lllon = cfslls[cfstupsize * i];
            float lllat = cfslls[cfstupsize * i + 1];
            if ((lllat < south) || (lllat > north)
                    || ((west < east) && ((lllon < west) || (lllon > east)))
                    || ((west > east) && (lllon < west) && (lllon > east))) {
                outcount++;
                if (((lpcount > 1) && (outcount > 2))
                        || ((lpcount == 1) && (outcount > 1))) {
                    pts[lpcount] = new LLPoint(lllat, lllon); //overwrite
                                                              // previous
                    continue;
                }
            } else {
                outcount = 0;
            }
            if ((lpcount > 0)
                    && (i != (pts.length - 1))
                    && (java.lang.Math.abs(pts[lpcount - 1].lat - lllat) < dpplat)
                    && (java.lang.Math.abs(pts[lpcount - 1].lon - lllon) < dpplon)) {
                elimscale++;
                continue;
            }
            pts[lpcount++] = new LLPoint(lllat, lllon);
        }
        //only 1 point in poly, and it was out of bounds...
        if ((lpcount == 1) && (outcount > 0))
            lpcount = 0;

        if (lpcount != cfs.maxIndex()) {
            LLPoint newpts[] = new LLPoint[lpcount];
            System.arraycopy(pts, 0, newpts, 0, lpcount);
            pts = newpts;
            //System.out.println("Old(" + cfs.maxIndex() +
            //                   ")-area(" + elimarea+")-scale(" + elimscale +
            //                   ") = new(" + pts.length + ")");
View Full Code Here

     */
    public SText createTextSText(String text, float latitude, float longitude) {
        SText py = new SText();
        py.rType(RenderType.RT_LatLon);
        py.data(text);
        py.ll1(new LLPoint(latitude, longitude));
        return py;
    }
View Full Code Here

            int cfscnt = cfs.tcount;
            int cfssz = cfs.tsize;
            float cfsvals[] = cfs.vals;
            if (cfscnt > 0) { // normal
                for (int i = 0; i < cfscnt; i++) {
                    ipts.add(new LLPoint(cfsvals[i * cfssz + 1], cfsvals[i
                            * cfssz]));
                }
            } else { // reverse
                cfscnt *= -1; // normalize
                for (int i = cfscnt - 1; i >= 0; i--) {
                    ipts.add(new LLPoint(cfsvals[i * cfssz + 1], cfsvals[i
                            * cfssz]));
                }
            }
        }

        LLPoint pts[] = generatePolyPts(ipts,
                ll1.getLatitude(),
                ll2.getLatitude(),
                ll2.getLongitude(),
                ll1.getLongitude(),
                dpplat,
View Full Code Here

        // it will display "correctly" in the cylindrical projections.
        //only check if bottom edge of screen below a certain
        // latitude
        boolean weaseledOurWayAroundAntarcticAnomaly = (south >= -62f);

        LLPoint prevPt = null;

        for (int i = 0; i < coordcount; i++) {

            LLPoint pt = (LLPoint) ipts.get(i);
            float lllat = pt.lat;

            if ((prevPt != null) && (i != (coordcount - 1))
                    && (Math.abs(prevPt.lat - pt.lat) < dpplat)
                    && (Math.abs(prevPt.lon - pt.lon) < dpplon)) {

                continue;

            }

            vPts.add(pt);
            prevPt = pt;

            if (!weaseledOurWayAroundAntarcticAnomaly
                    && (lllat < antarcticaThreshold)) {
                weaseledOurWayAroundAntarcticAnomaly = true;
                System.out.println("AreaTable.generateSPoly(): Antarctica!");
                //another HACK: we're assuming data is going from
                // west to east,
                //so we wrap the other way
                vPts.add(new LLPoint(-89.99f, 179.99f));
                vPts.add(new LLPoint(-89.99f, 90f));
                vPts.add(new LLPoint(-89.99f, 0f));
                vPts.add(new LLPoint(-89.99f, -90f));
                vPts.add(new LLPoint(-89.99f, -179.99f));

                prevPt = (LLPoint) vPts.lastElement();

                //advance to western hemisphere where we
                //pick up the real data again
                while (((LLPoint) ipts.get(i)).lon > 0) {
                    ++i;
                }
            }
        }

        int nPts = vPts.size();

        if (nPts == 0) {

            return null;

        } else {

            LLPoint pts[] = new LLPoint[nPts];
            vPts.copyInto(pts);
            return pts;

        }
    }
View Full Code Here

        setNeedToRegenerate(true); // flag dirty

        switch (update.discriminator().value()) {
        // set fixed point
        case com.bbn.openmap.CSpecialist.UnitSymbolPackage.settableFields._USF_ll1:
            LLPoint ll = update.ll1();
            eunit.ll1.lat = ll.lat;
            eunit.ll1.lon = ll.lon;
            break;

        case com.bbn.openmap.CSpecialist.UnitSymbolPackage.settableFields._USF_p1:
View Full Code Here

        setNeedToRegenerate(true); // flag dirty

        switch (update.discriminator().value()) {
        // set fixed point
        case com.bbn.openmap.CSpecialist.RasterPackage.settableFields._RASF_ll1:
            LLPoint ll = update.ll1();
            lat = ll.lat;
            lon = ll.lon;
            break;

        case com.bbn.openmap.CSpecialist.RasterPackage.settableFields._RASF_p1:
View Full Code Here

        // do the updates, but don't rerender just yet

        switch (update.discriminator().value()) {
        // set fixed point
        case com.bbn.openmap.CSpecialist.BitmapPackage.settableFields._BF_ll1:
            LLPoint ll = update.ll1();
            setLat(ll.lat);
            setLon(ll.lon);
            break;

        case com.bbn.openmap.CSpecialist.BitmapPackage.settableFields._BF_p1:
View Full Code Here

     * @param p Projection
     * @return UGraphic[] graphic list or null if error
     */
    protected UGraphic[] getSpecGraphics(Projection p) {
        CProjection cproj;
        LLPoint ll1, ll2;
        StringHolder dynamicArgsHolder;
        UGraphic[] graphics = null;
        Server spec = getSpecialist();
        if (Debug.debugging("cspec"))
            Debug.output(getName() + "|CSpecLayer.getSpecGraphics()");

        cproj = new CProjection((short) (p.getProjectionType()), new LLPoint(p.getCenter()
                .getLatitude(), p.getCenter().getLongitude()), (short) p.getHeight(), (short) p.getWidth(), (int) p.getScale());

        // lat-lon "box", (depends on the projection)
        LatLonPoint ul = p.getUpperLeft();
        LatLonPoint lr = p.getLowerRight();

        ll1 = new LLPoint(ul.getLatitude(), ul.getLongitude());
        ll2 = new LLPoint(lr.getLatitude(), lr.getLongitude());

        // check for cancellation
        if (isCancelled()) {
            dirtybits |= PREMATURE_FINISH;
            if (Debug.debugging("cspec"))
View Full Code Here

TOP

Related Classes of com.bbn.openmap.CSpecialist.LLPoint

Copyright © 2018 www.massapicom. 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.