BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Member Functions
BDSGeometryFactoryBase Class Referenceabstract

Base class for external geometry loading factories. More...

#include <BDSGeometryFactoryBase.hh>

Inheritance diagram for BDSGeometryFactoryBase:
Inheritance graph
Collaboration diagram for BDSGeometryFactoryBase:
Collaboration graph

Public Member Functions

virtual BDSGeometryExternalBuild (G4String componentName, G4String fileName, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *vacuumBiasVolumeNames=nullptr, G4UserLimits *userLimitsToAttachToAllLVs=nullptr)=0
 Main method to load and construct geometry. More...
 
virtual std::set< G4VisAttributes * > ApplyColourMapping (std::set< G4LogicalVolume * > &lvs, std::map< G4String, G4Colour * > *mapping, G4bool autoColour, const G4String &preprocessPrefix="")
 
virtual void ApplyUserLimits (const std::set< G4LogicalVolume * > &lvsIn, G4UserLimits *userLimits)
 Attach a set of user limits to every logical volume supplied. More...
 
- Public Member Functions inherited from BDSFactoryBase
virtual void FactoryBaseCleanUp ()
 Empty containers for next use - factories are never deleted so can't rely on scope. More...
 

Protected Member Functions

virtual void CleanUp ()
 Virtual clean up that derived classes can override that calls CleanUpBase(). More...
 
virtual G4String PreprocessedName (const G4String &objectName, const G4String &acceleratorComponentName) const
 
std::set< G4LogicalVolume * > GetVolumes (const std::set< G4LogicalVolume * > &allLVs, std::vector< G4String > *volumeNames, G4bool preprocessGDML, const G4String &componentName) const
 Get the volumes that match the name. Volume names are matched exactly and are case sensitive. More...
 
void CleanUpBase ()
 
void ExpandExtent (const BDSExtent &extent)
 Expand the acuumulated extents using a (possibly asymmetric) extent instance. More...
 
void ExpandExtent (G4double xO, G4double rx, G4double y0, G4double ry, G4double z0, G4double rz)
 
void ExpandExtent (G4double x0, G4double xLow, G4double xHigh, G4double y0, G4double yLow, G4double yHigh, G4double z0, G4double zLow, G4double zHigh)
 Expand the extent but asymmetrically. More...
 
BDSExtent Extent () const
 

Protected Attributes

G4double xmin
 Extent in one dimension. More...
 
G4double xmax
 Extent in one dimension. More...
 
G4double ymin
 Extent in one dimension. More...
 
G4double ymax
 Extent in one dimension. More...
 
G4double zmin
 Extent in one dimension. More...
 
G4double zmax
 Extent in one dimension. More...
 
- Protected Attributes inherited from BDSFactoryBase
std::set< G4LogicalVolume * > allLogicalVolumes
 
std::set< G4VPhysicalVolume * > allPhysicalVolumes
 
std::set< G4RotationMatrix * > allRotationMatrices
 
std::set< G4UserLimits * > allUserLimits
 
std::set< G4VSolid * > allSolids
 
std::set< G4VisAttributes * > allVisAttributes
 
G4double lengthSafety
 Cache of global constants variable. More...
 
G4double lengthSafetyLarge
 Cache of global constants variable. More...
 
G4bool checkOverlaps
 Cache of global constants variable. More...
 
G4bool visDebug
 Cache of global constants variable. More...
 
G4double nSegmentsPerCircle
 Cache of global constants variable. More...
 
G4VisAttributes * containerVisAttr
 Cache of global constants variable. More...
 
G4UserLimits * defaultUserLimits
 Cache of global constants variable. More...
 

Detailed Description

Base class for external geometry loading factories.

Author
Laurie Nevay

Definition at line 47 of file BDSGeometryFactoryBase.hh.

Constructor & Destructor Documentation

◆ BDSGeometryFactoryBase()

BDSGeometryFactoryBase::BDSGeometryFactoryBase ( )

Definition at line 40 of file BDSGeometryFactoryBase.cc.

◆ ~BDSGeometryFactoryBase()

BDSGeometryFactoryBase::~BDSGeometryFactoryBase ( )
virtual

Definition at line 45 of file BDSGeometryFactoryBase.cc.

Member Function Documentation

◆ ApplyColourMapping()

std::set< G4VisAttributes * > BDSGeometryFactoryBase::ApplyColourMapping ( std::set< G4LogicalVolume * > &  lvs,
std::map< G4String, G4Colour * > *  mapping,
G4bool  autoColour,
const G4String &  preprocessPrefix = "" 
)
virtual

Apply a colour mapping to a set of logical volumes. This applies a colour from the map if the key value is found as a substring or whole part of the logical volume name. Ie the BDSColour* (red) is defined to key 'quad' and any logical volume with 'quad' (case sensitive) will be set as red. Caches common G4VisAttributes (so no repeats for same colour) and returns those constructed. Map is searched through so key order gives precedence order.

Definition at line 48 of file BDSGeometryFactoryBase.cc.

References BDSColourFromMaterial::GetColour(), BDSColourFromMaterial::Instance(), BDSColours::Instance(), and BDS::StrContains().

Referenced by BDSGeometryFactoryGDML::Build(), and BDSGeometryFactorySQL::Build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyUserLimits()

void BDSGeometryFactoryBase::ApplyUserLimits ( const std::set< G4LogicalVolume * > &  lvsIn,
G4UserLimits *  userLimits 
)
virtual

Attach a set of user limits to every logical volume supplied.

Definition at line 115 of file BDSGeometryFactoryBase.cc.

Referenced by BDSGeometryFactoryGDML::Build().

Here is the caller graph for this function:

◆ Build()

virtual BDSGeometryExternal * BDSGeometryFactoryBase::Build ( G4String  componentName,
G4String  fileName,
std::map< G4String, G4Colour * > *  colourMapping = nullptr,
G4bool  autoColour = true,
G4double  suggestedLength = 0,
G4double  suggestedHorizontalWidth = 0,
std::vector< G4String > *  vacuumBiasVolumeNames = nullptr,
G4UserLimits *  userLimitsToAttachToAllLVs = nullptr 
)
pure virtual

Main method to load and construct geometry.

Implemented in BDSGeometryFactoryGDML, and BDSGeometryFactorySQL.

Referenced by BDSGeometryFactory::BuildGeometry().

Here is the caller graph for this function:

◆ CleanUp()

void BDSGeometryFactoryBase::CleanUp ( )
protectedvirtual

Virtual clean up that derived classes can override that calls CleanUpBase().

Reimplemented in BDSGeometryFactorySQL.

Definition at line 122 of file BDSGeometryFactoryBase.cc.

References CleanUpBase().

Referenced by BDSGeometryFactoryGDML::Build(), and BDSGeometryFactorySQL::CleanUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUpBase()

void BDSGeometryFactoryBase::CleanUpBase ( )
protected

Initialise variables - used to reset variables before each use of the factory. Non-virtual as used in constructor.

Definition at line 164 of file BDSGeometryFactoryBase.cc.

References BDSFactoryBase::FactoryBaseCleanUp(), xmax, xmin, ymax, ymin, zmax, and zmin.

Referenced by CleanUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExpandExtent() [1/3]

void BDSGeometryFactoryBase::ExpandExtent ( const BDSExtent extent)
protected

Expand the acuumulated extents using a (possibly asymmetric) extent instance.

Definition at line 175 of file BDSGeometryFactoryBase.cc.

References xmax, xmin, BDSExtent::XNeg(), BDSExtent::XPos(), ymax, ymin, BDSExtent::YNeg(), BDSExtent::YPos(), zmax, zmin, BDSExtent::ZNeg(), and BDSExtent::ZPos().

Referenced by BDSGeometryFactorySQL::PlaceComponents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExpandExtent() [2/3]

void BDSGeometryFactoryBase::ExpandExtent ( G4double  x0,
G4double  xLow,
G4double  xHigh,
G4double  y0,
G4double  yLow,
G4double  yHigh,
G4double  z0,
G4double  zLow,
G4double  zHigh 
)
protected

Expand the extent but asymmetrically.

Definition at line 197 of file BDSGeometryFactoryBase.cc.

References xmax, xmin, ymax, ymin, zmax, and zmin.

◆ ExpandExtent() [3/3]

void BDSGeometryFactoryBase::ExpandExtent ( G4double  xO,
G4double  rx,
G4double  y0,
G4double  ry,
G4double  z0,
G4double  rz 
)
protected

Expand the accumulated extents with a symmetric extent in each dimension (rx,ry,rz) about the offset x0,y0,z0.

Definition at line 185 of file BDSGeometryFactoryBase.cc.

References xmax, xmin, ymax, ymin, zmax, and zmin.

◆ Extent()

BDSExtent BDSGeometryFactoryBase::Extent ( ) const
inlineprotected

Definition at line 121 of file BDSGeometryFactoryBase.hh.

◆ GetVolumes()

std::set< G4LogicalVolume * > BDSGeometryFactoryBase::GetVolumes ( const std::set< G4LogicalVolume * > &  allLVs,
std::vector< G4String > *  volumeNames,
G4bool  preprocessGDML,
const G4String &  componentName 
) const
protected

Get the volumes that match the name. Volume names are matched exactly and are case sensitive.

Definition at line 131 of file BDSGeometryFactoryBase.cc.

Referenced by BDSGeometryFactoryGDML::Build().

Here is the caller graph for this function:

◆ PreprocessedName()

G4String BDSGeometryFactoryBase::PreprocessedName ( const G4String &  objectName,
const G4String &  acceleratorComponentName 
) const
protectedvirtual

Provide the preprocessed object (such as volume) names in case they're processed whilst loading from external formats. By default, no action.

Reimplemented in BDSGeometryFactoryGDML.

Definition at line 127 of file BDSGeometryFactoryBase.cc.

Field Documentation

◆ xmax

G4double BDSGeometryFactoryBase::xmax
protected

Extent in one dimension.

Definition at line 114 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().

◆ xmin

G4double BDSGeometryFactoryBase::xmin
protected

Extent in one dimension.

Definition at line 113 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().

◆ ymax

G4double BDSGeometryFactoryBase::ymax
protected

Extent in one dimension.

Definition at line 116 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().

◆ ymin

G4double BDSGeometryFactoryBase::ymin
protected

Extent in one dimension.

Definition at line 115 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().

◆ zmax

G4double BDSGeometryFactoryBase::zmax
protected

Extent in one dimension.

Definition at line 118 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().

◆ zmin

G4double BDSGeometryFactoryBase::zmin
protected

Extent in one dimension.

Definition at line 117 of file BDSGeometryFactoryBase.hh.

Referenced by CleanUpBase(), and ExpandExtent().


The documentation for this class was generated from the following files: