Geant4  10.02.p03
cheprep::DefaultHepRepInstance Class Reference

#include <DefaultHepRepInstance.h>

Inheritance diagram for cheprep::DefaultHepRepInstance:
Collaboration diagram for cheprep::DefaultHepRepInstance:

Public Member Functions

 DefaultHepRepInstance (HEPREP::HepRepInstance *parent, HEPREP::HepRepType *type)
 
 DefaultHepRepInstance (HEPREP::HepRepInstanceTree *parent, HEPREP::HepRepType *type)
 
 ~DefaultHepRepInstance ()
 
void overlay (HEPREP::HepRepInstance *instance)
 
HEPREP::HepRepInstancecopy (HEPREP::HepRepTypeTree *typeTree, HEPREP::HepRepInstance *parent, HEPREP::HepRepSelectFilter *filter)
 
HEPREP::HepRepInstancecopy (HEPREP::HepRepTypeTree *typeTree, HEPREP::HepRepInstanceTree *parent, HEPREP::HepRepSelectFilter *filter)
 
HEPREP::HepRepTypegetType ()
 
void addPoint (HEPREP::HepRepPoint *point)
 
std::vector< HEPREP::HepRepPoint * > getPoints ()
 
HEPREP::HepRepInstancegetSuperInstance ()
 
void addInstance (HEPREP::HepRepInstance *instance)
 
void removeInstance (HEPREP::HepRepInstance *instance)
 
std::vector< HEPREP::HepRepInstance * > getInstances ()
 
HEPREP::HepRepAttValuegetAttValue (std::string name)
 
void * getParent ()
 
- Public Member Functions inherited from cheprep::DefaultHepRepAttribute
 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)
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor. More...
 
- Public Member Functions inherited from HEPREP::HepRepInstance
virtual ~HepRepInstance ()
 Destructor. More...
 

Private Attributes

HEPREP::HepRepInstanceparent
 
HEPREP::HepRepTypetype
 
std::vector< HEPREP::HepRepPoint * > points
 
std::vector< HEPREP::HepRepInstance * > instances
 

Detailed Description

Definition at line 27 of file DefaultHepRepInstance.h.

Constructor & Destructor Documentation

◆ DefaultHepRepInstance() [1/2]

cheprep::DefaultHepRepInstance::DefaultHepRepInstance ( HEPREP::HepRepInstance parent,
HEPREP::HepRepType type 
)

Definition at line 16 of file DefaultHepRepInstance.cc.

17  : DefaultHepRepAttribute(), parent(instance), type(heprepType) {
18 
19  if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
20  parent->addInstance(this);
21 }
HEPREP::HepRepInstance * parent
static MCTruthManager * instance
virtual void addInstance(HepRepInstance *instance)=0
Here is the call graph for this function:

◆ DefaultHepRepInstance() [2/2]

cheprep::DefaultHepRepInstance::DefaultHepRepInstance ( HEPREP::HepRepInstanceTree parent,
HEPREP::HepRepType type 
)

Definition at line 23 of file DefaultHepRepInstance.cc.

24  : DefaultHepRepAttribute(), parent(NULL), type(heprepType) {
25 
26  if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
27  instanceTree->addInstance(this);
28 }
HEPREP::HepRepInstance * parent
Here is the call graph for this function:

◆ ~DefaultHepRepInstance()

cheprep::DefaultHepRepInstance::~DefaultHepRepInstance ( )

Definition at line 30 of file DefaultHepRepInstance.cc.

30  {
31  parent = NULL;
32  type = NULL;
33  for (vector<HepRepInstance*>::iterator i1 = instances.begin(); i1 != instances.end(); i1++) {
34  delete (*i1);
35  }
36  for (vector<HepRepPoint*>::iterator i2 = points.begin(); i2 != points.end(); i2++) {
37  delete (*i2);
38  }
39 }
std::vector< HEPREP::HepRepInstance * > instances
HEPREP::HepRepInstance * parent
std::vector< HEPREP::HepRepPoint * > points

Member Function Documentation

◆ addInstance()

void cheprep::DefaultHepRepInstance::addInstance ( HEPREP::HepRepInstance instance)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 71 of file DefaultHepRepInstance.cc.

71  {
72  instances.push_back(instance);
73 }
std::vector< HEPREP::HepRepInstance * > instances

◆ addPoint()

void cheprep::DefaultHepRepInstance::addPoint ( HEPREP::HepRepPoint point)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 59 of file DefaultHepRepInstance.cc.

59  {
60  points.push_back(point);
61 }
std::vector< HEPREP::HepRepPoint * > points

◆ copy() [1/2]

HepRepInstance * cheprep::DefaultHepRepInstance::copy ( HEPREP::HepRepTypeTree typeTree,
HEPREP::HepRepInstance parent,
HEPREP::HepRepSelectFilter filter 
)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 45 of file DefaultHepRepInstance.cc.

45  {
46  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstance*, HepRepSelectFilter*) not implemented." << endl;
47  return NULL;
48 }

◆ copy() [2/2]

HepRepInstance * cheprep::DefaultHepRepInstance::copy ( HEPREP::HepRepTypeTree typeTree,
HEPREP::HepRepInstanceTree parent,
HEPREP::HepRepSelectFilter filter 
)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 50 of file DefaultHepRepInstance.cc.

50  {
51  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstanceTree*, HepRepSelectFilter*) not implemented." << endl;
52  return NULL;
53 }

◆ getAttValue()

HepRepAttValue * cheprep::DefaultHepRepInstance::getAttValue ( std::string  name)
virtual

Implements cheprep::DefaultHepRepAttribute.

Definition at line 83 of file DefaultHepRepInstance.cc.

83  {
85  return (value != NULL) ? value : type->getAttValue(name);
86 }
G4String name
Definition: TRTMaterials.hh:40
virtual HepRepAttValue * getAttValue(std::string name)=0
HEPREP::HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)
Here is the call graph for this function:

◆ getInstances()

vector< HepRepInstance * > cheprep::DefaultHepRepInstance::getInstances ( )
virtual

Implements HEPREP::HepRepInstance.

Definition at line 79 of file DefaultHepRepInstance.cc.

79  {
80  return instances;
81 }
std::vector< HEPREP::HepRepInstance * > instances

◆ getParent()

void* cheprep::DefaultHepRepInstance::getParent ( )
inline

Definition at line 53 of file DefaultHepRepInstance.h.

53 { return parent; }
HEPREP::HepRepInstance * parent

◆ getPoints()

vector< HepRepPoint * > cheprep::DefaultHepRepInstance::getPoints ( )
virtual

Implements HEPREP::HepRepInstance.

Definition at line 63 of file DefaultHepRepInstance.cc.

63  {
64  return points;
65 }
std::vector< HEPREP::HepRepPoint * > points

◆ getSuperInstance()

HepRepInstance * cheprep::DefaultHepRepInstance::getSuperInstance ( )
virtual

Implements HEPREP::HepRepInstance.

Definition at line 67 of file DefaultHepRepInstance.cc.

67  {
68  return parent;
69 }
HEPREP::HepRepInstance * parent

◆ getType()

HepRepType * cheprep::DefaultHepRepInstance::getType ( )
virtual

Implements HEPREP::HepRepInstance.

Definition at line 55 of file DefaultHepRepInstance.cc.

55  {
56  return type;
57 }

◆ overlay()

void cheprep::DefaultHepRepInstance::overlay ( HEPREP::HepRepInstance instance)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 41 of file DefaultHepRepInstance.cc.

41  {
42  cerr << "DefaultHepRepInstance::overlay(HepRepInstance * instance) not implemented." << endl;
43 }

◆ removeInstance()

void cheprep::DefaultHepRepInstance::removeInstance ( HEPREP::HepRepInstance instance)
virtual

Implements HEPREP::HepRepInstance.

Definition at line 75 of file DefaultHepRepInstance.cc.

75  {
76  cerr << "DefaultHepRepInstance::removeInstance(HepRepInstance*) not implemented." << endl;
77 }

Member Data Documentation

◆ instances

std::vector<HEPREP::HepRepInstance*> cheprep::DefaultHepRepInstance::instances
private

Definition at line 33 of file DefaultHepRepInstance.h.

◆ parent

HEPREP::HepRepInstance* cheprep::DefaultHepRepInstance::parent
private

Definition at line 30 of file DefaultHepRepInstance.h.

◆ points

std::vector<HEPREP::HepRepPoint*> cheprep::DefaultHepRepInstance::points
private

Definition at line 32 of file DefaultHepRepInstance.h.

◆ type

HEPREP::HepRepType* cheprep::DefaultHepRepInstance::type
private

Definition at line 31 of file DefaultHepRepInstance.h.


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