use of com.revolsys.geometry.model.impl.TriangleDoubleXYZ in project com.revolsys.open by revolsys.
the class IntArrayScaleTriangulatedIrregularNetwork method getTriangleSpatialIndex.
public QuadTree<Triangle> getTriangleSpatialIndex() {
if (this.triangleSpatialIndex == null) {
final QuadTree<Triangle> index = new QuadTree<>(this.geometryFactory);
forEachTriangle((x1, y1, z1, x2, y2, z2, x3, y3, z3) -> {
final Triangle triangle = new TriangleDoubleXYZ(x1, y1, z1, x2, y2, z2, x3, y3, z3);
final BoundingBox boundingBox = triangle.getBoundingBox();
index.insertItem(boundingBox, triangle);
});
this.triangleSpatialIndex = index;
}
return this.triangleSpatialIndex;
}
use of com.revolsys.geometry.model.impl.TriangleDoubleXYZ in project com.revolsys.open by revolsys.
the class QuadEdgeSubdivision method getTrianglesPolygonal.
/**
* Gets the geometry for the triangles in a triangulated subdivision as a {@link Polygonal}.
*
* @param geometryFactory the GeometryFactory to use
* @return a GeometryCollection of triangular Polygons
*/
public Polygonal getTrianglesPolygonal(final GeometryFactory geometryFactory) {
final List<Triangle> triangles = new ArrayList<>();
forEachTriangle((final double x1, final double y1, final double z1, final double x2, final double y2, final double z2, final double x3, final double y3, final double z3) -> {
final Triangle triangle = new TriangleDoubleXYZ(x1, y1, z1, x2, y2, z2, x3, y3, z3);
triangles.add(triangle);
});
return geometryFactory.polygonal(triangles);
}
use of com.revolsys.geometry.model.impl.TriangleDoubleXYZ in project com.revolsys.open by revolsys.
the class QuadEdgeSubdivision method forEachTriangle.
public void forEachTriangle(final Consumer<? super Triangle> action) {
forEachTriangle((x1, y1, z1, x2, y2, z2, x3, y3, z3) -> {
final Triangle triangle = new TriangleDoubleXYZ(x1, y1, z1, x2, y2, z2, x3, y3, z3);
action.accept(triangle);
});
}
Aggregations