Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
DefaultHepRepInstance.cc
이 파일의 문서화 페이지로 가기
1 // Copyright FreeHEP, 2005.
2 
3 #include <iostream>
4 
6 
7 using namespace std;
8 using namespace HEPREP;
9 
14 namespace cheprep {
15 
16 DefaultHepRepInstance::DefaultHepRepInstance(HepRepInstance* instance, HepRepType* heprepType)
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 }
22 
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 }
29 
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 }
40 
42  cerr << "DefaultHepRepInstance::overlay(HepRepInstance * instance) not implemented." << endl;
43 }
44 
46  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstance*, HepRepSelectFilter*) not implemented." << endl;
47  return NULL;
48 }
49 
51  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstanceTree*, HepRepSelectFilter*) not implemented." << endl;
52  return NULL;
53 }
54 
56  return type;
57 }
58 
60  points.push_back(point);
61 }
62 
63 vector<HepRepPoint*> DefaultHepRepInstance::getPoints() {
64  return points;
65 }
66 
68  return parent;
69 }
70 
72  instances.push_back(instance);
73 }
74 
76  cerr << "DefaultHepRepInstance::removeInstance(HepRepInstance*) not implemented." << endl;
77 }
78 
79 vector<HepRepInstance*> DefaultHepRepInstance::getInstances() {
80  return instances;
81 }
82 
85  return (value != NULL) ? value : type->getAttValue(name);
86 }
87 
88 } // cheprep
DefaultHepRepInstance(HEPREP::HepRepInstance *parent, HEPREP::HepRepType *type)
const XML_Char * name
Definition: expat.h:151
virtual HepRepAttValue * getAttValue(std::string name)=0
std::vector< HEPREP::HepRepInstance * > getInstances()
std::vector< HEPREP::HepRepInstance * > instances
HEPREP::HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)
HEPREP::HepRepInstance * parent
HEPREP::HepRepAttValue * getAttValue(std::string name)
HEPREP::HepRepInstance * getSuperInstance()
virtual void addInstance(HepRepInstance *instance)=0
void addInstance(HEPREP::HepRepInstance *instance)
std::vector< HEPREP::HepRepPoint * > getPoints()
const XML_Char int const XML_Char * value
Definition: expat.h:331
void addPoint(HEPREP::HepRepPoint *point)
std::vector< HEPREP::HepRepPoint * > points
void overlay(HEPREP::HepRepInstance *instance)
HEPREP::HepRepInstance * copy(HEPREP::HepRepTypeTree *typeTree, HEPREP::HepRepInstance *parent, HEPREP::HepRepSelectFilter *filter)
static MCTruthManager * instance
virtual void addInstance(HepRepInstance *instance)=0
void removeInstance(HEPREP::HepRepInstance *instance)