BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
BDSColours Class Reference

Colour class that holds all colours used in BDSIM. More...

#include <BDSColours.hh>

Collaboration diagram for BDSColours:
Collaboration graph

Public Member Functions

G4Colour * GetColour (const G4String &type, G4bool normaliseTo255=true)
 Get colour from name. More...
 
void DefineColour (const G4String &name, G4double red, G4double green, G4double blue, G4double alpha=1, G4bool normaliseTo255=true)
 Define a new colour. More...
 
void Print ()
 

Static Public Member Functions

static BDSColoursInstance ()
 singleton pattern More...
 

Private Member Functions

 BDSColours ()
 Private constructor as singleton. More...
 

Private Attributes

std::map< G4int, G4String > magnetName
 
std::map< G4String, G4Colour * > colours
 A map of the colour for each type or component by name. More...
 

Static Private Attributes

static BDSColoursinstance = nullptr
 

Detailed Description

Colour class that holds all colours used in BDSIM.

Definition at line 32 of file BDSColours.hh.

Constructor & Destructor Documentation

◆ ~BDSColours()

BDSColours::~BDSColours ( )

Definition at line 40 of file BDSColours.cc.

◆ BDSColours()

BDSColours::BDSColours ( )
private

Private constructor as singleton.

Definition at line 45 of file BDSColours.cc.

References colours, magnetName, and Print().

Referenced by Instance().

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

Member Function Documentation

◆ DefineColour()

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 152 of file BDSColours.cc.

References colours, BDS::EnsureInLimits(), and Print().

Referenced by GetColour(), and BDSComponentFactory::PrepareColours().

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

◆ GetColour()

G4Colour * BDSColours::GetColour ( const G4String &  type,
G4bool  normaliseTo255 = true 
)

◆ Instance()

BDSColours * BDSColours::Instance ( )
static

◆ Print()

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 179 of file BDSColours.cc.

References colours.

Referenced by BDSColours(), DefineColour(), and BDSExecOptions::Parse().

Here is the caller graph for this function:

Field Documentation

◆ colours

std::map<G4String, G4Colour*> BDSColours::colours
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().

◆ instance

BDSColours * BDSColours::instance = nullptr
staticprivate

Definition at line 57 of file BDSColours.hh.

◆ magnetName

std::map<G4int, G4String> BDSColours::magnetName
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().


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