Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
"Native" geometry, using simple shapes. More...
#include <GeometrySimple.hh>
Public Member Functions | |
GeometrySimple () | |
Constructor. | |
virtual | ~GeometrySimple () |
Destructor. | |
Medium * | GetMedium (const double x, const double y, const double z, const bool tesselated=false) const override |
Retrieve the medium at a given point. | |
size_t | GetNumberOfSolids () const override |
Return the number of solids in the geometry. | |
Solid * | GetSolid (const size_t i) const override |
Get a solid from the list. | |
Solid * | GetSolid (const size_t i, Medium *&medium) const override |
Get a solid from the list, together with the associated medium. | |
void | AddSolid (Solid *s, Medium *m) |
Add a solid to the geometry, together with the medium inside. | |
Solid * | GetSolid (const double x, const double y, const double z, const bool tesselated=false) const |
Get the solid at a given location (x, y, z). | |
void | SetMedium (Medium *medium) |
Set a background medium. | |
void | Clear () |
Reset the geometry. | |
void | PrintSolids () |
Print a summary of the solids present in the geometry. | |
bool | IsInside (const double x, const double y, const double z, const bool tesselated=false) const override |
Check if a point is inside the geometry. | |
bool | IsInBoundingBox (const double x, const double y, const double z) const |
Determine whether a point is inside the envelope of the geometry. | |
bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override |
Get the bounding box (envelope of the geometry). | |
void | EnableDebugging (const bool on=true) |
Switch on/off debugging and warning messages. | |
Public Member Functions inherited from Garfield::Geometry | |
Geometry ()=delete | |
Default constructor. | |
Geometry (const std::string &name) | |
Constructor. | |
virtual | ~Geometry () |
Destructor. | |
virtual Medium * | GetMedium (const double x, const double y, const double z, const bool tesselated=false) const =0 |
Retrieve the medium at a given point. | |
virtual size_t | GetNumberOfSolids () const |
Return the number of solids in the geometry. | |
virtual Solid * | GetSolid (const size_t) const |
Get a solid from the list. | |
virtual Solid * | GetSolid (const size_t, Medium *&medium) const |
Get a solid from the list, together with the associated medium. | |
virtual bool | IsInside (const double x, const double y, const double z, const bool tesselated=false) const =0 |
Check if a point is inside the geometry. | |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0 |
Get the bounding box (envelope of the geometry). | |
Protected Attributes | |
std::vector< std::pair< Solid *, Medium * > > | m_solids |
List of solids and associated media. | |
Medium * | m_medium = nullptr |
Background medium. | |
bool | m_hasBoundingBox = false |
std::array< double, 3 > | m_bbMin = {{0., 0., 0.}} |
std::array< double, 3 > | m_bbMax = {{0., 0., 0.}} |
bool | m_debug = false |
Switch on/off debugging messages. | |
Protected Attributes inherited from Garfield::Geometry | |
std::string | m_className = "Geometry" |
"Native" geometry, using simple shapes.
Definition at line 13 of file GeometrySimple.hh.
Garfield::GeometrySimple::GeometrySimple | ( | ) |
|
inlinevirtual |
Add a solid to the geometry, together with the medium inside.
Definition at line 10 of file GeometrySimple.cc.
void Garfield::GeometrySimple::Clear | ( | ) |
Reset the geometry.
Definition at line 82 of file GeometrySimple.cc.
|
inline |
Switch on/off debugging and warning messages.
Definition at line 57 of file GeometrySimple.hh.
|
inlineoverridevirtual |
Get the bounding box (envelope of the geometry).
Implements Garfield::Geometry.
Definition at line 45 of file GeometrySimple.hh.
Referenced by Garfield::ViewGeometry::Plot2d(), and Garfield::ViewGeometry::Plot3d().
|
overridevirtual |
Retrieve the medium at a given point.
Implements Garfield::Geometry.
Definition at line 54 of file GeometrySimple.cc.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlineoverridevirtual |
Return the number of solids in the geometry.
Reimplemented from Garfield::Geometry.
Definition at line 23 of file GeometrySimple.hh.
Referenced by Garfield::ViewGeometry::Plot2d(), and Garfield::ViewGeometry::Plot3d().
Solid * Garfield::GeometrySimple::GetSolid | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const bool | tesselated = false |
||
) | const |
Get the solid at a given location (x, y, z).
Definition at line 46 of file GeometrySimple.cc.
|
overridevirtual |
Get a solid from the list.
Reimplemented from Garfield::Geometry.
Definition at line 65 of file GeometrySimple.cc.
Referenced by Garfield::ViewGeometry::Plot2d(), and Garfield::ViewGeometry::Plot3d().
|
overridevirtual |
Get a solid from the list, together with the associated medium.
Reimplemented from Garfield::Geometry.
Definition at line 73 of file GeometrySimple.cc.
bool Garfield::GeometrySimple::IsInBoundingBox | ( | const double | x, |
const double | y, | ||
const double | z | ||
) | const |
Determine whether a point is inside the envelope of the geometry.
Definition at line 134 of file GeometrySimple.cc.
Referenced by IsInside().
|
overridevirtual |
Check if a point is inside the geometry.
Implements Garfield::Geometry.
Definition at line 124 of file GeometrySimple.cc.
void Garfield::GeometrySimple::PrintSolids | ( | ) |
Print a summary of the solids present in the geometry.
Definition at line 87 of file GeometrySimple.cc.
|
inline |
|
protected |
Definition at line 68 of file GeometrySimple.hh.
Referenced by AddSolid(), GetBoundingBox(), and IsInBoundingBox().
|
protected |
Definition at line 67 of file GeometrySimple.hh.
Referenced by AddSolid(), GetBoundingBox(), and IsInBoundingBox().
|
protected |
Switch on/off debugging messages.
Definition at line 71 of file GeometrySimple.hh.
Referenced by EnableDebugging(), and IsInBoundingBox().
|
protected |
Definition at line 66 of file GeometrySimple.hh.
Referenced by AddSolid(), and IsInBoundingBox().
|
protected |
Background medium.
Definition at line 63 of file GeometrySimple.hh.
Referenced by Clear(), GetMedium(), and SetMedium().
List of solids and associated media.
Definition at line 61 of file GeometrySimple.hh.
Referenced by AddSolid(), Clear(), GetMedium(), GetNumberOfSolids(), GetSolid(), IsInside(), and PrintSolids().