|
G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
|
Dynamically constructs a Geant4 world from STEP solids and assemblies. More...
#include <G4OCCTDetectorConstruction.hh>
Public Member Functions | |
| G4OCCTDetectorConstruction () | |
| ~G4OCCTDetectorConstruction () override | |
| G4VPhysicalVolume * | Construct () override |
| void | LoadMaterial (G4String xmlFile) |
| Queue a material-map XML file to be loaded at construction time. | |
| void | AddSTEP (G4String stepFile) |
| Queue a STEP file as a solid or assembly (auto-detected). | |
| void | AddSolid (G4String stepFile, G4String materialName="") |
| Explicitly queue a STEP file as a G4OCCTSolid with an optional material override. | |
| void | AddAssembly (G4String stepFile) |
| Explicitly queue a STEP file as a G4OCCTAssemblyVolume. | |
| void | SetWorldMaterial (G4String name) |
| Set the world volume material by Geant4/NIST name. | |
| void | SetWorldHalfSize (G4ThreeVector halfSize) |
| Set the world half-size. Overrides auto-sizing. | |
Dynamically constructs a Geant4 world from STEP solids and assemblies.
Geometry is accumulated via public methods (called from positional CLI arguments in main()) or via the /G4OCCT/ messenger commands registered in the constructor.
| Command | Effect |
|---|---|
/G4OCCT/load/step <file> | Auto-detect and queue as solid or assembly |
/G4OCCT/load/assembly <file> | Force assembly import via XDE |
/G4OCCT/load/material <file> | Parse material-map XML |
/G4OCCT/world/setMaterial <name> | World volume material (default G4_AIR) |
/G4OCCT/world/setSize <x> <y> <z> <unit> | World half-size as 3-vector |
/G4OCCT/vis/open [driver] | Open a visualisation driver |
/G4OCCT/vis/scene | Redraw and refresh the current scene |
If no explicit size is set, Construct() computes the world half-size as 110 % of the axis-aligned bounding box of all placed volumes. An empty world defaults to a 1 m³ box.
Resolution order: G4OCCTMaterialMap → G4NistManager lookup → fatal G4Exception. Passing material XML files via LoadMaterial() before Construct() is strongly recommended for STEP files that embed non-NIST material names.
Definition at line 53 of file G4OCCTDetectorConstruction.hh.
| G4OCCTDetectorConstruction::G4OCCTDetectorConstruction | ( | ) |
Definition at line 76 of file G4OCCTDetectorConstruction.cc.
|
overridedefault |
| void G4OCCTDetectorConstruction::AddAssembly | ( | G4String | stepFile | ) |
Explicitly queue a STEP file as a G4OCCTAssemblyVolume.
Definition at line 140 of file G4OCCTDetectorConstruction.cc.
Referenced by AddSTEP().
| void G4OCCTDetectorConstruction::AddSolid | ( | G4String | stepFile, |
| G4String | materialName = "" |
||
| ) |
Explicitly queue a STEP file as a G4OCCTSolid with an optional material override.
Definition at line 136 of file G4OCCTDetectorConstruction.cc.
Referenced by AddSTEP().
| void G4OCCTDetectorConstruction::AddSTEP | ( | G4String | stepFile | ) |
Queue a STEP file as a solid or assembly (auto-detected).
Definition at line 128 of file G4OCCTDetectorConstruction.cc.
References AddAssembly(), and AddSolid().
|
override |
Definition at line 156 of file G4OCCTDetectorConstruction.cc.
References G4OCCTMaterialMap::Contains(), G4OCCTSolid::FromSTEP(), G4OCCTAssemblyVolume::FromSTEP(), G4OCCTMaterialMap::Merge(), G4OCCTMaterialMapReader::ReadFile(), and G4OCCTMaterialMap::Resolve().
| void G4OCCTDetectorConstruction::LoadMaterial | ( | G4String | xmlFile | ) |
Queue a material-map XML file to be loaded at construction time.
Definition at line 124 of file G4OCCTDetectorConstruction.cc.
Referenced by main().
|
inline |
Set the world half-size. Overrides auto-sizing.
Definition at line 78 of file G4OCCTDetectorConstruction.hh.
|
inline |
Set the world volume material by Geant4/NIST name.
Definition at line 75 of file G4OCCTDetectorConstruction.hh.