39 #ifndef EGS_GTRANSFORMED_
40 #define EGS_GTRANSFORMED_
47 #ifdef BUILD_GTRANSFORMED_DLL
48 #define EGS_GTRANSFORMED_EXPORT __declspec(dllexport)
50 #define EGS_GTRANSFORMED_EXPORT __declspec(dllimport)
52 #define EGS_GTRANSFORMED_LOCAL
56 #ifdef HAVE_VISIBILITY
57 #define EGS_GTRANSFORMED_EXPORT __attribute__ ((visibility ("default")))
58 #define EGS_GTRANSFORMED_LOCAL __attribute__ ((visibility ("hidden")))
60 #define EGS_GTRANSFORMED_EXPORT
61 #define EGS_GTRANSFORMED_LOCAL
150 is_convex = g->isConvex();
151 has_rho_scaling = g->hasRhoScaling();
152 has_B_scaling = g->hasBScaling();
168 T.inverseTransform(xt);
170 return g->computeIntersections(ireg,n,xt,ut,isections);
174 return g->isRealRegion(ireg);
178 T.inverseTransform(xt);
179 return g->isInside(xt);
184 T.inverseTransform(xt);
185 return g->isWhere(xt);
192 int medium(
int ireg)
const {
193 return g->medium(ireg);
198 return ireg >= 0 ? g->howfarToOutside(ireg,x*T,u*T.getRotation()) : 0;
201 EGS_Float &t,
int *newmed=0,
EGS_Vector *normal=0) {
203 T.inverseTransform(xt);
205 int inew = g->howfar(ireg,xt,ut,t,newmed,normal);
207 if (inew != ireg && normal) {
208 *normal = T.getRotation()*(*normal);
215 T.inverseTransform(xt);
216 return g->hownear(ireg,xt);
221 return g->getMaxStep();
231 return g->hasBooleanProperty(ireg,prop);
234 g->setBooleanProperty(prop);
237 g->addBooleanProperty(bit);
240 g->setBooleanProperty(prop,start,end,step);
243 g->addBooleanProperty(bit,start,end,step);
246 const string &
getType()
const {
251 return g->getRelativeRho(ireg);
258 return g->getBScaling(ireg);
260 void setBScaling(
int start,
int end, EGS_Float bf);
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?
virtual bool hasBooleanProperty(int ireg, EGS_BPType prop) const
Is the boolean property prop set for region ireg ?
virtual int medium(int ireg) const
Returns the medium index in region ireg.
virtual EGS_Float howfarToOutside(int ireg, const EGS_Vector &x, const EGS_Vector &u)
virtual int getMaxStep() const
Returns the maximum number of steps through the geometry.
A class representing 3D vectors.
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.
virtual void setRelativeRho(int start, int end, EGS_Float rho)
Set the relative mass density in regions.
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.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
void setMedia(EGS_Input *inp)
Set the media in the geometry from the input pointed to by inp.
virtual int inside(const EGS_Vector &x)=0
Returns the region index, if inside, or -1 if outside (obsolete)
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 EGS_Float getRelativeRho(int ireg) const
Get the relative mass density in region ireg.
virtual bool isRealRegion(int ireg) const
Returnes true if ireg is a real region, false otherwise.
EGS_BaseGeometry class header file.
virtual void addBooleanProperty(int bit)
Add a boolean property for the entire geometry by setting the bit'th bit.
virtual void setBooleanProperty(EGS_BPType prop)
Set the boolean properties of the entire geometry to prop.