BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSGeometryFactory.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSGEOMETRYFACTORY_H
20#define BDSGEOMETRYFACTORY_H
21
22#include "BDSGeometryType.hh"
23#include "BDSSDType.hh"
24
25#include "globals.hh"
26
27#include <map>
28#include <set>
29#include <string>
30#include <utility>
31#include <vector>
32
35class G4Colour;
36class G4UserLimits;
37
49{
50public:
53
55
60 BDSGeometryExternal* BuildGeometry(G4String componentName,
61 const G4String& formatAndFilePath,
62 std::map<G4String, G4Colour*>* colourMapping = nullptr,
63 G4bool autoColour = true,
64 G4double suggestedLength = 0,
65 G4double suggestedHorizontalWidth = 0,
66 std::vector<G4String>* namedVacuumVolumes = nullptr,
67 G4bool makeSensitive = true,
68 BDSSDType sensitivityType = BDSSDType::energydep,
69 G4bool stripOuterVolumeAndMakeAssembly = false,
70 G4UserLimits* userLimitsToAttachToAllLVs = nullptr,
71 G4bool dontReloadGeometry = false);
72
73private:
76
79
84 std::map<std::pair<std::string, std::string>, BDSGeometryExternal*> registry;
85
88 std::set<BDSGeometryExternal*> storage;
89
92
97};
98
99#endif
A loaded piece of externally provided geometry.
Base class for external geometry loading factories.
Interface to external geometry construction.
static BDSGeometryFactory * Instance()
Singleton accessor.
static BDSGeometryFactory * instance
Singleton instance.
BDSGeometryExternal * BuildGeometry(G4String componentName, const G4String &formatAndFilePath, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *namedVacuumVolumes=nullptr, G4bool makeSensitive=true, BDSSDType sensitivityType=BDSSDType::energydep, G4bool stripOuterVolumeAndMakeAssembly=false, G4UserLimits *userLimitsToAttachToAllLVs=nullptr, G4bool dontReloadGeometry=false)
BDSGeometryFactoryBase * gdml
Factory instance.
std::map< std::pair< std::string, std::string >, BDSGeometryExternal * > registry
BDSGeometryFactoryBase * GetAppropriateFactory(BDSGeometryType type)
Get the appropriate geometry factory.
BDSGeometryFactory()
Private accessor as singleton.
std::set< BDSGeometryExternal * > storage
BDSGeometryFactoryBase * sql
Factory instance.
Improve type-safety of native enum data type in C++.