Geant4-11
Functions
G4Colour.cc File Reference
#include "G4Colour.hh"
#include "G4Threading.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4Colour &c)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const G4Colour c 
)

Definition at line 80 of file G4Colour.cc.

80 {
81 os << '(' << c.red << ',' << c.green << ',' << c.blue
82 << ',' << c.alpha << ')';
83 const std::map<G4String, G4Colour>& colourMap = G4Colour::GetMap();
84 // Reverse iterator to pick up English spelling of grey!! :)
85 std::map<G4String, G4Colour>::const_reverse_iterator ri;
86 for (ri = colourMap.rbegin(); ri != colourMap.rend(); ++ri) {
87 if (c == ri->second) {
88 os << " (" << ri->first << ')';
89 break;
90 }
91 }
92
93 return os;
94}
G4double alpha
Definition: G4Colour.hh:145
G4double green
Definition: G4Colour.hh:145
static const std::map< G4String, G4Colour > & GetMap()
Definition: G4Colour.cc:178
G4double red
Definition: G4Colour.hh:145
G4double blue
Definition: G4Colour.hh:145