|
| void | Construct (Index nPrimitives, Index maxPointsInLeaf=10) |
| | Construct the BVH from a set of primitives.
|
| |
| auto | BoundingVolumes () const -> std::vector< BoundingVolumeType > const & |
| | Returns the bounding volumes of this BVH.
|
| |
| auto | PrimitivesInBoundingVolume (Index bvIdx) const |
| | Returns the indices of the primitives contained in the bounding volume bvIdx.
|
| |
| template<class FIntersectsBoundingVolume, class FIntersectsPrimitive> |
| std::vector< Index > | PrimitivesIntersecting (FIntersectsBoundingVolume &&ibv, FIntersectsPrimitive &&ip, std::size_t reserve=50ULL) const |
| | Returns the indices of the primitives intersecting the bounding volume bv.
|
| |
| template<class FDistanceToBoundingVolume, class FDistanceToPrimitive> |
| auto | NearestPrimitivesTo (FDistanceToBoundingVolume &&db, FDistanceToPrimitive &&dp, std::size_t K) const -> std::pair< std::vector< Index >, std::vector< Scalar > > |
| | Obtains the k nearest neighbours (primitives of this BVH)
|
| |
|
void | Update () |
| | Update the bounding volumes of this BVH.
|
| |
| PrimitiveType | Primitive (Index p) const |
| | Returns the primitive at index p.
|
| |
| auto | PrimitiveLocation (PrimitiveType const &primitive) const |
| | Returns the location of the primitive.
|
| |
| template<class RPrimitiveIndices> |
| BoundingVolumeType | BoundingVolumeOf (RPrimitiveIndices &&primitiveIndexRange) const |
| | Returns the bounding volume of the primitives in the range [first, last)
|
| |
|
| template<class TDerived2, class TBoundingVolume2, class TPrimitive2, int Dims2, class FBoundingVolumesOverlap, class FPrimitivesOverlap, class FPrimitivesAreAdjacent> |
| IndexMatrixX | OverlappingPrimitivesImpl (BoundingVolumeHierarchy< TDerived2, TBoundingVolume2, TPrimitive2, Dims2 > const &other, FBoundingVolumesOverlap &&bvo, FPrimitivesOverlap &&po, FPrimitivesAreAdjacent &&PrimitivesAreAdjacent=[](PrimitiveType const &p1, TPrimitive2 const &p2) -> bool { return false;}, std::size_t reserve=50ULL) const |
| | Returns the indices of the primitives overlapping between this BVH and another BVH.
|
| |
template<class TDerived, class TBoundingVolume, class TPrimitive, int Dims>
class pbat::geometry::BoundingVolumeHierarchy< TDerived, TBoundingVolume, TPrimitive, Dims >
CRTP base class for BVHs.
- Template Parameters
-
| TDerived | Type of the child class (the concrete BVH implementation) |
| TBoundingVolume | Type of bounding volumes used in the BVH tree |
| TPrimitive | Type of primitives stored in the BVH |
| Dims | Embedding dimensionality |
template<class TDerived, class TBoundingVolume, class TPrimitive, int Dims>
template<class FDistanceToBoundingVolume, class FDistanceToPrimitive>
| auto pbat::geometry::BoundingVolumeHierarchy< TDerived, TBoundingVolume, TPrimitive, Dims >::NearestPrimitivesTo |
( |
FDistanceToBoundingVolume && | db, |
|
|
FDistanceToPrimitive && | dp, |
|
|
std::size_t | K ) const -> std::pair<std::vector<Index>, std::vector<Scalar>> |
|
inline |
Obtains the k nearest neighbours (primitives of this BVH)
- Template Parameters
-
| FDistanceToBoundingVolume | Callable with signature Scalar pred(BoundingVolume const&) |
| FDistanceToPrimitive | Callable with signature Scalar pred(Primitive const&) |
- Parameters
-
| db | Distance function d(b) between bounding volume b and user-owned shape |
| dp | Distance function d(p) between primitive p and user-owned shape |
| K | Number of nearest neighbours to query |
- Returns
- Pair of vectors containing the indices of the nearest primitives and their distances
template<class TDerived, class TBoundingVolume, class TPrimitive, int Dims>
template<class TDerived2, class TBoundingVolume2, class TPrimitive2, int Dims2, class FBoundingVolumesOverlap, class FPrimitivesOverlap, class FPrimitivesAreAdjacent>
| IndexMatrixX pbat::geometry::BoundingVolumeHierarchy< TDerived, TBoundingVolume, TPrimitive, Dims >::OverlappingPrimitivesImpl |
( |
BoundingVolumeHierarchy< TDerived2, TBoundingVolume2, TPrimitive2, Dims2 > const & | other, |
|
|
FBoundingVolumesOverlap && | bvo, |
|
|
FPrimitivesOverlap && | po, |
|
|
FPrimitivesAreAdjacent && | PrimitivesAreAdjacent = [](PrimitiveType const& p1, TPrimitive2 const& p2) -> bool { return false; }, |
|
|
std::size_t | reserve = 50ULL ) const |
|
inlineprotected |
Returns the indices of the primitives overlapping between this BVH and another BVH.
- Template Parameters
-
| TDerived2 | Type of the other BVH |
| TBoundingVolume2 | Type of bounding volumes of the other BVH |
| TPrimitive2 | Type of primitives of the other BVH |
| FBoundingVolumesOverlap | Callable with signature bool pred(BoundingVolume const&, BoundingVolume2 const&) |
| FPrimitivesOverlap | Callable with signature bool pred(Primitive const&, Primitive2 const&) |
| FPrimitivesAreAdjacent | Callable with signature bool pred(Primitive const&, Primitive2 const&) |
| Dims2 | Embedding dimensionality of the other BVH |
- Parameters
-
| other | Other BVH |
| bvo | Predicate pred(bv1, bv2) evaluating to true if the bounding volumes bv1 and bv2 overlap |
| po | Predicate pred(p1, p2) evaluating to true if the primitives p1 and p2 overlap |
| PrimitivesAreAdjacent | Predicate pred(p1, p2) evaluating to true if the primitives p1 and p2 are adjacent |
| reserve | Estimated number of overlapping primitives to reserve in memory |
- Returns
2 x |# overlaps| matrix of overlapping primitive indices
template<class TDerived, class TBoundingVolume, class TPrimitive, int Dims>
template<class FIntersectsBoundingVolume, class FIntersectsPrimitive>
| std::vector< Index > pbat::geometry::BoundingVolumeHierarchy< TDerived, TBoundingVolume, TPrimitive, Dims >::PrimitivesIntersecting |
( |
FIntersectsBoundingVolume && | ibv, |
|
|
FIntersectsPrimitive && | ip, |
|
|
std::size_t | reserve = 50ULL ) const |
|
inline |
Returns the indices of the primitives intersecting the bounding volume bv.
- Template Parameters
-
| FIntersectsBoundingVolume | Callable with signature bool pred(BoundingVolume const&) |
| FIntersectsPrimitive | Callable with signature bool pred(Primitive const&) primitive p is intersected. |
- Parameters
-
| ibv | Predicate pred(bv) evaluating to true if the bounding volume bv is intersected. |
| ip | Predicate pred(p) evaluating to true if the primitive p is intersected. |
| reserve | Estimated number of intersecting primitives to reserve in memory |
- Returns