Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ModelColourMap< T > Class Template Reference

#include <G4ModelColourMap.hh>

Public Member Functions

 G4ModelColourMap ()
 
virtual ~G4ModelColourMap ()
 
void Set (const T &, const G4Colour &)
 
void Set (const T &, const G4String &)
 
G4Colouroperator[] (const T &quantity)
 
const std::map< T, G4Colour > & GetBasicMap () const
 
bool GetColour (const T &, G4Colour &) const
 
void Print (std::ostream &ostr) const
 

Detailed Description

template<typename T>
class G4ModelColourMap< T >

Definition at line 41 of file G4ModelColourMap.hh.

Constructor & Destructor Documentation

template<typename T >
G4ModelColourMap< T >::G4ModelColourMap ( )

Definition at line 71 of file G4ModelColourMap.hh.

71 {}
template<typename T >
G4ModelColourMap< T >::~G4ModelColourMap ( )
virtual

Definition at line 74 of file G4ModelColourMap.hh.

74 {}

Member Function Documentation

template<typename T >
const std::map< T, G4Colour > & G4ModelColourMap< T >::GetBasicMap ( ) const

Definition at line 105 of file G4ModelColourMap.hh.

106 { return fMap; }

Here is the caller graph for this function:

template<typename T>
bool G4ModelColourMap< T >::GetColour ( const T &  quantity,
G4Colour colour 
) const

Definition at line 110 of file G4ModelColourMap.hh.

111 {
112  typename std::map<T, G4Colour>::const_iterator iter = fMap.find(quantity);
113 
114  if (iter != fMap.end()) {
115  colour = iter->second;
116  return true;
117  }
118 
119  return false;
120 }

Here is the caller graph for this function:

template<typename T>
G4Colour & G4ModelColourMap< T >::operator[] ( const T &  quantity)

Definition at line 68 of file G4ModelColourMap.hh.

68 {return fMap[quantity];}
template<typename T >
void G4ModelColourMap< T >::Print ( std::ostream &  ostr) const

Definition at line 124 of file G4ModelColourMap.hh.

125 {
126  typename std::map<T, G4Colour>::const_iterator iter = fMap.begin();
127 
128  while (iter != fMap.end()) {
129  ostr<< iter->first <<" : "<< iter->second <<G4endl;
130  iter++;
131  }
132 }
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

template<typename T>
void G4ModelColourMap< T >::Set ( const T &  quantity,
const G4Colour colour 
)

Definition at line 99 of file G4ModelColourMap.hh.

100 {
101  fMap[quantity] = colour;
102 }

Here is the caller graph for this function:

template<typename T>
void G4ModelColourMap< T >::Set ( const T &  quantity,
const G4String colour 
)

Definition at line 78 of file G4ModelColourMap.hh.

79 {
80  G4Colour myColour;
81 
82  // Will not setup the map if colour key does not exist
83  if (!G4Colour::GetColour(colour, myColour)) {
85  ed << "G4Colour with key "<<colour<<" does not exist ";
87  ("G4ColourMap::Set(Charge charge, const G4String& colour)",
88  "modeling0108", JustWarning, ed);
89  return;
90  }
91 
92 
93  // Will not modify myColour if colour key does not exist
94  Set(quantity, myColour);
95 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
static G4bool GetColour(const G4String &key, G4Colour &result)
Definition: G4Colour.cc:126
void Set(const T &, const G4Colour &)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:


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