summaryrefslogtreecommitdiff
path: root/src/main/CompositeElement.cc
blob: 44714ea078e2fe510c07eb8fc9fd16bae7bfee63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * CompositeElement.cc
 *
 *  Created on: Mar 23, 2011
 *      Author: jakob
 */

#include "CompositeElement.h"

namespace vhc {

CompositeElement::CompositeElement(const Vector3D& entry, const Vector3D& exit, double sectionRadius, Element* next):
				Element(entry, exit, sectionRadius, next),
				elements(0) {};

CompositeElement::~CompositeElement() {};

bool CompositeElement::isOutside(const Particle& particle) const {
	for (int i(0); i < elements.size(); ++i) {
		if (elements[i]->isOutside(particle)) return true;
	}
	return false;
}

bool CompositeElement::isPast(const Particle& particle) const {
	if (elements[elements.size() - 1]->isPast(particle)) return true;
	else return false;
}


}