Project
Loading...
Searching...
No Matches
o2::cad::O2BVHSurfaceSolid Class Reference

#include <O2BVHSurfaceSolid.h>

Inherits TGeoBBox.

Classes

struct  ContainsCrossing
 One crossing of the containment parity ray, as seen by Contains(). More...
 
struct  Impl
 
struct  PlanarBoundaryCurve
 One boundary curve in the surface's local (u, v) frame: a line segment, a circular arc or a clamped (rational) B-spline. More...
 
struct  RimReport
 One trim loop of one face as the closure measurement saw it, naming the rim and its worst chord. More...
 

Public Types

enum class  NavigationReliability {
  Undetermined = 0 , Reliable , ReversedFaces , OpenSurfaceSet ,
  NonManifold
}
 
using Point2D = std::array< double, 2 >
 
using Point3D = std::array< double, 3 >
 

Public Member Functions

 O2BVHSurfaceSolid ()
 
 O2BVHSurfaceSolid (const char *name)
 
 ~O2BVHSurfaceSolid () override
 
 O2BVHSurfaceSolid (const O2BVHSurfaceSolid &)=delete
 
O2BVHSurfaceSolidoperator= (const O2BVHSurfaceSolid &)=delete
 
bool AddPlanarSurface (const Point3D &origin, const Point3D &axisU, const Point3D &axisV, const std::vector< Point2D > &outerWire, const std::vector< std::vector< Point2D > > &innerWires={})
 
bool AddCurvedPlanarSurface (const Point3D &origin, const Point3D &axisU, const Point3D &axisV, const std::vector< PlanarBoundaryCurve > &outerWire, const std::vector< std::vector< PlanarBoundaryCurve > > &innerWires={})
 Add an exact planar surface bounded by line/arc wires; axisU and axisV are orthonormal and axisU x axisV points out.
 
bool AddCylindricalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double radius, double heightMin, double heightMax, double phiStart=0., double phiSweep=6.283185307179586, bool innerWall=false)
 Add a cylindrical wall of radius around axis over a height range and a phi sweep; innerWall points the normal to the axis.
 
bool AddCylindricalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double radius, double heightMin, double heightMax, double phiStart, double phiSweep, bool innerWall, const std::vector< PlanarBoundaryCurve > &outerTrim, const std::vector< std::vector< PlanarBoundaryCurve > > &innerTrims={})
 As AddCylindricalSurface, trimmed by line/arc wires in the (phi[rad], h[cm]) domain, which decide containment.
 
bool AddSphericalSurface (const Point3D &center, const Point3D &polarAxis, const Point3D &referenceAxisU, double radius, double thetaMin=0., double thetaMax=3.141592653589793, double phiStart=0., double phiSweep=6.283185307179586, bool innerWall=false)
 Add a spherical surface of radius trimmed to a theta range and a phi sweep; the defaults give a full sphere.
 
bool AddSphericalSurface (const Point3D &center, const Point3D &polarAxis, const Point3D &referenceAxisU, double radius, double thetaMin, double thetaMax, double phiStart, double phiSweep, bool innerWall, const std::vector< PlanarBoundaryCurve > &outerTrim, const std::vector< std::vector< PlanarBoundaryCurve > > &innerTrims={})
 As AddSphericalSurface, trimmed by line/arc wires in the (phi[rad], theta[rad]) domain.
 
bool AddConicalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double radiusAtMin, double radiusAtMax, double heightMin, double heightMax, double phiStart=0., double phiSweep=6.283185307179586, bool innerWall=false)
 Add a conical wall whose radius runs linearly from radiusAtMin to radiusAtMax; one radius may be zero.
 
bool AddConicalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double radiusAtMin, double radiusAtMax, double heightMin, double heightMax, double phiStart, double phiSweep, bool innerWall, const std::vector< PlanarBoundaryCurve > &outerTrim, const std::vector< std::vector< PlanarBoundaryCurve > > &innerTrims={})
 As AddConicalSurface, trimmed by line/arc wires in the (phi[rad], h[cm]) domain, which decide containment.
 
bool AddToroidalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double majorRadius, double minorRadius, double phiStart=0., double phiSweep=6.283185307179586, double tubeStart=0., double tubeSweep=6.283185307179586, bool innerWall=false)
 Add a toroidal surface trimmed to a phiRing x phiTube rectangle; the defaults give a full torus, innerWall points the normal to the tube spine.
 
bool AddToroidalSurface (const Point3D &centerPoint, const Point3D &axis, const Point3D &referenceAxisU, double majorRadius, double minorRadius, double phiStart, double phiSweep, double tubeStart, double tubeSweep, bool innerWall, const std::vector< PlanarBoundaryCurve > &outerTrim, const std::vector< std::vector< PlanarBoundaryCurve > > &innerTrims={})
 As AddToroidalSurface, trimmed by wires in the (phiRing, phiTube) domain; the trim may not wrap more than a turn in either angle.
 
void CloseShape (bool check=true)
 Finalize the shape: bounding box, display mesh, BVH and closure diagnostics, reported when check is set.
 
int GetNsurfaces () const
 
bool IsDefined () const
 
bool HasBVH () const
 Whether the BVH acceleration structure has been built (after CloseShape).
 
bool GetBVHRootBounds (Point3D &lower, Point3D &upper) const
 Fill the BVH root-node bounding box; returns false when no BVH has been built.
 
int CountBVHRayCandidates (const Point3D &point, const Point3D &direction) const
 Test hook: distinct surfaces whose cover boxes the ray traverses; -1 without a BVH.
 
void DescribeContainsCrossings (const Point3D &point, std::vector< ContainsCrossing > &bvhCrossings, std::vector< ContainsCrossing > &loopCrossings) const
 Diagnostic: the parity ray's crossings at point from the BVH and from the loop, sorted by distance.
 
void DescribeContainsCrossings (const Point3D &point, const Point3D &direction, std::vector< ContainsCrossing > &bvhCrossings, std::vector< ContainsCrossing > &loopCrossings) const
 As above for an explicit shooting direction: the crossing list behind ContainsAlongDirection().
 
bool IsClosed () const
 
bool IsOrientationConsistent () const
 
NavigationReliability GetNavigationReliability () const
 The reliability state derived from the last CloseShape(); Undetermined before it has run.
 
bool IsNavigable () const
 
int GetBoundaryEdgeCount () const
 Per-chord closure counts: diagnostics only; GetNavigationReliability() reads the rim counts below.
 
int GetNonManifoldEdgeCount () const
 
int GetReversedEdgeCount () const
 
double GetRimChordResolution () const
 
double GetRimMatchTolerance () const
 The declared rim match tolerance in cm, the model's own or a fallback: the floor of each chord's match band.
 
double GetTotalRimLength () const
 Summed trim-boundary length, and the part with no other face within the match band, in cm.
 
double GetUnmatchedRimLength () const
 
int GetRimCount () const
 Rim counts: total, and split by the same four states as the edge counters above.
 
int GetMatchedRimCount () const
 
int GetBoundaryRimCount () const
 
int GetNonManifoldRimCount () const
 
int GetReversedRimCount () const
 
const std::vector< RimReport > & GetRimReports () const
 
void GetSurfaceCapacityContributions (std::vector< double > &contributions) const
 Each face's divergence-theorem contribution to Capacity(), in record order.
 
void ComputeBBox () override
 
int DistancetoPrimitive (int, int) override
 
const TBuffer3D & GetBuffer3D (int reqSections, Bool_t localFrame) const override
 
void GetMeshNumbers (int &nvert, int &nsegs, int &npols) const override
 
int GetNmeshVertices () const override
 
Bool_t GetPointsOnSegments (Int_t npoints, Double_t *array) const override
 Fill array with npoints points on the solid's exact boundary; kFALSE below GetNmeshVertices() so ROOT uses SetPoints().
 
void InspectShape () const override
 
TBuffer3D * MakeBuffer3D () const override
 
void Print (Option_t *option="") const override
 
void SavePrimitive (std::ostream &, Option_t *) override
 
void SetPoints (double *points) const override
 
void SetPoints (Float_t *points) const override
 
void SetSegsAndPols (TBuffer3D &buff) const override
 
void Sizeof3D () const override
 
Double_t DistFromOutside (const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
 
Double_t DistFromInside (const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
 
bool Contains (const Double_t *point) const override
 
bool Contains_Loop (const Double_t *point) const
 
bool ContainsAlongDirection (const Double_t *point, const Double_t *direction) const
 Diagnostic: the parity answer for one explicit direction, bypassing Contains()'s re-shoot policy.
 
Double_t DistFromOutside_Loop (const Double_t *point, const Double_t *dir, Double_t stepmax=TGeoShape::Big()) const
 Non-BVH DistFrom* over all surfaces: the oracles the BVH paths must match exactly.
 
Double_t DistFromInside_Loop (const Double_t *point, const Double_t *dir, Double_t stepmax=TGeoShape::Big()) const
 
Double_t Safety (const Double_t *point, Bool_t in=kTRUE) const override
 The distance to the nearest patch, rounded down by one ulp so that Safety is never too large.
 
void ComputeNormal (const Double_t *point, const Double_t *dir, Double_t *norm) const override
 
Double_t Safety_Loop (const Double_t *point, Bool_t in=kTRUE) const
 Non-BVH Safety/ComputeNormal over all surfaces: the oracles the BVH traversal must match bit for bit.
 
void ComputeNormal_Loop (const Double_t *point, const Double_t *dir, Double_t *norm) const
 
Double_t Capacity () const override
 
const std::vector< BVHSurfaceRecord > & GetSurfaceRecords () const
 The Add*Surface calls this solid was built from, in order.
 
The source model's own tolerance, in cm, from the sidecar; zero means not stated
void SetModelTolerance (double toleranceCm)
 
double GetModelTolerance () const
 
The rim-based closure measurement, in cm and per rim; GetNavigationReliability() decides on it

Largest distance from any face's trim boundary to the nearest trim boundary of another face, in cm.

double GetMaxRimIsolation () const
 
Closure by edge identity (sidecar v3); when available these decide closure and reliability

Whether the edge identities were complete enough to decide closure by counting.

bool HasEdgeIdentity () const
 
int GetSourceEdgeCount () const
 Distinct source edges and their incidence: shared, boundary, non-manifold, reversed and degenerate.
 
int GetSharedSourceEdgeCount () const
 
int GetBoundarySourceEdgeCount () const
 
int GetNonManifoldSourceEdgeCount () const
 
int GetReversedSourceEdgeCount () const
 
int GetDegenerateSourceEdgeCount () const
 
double GetMaxSharedEdgeDeviation () const
 Largest Hausdorff distance between the two faces' realisations of one shared edge, in cm; a measurement only.
 
int GetMeasuredSharedEdgeCount () const
 
int GetUnmeasuredSharedEdgeCount () const
 

Static Public Member Functions

static void SetRayTMaxPruning (bool enable)
 Ray tmax tightening in the distance queries, on by default; it never changes an answer. Process-wide, not thread safe.
 
static bool GetRayTMaxPruning ()
 
static void ResetRayCandidateCounter ()
 Per-thread count of surfaces handed to the BVH leaf callback by DistFrom* since the last reset.
 
static long long GetRayCandidateCount ()
 
static void ResetSafetyCandidateCounter ()
 Per-thread count of surfaces handed to distanceSqToPatch by Safety and ComputeNormal since the last reset.
 
static long long GetSafetyCandidateCount ()
 
static void SetSafetyBoundUnsoundForTest (bool enable)
 Test-only sabotage: prune on the distance to the box centre, which bounds nothing, so the twins must disagree.
 
static bool GetSafetyBoundUnsoundForTest ()
 
static const charGetNavigationReliabilityName (NavigationReliability reliability)
 

Static Public Attributes

static constexpr double kSurfacePointTolerance = 1.e-11
 

Boundary edge identity (sidecar v3): when every face states its edges, CloseShape decides closure by counting them

enum  BoundaryEdgeFlag : unsigned char { kEdgeReversed = 1u << 0 , kEdgeDegenerate = 1u << 1 , kEdgeAnchored = 1u << 2 }
 
bool SetSurfaceBoundaryEdges (int surfaceIndex, const std::vector< unsigned int > &edgeIds, const std::vector< unsigned char > &edgeFlags)
 Attach surface surfaceIndex's edge identities in trim-curve order; false on a bad index or mismatched lengths.
 

Detailed Description

Definition at line 79 of file O2BVHSurfaceSolid.h.

Member Typedef Documentation

◆ Point2D

using o2::cad::O2BVHSurfaceSolid::Point2D = std::array<double, 2>

Definition at line 82 of file O2BVHSurfaceSolid.h.

◆ Point3D

using o2::cad::O2BVHSurfaceSolid::Point3D = std::array<double, 3>

Definition at line 83 of file O2BVHSurfaceSolid.h.

Member Enumeration Documentation

◆ BoundaryEdgeFlag

Enumerator
kEdgeReversed 

the face runs against the edge's own direction

kEdgeDegenerate 

cone apex / sphere pole: a point, so it has no second face

kEdgeAnchored 

entry i is trim curve i of this face, so it can be measured

Definition at line 196 of file O2BVHSurfaceSolid.h.

◆ NavigationReliability

How far navigation can be trusted: parity containment is defined only on a closed, consistently oriented 2-manifold. Ordered by severity; CloseShape reports the worst defect.

Enumerator
Undetermined 

CloseShape() has not run yet: no diagnostics exist.

Reliable 

closed, consistently oriented 2-manifold: parity is well defined

ReversedFaces 

closed, but some rim's partner traverses the shared curve the same way: at least one face's outward normal points inward

OpenSurfaceSet 

some rim has no other face within the match band (missing faces / trim gaps): parity is undefined in the shadow of every gap along the parity test direction. GetRimReports() names the loops

NonManifold 

some rim has two or more other faces within tolerance (coincident or duplicated faces): parity depends on the order hits are clustered in

Definition at line 268 of file O2BVHSurfaceSolid.h.

Constructor & Destructor Documentation

◆ O2BVHSurfaceSolid() [1/3]

O2BVHSurfaceSolid::O2BVHSurfaceSolid ( )

Definition at line 865 of file O2BVHSurfaceSolid.cxx.

◆ O2BVHSurfaceSolid() [2/3]

O2BVHSurfaceSolid::O2BVHSurfaceSolid ( const char name)
explicit

Definition at line 869 of file O2BVHSurfaceSolid.cxx.

◆ ~O2BVHSurfaceSolid()

O2BVHSurfaceSolid::~O2BVHSurfaceSolid ( )
override

Definition at line 873 of file O2BVHSurfaceSolid.cxx.

◆ O2BVHSurfaceSolid() [3/3]

o2::cad::O2BVHSurfaceSolid::O2BVHSurfaceSolid ( const O2BVHSurfaceSolid )
delete

Member Function Documentation

◆ AddConicalSurface() [1/2]

bool O2BVHSurfaceSolid::AddConicalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  radiusAtMin,
double  radiusAtMax,
double  heightMin,
double  heightMax,
double  phiStart,
double  phiSweep,
bool  innerWall,
const std::vector< PlanarBoundaryCurve > &  outerTrim,
const std::vector< std::vector< PlanarBoundaryCurve > > &  innerTrims = {} 
)

As AddConicalSurface, trimmed by line/arc wires in the (phi[rad], h[cm]) domain, which decide containment.

Definition at line 1104 of file O2BVHSurfaceSolid.cxx.

◆ AddConicalSurface() [2/2]

bool O2BVHSurfaceSolid::AddConicalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  radiusAtMin,
double  radiusAtMax,
double  heightMin,
double  heightMax,
double  phiStart = 0.,
double  phiSweep = 6.283185307179586,
bool  innerWall = false 
)

Add a conical wall whose radius runs linearly from radiusAtMin to radiusAtMax; one radius may be zero.

Definition at line 1080 of file O2BVHSurfaceSolid.cxx.

◆ AddCurvedPlanarSurface()

bool O2BVHSurfaceSolid::AddCurvedPlanarSurface ( const Point3D origin,
const Point3D axisU,
const Point3D axisV,
const std::vector< PlanarBoundaryCurve > &  outerWire,
const std::vector< std::vector< PlanarBoundaryCurve > > &  innerWires = {} 
)

Add an exact planar surface bounded by line/arc wires; axisU and axisV are orthonormal and axisU x axisV points out.

Definition at line 956 of file O2BVHSurfaceSolid.cxx.

◆ AddCylindricalSurface() [1/2]

bool O2BVHSurfaceSolid::AddCylindricalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  radius,
double  heightMin,
double  heightMax,
double  phiStart,
double  phiSweep,
bool  innerWall,
const std::vector< PlanarBoundaryCurve > &  outerTrim,
const std::vector< std::vector< PlanarBoundaryCurve > > &  innerTrims = {} 
)

As AddCylindricalSurface, trimmed by line/arc wires in the (phi[rad], h[cm]) domain, which decide containment.

Definition at line 1002 of file O2BVHSurfaceSolid.cxx.

◆ AddCylindricalSurface() [2/2]

bool O2BVHSurfaceSolid::AddCylindricalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  radius,
double  heightMin,
double  heightMax,
double  phiStart = 0.,
double  phiSweep = 6.283185307179586,
bool  innerWall = false 
)

Add a cylindrical wall of radius around axis over a height range and a phi sweep; innerWall points the normal to the axis.

Definition at line 980 of file O2BVHSurfaceSolid.cxx.

◆ AddPlanarSurface()

bool O2BVHSurfaceSolid::AddPlanarSurface ( const Point3D origin,
const Point3D axisU,
const Point3D axisV,
const std::vector< Point2D > &  outerWire,
const std::vector< std::vector< Point2D > > &  innerWires = {} 
)

Definition at line 878 of file O2BVHSurfaceSolid.cxx.

◆ AddSphericalSurface() [1/2]

bool O2BVHSurfaceSolid::AddSphericalSurface ( const Point3D center,
const Point3D polarAxis,
const Point3D referenceAxisU,
double  radius,
double  thetaMin,
double  thetaMax,
double  phiStart,
double  phiSweep,
bool  innerWall,
const std::vector< PlanarBoundaryCurve > &  outerTrim,
const std::vector< std::vector< PlanarBoundaryCurve > > &  innerTrims = {} 
)

As AddSphericalSurface, trimmed by line/arc wires in the (phi[rad], theta[rad]) domain.

Definition at line 1052 of file O2BVHSurfaceSolid.cxx.

◆ AddSphericalSurface() [2/2]

bool O2BVHSurfaceSolid::AddSphericalSurface ( const Point3D center,
const Point3D polarAxis,
const Point3D referenceAxisU,
double  radius,
double  thetaMin = 0.,
double  thetaMax = 3.141592653589793,
double  phiStart = 0.,
double  phiSweep = 6.283185307179586,
bool  innerWall = false 
)

Add a spherical surface of radius trimmed to a theta range and a phi sweep; the defaults give a full sphere.

Definition at line 1030 of file O2BVHSurfaceSolid.cxx.

◆ AddToroidalSurface() [1/2]

bool O2BVHSurfaceSolid::AddToroidalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  majorRadius,
double  minorRadius,
double  phiStart,
double  phiSweep,
double  tubeStart,
double  tubeSweep,
bool  innerWall,
const std::vector< PlanarBoundaryCurve > &  outerTrim,
const std::vector< std::vector< PlanarBoundaryCurve > > &  innerTrims = {} 
)

As AddToroidalSurface, trimmed by wires in the (phiRing, phiTube) domain; the trim may not wrap more than a turn in either angle.

Definition at line 1156 of file O2BVHSurfaceSolid.cxx.

◆ AddToroidalSurface() [2/2]

bool O2BVHSurfaceSolid::AddToroidalSurface ( const Point3D centerPoint,
const Point3D axis,
const Point3D referenceAxisU,
double  majorRadius,
double  minorRadius,
double  phiStart = 0.,
double  phiSweep = 6.283185307179586,
double  tubeStart = 0.,
double  tubeSweep = 6.283185307179586,
bool  innerWall = false 
)

Add a toroidal surface trimmed to a phiRing x phiTube rectangle; the defaults give a full torus, innerWall points the normal to the tube spine.

Definition at line 1132 of file O2BVHSurfaceSolid.cxx.

◆ Capacity()

Double_t O2BVHSurfaceSolid::Capacity ( ) const
override

Definition at line 2119 of file O2BVHSurfaceSolid.cxx.

◆ CloseShape()

void O2BVHSurfaceSolid::CloseShape ( bool  check = true)

Finalize the shape: bounding box, display mesh, BVH and closure diagnostics, reported when check is set.

Definition at line 1184 of file O2BVHSurfaceSolid.cxx.

◆ ComputeBBox()

void O2BVHSurfaceSolid::ComputeBBox ( )
override

Definition at line 1537 of file O2BVHSurfaceSolid.cxx.

◆ ComputeNormal()

void O2BVHSurfaceSolid::ComputeNormal ( const Double_t *  point,
const Double_t *  dir,
Double_t *  norm 
) const
override

Definition at line 2072 of file O2BVHSurfaceSolid.cxx.

◆ ComputeNormal_Loop()

void O2BVHSurfaceSolid::ComputeNormal_Loop ( const Double_t *  point,
const Double_t *  dir,
Double_t *  norm 
) const

Definition at line 2077 of file O2BVHSurfaceSolid.cxx.

◆ Contains()

bool O2BVHSurfaceSolid::Contains ( const Double_t *  point) const
override

Definition at line 1822 of file O2BVHSurfaceSolid.cxx.

◆ Contains_Loop()

bool O2BVHSurfaceSolid::Contains_Loop ( const Double_t *  point) const

Trivial non-BVH Contains looping over all surfaces; kept for debugging and cross-validation of the BVH-accelerated path (see O2Tessellated::Contains_Loop).

Definition at line 1863 of file O2BVHSurfaceSolid.cxx.

◆ ContainsAlongDirection()

bool O2BVHSurfaceSolid::ContainsAlongDirection ( const Double_t *  point,
const Double_t *  direction 
) const

Diagnostic: the parity answer for one explicit direction, bypassing Contains()'s re-shoot policy.

Definition at line 1849 of file O2BVHSurfaceSolid.cxx.

◆ CountBVHRayCandidates()

int O2BVHSurfaceSolid::CountBVHRayCandidates ( const Point3D point,
const Point3D direction 
) const

Test hook: distinct surfaces whose cover boxes the ray traverses; -1 without a BVH.

Definition at line 1304 of file O2BVHSurfaceSolid.cxx.

◆ DescribeContainsCrossings() [1/2]

void O2BVHSurfaceSolid::DescribeContainsCrossings ( const Point3D point,
const Point3D direction,
std::vector< ContainsCrossing > &  bvhCrossings,
std::vector< ContainsCrossing > &  loopCrossings 
) const

As above for an explicit shooting direction: the crossing list behind ContainsAlongDirection().

Definition at line 1905 of file O2BVHSurfaceSolid.cxx.

◆ DescribeContainsCrossings() [2/2]

void O2BVHSurfaceSolid::DescribeContainsCrossings ( const Point3D point,
std::vector< ContainsCrossing > &  bvhCrossings,
std::vector< ContainsCrossing > &  loopCrossings 
) const

Diagnostic: the parity ray's crossings at point from the BVH and from the loop, sorted by distance.

Definition at line 1896 of file O2BVHSurfaceSolid.cxx.

◆ DistancetoPrimitive()

int o2::cad::O2BVHSurfaceSolid::DistancetoPrimitive ( int  ,
int   
)
inlineoverride

Definition at line 358 of file O2BVHSurfaceSolid.h.

◆ DistFromInside()

Double_t O2BVHSurfaceSolid::DistFromInside ( const Double_t *  point,
const Double_t *  dir,
Int_t  iact = 1,
Double_t  step = TGeoShape::Big(),
Double_t *  safe = nullptr 
) const
override

Definition at line 1975 of file O2BVHSurfaceSolid.cxx.

◆ DistFromInside_Loop()

Double_t O2BVHSurfaceSolid::DistFromInside_Loop ( const Double_t *  point,
const Double_t *  dir,
Double_t  stepmax = TGeoShape::Big() 
) const

Definition at line 2005 of file O2BVHSurfaceSolid.cxx.

◆ DistFromOutside()

Double_t O2BVHSurfaceSolid::DistFromOutside ( const Double_t *  point,
const Double_t *  dir,
Int_t  iact = 1,
Double_t  step = TGeoShape::Big(),
Double_t *  safe = nullptr 
) const
override

Definition at line 1941 of file O2BVHSurfaceSolid.cxx.

◆ DistFromOutside_Loop()

Double_t O2BVHSurfaceSolid::DistFromOutside_Loop ( const Double_t *  point,
const Double_t *  dir,
Double_t  stepmax = TGeoShape::Big() 
) const

Non-BVH DistFrom* over all surfaces: the oracles the BVH paths must match exactly.

Definition at line 1997 of file O2BVHSurfaceSolid.cxx.

◆ GetBoundaryEdgeCount()

int O2BVHSurfaceSolid::GetBoundaryEdgeCount ( ) const

Per-chord closure counts: diagnostics only; GetNavigationReliability() reads the rim counts below.

Definition at line 1378 of file O2BVHSurfaceSolid.cxx.

◆ GetBoundaryRimCount()

int O2BVHSurfaceSolid::GetBoundaryRimCount ( ) const

Definition at line 1508 of file O2BVHSurfaceSolid.cxx.

◆ GetBoundarySourceEdgeCount()

int O2BVHSurfaceSolid::GetBoundarySourceEdgeCount ( ) const

Definition at line 1443 of file O2BVHSurfaceSolid.cxx.

◆ GetBuffer3D()

const TBuffer3D & O2BVHSurfaceSolid::GetBuffer3D ( int  reqSections,
Bool_t  localFrame 
) const
override

Definition at line 1794 of file O2BVHSurfaceSolid.cxx.

◆ GetBVHRootBounds()

bool O2BVHSurfaceSolid::GetBVHRootBounds ( Point3D lower,
Point3D upper 
) const

Fill the BVH root-node bounding box; returns false when no BVH has been built.

Definition at line 1291 of file O2BVHSurfaceSolid.cxx.

◆ GetDegenerateSourceEdgeCount()

int O2BVHSurfaceSolid::GetDegenerateSourceEdgeCount ( ) const

Definition at line 1458 of file O2BVHSurfaceSolid.cxx.

◆ GetMatchedRimCount()

int O2BVHSurfaceSolid::GetMatchedRimCount ( ) const

Definition at line 1503 of file O2BVHSurfaceSolid.cxx.

◆ GetMaxRimIsolation()

double O2BVHSurfaceSolid::GetMaxRimIsolation ( ) const

Definition at line 1393 of file O2BVHSurfaceSolid.cxx.

◆ GetMaxSharedEdgeDeviation()

double O2BVHSurfaceSolid::GetMaxSharedEdgeDeviation ( ) const

Largest Hausdorff distance between the two faces' realisations of one shared edge, in cm; a measurement only.

Definition at line 1463 of file O2BVHSurfaceSolid.cxx.

◆ GetMeasuredSharedEdgeCount()

int O2BVHSurfaceSolid::GetMeasuredSharedEdgeCount ( ) const

How many shared edges that maximum is over, and how many could not contribute because one of the two faces carries a parametric-rectangle trim with no per-edge curve to sample.

Definition at line 1468 of file O2BVHSurfaceSolid.cxx.

◆ GetMeshNumbers()

void O2BVHSurfaceSolid::GetMeshNumbers ( int nvert,
int nsegs,
int npols 
) const
override

Definition at line 1566 of file O2BVHSurfaceSolid.cxx.

◆ GetModelTolerance()

double o2::cad::O2BVHSurfaceSolid::GetModelTolerance ( ) const
inline

Definition at line 216 of file O2BVHSurfaceSolid.h.

◆ GetNavigationReliability()

O2BVHSurfaceSolid::NavigationReliability O2BVHSurfaceSolid::GetNavigationReliability ( ) const

The reliability state derived from the last CloseShape(); Undetermined before it has run.

Definition at line 1324 of file O2BVHSurfaceSolid.cxx.

◆ GetNavigationReliabilityName()

const char * O2BVHSurfaceSolid::GetNavigationReliabilityName ( NavigationReliability  reliability)
static

Short stable identifier of a reliability state ("reliable", "open-surface-set", ...), for logs and machine-readable reports.

Definition at line 1361 of file O2BVHSurfaceSolid.cxx.

◆ GetNmeshVertices()

int O2BVHSurfaceSolid::GetNmeshVertices ( ) const
override

Definition at line 1573 of file O2BVHSurfaceSolid.cxx.

◆ GetNonManifoldEdgeCount()

int O2BVHSurfaceSolid::GetNonManifoldEdgeCount ( ) const

Definition at line 1383 of file O2BVHSurfaceSolid.cxx.

◆ GetNonManifoldRimCount()

int O2BVHSurfaceSolid::GetNonManifoldRimCount ( ) const

Definition at line 1513 of file O2BVHSurfaceSolid.cxx.

◆ GetNonManifoldSourceEdgeCount()

int O2BVHSurfaceSolid::GetNonManifoldSourceEdgeCount ( ) const

Definition at line 1448 of file O2BVHSurfaceSolid.cxx.

◆ GetNsurfaces()

int O2BVHSurfaceSolid::GetNsurfaces ( ) const

Definition at line 1266 of file O2BVHSurfaceSolid.cxx.

◆ GetPointsOnSegments()

Bool_t O2BVHSurfaceSolid::GetPointsOnSegments ( Int_t  npoints,
Double_t *  array 
) const
override

Fill array with npoints points on the solid's exact boundary; kFALSE below GetNmeshVertices() so ROOT uses SetPoints().

Definition at line 1629 of file O2BVHSurfaceSolid.cxx.

◆ GetRayCandidateCount()

long long O2BVHSurfaceSolid::GetRayCandidateCount ( )
static

Definition at line 2028 of file O2BVHSurfaceSolid.cxx.

◆ GetRayTMaxPruning()

bool O2BVHSurfaceSolid::GetRayTMaxPruning ( )
static

Definition at line 2018 of file O2BVHSurfaceSolid.cxx.

◆ GetReversedEdgeCount()

int O2BVHSurfaceSolid::GetReversedEdgeCount ( ) const

Definition at line 1388 of file O2BVHSurfaceSolid.cxx.

◆ GetReversedRimCount()

int O2BVHSurfaceSolid::GetReversedRimCount ( ) const

Definition at line 1518 of file O2BVHSurfaceSolid.cxx.

◆ GetReversedSourceEdgeCount()

int O2BVHSurfaceSolid::GetReversedSourceEdgeCount ( ) const

Definition at line 1453 of file O2BVHSurfaceSolid.cxx.

◆ GetRimChordResolution()

double O2BVHSurfaceSolid::GetRimChordResolution ( ) const

Largest distance a rim polyline sits from the smooth rim it samples, in cm.

Definition at line 1478 of file O2BVHSurfaceSolid.cxx.

◆ GetRimCount()

int O2BVHSurfaceSolid::GetRimCount ( ) const

Rim counts: total, and split by the same four states as the edge counters above.

Definition at line 1498 of file O2BVHSurfaceSolid.cxx.

◆ GetRimMatchTolerance()

double O2BVHSurfaceSolid::GetRimMatchTolerance ( ) const

The declared rim match tolerance in cm, the model's own or a fallback: the floor of each chord's match band.

Definition at line 1483 of file O2BVHSurfaceSolid.cxx.

◆ GetRimReports()

const std::vector< O2BVHSurfaceSolid::RimReport > & O2BVHSurfaceSolid::GetRimReports ( ) const

Every rim of the last CloseShape(), in the order the faces were visited; empty before it has run. GetRimCount() is its size.

Definition at line 1523 of file O2BVHSurfaceSolid.cxx.

◆ GetSafetyBoundUnsoundForTest()

bool O2BVHSurfaceSolid::GetSafetyBoundUnsoundForTest ( )
static

Definition at line 2048 of file O2BVHSurfaceSolid.cxx.

◆ GetSafetyCandidateCount()

long long O2BVHSurfaceSolid::GetSafetyCandidateCount ( )
static

Definition at line 2038 of file O2BVHSurfaceSolid.cxx.

◆ GetSharedSourceEdgeCount()

int O2BVHSurfaceSolid::GetSharedSourceEdgeCount ( ) const

Definition at line 1438 of file O2BVHSurfaceSolid.cxx.

◆ GetSourceEdgeCount()

int O2BVHSurfaceSolid::GetSourceEdgeCount ( ) const

Distinct source edges and their incidence: shared, boundary, non-manifold, reversed and degenerate.

Definition at line 1433 of file O2BVHSurfaceSolid.cxx.

◆ GetSurfaceCapacityContributions()

void O2BVHSurfaceSolid::GetSurfaceCapacityContributions ( std::vector< double > &  contributions) const

Each face's divergence-theorem contribution to Capacity(), in record order.

Definition at line 1528 of file O2BVHSurfaceSolid.cxx.

◆ GetSurfaceRecords()

const std::vector< BVHSurfaceRecord > & o2::cad::O2BVHSurfaceSolid::GetSurfaceRecords ( ) const
inline

The Add*Surface calls this solid was built from, in order.

Definition at line 402 of file O2BVHSurfaceSolid.h.

◆ GetTotalRimLength()

double O2BVHSurfaceSolid::GetTotalRimLength ( ) const

Summed trim-boundary length, and the part with no other face within the match band, in cm.

Definition at line 1488 of file O2BVHSurfaceSolid.cxx.

◆ GetUnmatchedRimLength()

double O2BVHSurfaceSolid::GetUnmatchedRimLength ( ) const

Definition at line 1493 of file O2BVHSurfaceSolid.cxx.

◆ GetUnmeasuredSharedEdgeCount()

int O2BVHSurfaceSolid::GetUnmeasuredSharedEdgeCount ( ) const

Definition at line 1473 of file O2BVHSurfaceSolid.cxx.

◆ HasBVH()

bool O2BVHSurfaceSolid::HasBVH ( ) const

Whether the BVH acceleration structure has been built (after CloseShape).

Definition at line 1286 of file O2BVHSurfaceSolid.cxx.

◆ HasEdgeIdentity()

bool O2BVHSurfaceSolid::HasEdgeIdentity ( ) const

Definition at line 1428 of file O2BVHSurfaceSolid.cxx.

◆ InspectShape()

void o2::cad::O2BVHSurfaceSolid::InspectShape ( ) const
inlineoverride

Definition at line 370 of file O2BVHSurfaceSolid.h.

◆ IsClosed()

bool O2BVHSurfaceSolid::IsClosed ( ) const

Whether the closed shape forms a closed 2-manifold (every boundary edge shared by two faces). Meaningful only after CloseShape(); detects e.g. missing faces.

Definition at line 1314 of file O2BVHSurfaceSolid.cxx.

◆ IsDefined()

bool O2BVHSurfaceSolid::IsDefined ( ) const

Definition at line 1271 of file O2BVHSurfaceSolid.cxx.

◆ IsNavigable()

bool O2BVHSurfaceSolid::IsNavigable ( ) const

Shorthand for GetNavigationReliability() == NavigationReliability::Reliable. False means the navigation answers of this solid are not to be trusted anywhere, not just near the defect.

Definition at line 1356 of file O2BVHSurfaceSolid.cxx.

◆ IsOrientationConsistent()

bool O2BVHSurfaceSolid::IsOrientationConsistent ( ) const

Whether all shared boundary edges are traversed in opposite directions after CloseShape(); detects e.g. reversed faces (inconsistent outward normals).

Definition at line 1319 of file O2BVHSurfaceSolid.cxx.

◆ MakeBuffer3D()

TBuffer3D * O2BVHSurfaceSolid::MakeBuffer3D ( ) const
override

Definition at line 1699 of file O2BVHSurfaceSolid.cxx.

◆ operator=()

O2BVHSurfaceSolid & o2::cad::O2BVHSurfaceSolid::operator= ( const O2BVHSurfaceSolid )
delete

◆ Print()

void O2BVHSurfaceSolid::Print ( Option_t *  option = "") const
override

Definition at line 1713 of file O2BVHSurfaceSolid.cxx.

◆ ResetRayCandidateCounter()

void O2BVHSurfaceSolid::ResetRayCandidateCounter ( )
static

Per-thread count of surfaces handed to the BVH leaf callback by DistFrom* since the last reset.

Definition at line 2023 of file O2BVHSurfaceSolid.cxx.

◆ ResetSafetyCandidateCounter()

void O2BVHSurfaceSolid::ResetSafetyCandidateCounter ( )
static

Per-thread count of surfaces handed to distanceSqToPatch by Safety and ComputeNormal since the last reset.

Definition at line 2033 of file O2BVHSurfaceSolid.cxx.

◆ Safety()

Double_t O2BVHSurfaceSolid::Safety ( const Double_t *  point,
Bool_t  in = kTRUE 
) const
override

The distance to the nearest patch, rounded down by one ulp so that Safety is never too large.

Definition at line 2054 of file O2BVHSurfaceSolid.cxx.

◆ Safety_Loop()

Double_t O2BVHSurfaceSolid::Safety_Loop ( const Double_t *  point,
Bool_t  in = kTRUE 
) const

Non-BVH Safety/ComputeNormal over all surfaces: the oracles the BVH traversal must match bit for bit.

Definition at line 2063 of file O2BVHSurfaceSolid.cxx.

◆ SavePrimitive()

void o2::cad::O2BVHSurfaceSolid::SavePrimitive ( std::ostream &  ,
Option_t *   
)
inlineoverride

Definition at line 373 of file O2BVHSurfaceSolid.h.

◆ SetModelTolerance()

void O2BVHSurfaceSolid::SetModelTolerance ( double  toleranceCm)

Definition at line 1276 of file O2BVHSurfaceSolid.cxx.

◆ SetPoints() [1/2]

void O2BVHSurfaceSolid::SetPoints ( double *  points) const
override

Definition at line 1752 of file O2BVHSurfaceSolid.cxx.

◆ SetPoints() [2/2]

void O2BVHSurfaceSolid::SetPoints ( Float_t points) const
override

Definition at line 1762 of file O2BVHSurfaceSolid.cxx.

◆ SetRayTMaxPruning()

void O2BVHSurfaceSolid::SetRayTMaxPruning ( bool  enable)
static

Ray tmax tightening in the distance queries, on by default; it never changes an answer. Process-wide, not thread safe.

Definition at line 2013 of file O2BVHSurfaceSolid.cxx.

◆ SetSafetyBoundUnsoundForTest()

void O2BVHSurfaceSolid::SetSafetyBoundUnsoundForTest ( bool  enable)
static

Test-only sabotage: prune on the distance to the box centre, which bounds nothing, so the twins must disagree.

Definition at line 2043 of file O2BVHSurfaceSolid.cxx.

◆ SetSegsAndPols()

void O2BVHSurfaceSolid::SetSegsAndPols ( TBuffer3D &  buff) const
override

Definition at line 1772 of file O2BVHSurfaceSolid.cxx.

◆ SetSurfaceBoundaryEdges()

bool O2BVHSurfaceSolid::SetSurfaceBoundaryEdges ( int  surfaceIndex,
const std::vector< unsigned int > &  edgeIds,
const std::vector< unsigned char > &  edgeFlags 
)

Attach surface surfaceIndex's edge identities in trim-curve order; false on a bad index or mismatched lengths.

Definition at line 1398 of file O2BVHSurfaceSolid.cxx.

◆ Sizeof3D()

void o2::cad::O2BVHSurfaceSolid::Sizeof3D ( ) const
inlineoverride

Definition at line 377 of file O2BVHSurfaceSolid.h.

Member Data Documentation

◆ kSurfacePointTolerance

constexpr double o2::cad::O2BVHSurfaceSolid::kSurfacePointTolerance = 1.e-11
staticconstexpr

The tolerance GetPointsOnSegments() holds its points to, in cm. A point further than this from its own patch is replaced by an exact display-mesh vertex rather than emitted.

Definition at line 368 of file O2BVHSurfaceSolid.h.


The documentation for this class was generated from the following files: