|
G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
|
Maps STEP material names to Geant4 G4Material objects. More...
#include <G4OCCTMaterialMap.hh>
Public Member Functions | |
| G4OCCTMaterialMap ()=default | |
| void | Add (const G4String &stepName, G4Material *material) |
| G4Material * | Resolve (const G4String &stepName) const |
| bool | Contains (const G4String &stepName) const |
| std::size_t | Size () const |
| void | Merge (const G4OCCTMaterialMap &other) |
Maps STEP material names to Geant4 G4Material objects.
Provides a strict, no-fallback lookup table from the material name strings found in a STEP file (via the XDE material attribute) to the corresponding Geant4 G4Material pointers. The design follows the material-bridging policy described in docs/material_bridging.md: every name encountered during STEP import must have a registered entry; unresolved names produce a fatal G4Exception.
Definition at line 37 of file G4OCCTMaterialMap.hh.
|
default |
| void G4OCCTMaterialMap::Add | ( | const G4String & | stepName, |
| G4Material * | material | ||
| ) |
Register a mapping from a STEP material name to a Geant4 material.
If stepName is already registered the previous entry is silently overwritten.
| stepName | STEP material name string (case-sensitive). |
| material | Non-null pointer to a Geant4 material. |
Definition at line 12 of file G4OCCTMaterialMap.cc.
Referenced by G4OCCT_ImportSTEPAssembly(), Merge(), and G4OCCTMaterialMapReader::ReadFile().
| bool G4OCCTMaterialMap::Contains | ( | const G4String & | stepName | ) | const |
Return true if stepName has been registered.
Definition at line 35 of file G4OCCTMaterialMap.cc.
Referenced by G4OCCTDetectorConstruction::Construct().
| void G4OCCTMaterialMap::Merge | ( | const G4OCCTMaterialMap & | other | ) |
Merge all entries from other into this map.
If a STEP name already exists in this map, the entry from other overwrites it (later files win on conflict).
| other | Source map whose entries are merged into this one. |
Definition at line 39 of file G4OCCTMaterialMap.cc.
References Add().
Referenced by G4OCCTDetectorConstruction::Construct().
| G4Material * G4OCCTMaterialMap::Resolve | ( | const G4String & | stepName | ) | const |
Look up the Geant4 material for a given STEP material name.
| stepName | STEP material name to resolve. |
| G4Exception | (severity FatalException) if stepName is not registered. |
Definition at line 23 of file G4OCCTMaterialMap.cc.
Referenced by G4OCCTDetectorConstruction::Construct().
|
inline |
Return the number of registered entries.
Definition at line 70 of file G4OCCTMaterialMap.hh.