Search in sources :

Example 1 with PointDoubleXYZ

use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.

the class CoordinatesTest method testClone.

public void testClone() {
    for (final Point point : // 
    Arrays.asList(// 
    new PointDoubleXY(100.0, 200.0), // 
    new PointDoubleXYZ(100.0, 200.0, 50.0), new PointDouble(100.0, 200.0, 50.0, 4.0))) {
        final Point clone = point.newPoint();
        assertEquals3d(point, clone);
    }
}
Also used : PointDouble(com.revolsys.geometry.model.impl.PointDouble) PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY)

Example 2 with PointDoubleXYZ

use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.

the class CoordinatesTest method testEquals2DWithinTolerance.

public void testEquals2DWithinTolerance() {
    final Point c = new PointDoubleXYZ(100.0, 200.0, 50.0);
    final Point aBitOff = new PointDoubleXYZ(100.1, 200.1, 50.0);
    assertTrue(c.equalsVertex2d(aBitOff, 0.2));
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 3 with PointDoubleXYZ

use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.

the class CoordinatesTest method testCompareTo.

public void testCompareTo() {
    final Point lowest = new PointDoubleXYZ(10.0, 100.0, 50.0);
    final Point highest = new PointDoubleXYZ(20.0, 100.0, 50.0);
    final Point equalToHighest = new PointDoubleXYZ(20.0, 100.0, 50.0);
    final Point higherStill = new PointDoubleXYZ(20.0, 200.0, 50.0);
    assertEquals(-1, lowest.compareTo(highest));
    assertEquals(1, highest.compareTo(lowest));
    assertEquals(-1, highest.compareTo(higherStill));
    assertEquals(0, highest.compareTo(equalToHighest));
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ) Point(com.revolsys.geometry.model.Point)

Example 4 with PointDoubleXYZ

use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.

the class CoordinatesTest method testToString.

public void testToString() {
    final String expectedResult = "POINT Z(100 200 50)";
    final String actualResult = new PointDoubleXYZ(100.0, 200.0, 50.0).toString();
    assertEquals(expectedResult, actualResult);
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ)

Example 5 with PointDoubleXYZ

use of com.revolsys.geometry.model.impl.PointDoubleXYZ in project com.revolsys.open by revolsys.

the class MiscellaneousTest2 method test1.

public void test1() throws Exception {
    assertTrue(this.geometryFactory.lineString(2, 0.0, 10.0, 20.0, 10.0).isOnLine(new PointDoubleXYZ(2, 10, 10)));
    assertTrue(!this.geometryFactory.lineString(2, 0.0, 10.0, 20.0, 10.0).isOnLine(new PointDoubleXYZ(2, 30, 10)));
}
Also used : PointDoubleXYZ(com.revolsys.geometry.model.impl.PointDoubleXYZ)

Aggregations

PointDoubleXYZ (com.revolsys.geometry.model.impl.PointDoubleXYZ)20 Point (com.revolsys.geometry.model.Point)17 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)4 Geometry (com.revolsys.geometry.model.Geometry)2 Record (com.revolsys.record.Record)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 BPlusTreeMap (com.revolsys.collection.bplus.BPlusTreeMap)1 IntHashMap (com.revolsys.collection.map.IntHashMap)1 LengthIndexedLine (com.revolsys.geometry.linearref.LengthIndexedLine)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 LineString (com.revolsys.geometry.model.LineString)1 Triangle (com.revolsys.geometry.model.Triangle)1 CoordinatesDistanceComparator (com.revolsys.geometry.model.coordinates.comparator.CoordinatesDistanceComparator)1 LineStringDouble (com.revolsys.geometry.model.impl.LineStringDouble)1 PointDouble (com.revolsys.geometry.model.impl.PointDouble)1 LineSegment (com.revolsys.geometry.model.segment.LineSegment)1 LineSegmentDoubleGF (com.revolsys.geometry.model.segment.LineSegmentDoubleGF)1 List (java.util.List)1 Map (java.util.Map)1