Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Geometry.hh
Go to the documentation of this file.
1#ifndef G_GEOMETRY_H
2#define G_GEOMETRY_H
3
4#include <cstddef>
5#include <string>
6
7namespace Garfield {
8
9class Medium;
10class Solid;
11
13class Geometry {
14 public:
16 Geometry() = delete;
18 Geometry(const std::string& name) : m_className(name) {}
20 virtual ~Geometry() {}
21
23 virtual Medium* GetMedium(const double x, const double y, const double z,
24 const bool tesselated = false) const = 0;
25
27 virtual std::size_t GetNumberOfSolids() const { return 0; }
29 virtual Solid* GetSolid(const std::size_t /*i*/) const { return nullptr; }
31 virtual Solid* GetSolid(const std::size_t /*i*/, Medium*& /*medium*/) const {
32 return nullptr;
33 }
34
35 virtual bool IsInside(const double x, const double y, const double z,
36 const bool tesselated = false) const = 0;
37
39 virtual bool GetBoundingBox(double& xmin, double& ymin, double& zmin,
40 double& xmax, double& ymax, double& zmax) = 0;
41
42 protected:
43 std::string m_className = "Geometry";
44};
45} // namespace Garfield
46
47#endif
Geometry(const std::string &name)
Constructor.
Definition Geometry.hh:18
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0
Get the bounding box (envelope of the geometry).
virtual Solid * GetSolid(const std::size_t) const
Get a solid from the list.
Definition Geometry.hh:29
virtual std::size_t GetNumberOfSolids() const
Return the number of solids in the geometry.
Definition Geometry.hh:27
virtual Solid * GetSolid(const std::size_t, Medium *&) const
Get a solid from the list, together with the associated medium.
Definition Geometry.hh:31
std::string m_className
Definition Geometry.hh:43
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 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.
Geometry()=delete
Default constructor.
virtual ~Geometry()
Destructor.
Definition Geometry.hh:20
Abstract base class for solids.
Definition Solid.hh:28