Search in sources :

Example 6 with SineStarFactory

use of com.revolsys.geometry.model.util.SineStarFactory in project com.revolsys.open by revolsys.

the class PreparedPolygonIntersectsPerfTest method newLine.

Geometry newLine(final Point base, final double size, final int nPts) {
    final SineStarFactory gsf = new SineStarFactory();
    gsf.setCentre(base);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    final Geometry circle = gsf.newSineStar();
    // System.out.println(circle);
    return circle.getBoundary();
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) SineStarFactory(com.revolsys.geometry.model.util.SineStarFactory)

Example 7 with SineStarFactory

use of com.revolsys.geometry.model.util.SineStarFactory in project com.revolsys.open by revolsys.

the class RectangleIntersectsPerfTest method newSineStar.

Geometry newSineStar(final Point origin, final double size, final int nPts) {
    final SineStarFactory gsf = new SineStarFactory();
    gsf.setCentre(origin);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    gsf.setArmLengthRatio(2);
    gsf.setNumArms(20);
    final Geometry poly = gsf.newSineStar();
    return poly;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) SineStarFactory(com.revolsys.geometry.model.util.SineStarFactory)

Example 8 with SineStarFactory

use of com.revolsys.geometry.model.util.SineStarFactory in project com.revolsys.open by revolsys.

the class PointInAreaPerfTest method run.

public void run() {
    final GeometryFactory geomFactory = GeometryFactory.DEFAULT_3D;
    final SineStarFactory ssFact = new SineStarFactory();
    ssFact.setSize(1000.0);
    ssFact.setNumPoints(2000);
    ssFact.setArmLengthRatio(0.1);
    ssFact.setNumArms(100);
    final Geometry area = ssFact.newSineStar();
    // System.out.println(area);
    final Stopwatch sw = new Stopwatch();
    final PointOnGeometryLocator pia = new MCIndexedPointInAreaLocator(area);
    // PointInAreaLocator pia = new IntervalIndexedPointInAreaLocator(area);
    // PointInAreaLocator pia = new SimplePointInAreaLocator(area);
    final PointInAreaPerfTester perfTester = new PointInAreaPerfTester(geomFactory, area);
    perfTester.setNumPoints(50000);
    perfTester.setPIA(pia);
    perfTester.run();
// System.out.println("Overall time: " + sw.getTimeString());
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) PointOnGeometryLocator(com.revolsys.geometry.algorithm.locate.PointOnGeometryLocator) SineStarFactory(com.revolsys.geometry.model.util.SineStarFactory) Stopwatch(com.revolsys.geometry.util.Stopwatch)

Example 9 with SineStarFactory

use of com.revolsys.geometry.model.util.SineStarFactory in project com.revolsys.open by revolsys.

the class PreparedGeometryThreadSafeTest method newSineStar.

Geometry newSineStar(final Point origin, final double size, final int nPts) {
    final SineStarFactory gsf = new SineStarFactory(this.factory);
    gsf.setCentre(origin);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    gsf.setArmLengthRatio(0.1);
    gsf.setNumArms(20);
    final Geometry poly = gsf.newSineStar();
    return poly;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) SineStarFactory(com.revolsys.geometry.model.util.SineStarFactory)

Example 10 with SineStarFactory

use of com.revolsys.geometry.model.util.SineStarFactory in project com.revolsys.open by revolsys.

the class StressTestHarness method newSineStar.

Geometry newSineStar(final Point origin, final double size, final int nPts) {
    final SineStarFactory gsf = new SineStarFactory();
    gsf.setCentre(origin);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    gsf.setArmLengthRatio(0.1);
    gsf.setNumArms(20);
    final Geometry poly = gsf.newSineStar();
    return poly;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) SineStarFactory(com.revolsys.geometry.model.util.SineStarFactory)

Aggregations

SineStarFactory (com.revolsys.geometry.model.util.SineStarFactory)10 Geometry (com.revolsys.geometry.model.Geometry)9 PointOnGeometryLocator (com.revolsys.geometry.algorithm.locate.PointOnGeometryLocator)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 Polygon (com.revolsys.geometry.model.Polygon)1 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)1 Stopwatch (com.revolsys.geometry.util.Stopwatch)1