37 #ifndef EGS_SHAPE_COLLECTION_
38 #define EGS_SHAPE_COLLECTION_
46 #ifdef BUILD_SHAPE_COLLECTION_DLL
47 #define EGS_SHAPE_COLLECTION_EXPORT __declspec(dllexport)
49 #define EGS_SHAPE_COLLECTION_EXPORT __declspec(dllimport)
51 #define EGS_SHAPE_COLLECTION_LOCAL
55 #ifdef HAVE_VISIBILITY
56 #define EGS_SHAPE_COLLECTION_EXPORT __attribute__ ((visibility ("default")))
57 #define EGS_SHAPE_COLLECTION_LOCAL __attribute__ ((visibility ("hidden")))
59 #define EGS_SHAPE_COLLECTION_EXPORT
60 #define EGS_SHAPE_COLLECTION_LOCAL
100 const vector<EGS_Float> &Probs,
const string &Name=
"",
104 for (
int j=0; j<nshape; j++) {
113 int j = table->sample(rndm);
114 return shapes[j]->getRandomPoint(rndm);
118 for (
int j=0; j<nshape; j++) {
126 EGS_Float
area()
const {
128 for (
int j=0; j<nshape; j++) {
129 A += shapes[j]->area();
137 int j = table->sample(rndm);
138 shapes[j]->getPointSourceDirection(xo,rndm,u,wt);
EGS_AliasTable class header file.
A class representing 3D vectors.
static void deleteObject(EGS_Object *o)
Delete an object.
Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape.
virtual EGS_Vector getPoint(EGS_RandomGenerator *rndm)
Sample and return a random 3D vector.
Base random number generator class. All random number generators should be derived from this class...
virtual EGS_Float area() const
virtual bool supportsDirectionMethod() const
EGS_RandomGenerator class header file.
virtual void getPointSourceDirection(const EGS_Vector &xo, EGS_RandomGenerator *rndm, EGS_Vector &u, EGS_Float &wt)
A class for sampling random bins from a given probability distribution using the alias table techniqu...
EGS_BaseShape and shape classes header file.