Package org.opengis.referencing.cs

Examples of org.opengis.referencing.cs.AxisDirection.ordinal()


     * @return The direction from the above table, or {@code null} if the given direction was null.
     */
    public static AxisDirection absolute(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        if (opposite != null) {
            if (opposite.ordinal() < dir.ordinal()) {
                return opposite;
            }
        }
        return dir;
    }
View Full Code Here


     * @param  dir The direction to test, or {@code null}.
     * @return {@code true} if the given direction is an "opposite".
     */
    public static boolean isOpposite(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        return (opposite != null) && opposite.ordinal() < dir.ordinal();
    }

    /**
     * Returns {@code true} if the specified direction is a compass direction.
     * Compass directions are {@code NORTH}, {@code EAST}, {@code NORTH_EAST}, etc.
View Full Code Here

     * @return The direction from the above table, or {@code null} if the given direction was null.
     */
    public static AxisDirection absolute(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        if (opposite != null) {
            if (opposite.ordinal() < dir.ordinal()) {
                return opposite;
            }
        }
        return dir;
    }
View Full Code Here

     * @param  dir The direction to test, or {@code null}.
     * @return {@code true} if the given direction is an "opposite".
     */
    public static boolean isOpposite(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        return (opposite != null) && opposite.ordinal() < dir.ordinal();
    }

    /**
     * Returns {@code true} if the specified direction is a compass direction.
     * Compass directions are {@code NORTH}, {@code EAST}, {@code NORTH_EAST}, etc.
View Full Code Here

            final String        message   = direction.name();
            int io = i+h, in = i;
            if (i >= h) io -= AxisDirections.COMPASS_COUNT;
            if (i >  h) in -= AxisDirections.COMPASS_COUNT;
            assertEquals(message, base + i,  direction.ordinal());
            assertEquals(message, base + io, opposite.ordinal());
            assertEquals(message, 0,     AxisDirections.angleForCompass(direction, direction));
            assertEquals(message, h, abs(AxisDirections.angleForCompass(direction, opposite)));
            assertEquals(message, in,    AxisDirections.angleForCompass(direction, NORTH));
        }
    }
View Full Code Here

            final String        message   = direction.name();
            int io = i+h, in = i;
            if (i >= h) io -= AxisDirections.COMPASS_COUNT;
            if (i >  h) in -= AxisDirections.COMPASS_COUNT;
            assertEquals(message, base + i,  direction.ordinal());
            assertEquals(message, base + io, opposite.ordinal());
            assertEquals(message, 0,     AxisDirections.angleForCompass(direction, direction));
            assertEquals(message, h, abs(AxisDirections.angleForCompass(direction, opposite)));
            assertEquals(message, in,    AxisDirections.angleForCompass(direction, NORTH));
        }
    }
View Full Code Here

            }
            return -1;
        } else if (that.meridian != null) {
            return +1;
        }
        return d1.ordinal() - d2.ordinal();
    }

    /**
     * Sorts the specified axis in an attempt to create a right-handed system.
     * The sorting is performed in place. This method returns {@code true} if
View Full Code Here

            final AxisDirection c = compass[i];
            double angle = i * (360.0/compass.length);
            if (angle > 180) {
                angle -= 360;
            }
            assertEquals(index, base + i, c.ordinal());
            assertEquals(index, base + i + (i<h ? h : -h), c.opposite().ordinal());
            assertEquals(index, 0, getAngle(c, c), EPS);
            assertEquals(index, 180, Math.abs(getAngle(c, c.opposite())), EPS);
            assertEquals(index, angle, getAngle(c, AxisDirection.NORTH), EPS);
        }
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.