1#ifndef G_GEOMETRY_SIMPLE_H
2#define G_GEOMETRY_SIMPLE_H
21 const bool tesselated =
false)
const override;
30 Solid*
GetSolid(
const double x,
const double y,
const double z,
31 const bool tesselated =
false)
const;
41 bool IsInside(
const double x,
const double y,
const double z,
42 const bool tesselated =
false)
const override;
44 bool IsInBoundingBox(
const double x,
const double y,
const double z)
const;
46 double& ymax,
double& zmax)
override {
61 std::vector<std::pair<Solid*, Medium*> >
m_solids;
67 std::array<double, 3>
m_bbMin = {{0., 0., 0.}};
68 std::array<double, 3>
m_bbMax = {{0., 0., 0.}};
"Native" geometry, using simple shapes.
size_t GetNumberOfSolids() const override
Return the number of solids in the geometry.
void SetMedium(Medium *medium)
Set a background medium.
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.
Medium * m_medium
Background medium.
std::array< double, 3 > m_bbMin
Medium * GetMedium(const double x, const double y, const double z, const bool tesselated=false) const override
Retrieve the medium at a given point.
std::array< double, 3 > m_bbMax
std::vector< std::pair< Solid *, Medium * > > m_solids
List of solids and associated media.
void EnableDebugging(const bool on=true)
Switch on/off debugging and warning messages.
bool IsInBoundingBox(const double x, const double y, const double z) const
Determine whether a point is inside the envelope of the geometry.
Solid * GetSolid(const size_t i) const override
Get a solid from the list.
void Clear()
Reset 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 PrintSolids()
Print a summary of the solids present in the geometry.
bool m_debug
Switch on/off debugging messages.
void AddSolid(Solid *s, Medium *m)
Add a solid to the geometry, together with the medium inside.
virtual ~GeometrySimple()
Destructor.
GeometrySimple()
Constructor.
Abstract base class for geometry classes.
Abstract base class for media.
Abstract base class for solids.