Concrete implementation of IGeometryService backed by GeoModel.
More...
#include <SHiPGeometryService.h>
|
| static std::unique_ptr< SHiPGeometryService > | fromSource () |
| | Build geometry from the C++ SHiPGeometryBuilder.
|
| |
| static std::unique_ptr< SHiPGeometryService > | fromFile (const std::filesystem::path &dbPath) |
| | Load geometry from a previously written GeoModel SQLite database.
|
| |
| static std::shared_ptr< SHiPGeometryService > | sharedFromFile (const std::filesystem::path &dbPath) |
| | Process-wide shared instance per geometry file, keyed by the canonical path.
|
| |
| static std::unique_ptr< SHiPGeometryService > | fromWorld (PVConstLink world) |
| | Wrap an already-built GeoModel world (e.g. a small test geometry).
|
| |
Concrete implementation of IGeometryService backed by GeoModel.
Four factory functions: SHiPGeometryService::fromSource() — builds via SHiPGeometryBuilder SHiPGeometryService::fromFile(dbPath) — reads from a GeoModel .db file SHiPGeometryService::sharedFromFile(dbPath)— process-wide shared instance SHiPGeometryService::fromWorld(world) — wraps an existing GeoModel tree
◆ ~SHiPGeometryService()
| ship::SHiPGeometryService::~SHiPGeometryService |
( |
| ) |
|
|
overridedefault |
◆ SHiPGeometryService() [1/2]
◆ SHiPGeometryService() [2/2]
◆ fromFile()
| std::unique_ptr< SHiPGeometryService > ship::SHiPGeometryService::fromFile |
( |
const std::filesystem::path & |
dbPath | ) |
|
|
static |
Load geometry from a previously written GeoModel SQLite database.
◆ fromSource()
Build geometry from the C++ SHiPGeometryBuilder.
◆ fromWorld()
| std::unique_ptr< SHiPGeometryService > ship::SHiPGeometryService::fromWorld |
( |
PVConstLink |
world | ) |
|
|
static |
Wrap an already-built GeoModel world (e.g. a small test geometry).
◆ geant4WorldLogical()
| G4LogicalVolume * ship::SHiPGeometryService::geant4WorldLogical |
( |
| ) |
|
|
overridevirtual |
◆ geoModelWorld()
| const GeoVPhysVol * ship::SHiPGeometryService::geoModelWorld |
( |
| ) |
const |
|
overridevirtual |
◆ getLogicalVolume()
| G4LogicalVolume * ship::SHiPGeometryService::getLogicalVolume |
( |
const std::string & |
name | ) |
const |
|
overridevirtual |
Look up a G4LogicalVolume by name within this service's converted tree (depth-first).
Returns nullptr before geant4WorldLogical() has been called or when no such volume exists; rethrows a stored conversion failure instead of masking it as nullptr.
Implements ship::IGeometryService.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ sharedFromFile()
| std::shared_ptr< SHiPGeometryService > ship::SHiPGeometryService::sharedFromFile |
( |
const std::filesystem::path & |
dbPath | ) |
|
|
static |
Process-wide shared instance per geometry file, keyed by the canonical path.
The first caller loads the file; later callers — from any plugin linking this library — get the same instance, so the GeoModel tree is loaded and converted at most once per process and freed once the last owner releases it.
All conversion and navigation on a shared instance must run on ship::geometry_thread() (see GeometryThread.h): Geant4 permits only one geometry-creating thread per process. Converted GeoModel trees are retained for the process lifetime (see geant4WorldLogical), so reloading a file after a converted instance has expired is safe.
The documentation for this class was generated from the following files: