Package org.apache.sis.geometry

Examples of org.apache.sis.geometry.GeneralDirectPosition


            assertTrue ("inner.intersects(outer)", ai.intersects(outer, true));
            assertTrue ("inner.intersects(outer)", ai.intersects(outer, false));
            assertFalse("inner.contains(outer)",   ai.contains  (outer, true));
            assertFalse("inner.contains(outer)",   ai.contains  (outer, false));
        }
        final GeneralDirectPosition median = new GeneralDirectPosition(inner.getDimension());
        for (int i=median.getDimension(); --i>=0;) {
            median.setOrdinate(i, inner.getMedian(i));
        }
        assertTrue("outer.contains(median)", outer.contains(median));
    }
View Full Code Here


            assertFalse("e2.contains(e1)",   ae.contains  (e1, false));
            assertFalse("e2.contains(e1)",   ae.contains  (e1, true));
        }
        final int dimension = e1.getDimension();
        final int numCases = (int) round(pow(3, dimension));
        final GeneralDirectPosition pos = new GeneralDirectPosition(dimension);
        for (int index=0; index<numCases; index++) {
            int n = index;
            for (int i=0; i<dimension; i++) {
                final double ordinate;
                switch (n % 3) {
                    case 0: ordinate = e2.getMinimum(i); break;
                    case 1: ordinate = e2.getMedian (i); break;
                    case 2: ordinate = e2.getMaximum(i); break;
                    default: throw new AssertionError(i);
                }
                pos.setOrdinate(i, ordinate);
                n /= 3;
            }
            assertEquals(0, n); // Opportunist check of this assert method.
            assertFalse("e1.contains(" + pos + ')', e1.contains(pos));
        }
View Full Code Here

            assertTrue ("inner.intersects(outer)", ai.intersects(outer, true));
            assertTrue ("inner.intersects(outer)", ai.intersects(outer, false));
            assertFalse("inner.contains(outer)",   ai.contains  (outer, true));
            assertFalse("inner.contains(outer)",   ai.contains  (outer, false));
        }
        final GeneralDirectPosition median = new GeneralDirectPosition(inner.getDimension());
        for (int i=median.getDimension(); --i>=0;) {
            median.setOrdinate(i, inner.getMedian(i));
        }
        assertTrue("outer.contains(median)", outer.contains(median));
    }
View Full Code Here

            assertFalse("e2.contains(e1)",   ae.contains  (e1, false));
            assertFalse("e2.contains(e1)",   ae.contains  (e1, true));
        }
        final int dimension = e1.getDimension();
        final int numCases = (int) round(pow(3, dimension));
        final GeneralDirectPosition pos = new GeneralDirectPosition(dimension);
        for (int index=0; index<numCases; index++) {
            int n = index;
            for (int i=0; i<dimension; i++) {
                final double ordinate;
                switch (n % 3) {
                    case 0: ordinate = e2.getMinimum(i); break;
                    case 1: ordinate = e2.getMedian (i); break;
                    case 2: ordinate = e2.getMaximum(i); break;
                    default: throw new AssertionError(i);
                }
                pos.setOrdinate(i, ordinate);
                n /= 3;
            }
            assertEquals(0, n); // Opportunist check of this assert method.
            assertFalse("e1.contains(" + pos + ')', e1.contains(pos));
        }
View Full Code Here

TOP

Related Classes of org.apache.sis.geometry.GeneralDirectPosition

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.