Search in sources :

Example 1 with PolygonEditor

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

the class Polygon method newGeometryEditor.

@Override
default PolygonEditor newGeometryEditor(final int axisCount) {
    final PolygonEditor geometryEditor = newGeometryEditor();
    geometryEditor.setAxisCount(axisCount);
    return geometryEditor;
}
Also used : PolygonEditor(com.revolsys.geometry.model.editor.PolygonEditor)

Example 2 with PolygonEditor

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

the class PolygonEditorTest method testSetZ.

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

Example 3 with PolygonEditor

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

the class PolygonEditorTest method testSetM.

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

Example 4 with PolygonEditor

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

the class PolygonEditorTest method testSetY.

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

Example 5 with PolygonEditor

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

the class PolygonEditorTest method testNotModified.

@Test
public void testNotModified() {
    final Polygon polygon = POLYGON;
    final PolygonEditor polygonEditor = polygon.newGeometryEditor();
    try {
        polygonEditor.setZ(new int[0], 13);
        Assert.fail("Invalid index should cause exception");
    } catch (final Exception e) {
    }
}
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