Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 40 of file G4ModelColourMap.hh.

Constructor & Destructor Documentation

◆ G4ModelColourMap()

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

Definition at line 70 of file G4ModelColourMap.hh.

70{}

◆ ~G4ModelColourMap()

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

Definition at line 73 of file G4ModelColourMap.hh.

73{}

Member Function Documentation

◆ GetBasicMap()

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

Definition at line 104 of file G4ModelColourMap.hh.

105{ return fMap; }

◆ GetColour()

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

Definition at line 109 of file G4ModelColourMap.hh.

110{
112
113 if (iter != fMap.end()) {
114 colour = iter->second;
115 return true;
116 }
117
118 return false;
119}

◆ operator[]()

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

Definition at line 67 of file G4ModelColourMap.hh.

67{return fMap[quantity];}

◆ Print()

template<typename T>
void G4ModelColourMap< T >::Print ( std::ostream & ostr) const

Definition at line 123 of file G4ModelColourMap.hh.

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

◆ Set() [1/2]

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

Definition at line 98 of file G4ModelColourMap.hh.

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

Referenced by Set().

◆ Set() [2/2]

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

Definition at line 77 of file G4ModelColourMap.hh.

78{
80
81 // Will not setup the map if colour key does not exist
84 ed << "G4Colour with key "<<colour<<" does not exist ";
86 ("G4ColourMap::Set(Charge charge, const G4String& colour)",
87 "modeling0108", JustWarning, ed);
88 return;
89 }
90
91
92 // Will not modify myColour if colour key does not exist
94}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void Set(const T &, const G4Colour &)

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