45 #ifndef EGS_AENVELOPE_GEOMETRY_
46 #define EGS_AENVELOPE_GEOMETRY_
50 #ifdef BUILD_AENVELOPE_DLL
51 #define EGS_AENVELOPE_EXPORT __declspec(dllexport)
53 #define EGS_AENVELOPE_EXPORT __declspec(dllimport)
55 #define EGS_AENVELOPE_LOCAL
59 #ifdef HAVE_VISIBILITY
60 #define EGS_AENVELOPE_EXPORT __attribute__ ((visibility ("default")))
61 #define EGS_AENVELOPE_LOCAL __attribute__ ((visibility ("hidden")))
63 #define EGS_AENVELOPE_EXPORT
64 #define EGS_AENVELOPE_LOCAL
338 using namespace volcor;
348 geom(geom), transform(transform), vcopts(vcopts) {};
358 const vector<AEnvelopeAux> inscribed,
const string &Name =
"",
bool debug=
false,
string output_vc_file=
"no");
368 int getNRegWithInscribed()
const;
370 bool isRealRegion(
int ireg)
const;
378 int medium(
int ireg)
const;
380 virtual vector<EGS_BaseGeometry *> getGeomsInRegion(
int ireg);
382 int computeIntersections(
int ireg,
int n,
const EGS_Vector &X,
389 EGS_Float &t,
int *newmed = 0,
EGS_Vector *normal = 0);
391 EGS_Float hownear(
int ireg,
const EGS_Vector &x);
393 bool hasBooleanProperty(
int ireg, EGS_BPType prop)
const;
395 void setBooleanProperty(EGS_BPType);
397 void addBooleanProperty(
int);
399 void setBooleanProperty(EGS_BPType,
int,
int,
int step=1);
401 void addBooleanProperty(
int,
int,
int,
int step=1);
403 int getMaxStep()
const;
405 virtual EGS_Float getVolume(
int ireg);
407 virtual EGS_Float getCorrectionRatio(
int ireg);
409 virtual const string &getType()
const {
413 void printInfo()
const;
415 void setRelativeRho(
int start,
int end, EGS_Float rho);
418 EGS_Float getRelativeRho(
int ireg)
const;
436 static vector<EGS_AffineTransform *> createTransforms(
EGS_Input *inpt);
441 static bool allowedBaseGeomType(
const string &geom_type);
449 vector<volcor::VCOptions *>
opts;
452 int nreg_with_inscribed;
459 map<volcor::GeomRegPairT, int> local_to_global_reg;
460 map<int, volcor::GeomRegPairT> global_reg_to_local;
463 vector<EGS_BaseGeometry *> *geoms_in_region;
467 const static string allowed_base_geom_types[];
475 void setMedia(
EGS_Input *,
int,
const int *);
477 double findRegionsInscribedIn(vector<EGS_BaseGeometry *>, vector<EGS_AffineTransform *>,
volcor::VCOptions *);
478 double loadFileVolumeCorrections(vector<EGS_BaseGeometry *>, vector<EGS_AffineTransform *>,
volcor::VCOptions *);
482 void writeVCToFile(ostream &);
483 void writeVolumeCorrection();
487 void setPropertyError(
const char *funcname) {
488 egsFatal(
"EGS_AEnvelope::%s: don't use this method\n Define "
489 "properties in the constituent geometries instead\n",
493 bool getHasRhoScaling();
553 vector<EGS_BaseGeometry *> active_inscribed;
560 vector<EGS_BaseGeometry *> getGeomsInRegion(
int ireg);
565 const vector<AEnvelopeAux> inscribed,
const string &Name =
"",
bool debug=
false,
string output_vc_file=
"no");
567 const string &getType()
const {
573 void setActiveGeometries(vector<EGS_BaseGeometry *> geoms);
577 void setActiveGeometries(vector<int> geom_indexes);
580 bool hasActiveGeom(
int ireg);
583 bool hasInactiveGeom(
int ireg);
586 void setActiveByIndex(
int inscribed_index);
589 void activateByIndex(
int inscribed_index);
592 void deactivateByIndex(
int inscribed_index);
A fast envelope geometry with automatic region detection.
A helper class for initializing auto envelopes.
This geometry type allows you to activate and deactivate inscribed geometries in custom egspp user co...
std::map< int, EGS_I64 > HitCounterT
Region discovery/volume correction functionality for EGS_AEnvelope geometries.
A class representing 3D vectors.
pair< EGS_BaseGeometry *, int > GeomRegPairT
int nregbase
Number of regions in the base geometry.
Global egspp functions header file.
vector< EGS_BaseGeometry * > inscribed_geoms
The inscribed geometries.
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
vector< EGS_AffineTransform * > transforms
The inscribed geometries.
vector< EGS_Float > applyVolumeCorrections(VCOptions *opts, HitCounterT hit_counter, vector< EGS_Float > uncorrected)
Apply volume corrections to base regions.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
vector< volcor::VCOptions * > opts
The inscribed geometries.
EGS_BaseShape and shape classes header file.
EGS_BaseGeometry * base_geom
The envelope geometry.
Struct used to collect and output results about a volume correction run.
static string type
Geometry type.
Volume correction initialization helper class.
EGS_BaseGeometry class header file.
int ninscribed
Number of regions in the base geometry.
static string type
Geometry type.