Search in sources :

Example 6 with PolygonEditor

use of com.revolsys.geometry.model.editor.PolygonEditor in project com.revolsys.open by revolsys.

the class PolygonEditorTest method testSetCoordinates.

@Test
public void testSetCoordinates() {
    for (int i = 0; i < 4; i++) {
        final Polygon polygon = POLYGON;
        final PolygonEditor polygonEditor = polygon.newGeometryEditor(4);
        final double newValue = POLYGON.getCoordinate(1, 1, i);
        polygonEditor.setCoordinate(1, 1, i, newValue);
        final Polygon newPolygon = polygonEditor.newGeometry();
        Assert.assertNotSame(polygon, newPolygon);
        Assert.assertEquals(newValue, newPolygon.getCoordinate(1, 1, i), 0.0);
    }
}
Also used : PolygonEditor(com.revolsys.geometry.model.editor.PolygonEditor) Polygon(com.revolsys.geometry.model.Polygon) Test(org.junit.Test)

Example 7 with PolygonEditor

use of com.revolsys.geometry.model.editor.PolygonEditor in project com.revolsys.open by revolsys.

the class PolygonEditorTest method testSetX.

@Test
public void testSetX() {
    final Polygon polygon = POLYGON;
    final PolygonEditor polygonEditor = polygon.newGeometryEditor(3);
    polygonEditor.setX(1, 1, 10);
    final Polygon newPolygon = polygonEditor.newGeometry();
    Assert.assertNotSame(polygon, newPolygon);
    Assert.assertEquals(10.0, newPolygon.getX(1, 1), 0.0);
}
Also used : PolygonEditor(com.revolsys.geometry.model.editor.PolygonEditor) Polygon(com.revolsys.geometry.model.Polygon) Test(org.junit.Test)

Aggregations

PolygonEditor (com.revolsys.geometry.model.editor.PolygonEditor)7 Polygon (com.revolsys.geometry.model.Polygon)6 Test (org.junit.Test)6