Search in sources :

Example 1 with QuadTree

use of com.revolsys.geometry.index.quadtree.QuadTree 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;
}
Also used : IdObjectQuadTree(com.revolsys.geometry.index.quadtree.IdObjectQuadTree) QuadTree(com.revolsys.geometry.index.quadtree.QuadTree) BaseBoundingBox(com.revolsys.geometry.model.impl.BaseBoundingBox) BoundingBox(com.revolsys.geometry.model.BoundingBox) AbstractTriangle(com.revolsys.geometry.model.impl.AbstractTriangle) Triangle(com.revolsys.geometry.model.Triangle) TriangleDoubleXYZ(com.revolsys.geometry.model.impl.TriangleDoubleXYZ)

Aggregations

IdObjectQuadTree (com.revolsys.geometry.index.quadtree.IdObjectQuadTree)1 QuadTree (com.revolsys.geometry.index.quadtree.QuadTree)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 Triangle (com.revolsys.geometry.model.Triangle)1 AbstractTriangle (com.revolsys.geometry.model.impl.AbstractTriangle)1 BaseBoundingBox (com.revolsys.geometry.model.impl.BaseBoundingBox)1 TriangleDoubleXYZ (com.revolsys.geometry.model.impl.TriangleDoubleXYZ)1