Project
Loading...
Searching...
No Matches
o2::cad::O2BVHSurfaceSolid::Impl Struct Reference

Public Member Functions

void buildBVH ()
 Build the BVH over the surfaces' cover boxes, widened by kBVHBoxTolerance and rounded outward to float.
 
size_t surfaceOfPrimitive (size_t primitive) const
 The surface a BVH leaf primitive belongs to.
 
void collectSafetyAnchors ()
 Subsample the display vertices, which lie on their patches, as safety anchors.
 
double anchorSeedDistanceSq (const Vec3 &point) const
 
template<typename SurfaceVisitor >
void visitRayCandidates (const Vec3 &rayOrigin, const Vec3 &rayDirection, SurfaceVisitor &&visitor) const
 
template<bool wantEntering>
double nearestCrossing (const Vec3 &rayOrigin, const Vec3 &rayDirection, double stepmax) const
 
template<bool wantEntering>
double nearestCrossingLoop (const Vec3 &rayOrigin, const Vec3 &rayDirection, double stepmax) const
 Same query without the BVH: visit every surface. Oracle and baseline for nearestCrossing.
 
bool parityAlong (const Vec3 &point, const Vec3 &direction, bool useBVH, bool *ambiguous=nullptr) const
 Parity of the ray's crossings with the surface set, through the BVH or the loop; ambiguous reports a trim-band tie-break.
 
bool containsByVote (const Vec3 &point, bool useBVH, bool *allTiedOnBoundary=nullptr) const
 
template<typename SurfaceVisitor >
bool visitPointCandidates (const Vec3 &point, SurfaceVisitor &&visitor) const
 Visit every surface whose widened leaf box holds the point, until the visitor returns true.
 
double nearestPatchDistanceSqLoop (const Vec3 &point, size_t *closestIndex) const
 The brute-force nearest patch and its index; the lowest index wins an exact tie, which ComputeNormal relies on.
 
template<bool TrackIndex>
double nearestPatchDistanceSq (const Vec3 &point, size_t *closestIndex) const
 
bool refuseIfDefined (const O2BVHSurfaceSolid &owner, const char *method) const
 True, after reporting it for method of owner, if the shape is defined and takes no more surfaces.
 
bool commit (std::unique_ptr< BoundedSurface > surface, BVHSurfaceRecord record, std::vector< BVHSurfaceRecord > &records)
 Append a built surface, and to records the record that rebuilds it.
 

Public Attributes

std::vector< std::unique_ptr< BoundedSurface > > surfaces
 
std::vector< Vec3displayVertices
 
std::vector< std::array< int, 3 > > displayTriangles
 
std::vector< intdisplayTriangleSurface
 The surface each display triangle came from, parallel to displayTriangles; see GetPointsOnSegments.
 
ClosureReport closure
 
std::vector< RimReportrimReports
 
bool defined = false
 
std::unique_ptr< BVH > bvh
 
std::vector< intleafSurface
 The surface of each BVH leaf primitive, in leaf order.
 
bool reliable = false
 GetNavigationReliability() is Reliable; set by CloseShape.
 
std::vector< Vec3safetyAnchors
 A few on-patch display vertices, seeding the nearest-patch traversal's upper bound; see anchorSeedDistanceSq.
 

Detailed Description

Definition at line 429 of file O2BVHSurfaceSolid.cxx.

Member Function Documentation

◆ anchorSeedDistanceSq()

double o2::cad::O2BVHSurfaceSolid::Impl::anchorSeedDistanceSq ( const Vec3 point) const
inline

The squared distance to the nearest safety anchor, inflated by a hair: an upper bound on the exact answer. It prunes only nodes that cannot win, so the value and index stay the loop's; infinity without anchors.

Definition at line 513 of file O2BVHSurfaceSolid.cxx.

◆ buildBVH()

void o2::cad::O2BVHSurfaceSolid::Impl::buildBVH ( )
inline

Build the BVH over the surfaces' cover boxes, widened by kBVHBoxTolerance and rounded outward to float.

Definition at line 449 of file O2BVHSurfaceSolid.cxx.

◆ collectSafetyAnchors()

void o2::cad::O2BVHSurfaceSolid::Impl::collectSafetyAnchors ( )
inline

Subsample the display vertices, which lie on their patches, as safety anchors.

Definition at line 498 of file O2BVHSurfaceSolid.cxx.

◆ commit()

bool o2::cad::O2BVHSurfaceSolid::Impl::commit ( std::unique_ptr< BoundedSurface surface,
BVHSurfaceRecord  record,
std::vector< BVHSurfaceRecord > &  records 
)
inline

Append a built surface, and to records the record that rebuilds it.

Definition at line 839 of file O2BVHSurfaceSolid.cxx.

◆ containsByVote()

bool o2::cad::O2BVHSurfaceSolid::Impl::containsByVote ( const Vec3 point,
bool  useBVH,
bool *  allTiedOnBoundary = nullptr 
) const
inline

Containment by majority vote over reshootDirections() for a solid that is not a closed 2-manifold; stops at a majority. allTiedOnBoundary reports that no direction's parity rested on the geometry alone.

Definition at line 657 of file O2BVHSurfaceSolid.cxx.

◆ nearestCrossing()

template<bool wantEntering>
double o2::cad::O2BVHSurfaceSolid::Impl::nearestCrossing ( const Vec3 rayOrigin,
const Vec3 rayDirection,
double  stepmax 
) const
inline

Distance to the nearest entering (wantEntering) or exiting crossing within stepmax, else Big. The ray bound shrinks to the best candidate, rounded up past kBVHBoxTolerance, so no nearer hit is cut.

Definition at line 555 of file O2BVHSurfaceSolid.cxx.

◆ nearestCrossingLoop()

template<bool wantEntering>
double o2::cad::O2BVHSurfaceSolid::Impl::nearestCrossingLoop ( const Vec3 rayOrigin,
const Vec3 rayDirection,
double  stepmax 
) const
inline

Same query without the BVH: visit every surface. Oracle and baseline for nearestCrossing.

Definition at line 618 of file O2BVHSurfaceSolid.cxx.

◆ nearestPatchDistanceSq()

template<bool TrackIndex>
double o2::cad::O2BVHSurfaceSolid::Impl::nearestPatchDistanceSq ( const Vec3 point,
size_t *  closestIndex 
) const
inline

Same answer as nearestPatchDistanceSqLoop through the BVH: an ordered descent with a running best. Box and patch distances both err downward, so Safety can only be too small; TrackIndex keeps ties for ComputeNormal.

Definition at line 743 of file O2BVHSurfaceSolid.cxx.

◆ nearestPatchDistanceSqLoop()

double o2::cad::O2BVHSurfaceSolid::Impl::nearestPatchDistanceSqLoop ( const Vec3 point,
size_t *  closestIndex 
) const
inline

The brute-force nearest patch and its index; the lowest index wins an exact tie, which ComputeNormal relies on.

Definition at line 723 of file O2BVHSurfaceSolid.cxx.

◆ parityAlong()

bool o2::cad::O2BVHSurfaceSolid::Impl::parityAlong ( const Vec3 point,
const Vec3 direction,
bool  useBVH,
bool *  ambiguous = nullptr 
) const
inline

Parity of the ray's crossings with the surface set, through the BVH or the loop; ambiguous reports a trim-band tie-break.

Definition at line 633 of file O2BVHSurfaceSolid.cxx.

◆ refuseIfDefined()

bool o2::cad::O2BVHSurfaceSolid::Impl::refuseIfDefined ( const O2BVHSurfaceSolid owner,
const char method 
) const
inline

True, after reporting it for method of owner, if the shape is defined and takes no more surfaces.

Definition at line 829 of file O2BVHSurfaceSolid.cxx.

◆ surfaceOfPrimitive()

size_t o2::cad::O2BVHSurfaceSolid::Impl::surfaceOfPrimitive ( size_t  primitive) const
inline

The surface a BVH leaf primitive belongs to.

Definition at line 492 of file O2BVHSurfaceSolid.cxx.

◆ visitPointCandidates()

template<typename SurfaceVisitor >
bool o2::cad::O2BVHSurfaceSolid::Impl::visitPointCandidates ( const Vec3 point,
SurfaceVisitor &&  visitor 
) const
inline

Visit every surface whose widened leaf box holds the point, until the visitor returns true.

Definition at line 688 of file O2BVHSurfaceSolid.cxx.

◆ visitRayCandidates()

template<typename SurfaceVisitor >
void o2::cad::O2BVHSurfaceSolid::Impl::visitRayCandidates ( const Vec3 rayOrigin,
const Vec3 rayDirection,
SurfaceVisitor &&  visitor 
) const
inline

Visit every surface one of whose cover-box leaves is traversed by the (unbounded) ray, each exactly once however many of its boxes the ray crosses.

Definition at line 530 of file O2BVHSurfaceSolid.cxx.

Member Data Documentation

◆ bvh

std::unique_ptr<BVH> o2::cad::O2BVHSurfaceSolid::Impl::bvh

acceleration structure over the sub-patch cover boxes (built in CloseShape)

Definition at line 440 of file O2BVHSurfaceSolid.cxx.

◆ closure

ClosureReport o2::cad::O2BVHSurfaceSolid::Impl::closure

Definition at line 435 of file O2BVHSurfaceSolid.cxx.

◆ defined

bool o2::cad::O2BVHSurfaceSolid::Impl::defined = false

Definition at line 439 of file O2BVHSurfaceSolid.cxx.

◆ displayTriangles

std::vector<std::array<int, 3> > o2::cad::O2BVHSurfaceSolid::Impl::displayTriangles

Definition at line 432 of file O2BVHSurfaceSolid.cxx.

◆ displayTriangleSurface

std::vector<int> o2::cad::O2BVHSurfaceSolid::Impl::displayTriangleSurface

The surface each display triangle came from, parallel to displayTriangles; see GetPointsOnSegments.

Definition at line 434 of file O2BVHSurfaceSolid.cxx.

◆ displayVertices

std::vector<Vec3> o2::cad::O2BVHSurfaceSolid::Impl::displayVertices

Definition at line 431 of file O2BVHSurfaceSolid.cxx.

◆ leafSurface

std::vector<int> o2::cad::O2BVHSurfaceSolid::Impl::leafSurface

The surface of each BVH leaf primitive, in leaf order.

Definition at line 442 of file O2BVHSurfaceSolid.cxx.

◆ reliable

bool o2::cad::O2BVHSurfaceSolid::Impl::reliable = false

GetNavigationReliability() is Reliable; set by CloseShape.

Definition at line 444 of file O2BVHSurfaceSolid.cxx.

◆ rimReports

std::vector<RimReport> o2::cad::O2BVHSurfaceSolid::Impl::rimReports

closure.rimRecords in the public form, built once by CloseShape so the accessor can hand out a reference. The two are the same data; only the state enum and the Vec3 differ in type.

Definition at line 438 of file O2BVHSurfaceSolid.cxx.

◆ safetyAnchors

std::vector<Vec3> o2::cad::O2BVHSurfaceSolid::Impl::safetyAnchors

A few on-patch display vertices, seeding the nearest-patch traversal's upper bound; see anchorSeedDistanceSq.

Definition at line 446 of file O2BVHSurfaceSolid.cxx.

◆ surfaces

std::vector<std::unique_ptr<BoundedSurface> > o2::cad::O2BVHSurfaceSolid::Impl::surfaces

Definition at line 430 of file O2BVHSurfaceSolid.cxx.


The documentation for this struct was generated from the following file: