Geant4  10.02.p03
cheprep::DefaultHepRepAttribute Class Referenceabstract

#include <DefaultHepRepAttribute.h>

Inheritance diagram for cheprep::DefaultHepRepAttribute:
Collaboration diagram for cheprep::DefaultHepRepAttribute:

Public Member Functions

 DefaultHepRepAttribute ()
 
 ~DefaultHepRepAttribute ()
 
std::set< HEPREP::HepRepAttValue * > getAttValuesFromNode ()
 
void addAttValue (HEPREP::HepRepAttValue *hepRepAttValue)
 
void addAttValue (std::string key, char *value, int showLabel)
 
void addAttValue (std::string key, std::string value, int showLabel)
 
void addAttValue (std::string key, int value, int showLabel)
 
void addAttValue (std::string key, int64 value, int showLabel)
 
void addAttValue (std::string key, double value, int showLabel)
 
void addAttValue (std::string key, bool value, int showLabel)
 
void addAttValue (std::string key, std::vector< double > value, int showLabel)
 
void addAttValue (std::string key, double red, double green, double blue, double alpha, int showLabel)
 
HEPREP::HepRepAttValuegetAttValueFromNode (std::string lowerCaseName)
 
HEPREP::HepRepAttValueremoveAttValue (std::string key)
 
HEPREP::HepRepAttValuegetAttValue (std::string name)=0
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor. More...
 

Private Attributes

std::map< std::string, HEPREP::HepRepAttValue * > attValues
 

Detailed Description

Definition at line 23 of file DefaultHepRepAttribute.h.

Constructor & Destructor Documentation

◆ DefaultHepRepAttribute()

cheprep::DefaultHepRepAttribute::DefaultHepRepAttribute ( )

Definition at line 21 of file DefaultHepRepAttribute.cc.

21  {
22 }

◆ ~DefaultHepRepAttribute()

cheprep::DefaultHepRepAttribute::~DefaultHepRepAttribute ( )

Definition at line 24 of file DefaultHepRepAttribute.cc.

24  {
25  for (map<string, HepRepAttValue*>::iterator i = attValues.begin(); i != attValues.end(); i++) {
26  delete (*i).second;
27  }
28 }
std::map< std::string, HEPREP::HepRepAttValue * > attValues

Member Function Documentation

◆ addAttValue() [1/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( HEPREP::HepRepAttValue hepRepAttValue)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 38 of file DefaultHepRepAttribute.cc.

38  {
39  string lowerCaseName = hepRepAttValue->getLowerCaseName();
40  if (attValues[lowerCaseName] != NULL) delete attValues[lowerCaseName];
41  attValues[lowerCaseName] = hepRepAttValue;
42 }
virtual std::string getLowerCaseName()=0
std::map< std::string, HEPREP::HepRepAttValue * > attValues
Here is the call graph for this function:

◆ addAttValue() [2/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
char *  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 44 of file DefaultHepRepAttribute.cc.

44  {
45  addAttValue(key, (std::string)value, showLabel);
46 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [3/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
std::string  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 48 of file DefaultHepRepAttribute.cc.

48  {
49  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
50 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [4/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
int  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 56 of file DefaultHepRepAttribute.cc.

56  {
57  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
58 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [5/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
int64  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 52 of file DefaultHepRepAttribute.cc.

52  {
53  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
54 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [6/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
double  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 60 of file DefaultHepRepAttribute.cc.

60  {
61  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
62 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [7/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
bool  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 64 of file DefaultHepRepAttribute.cc.

64  {
65  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
66 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [8/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
std::vector< double >  value,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 68 of file DefaultHepRepAttribute.cc.

68  {
69  addAttValue(new DefaultHepRepAttValue(key, value, showLabel));
70 }
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)

◆ addAttValue() [9/9]

void cheprep::DefaultHepRepAttribute::addAttValue ( std::string  key,
double  red,
double  green,
double  blue,
double  alpha,
int  showLabel 
)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 72 of file DefaultHepRepAttribute.cc.

72  {
73  vector<double> color;
74  color.push_back(red);
75  color.push_back(green);
76  color.push_back(blue);
77  color.push_back(alpha);
78  addAttValue(new DefaultHepRepAttValue(key, color, showLabel));
79 }
Definition: test07.cc:36
Definition: test07.cc:36
void addAttValue(HEPREP::HepRepAttValue *hepRepAttValue)
static const G4double alpha

◆ getAttValue()

HEPREP::HepRepAttValue* cheprep::DefaultHepRepAttribute::getAttValue ( std::string  name)
pure virtual

◆ getAttValueFromNode()

HepRepAttValue * cheprep::DefaultHepRepAttribute::getAttValueFromNode ( std::string  lowerCaseName)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 81 of file DefaultHepRepAttribute.cc.

81  {
82  string s = name;
83  transform(s.begin(), s.end(), s.begin(), (int(*)(int)) tolower);
84  return (attValues.count(s) > 0) ? attValues[s] : NULL;
85 }
G4String name
Definition: TRTMaterials.hh:40
std::map< std::string, HEPREP::HepRepAttValue * > attValues
static const double s
Definition: G4SIunits.hh:168
Here is the caller graph for this function:

◆ getAttValuesFromNode()

set< HepRepAttValue * > cheprep::DefaultHepRepAttribute::getAttValuesFromNode ( )
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 30 of file DefaultHepRepAttribute.cc.

30  {
31  set<HepRepAttValue*> attSet;
32  for (map<string, HepRepAttValue*>::iterator i = attValues.begin(); i != attValues.end(); i++) {
33  if ((*i).first != "layer") attSet.insert((*i).second);
34  }
35  return attSet;
36 }
std::map< std::string, HEPREP::HepRepAttValue * > attValues

◆ removeAttValue()

HepRepAttValue * cheprep::DefaultHepRepAttribute::removeAttValue ( std::string  key)
virtual

Implements HEPREP::HepRepAttribute.

Definition at line 87 of file DefaultHepRepAttribute.cc.

87  {
88  string s = name;
89  transform(s.begin(), s.end(), s.begin(), (int(*)(int)) tolower);
90  HepRepAttValue* attValue = attValues[s];
91  attValues.erase(s);
92  return attValue;
93 }
G4String name
Definition: TRTMaterials.hh:40
std::map< std::string, HEPREP::HepRepAttValue * > attValues
static const double s
Definition: G4SIunits.hh:168

Member Data Documentation

◆ attValues

std::map<std::string, HEPREP::HepRepAttValue*> cheprep::DefaultHepRepAttribute::attValues
private

Definition at line 26 of file DefaultHepRepAttribute.h.


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