37 if( red > 1.0 ){red = 1.0;}
if( red < 0.0 ){red = 0.0;}
38 if( green > 1.0 ){green = 1.0;}
if( green < 0.0 ){green = 0.0;}
39 if( blue > 1.0 ){blue = 1.0;}
if( blue < 0.0 ){blue = 0.0;}
40 if( alpha > 1.0 ){alpha = 1.0;}
if( alpha < 0.0 ){alpha = 0.0;}
46 if( red > 1.0 ){red = 1.0;}
if( red < 0.0 ){red = 0.0;}
47 if( green > 1.0 ){green = 1.0;}
if( green < 0.0 ){green = 0.0;}
48 if( blue > 1.0 ){blue = 1.0;}
if( blue < 0.0 ){blue = 0.0;}
56 os <<
'(' << c.red <<
',' << c.green <<
',' << c.blue
57 <<
',' << c.alpha <<
')';
60 std::map<G4String, G4Colour>::const_reverse_iterator ri;
61 for (ri = colourMap.rbegin(); ri != colourMap.rend(); ++ri) {
62 if (c == ri->second) {
63 os <<
" (" << ri->first <<
')';
82 G4ThreadLocal std::map<G4String, G4Colour> *G4Colour::fColourMap = 0;
89 fColourMap =
new std::map<G4String, G4Colour>;
95 std::map<G4String, G4Colour>::iterator iter = fColourMap->find(myKey);
97 if (iter == fColourMap->end()) (*fColourMap)[myKey] = colour;
100 ed <<
"G4Colour with key "<<myKey<<
" already exists."<<
G4endl;
102 (
"G4Colour::AddToMap(const G4String& key, const G4Colour& colour)",
104 "Colour key exists");
109 G4Colour::InitialiseColourMap()
128 if (
false == fInitColourMap) {
129 fInitColourMap =
true;
131 InitialiseColourMap();
137 std::map<G4String, G4Colour>::iterator iter = fColourMap->find(myKey);
140 if (iter == fColourMap->end())
return false;
142 result = iter->second;
149 if (
false == fInitColourMap) {
150 fInitColourMap =
true;
152 InitialiseColourMap();
G4double G4ParticleHPJENDLHEData::G4double result
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
static G4bool GetColour(const G4String &key, G4Colour &result)
static G4Colour Magenta()
G4Colour(G4double r=1., G4double g=1., G4double b=1., G4double a=1.)
static void AddToMap(const G4String &key, const G4Colour &colour)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
static const std::map< G4String, G4Colour > & GetMap()
static const G4double alpha
G4bool operator!=(const G4Colour &c) const