BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSColourFromMaterial.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSCOLOURFROMMATERIAL_H
19#define BDSCOLOURFROMMATERIAL_H
20#include "G4String.hh"
21
22#include <map>
23
24class G4Colour;
25class G4Material;
26class G4PhysicsFreeVector;
27
35{
36public:
38
40
42 G4Colour* GetColour(const G4Material* material,
43 const G4String& prefixToStripFromName = "");
44
46 G4Colour* GetColourWithDefault(const G4Material* material,
47 G4Colour* defaultIn) const;
48
49private:
51 static BDSColourFromMaterial* instance;
52
53 std::map<G4String, G4Colour*> defines;
54 G4PhysicsFreeVector* generalDensity;
55};
56
57#endif
Automatic colours from materials.
std::map< G4String, G4Colour * > defines
Specially defined material colours.
static BDSColourFromMaterial * Instance()
Singleton pattern.
G4Colour * GetColour(const G4Material *material, const G4String &prefixToStripFromName="")
Get colour from name.
BDSColourFromMaterial()
Private constructor as singleton.
G4Colour * GetColourWithDefault(const G4Material *material, G4Colour *defaultIn) const
Get colour from name - if not found return the supplied default.