46 #ifdef BUILD_IPLANES_DLL
47 #define EGS_IPLANES_EXPORT __declspec(dllexport)
49 #define EGS_IPLANES_EXPORT __declspec(dllimport)
51 #define EGS_IPLANES_LOCAL
55 #ifdef HAVE_VISIBILITY
56 #define EGS_IPLANES_EXPORT __attribute__ ((visibility ("default")))
57 #define EGS_IPLANES_LOCAL __attribute__ ((visibility ("hidden")))
59 #define EGS_IPLANES_EXPORT
60 #define EGS_IPLANES_LOCAL
162 const EGS_Float *angles,
const string &Name =
"",
174 const string &Name =
"");
184 EGS_Float first=0,
const string &Name =
"");
196 EGS_Float &t,
int *newmed = 0,
EGS_Vector *normal = 0);
200 const string &
getType()
const {
215 EGS_Float getPlanePosition(
int j)
const {
355 int ir = iplanes->isWhere(x);
358 int il = g->isWhere(xp);
359 return il >= 0 ? ir*ng + il : nreg-1;
362 int medium(
int ireg)
const {
363 if (ireg < 0 || ireg >= nreg) {
366 if (ireg == nreg-1) {
370 int il = ireg - ir*ng;
371 return g->medium(il);
379 EGS_Float &t,
int *newmed = 0,
EGS_Vector *normal = 0) {
381 egsFatal(
"\nEGS_RadialRepeater::howfar: position can not"
389 int il = ireg - ir*ng;
394 int inew = g->howfar(il,xp,up,t,newmed,normal);
398 *normal = R[ir]*(*normal);
411 int ir = iplanes->isWhere(x);
413 EGS_Float t_left = t;
418 for (EGS_I64 loopCount=0; loopCount<=
loopMax; ++loopCount) {
420 egsFatal(
"EGS_RadialRepeater::howfar: Too many iterations were required! Input may be invalid, or consider increasing loopMax.");
423 EGS_Float this_t = t_left;
425 EGS_Vector xp = (xtmp-xo)*R[ir], up = u*R[ir];
428 int inew = g->howfar(-1,xp,up,this_t,newmed,normal);
433 *normal = R[ir]*(*normal);
437 int next_ir = iplanes->howfar(ir,xtmp,u,this_t,0,0);
453 egsFatal(
"EGS_RadialRepeater::hownear: position can not"
459 int il = ireg - ir*ng;
461 return g->hownear(il,xp);
464 int ir = iplanes->isWhere(x);
466 return g->hownear(-1,xp);
470 return nrep*(g->getMaxStep() + 1);
473 const string &
getType()
const {
virtual const string & getType() const =0
Get the geometry type.
virtual bool isInside(const EGS_Vector &x)=0
Is the position x inside the geometry?
const EGS_I64 loopMax
The maximum number of iterations for near-infinite loops.
virtual int medium(int ireg) const
Returns the medium index in region ireg.
virtual void printInfo() const
Print information about this geometry.
A class for vector rotations.
virtual int getMaxStep() const
Returns the maximum number of steps through the geometry.
A class representing 3D vectors.
A set of planes intersecting in the same axis.
virtual int isWhere(const EGS_Vector &x)=0
In which region is poisition x?
virtual int howfar(int ireg, const EGS_Vector &x, const EGS_Vector &u, EGS_Float &t, int *newmed=0, EGS_Vector *normal=0)=0
Calculate the distance to a boundary from x along the direction u.
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
virtual int inside(const EGS_Vector &x)=0
Returns the region index, if inside, or -1 if outside (obsolete)
virtual EGS_Float hownear(int ireg, const EGS_Vector &x)=0
Calculate the distance to a boundary for position x in any direction.
A radial geometry replicator.
EGS_BaseGeometry class header file.