35red (r), green (gr), blue (b), alpha (a)
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;}
44red (v.x()), green (v.y()), blue (v.z()), alpha (1.)
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 <<
')';
82std::map<G4String, G4Colour> G4Colour::fColourMap;
83bool G4Colour::fInitColourMap =
false;
92 std::map<G4String, G4Colour>::iterator iter = fColourMap.find(myKey);
94 if (iter == fColourMap.end()) fColourMap[myKey] = colour;
97 ed <<
"G4Colour with key "<<myKey<<
" already exists."<<
G4endl;
99 (
"G4Colour::AddToMap(const G4String& key, const G4Colour& colour)",
101 "Colour key exists");
106G4Colour::InitialiseColourMap()
125 if (
false == fInitColourMap) {
126 fInitColourMap =
true;
128 InitialiseColourMap();
134 std::map<G4String, G4Colour>::iterator iter = fColourMap.find(myKey);
137 if (iter == fColourMap.end())
return false;
139 result = iter->second;
146 if (
false == fInitColourMap) {
147 fInitColourMap =
true;
149 InitialiseColourMap();
std::ostream & operator<<(std::ostream &os, const G4Colour &c)
CLHEP::Hep3Vector G4ThreeVector
static void AddToMap(const G4String &key, const G4Colour &colour)
static const std::map< G4String, G4Colour > & GetMap()
G4bool operator!=(const G4Colour &c) const
static G4Colour Magenta()
G4Colour(G4double r=1., G4double g=1., G4double b=1., G4double a=1.)
static G4bool GetColour(const G4String &key, G4Colour &result)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription