Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
DefaultHepRepInstance.cc
Go to the documentation of this file.
1// Copyright FreeHEP, 2005.
2
3#include <iostream>
4
6
7using namespace std;
8using namespace HEPREP;
9
10/**
11 * @author Mark Donszelmann
12 */
13namespace cheprep {
14
16 : DefaultHepRepAttribute(), parent(instance), type(heprepType) {
17
18 if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
19 parent->addInstance(this);
20}
21
23 : DefaultHepRepAttribute(), parent(NULL), type(heprepType) {
24
25 if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
26 instanceTree->addInstance(this);
27}
28
30 parent = NULL;
31 type = NULL;
32 for (vector<HepRepInstance*>::iterator i1 = instances.begin(); i1 != instances.end(); i1++) {
33 delete (*i1);
34 }
35 for (vector<HepRepPoint*>::iterator i2 = points.begin(); i2 != points.end(); i2++) {
36 delete (*i2);
37 }
38}
39
41 cerr << "DefaultHepRepInstance::overlay(HepRepInstance * instance) not implemented." << endl;
42}
43
45 cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstance*, HepRepSelectFilter*) not implemented." << endl;
46 return NULL;
47}
48
50 cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstanceTree*, HepRepSelectFilter*) not implemented." << endl;
51 return NULL;
52}
53
55 return type;
56}
57
59 points.push_back(point);
60}
61
62vector<HepRepPoint*> DefaultHepRepInstance::getPoints() {
63 return points;
64}
65
67 return parent;
68}
69
71 instances.push_back(instance);
72}
73
75 cerr << "DefaultHepRepInstance::removeInstance(HepRepInstance*) not implemented." << endl;
76}
77
78vector<HepRepInstance*> DefaultHepRepInstance::getInstances() {
79 return instances;
80}
81
84 return (value != NULL) ? value : type->getAttValue(name);
85}
86
87} // cheprep
virtual HepRepAttValue * getAttValue(std::string name)=0
virtual void addInstance(HepRepInstance *instance)=0
virtual void addInstance(HepRepInstance *instance)=0
HEPREP::HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)
void removeInstance(HEPREP::HepRepInstance *instance)
DefaultHepRepInstance(HEPREP::HepRepInstance *parent, HEPREP::HepRepType *type)
std::vector< HEPREP::HepRepPoint * > getPoints()
HEPREP::HepRepInstance * getSuperInstance()
std::vector< HEPREP::HepRepInstance * > getInstances()
HEPREP::HepRepInstance * copy(HEPREP::HepRepTypeTree *typeTree, HEPREP::HepRepInstance *parent, HEPREP::HepRepSelectFilter *filter)
void addInstance(HEPREP::HepRepInstance *instance)
void addPoint(HEPREP::HepRepPoint *point)
HEPREP::HepRepAttValue * getAttValue(std::string name)
void overlay(HEPREP::HepRepInstance *instance)