BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Colour class that holds all colours used in BDSIM. More...
#include <BDSColours.hh>
Public Member Functions | |
G4Colour * | GetColour (const G4String &type, G4bool normaliseTo255=true) |
Get colour from name. | |
void | DefineColour (const G4String &name, G4double red, G4double green, G4double blue, G4double alpha=1, G4bool normaliseTo255=true) |
Define a new colour. | |
void | Print () |
Static Public Member Functions | |
static BDSColours * | Instance () |
singleton pattern | |
Private Member Functions | |
BDSColours () | |
Private constructor as singleton. | |
Private Attributes | |
std::map< G4int, G4String > | magnetName |
std::map< G4String, G4Colour * > | colours |
A map of the colour for each type or component by name. | |
Static Private Attributes | |
static BDSColours * | instance = nullptr |
Colour class that holds all colours used in BDSIM.
Definition at line 32 of file BDSColours.hh.
BDSColours::~BDSColours | ( | ) |
Definition at line 40 of file BDSColours.cc.
|
private |
Private constructor as singleton.
Definition at line 45 of file BDSColours.cc.
References colours, magnetName, and Print().
Referenced by Instance().
void BDSColours::DefineColour | ( | const G4String & | name, |
G4double | red, | ||
G4double | green, | ||
G4double | blue, | ||
G4double | alpha = 1 , |
||
G4bool | normaliseTo255 = true |
||
) |
Define a new colour.
Definition at line 154 of file BDSColours.cc.
References colours, BDS::EnsureInLimits(), and Print().
Referenced by GetColour(), and BDSComponentFactory::PrepareColours().
G4Colour * BDSColours::GetColour | ( | const G4String & | type, |
G4bool | normaliseTo255 = true |
||
) |
Get colour from name.
Definition at line 204 of file BDSColours.cc.
References colours, DefineColour(), and BDS::StrContains().
Referenced by BDSColourFromMaterial::BDSColourFromMaterial(), BDSMagnetOuterInfo::BDSMagnetOuterInfo(), BDSDump::Build(), BDSGeometryFactoryGDML::Build(), BDSCollimator::CheckParameters(), BDSCollimatorJaw::CheckParameters(), BDSMagnetOuterFactory::CreateExternal(), BDSMagnetOuterFactoryLHC::CreateLHCDipole(), BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumesCoil(), BDSMagnetOuterFactoryCylindrical::CreateSolenoid(), BDSColourFromMaterial::GetColour(), BDSComponentFactory::PrepareColour(), and BDSCavityFactoryBase::SetVisAttributes().
|
static |
singleton pattern
Definition at line 33 of file BDSColours.cc.
References BDSColours().
Referenced by BDSGeometryFactoryBase::ApplyColourMapping(), BDSColourFromMaterial::BDSColourFromMaterial(), BDSMagnetOuterInfo::BDSMagnetOuterInfo(), BDSUndulator::Build(), BDSWireScanner::Build(), BDSDump::Build(), BDSGeometryFactoryGDML::Build(), BDSCollimator::CheckParameters(), BDSCollimatorJaw::CheckParameters(), BDSMagnetOuterFactory::CreateExternal(), BDSMagnetOuterFactoryLHC::CreateLHCDipole(), BDSMagnetOuterFactoryBase::CreateLogicalVolumes(), BDSMagnetOuterFactoryPolesBase::CreateLogicalVolumesCoil(), BDSMagnetOuterFactoryLHC::CreateQuadrupole(), BDSMagnetOuterFactoryCylindrical::CreateSolenoid(), BDSColourFromMaterial::GetColour(), BDSExecOptions::Parse(), BDSComponentFactory::PrepareColour(), BDSComponentFactory::PrepareColours(), BDSScreenFrame::SetDefaultVisAtts(), BDSCrystalFactory::SetVisAttributes(), BDSTunnelFactoryBase::SetVisAttributes(), BDSBeamPipeFactoryBase::SetVisAttributes(), BDSBeamPipeFactoryLHCDetailed::SetVisAttributes(), BDSCavityFactoryBase::SetVisAttributes(), BDSVisManager::StartSession(), BDSIM::~BDSIM(), and BDSIMLink::~BDSIMLink().
void BDSColours::Print | ( | ) |
Print out a full list of colours using Sphinx rst table syntax. Looks nice and easy to regenerate table for the manual.
Definition at line 181 of file BDSColours.cc.
References colours.
Referenced by BDSColours(), DefineColour(), and BDSExecOptions::Parse().
|
private |
A map of the colour for each type or component by name.
Definition at line 64 of file BDSColours.hh.
Referenced by BDSColours(), DefineColour(), GetColour(), and Print().
|
staticprivate |
Definition at line 57 of file BDSColours.hh.
|
private |
A map of the magnet name for which order it is, which can be used to access the appropriate colour map
Definition at line 61 of file BDSColours.hh.
Referenced by BDSColours().