|
G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
|
Geant4 solid wrapping an Open CASCADE Technology (OCCT) TopoDS_Shape. More...
#include <G4OCCTSolid.hh>
Classes | |
| class | Impl |
Public Member Functions | |
| G4OCCTSolid (const G4String &name, const TopoDS_Shape &shape) | |
| ~G4OCCTSolid () override | |
| EInside | Inside (const G4ThreeVector &p) const override |
| G4ThreeVector | SurfaceNormal (const G4ThreeVector &p) const override |
| G4double | DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const override |
| G4double | DistanceToIn (const G4ThreeVector &p) const override |
| G4double | DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override |
| G4double | DistanceToOut (const G4ThreeVector &p) const override |
| G4ThreeVector | GetPointOnSurface () const override |
| G4double | ExactDistanceToIn (const G4ThreeVector &p) const |
| G4double | ExactDistanceToOut (const G4ThreeVector &p) const |
| G4double | GetCubicVolume () override |
| G4double | GetSurfaceArea () override |
| G4GeometryType | GetEntityType () const override |
| G4VisExtent | GetExtent () const override |
| void | BoundingLimits (G4ThreeVector &pMin, G4ThreeVector &pMax) const override |
| G4bool | CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const override |
| void | DescribeYourselfTo (G4VGraphicsScene &scene) const override |
| G4Polyhedron * | CreatePolyhedron () const override |
| std::ostream & | StreamInfo (std::ostream &os) const override |
| const TopoDS_Shape & | GetOCCTShape () const |
| void | SetOCCTShape (const TopoDS_Shape &shape) |
Static Public Member Functions | |
| static G4OCCTSolid * | FromSTEP (const G4String &name, const std::string &path) |
Geant4 solid wrapping an Open CASCADE Technology (OCCT) TopoDS_Shape.
G4OCCTSolid is the Geant4-facing adapter over G4OCCT's shared OCCT solid query kernel. The adapter preserves the original G4VSolid contract and keeps Geant4 worker-thread cache ownership local to the Geant4 workflow, while the shared kernel owns the reusable OCCT geometry/query state needed for future non-Geant4 frontends.
Definition at line 31 of file G4OCCTSolid.hh.
| G4OCCTSolid::G4OCCTSolid | ( | const G4String & | name, |
| const TopoDS_Shape & | shape | ||
| ) |
Construct with a Geant4 solid name and an OCCT shape.
| name | Name registered with the Geant4 solid store. |
| shape | OCCT boundary-representation shape to wrap. |
| std::invalid_argument | if shape is null or has no computable bounding box. |
Definition at line 76 of file G4OCCTSolid.cc.
|
overridedefault |
Destroy the solid and release its adapter-owned caches.
|
override |
Return axis-aligned bounding-box limits.
Definition at line 160 of file G4OCCTSolid.cc.
|
override |
Calculate the solid extent along axis pAxis under pTransform and pVoxelLimit.
Definition at line 166 of file G4OCCTSolid.cc.
|
override |
Create a polyhedron representation for visualisation.
The adapter caches the generated polyhedron per shape generation.
Definition at line 176 of file G4OCCTSolid.cc.
References g4occt::detail::kOCCTRelativeDeflection.
|
override |
Describe the solid to the graphics scene.
Definition at line 174 of file G4OCCTSolid.cc.
|
override |
Lower bound on the shortest distance from external point p to the surface.
Use ExactDistanceToIn() when the exact shortest distance is required.
Definition at line 121 of file G4OCCTSolid.cc.
|
override |
Distance from external point p along direction v to the surface.
| p | Point outside (or on) the solid surface. |
| v | Non-zero direction vector, as required by the G4VSolid contract. |
kInfinity if the ray does not intersect the solid. Definition at line 117 of file G4OCCTSolid.cc.
|
override |
Lower bound on the shortest distance from internal point p to the surface.
Use ExactDistanceToOut() when the exact shortest distance is required.
Definition at line 132 of file G4OCCTSolid.cc.
|
override |
Distance from internal point p along direction v to the surface.
| p | Point inside (or on) the solid surface. |
| v | Non-zero direction vector, as required by the G4VSolid contract. |
| calcNorm | When true, also request the exit normal information. |
| validNorm | Optional output flag reporting whether n contains a valid normal. |
| n | Optional output for the exit normal. |
v. Definition at line 125 of file G4OCCTSolid.cc.
| G4double G4OCCTSolid::ExactDistanceToIn | ( | const G4ThreeVector & | p | ) | const |
Exact shortest distance from external point p to the surface.
p is on or inside the surface. Definition at line 140 of file G4OCCTSolid.cc.
| G4double G4OCCTSolid::ExactDistanceToOut | ( | const G4ThreeVector & | p | ) | const |
Exact shortest distance from internal point p to the surface.
p is within the surface tolerance of the boundary. Definition at line 144 of file G4OCCTSolid.cc.
|
static |
Load a STEP file and construct a G4OCCTSolid from the first shape found.
Convenience factory that combines STEP file reading with solid construction.
| name | Name registered with the Geant4 solid store. |
| path | Filesystem path to the STEP file. |
| std::runtime_error | if the file cannot be read, transfers no roots, or yields a null shape. |
Definition at line 81 of file G4OCCTSolid.cc.
Referenced by G4OCCTDetectorConstruction::Construct().
|
override |
Compute and return the cubic volume of the solid.
The shared kernel caches the result after the first evaluation for the current shape generation.
Definition at line 148 of file G4OCCTSolid.cc.
|
override |
Return a string identifying the entity type.
Definition at line 152 of file G4OCCTSolid.cc.
|
override |
Return the axis-aligned bounding-box extent.
Definition at line 154 of file G4OCCTSolid.cc.
| const TopoDS_Shape & G4OCCTSolid::GetOCCTShape | ( | ) | const |
Read-only access to the underlying OCCT shape currently used for queries.
Definition at line 281 of file G4OCCTSolid.cc.
|
override |
Return a point sampled on the solid surface.
Sampling is performed from the cached OCCT tessellation used by the shared kernel and projected back to the analytical face where possible.
Definition at line 136 of file G4OCCTSolid.cc.
|
override |
Compute and return the surface area of the solid.
The shared kernel caches the result after the first evaluation for the current shape generation.
Definition at line 150 of file G4OCCTSolid.cc.
|
override |
Return kInside, kSurface, or kOutside for point p.
Definition at line 107 of file G4OCCTSolid.cc.
| void G4OCCTSolid::SetOCCTShape | ( | const TopoDS_Shape & | shape | ) |
Replace the underlying OCCT shape.
| std::invalid_argument | if shape is null or has no computable bounding box. |
Definition at line 283 of file G4OCCTSolid.cc.
|
override |
Stream a human-readable description of the solid.
Definition at line 271 of file G4OCCTSolid.cc.
|
override |
Return the outward unit normal at surface point p.
Behaviour is defined for points on the surface, following the Geant4 G4VSolid contract.
Definition at line 113 of file G4OCCTSolid.cc.