36 #ifndef EGS_DYNAMIC_GEOMETRY_
37 #define EGS_DYNAMIC_GEOMETRY_
50 #ifdef BUILD_DYNAMIC_GEOMETRY_DLL
51 #define EGS_DYNAMIC_GEOMETRY_EXPORT __declspec(dllexport)
53 #define EGS_DYNAMIC_GEOMETRY_EXPORT __declspec(dllimport)
55 #define EGS_DYNAMIC_GEOMETRY_LOCAL
59 #ifdef HAVE_VISIBILITY
60 #define EGS_DYNAMIC_GEOMETRY_EXPORT __attribute__ ((visibility ("default")))
61 #define EGS_DYNAMIC_GEOMETRY_LOCAL __attribute__ ((visibility ("hidden")))
63 #define EGS_DYNAMIC_GEOMETRY_EXPORT
64 #define EGS_DYNAMIC_GEOMETRY_LOCAL
134 is_convex = g->isConvex();
135 has_rho_scaling = g->hasRhoScaling();
136 has_B_scaling = g->hasBScaling();
139 if (cpts.size() < 2) {
140 egsWarning(
"EGS_DynamicGeometry: not enough or missing control points.\n");
143 if (cpts[0].time > 0.0) {
144 egsWarning(
"EGS_DynamicGeometry: time index of control point 1 > 0.0. This will generate many warning messages.\n");
146 int npts = cpts.size();
147 for (
int i = 0; i < npts; i++) {
148 if (i > 0 && cpts[i].time < cpts[i - 1].time -
epsilon) {
149 egsWarning(
"EGS_DynamicGeometry: time index of control point %i < time index of control point %i\n", i, i - 1);
151 if (cpts[i].time < 0.0) {
152 egsWarning(
"EGS_DynamicGeometry: time index of control point %i < 0.0\n", i);
156 for (
int i = 0; i < npts - 1; i++) {
157 cpts[i].time /= cpts[npts - 1].time;
230 int medium(
int ireg)
const;
359 void setBScaling(
int start,
int end, EGS_Float bf);
386 void updatePosition(EGS_Float time);
393 void containsDynamic(
bool &hasdynamic);
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
virtual int computeIntersections(int ireg, int n, const EGS_Vector &x, const EGS_Vector &u, EGS_GeometryIntersections *isections)
Calculates intersection distances to region boundaries.
virtual EGS_Float hownear(int ireg, const EGS_Vector &x)=0
Calculate the distance to a boundary for position x in any direction.
virtual int inside(const EGS_Vector &x)=0
Returns the region index, if inside, or -1 if outside (obsolete)
virtual bool hasBooleanProperty(int ireg, EGS_BPType prop) const
Is the boolean property prop set for region ireg ?
virtual EGS_Float howfarToOutside(int ireg, const EGS_Vector &x, const EGS_Vector &u)
virtual EGS_Float getBScaling(int ireg) const
Get the B field scaling factor in region ireg.
virtual void setBScaling(int start, int end, EGS_Float bf)
Set the B field scaling factor in regions.
void setMedia(EGS_Input *inp)
Set the media in the geometry from the input pointed to by inp.
virtual const string & getType() const =0
Get the geometry type.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
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.
virtual bool isRealRegion(int ireg) const
Returnes true if ireg is a real region, false otherwise.
virtual bool isInside(const EGS_Vector &x)=0
Is the position x inside the geometry?
virtual EGS_Float getRelativeRho(int ireg) const
Get the relative mass density in region ireg.
virtual void setBooleanProperty(EGS_BPType prop)
Set the boolean properties of the entire geometry to prop.
virtual int getMaxStep() const
Returns the maximum number of steps through the geometry.
virtual int medium(int ireg) const
Returns the medium index in region ireg.
virtual void setRelativeRho(int start, int end, EGS_Float rho)
Set the relative mass density in regions.
virtual void addBooleanProperty(int bit)
Add a boolean property for the entire geometry by setting the bit'th bit.
virtual int isWhere(const EGS_Vector &x)=0
In which region is poisition x?
int ncpts
Number of control points.
EGS_BaseGeometry * g
The geometry undergoing dynamic motion.
void setTransformation(EGS_AffineTransform t)
Sets the current state transform of the geometry. This is called when checking location....
string type
The geometry type.
void buildDynamicGeometry(EGS_BaseGeometry *g, EGS_Input *dyninp)
Builds the dynamic geometry using input specifications.
EGS_DynamicGeometry(EGS_BaseGeometry *G, EGS_Input *dyninp, const string &Name="")
Construct a dynamic geometry using G as the geometry and cpts as the control points.
vector< EGS_ControlPoint > cpts
Control points for dynamic motion.
EGS_AffineTransform T
Affine transformation representing the current state.
EGS_Float ptime
Time index corresponding to the particle.
Base random number generator class. All random number generators should be derived from this class.
A class representing 3D vectors.
EGS_Application class header file.
EGS_BaseGeometry class header file.
EGS_RandomGenerator class header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.
Structure to store control point information for dynamic geometry.
vector< EGS_Float > rot
Vector specifying rotation.
EGS_Float time
Time index for control point.
vector< EGS_Float > trnsl
Vector specifying x, y, z translation.